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