Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,5 @@
|
|||
::Tree a = Empty | Node a (Tree a) (Tree a)
|
||||
|
||||
mapTree :: (a -> b) (Tree a) -> (Tree b)
|
||||
mapTree f Empty = Empty
|
||||
mapTree f (Node x l r) = Node (f x) (mapTree f l) (mapTree f r)
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
instance Functor Tree where
|
||||
fmap f Empty = Empty
|
||||
fmap f (Node x l r) = Node (f x) (fmap f l) (fmap f r)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
add1Everywhere :: (f a) -> (f a) | Functor f & Num a
|
||||
add1Everywhere nums = fmap (\x = x + 1) nums
|
||||
Loading…
Add table
Add a link
Reference in a new issue