Support App.transform

Apply the transform to a Keyboard. Onwards to the final demonstration!
This commit is contained in:
William Carroll 2020-08-05 23:20:18 +01:00
parent 61a2fb108d
commit 244503bba9
5 changed files with 57 additions and 1 deletions

View file

@ -6,3 +6,8 @@ import Data.Function ((&))
(|>) :: a -> (a -> b) -> b
(|>) = (&)
-- | Rotate `xs` as a cycle `n` times.
rotate :: Int -> [a] -> [a]
rotate n xs = take size . drop (n `mod` size) . cycle $ xs
where size = length xs