Apply a series of transformation to a QWERTY keyboard

TL;DR:
- Accept input from the CLI
- Add a project README.md
This commit is contained in:
William Carroll 2020-08-05 23:30:25 +01:00
parent 244503bba9
commit d45685e245
4 changed files with 51 additions and 32 deletions

View file

@ -8,7 +8,7 @@ import Utils ((|>))
import qualified Utils
--------------------------------------------------------------------------------
transform :: Transform -> Keyboard -> Keyboard
transform HorizontalFlip (Keyboard xs) = xs |> fmap reverse |> Keyboard
transform VerticalFlip (Keyboard xs) = xs |> reverse |> Keyboard
transform (Shift n) (Keyboard xs) = xs |> fmap (Utils.rotate n) |> Keyboard
transform :: Keyboard -> Transform -> Keyboard
transform (Keyboard xs) HorizontalFlip = xs |> fmap reverse |> Keyboard
transform (Keyboard xs) VerticalFlip = xs |> reverse |> Keyboard
transform (Keyboard xs) (Shift n) = xs |> fmap (Utils.rotate n) |> Keyboard