Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data List = Cons Int List | Nil
- data ListF a = Cons Int a | Nil
- type ThreeList = ListF (ListF (ListF Void)))
- ListF ListFF == ListFF
- data Fix f = Fix {unfix :: f (Fix x)}
- type ListFF = Fix ListF
- type ListAlg a = ListF a -> a
- cata :: ListAlg a -> ListFF -> a
- cata f = f . fmap (cata f) . unfix
- cata :: ListAlg a -> ListFF -> a
- cata :: (Either () (Int, a) -> a) -> ListFF -> a
- cata :: (() -> a) -> ((Int, a) -> a) -> ListFF -> a
- cata :: a -> (Int -> a -> a) -> ListFF -> a
- cata :: (Int -> a -> a) -> a -> [Int] -> a
- cata :: (f a -> a) -> Fix f -> a
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement