git.iko.soy/production-haskell
on master help sign in
25 lines 1.1 kB history raw
1# Homework
3The task is to recreate a portion of the functionality of the unix utility [`wc`](https://linux.die.net/man/1/wc).
5## Functionality
71. `-c, --bytes` (2 point)
82. `-m, --chars` (2 point)
93. `-l, --lines` (4 points)
11Properly parsing the CLI arguments into a separate data structure will give you 2 additional points for a total of 10.
13Please see the [`wc` docs](https://linux.die.net/man/1/wc) for what every option should do.
15The binary should accept one additional CLI argument -- a path to the file to read. You do not need to read from stdin.
17The program should run in constant memory.
19## Implementation
21You should use the [`nightly-2024-10-11`](https://www.stackage.org/nightly-2024-10-11) stack snapshot in your project.
23You 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.
25You should use the [optparse-applicative](https://hackage.haskell.org/package/optparse-applicative) package to parse CLI arguments.