CMonad.hascasl.output revision 5581c4644d91dcb9b7e2e7f6052f7cbf5f97b6de
class Functor < Type -> Type
class Monad < Functor
type List : Monad
var a : Type; b : Type
var m : Monad
op fail : m a
op return : a -> m a
var f : Functor
op fmap : (a -> b) -> f a -> f b
op empty : List a
type Set : Functor
op emptySet : Set a
. fail = emptySet
. fail = ""
op map : (a -> b) -> List a -> List b
op __bind__ : m a * (a -> m b) -> m b
var g : a -> b
var x : m a
. fmap g = map g
. fmap g x = (x bind (\ y : a .! return (g y)))
%% Classes ---------------------------------------------------------------
Functor < Type -> Type
Monad < Functor
%% Type Constructors -----------------------------------------------------
List : Monad
Set : Functor
%% Type Variables --------------------------------------------------------
a : Type %(var_1)%
b : Type %(var_2)%
f : Functor %(var_4)%
m : Monad %(var_3)%
%% Assumptions -----------------------------------------------------------
__bind__
: forall a : Type; b : Type; m : Monad . m a * (a -> m b) -> m b
%(op)%
empty : forall a : Type . List a %(op)%
emptySet : forall a : Type . Set a %(op)%
fail : forall a : Type; m : Monad . m a %(op)%
fmap
: forall a : Type; b : Type; f : Functor . (a -> b) -> f a -> f b
%(op)%
map
: forall a : Type; b : Type . (a -> b) -> List a -> List b %(op)%
return : forall a : Type; m : Monad . a -> m a %(op)%
%% Variables -------------------------------------------------------------
g : a -> b
x : m a
%% Sentences -------------------------------------------------------------
fail = emptySet
fail = ""
fmap g = map g
fmap g x = (x bind (\ y : a .! return (g y)))
%% Diagnostics -----------------------------------------------------------
### Hint 7.5, is type variable 'a'
### Hint 7.8, is type variable 'b'
### Hint 9.5, is type variable 'm'
### Hint 15.5, is type variable 'f'
### Hint 25.8, constrain 'Set : Monad' is unprovable
known kinds are: Functor
*** Error 25.8, in term '(op fail[_v12; Set] : forall a : Type; m : Monad . m a) =
(op emptySet[_v12] : forall a : Type . Set a)' of type 'Unit'
unresolved constraints '{Set : Monad}'
### Hint 33.7, not a class 'a'
### Hint 33.7, not a class 'b'
### Hint 33.23, not a kind 'm a'