Changes between Version 13 and Version 14 of TypeFunctions/ClassFamilies


Ignore:
Timestamp:
Jul 19, 2007 9:44:12 AM (8 years ago)
Author:
toms
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TypeFunctions/ClassFamilies

    v13 v14  
    289289}}}
    290290
     291====Restricted Monads====
     292
     293'''Tom''': This way we can also make Set an instance of (C)Monad. I believe lots of people
     294have been asking for this.
     295
     296{{{
     297
     298class CMonad m where
     299  class Condition m :: * -> Class
     300  (>>=) :: (Condition a, Condition b) => m a -> (a -> m b) -> m b
     301  (>>)  :: (Condition a, Condition b) => m a -> m b -> m b
     302  return :: Condition a => a -> m a
     303  fail :: Condition a => String -> m a
     304
     305instance CMonad [] where
     306  class Condition [] a
     307  ...
     308
     309instance CMonad Set where
     310  class Eq a => Condition Set a
     311  ...
     312
     313}}}
     314
    291315=== Type checking ===
    292316