Mercurial > hg > Members > atton > delta_monad
view similer.hs @ 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 |
line wrap: on
line source
{-# LANGUAGE FlexibleContexts #-} data Similer a f b = Similer a (a -> b) b instance Functor (Similer a f) where fmap g (Similer a f b) = Similer a (g . f) $ g b eta :: a -> Similer a (a -> 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 (Similer a f b) = if ((f a) == b) then b else undefined