1 Either_Polytype (L:*) (R:*) : *p
2 = (Data:*) -> (L -> Data) -> (R -> Data) -> Data
3 Either (L:*) (R:*) : *m
4 = Monotype (Either_Polytype L R)
5 Left (L:*) (R:*) (l:L) : Either L R
6 = monotype (Either_Polytype L R)
7 (λ(Data:*) (Left:L -> Data) (Right:R -> Data) -> Left l)
8 Right (L:*) (R:*) (r:R) : Either L R
9 = monotype (Either_Polytype L R)
10 (λ(Data:*) (Left:L -> Data) (Right:R -> Data) -> Right r)
12 left (L:*) (R:*) (l:L)
14 = monotype (Either_Polytype L R)
15 (λ(Data:*) (Left:L -> Data) (Right:R -> Data) -> Left l)
16 right (L:*) (R:*) (r:R)
18 = monotype (Either_Polytype L R)
19 (λ(Data:*) (Left:L -> Data) (Right:R -> Data) -> Right r)
26 = polytype (Either_Polytype L R) e Data l r
29 Monad_return_Either (L:*) (X:*)
30 : Monad_Return (Either L) X
32 Monad_bind_Either (L:*) (X:*) (Y:*)
33 : Monad_Bind (Either L) X Y
34 = λ(mx:Either L X) (my:X -> Either L Y) ->
35 either L X (Either L Y) (Left L Y) my mx
39 (Monad_return_Either L)