Commit graph

15 commits

Author SHA1 Message Date
William Carroll
2da4b12266 Consume buildHaskell functions
Use the newly defined `buildHaskell` function for a few of my existing Haskell
projects. So far, it works as intended!
2020-08-12 16:28:39 +01:00
William Carroll
bba3f16c43 Prefer snake-shift instead of a row-by-row shift
Per the assignment's instructions, the `Shift n` operation should treat
the *entire keyboard* like a cycle and shift that. I was erroneously
treating *each row* like a cycle and shifting those one-by-one.

This change fixes that. In addition, it also:
- Updates README.md with expected inputs and outputs
- Updates test suite
- Adds `split` dependency to {default,shell}.nix
2020-08-12 12:03:35 +01:00
William Carroll
f11b91c985 Adds property tests to generically test keyboard transformations
Tests:
- HorizontalFlip
- VerticalFlip
- Shift n
2020-08-12 11:27:06 +01:00
William Carroll
f3ddd89302 Prefer literal, not computed, examples in the unit tests
TL:DR:
- Remove unused imports: Test.QuickCheck and Control.Exception
- Remove calls to `reverse` and `Utils.rotate` with their results
2020-08-12 11:07:37 +01:00
William Carroll
3d6130c7cf Provide more useful instructions for building this project
TL;DR:
- include a default.nix to allow users to build an named executable
- emphasize in the README that the user needs Nix to build this project
- pin nixpkgs to a specific commit and fetch it from GitHub
2020-08-12 10:28:04 +01:00
William Carroll
17e1764ef8 Generate coords function from existing qwerty keyboard
Per my take-home assignment's reviewer's comments, with which for the record I
agree, I should generate the character->coordinate table from my existing qwerty
keyboard definition.

The best part is: by doing this I found a bug: Notice how the original '0'
character was mapped to the Coordinate (0,0)... thus every subsequent digit
key (i.e. the first row) is off-by-one.
2020-08-12 09:46:36 +01:00
William Carroll
5f52077492 Re-type type using the altered keyboard
Remember: always read the instructions; that's the most important part.
2020-08-06 00:18:44 +01:00
William Carroll
e14fff7d4b Support Transforms.optimize
Partially optimize inputs and document rules for further optimizations we can
make.
2020-08-06 00:15:31 +01:00
William Carroll
d45685e245 Apply a series of transformation to a QWERTY keyboard
TL;DR:
- Accept input from the CLI
- Add a project README.md
2020-08-05 23:36:04 +01:00
William Carroll
244503bba9 Support App.transform
Apply the transform to a Keyboard. Onwards to the final demonstration!
2020-08-05 23:21:08 +01:00
William Carroll
61a2fb108d Support parsing the list of transforms
Using Haskell's Text.ParserCombinators.ReadP library for the first time, and I
enjoyed it thoroughly! It's nice avoiding a third-party library like MegaParsec.
2020-08-05 22:54:50 +01:00
William Carroll
d948ed9ebf Define an instance for Show for a Keyboard
This will help me debug.
2020-08-05 21:52:10 +01:00
William Carroll
1af0007a7d Create a Utils module
To stylize things...
2020-08-05 21:51:55 +01:00
William Carroll
40753e9f3b Add some the scaffolding for testing
As I attempt to habituate TDD, I should have some examples of tests to minimize
all friction preventing me from testing.
2020-08-05 21:37:08 +01:00
William Carroll
b1c403f6b9 Create small command line program that parses arguments
Before starting my take-home assignment, the instructions advised me to create a
"Hello, world" program in the language of my choice. Since I'm choosing Haskell,
I created this example as my starter boilerplate.
2020-08-04 16:36:31 +01:00