tvl-depot/scratch/brilliant/App.hs
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

14 lines
637 B
Haskell

--------------------------------------------------------------------------------
module App where
--------------------------------------------------------------------------------
import Keyboard (Keyboard(..))
import Transforms (Transform(..))
import Utils ((|>))
import qualified Utils
--------------------------------------------------------------------------------
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