git.iko.soy/production-haskell
on master help sign in
1 file changed+25
since splitsnapshots
unifiedsplit
hw.md+25
hw.mdnew file+25
@@ -0,0 +1,25 @@
1+# Homework
2+
3+The task is to recreate a portion of the functionality of the unix utility [`wc`](https://linux.die.net/man/1/wc).
4+
5+## Functionality
6+
7+1. `-c, --bytes` (2 point)
8+2. `-m, --chars` (2 point)
9+3. `-l, --lines` (4 points)
10+
11+Properly parsing the CLI arguments into a separate data structure will give you 2 additional points for a total of 10.
12+
13+Please see the [`wc` docs](https://linux.die.net/man/1/wc) for what every option should do.
14+
15+The binary should accept one additional CLI argument -- a path to the file to read. You do not need to read from stdin.
16+
17+The program should run in constant memory.
18+
19+## Implementation
20+
21+You should use the [`nightly-2024-10-11`](https://www.stackage.org/nightly-2024-10-11) stack snapshot in your project.
22+
23+You should use the [streamly](https://hackage.haskell.org/package/streamly) family of packages for streaming functionality. Using a streaming package will help ensure constant memory.
24+
25+You should use the [optparse-applicative](https://hackage.haskell.org/package/optparse-applicative) package to parse CLI arguments.