Created
April 16, 2021 07:43
-
-
Save gnumonik/5e1682b6ec02e25c1bbdf97b4811ee00 to your computer and use it in GitHub Desktop.
lol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Control.Comonad.Store | |
import Data.Char | |
thing :: [Char] -> [[Char]] | |
thing [] = [] | |
thing xss@(x:xs) = | |
let rotate n xs = reverse $ take (length xs) (drop n (cycle xs)) | |
ys = toUpper : (replicate (length xs) id) | |
f (n,zs) = zipWith (\g x -> g x) (rotate n ys) zs | |
myStore = store f (1,xss) | |
in map (\x -> peeks (\(y,z) -> (x,z)) myStore) [1.. length xss] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment