Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Magic a where
- conjure :: String -> [a]
- magikStorage :: [a] -> String
- -- Use return type
- doMagik :: Magic a => Int -> [a]
- doMagik n = concat $ replicate n res
- where
- res = conjure $ magikStorage res -- Must be lazy in res !!!!
- -- Pass dummy parameter
- anotherMagic :: Magic a => Int -> [a]
- anotherMagic n = concat $ replicate n $ go []
- where
- go :: Magic a => [a] -> [a]
- go x = conjure $ magikStorage x
Add Comment
Please, Sign In to add comment