# HG changeset patch # User Yasutaka Higa # Date 1409623320 -32400 # Node ID 051c663a4af2bdc8408e0c8b97069583754426d5 # Parent 66609010d47766f6c3c4d6baae6918390a747f52 Rename some functions diff -r 66609010d477 -r 051c663a4af2 similer.hs --- a/similer.hs Tue Sep 02 11:01:25 2014 +0900 +++ b/similer.hs Tue Sep 02 11:02:00 2014 +0900 @@ -4,14 +4,14 @@ instance Functor (Similer a) where fmap g (Similer a f b) = Similer a (g . f) \$ g b -same :: (Eq a) => Similer a b -> Similer a b -> Bool -same (Similer a _ _ ) (Similer b _ _) = a == b +eq :: (Eq a) => Similer a b -> Similer a b -> Bool +eq (Similer a _ _ ) (Similer b _ _) = a == b eta :: a -> Similer a a eta a = Similer a id a mu :: (Eq b) => Similer a (Similer b c) -> Similer b c -mu (Similer a f b) = if (same (f a) b) then b else undefined +mu (Similer a f b) = if (eq (f a) b) then b else undefined double :: Int -> Similer Int Int double x = Similer (2 * x) id (2 * x) @@ -22,5 +22,5 @@ plusTwo :: Int -> Similer Int (Similer Int Int) plusTwo x = Similer x double (Similer (x + 2) id (x + 2)) -hoge :: Eq b => Similer a b -> b -hoge (Similer x f y) = if (f x) == y then y else undefined +same :: Eq b => Similer a b -> b +same (Similer x f y) = if (f x) == y then y else undefined