Mercurial > hg > Members > atton > similar_monad
changeset 2:a5210ec1e41b
Reduce definition
author | Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 31 Aug 2014 18:41:02 +0900 |
parents | 878d1e271709 |
children | 3c5fbce357af |
files | similer.hs |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/similer.hs Sun Aug 31 18:35:10 2014 +0900 +++ b/similer.hs Sun Aug 31 18:41:02 2014 +0900 @@ -1,12 +1,12 @@ {-# LANGUAGE FlexibleContexts #-} -data Similer a f b = Similer a (a -> b) b +data Similer a b = Similer a (a -> b) b -instance Functor (Similer a f) where +instance Functor (Similer a) where fmap g (Similer a f b) = Similer a (g . f) $ g b -eta :: a -> Similer a (a -> a) a +eta :: a -> Similer a a eta a = Similer a id a --mu :: (Eq (Similer b (b -> c) c)) => Similer a (a -> (Similer b (b -> c) c)) (Similer b (b -> c) c) -> Similer b (b -> c) c -mu :: (Eq (Similer b (b -> c) c)) => Similer a (a -> (Similer b (b -> c) c)) (Similer b (b -> c) c) -> Similer b (b -> c) c +mu :: (Eq (Similer b c)) => Similer a (Similer b c) -> Similer b c mu (Similer a f b) = if ((f a) == b) then b else undefined