view src/list.hs @ 42:4cc65012412f

Add proofs of functor-laws on delta
author Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
date Fri, 13 Feb 2015 17:13:23 +0900
parents 086fc8bb6ea9
children
line wrap: on
line source

data List a = Nil | Cons a (List a) deriving (Show)

instance Functor List where
    fmap f Nil = Nil
    fmap f (Cons x xs) = Cons (f x) (fmap f xs)