Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Data.Char
- fix f = let x = f x in x
- z = fix $ \z -> \f -> \la -> \lb ->
- case (f, la, lb) of
- (f, [], _) -> []
- (f, _, []) -> []
- (f, x:xs, y:ys) -> f x y : z f xs ys
- m = fix $ \m -> \f -> \la ->
- case (f, la) of
- (f, []) -> []
- (f, x:xs) -> f x : m f xs
- fl = fix $ \fl -> \l ->
- case l of
- ([]) -> []
- (([]:ls)) -> fl ls
- ((x:xs):ls) -> x : fl (xs : ls)
- tk = fix $ \tk -> \i -> \l ->
- case (i, l) of
- (0, _) -> []
- (x, []) -> []
- (x, l:ls) -> l : tk (x - 1) ls
- rep = \x -> let e = x : rep x in e
- u = m chr $ z (+) (
- m (abs . (3-)) $ m ord $ fl $ tk 2 $ rep "grrp")
- $ [5, -11, -11, 4, 0, -78, -78, -99]
- -- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
- -- @ Georg, executed in ghci, what is `gutStr u` ??? @
- -- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
- --
- -- HINT: u :: [Char]
- --
- -- Rules:
- --
- -- Functions from libraries: {abs, ord, chr}
- -- abs :: Num a => a -> a
- -- Example: abs (-5) = 5
- --
- -- ord :: Char -> Int
- -- Example: ord 'A' = 65
- --
- -- chr :: Int -> Char
- -- Example: chr 65 = 'A'
- --
Add Comment
Please, Sign In to add comment