1 Maybe_Polytype (X:*) : *p
2 = (Data:*) -> Data -> (X -> Data) -> Data
4 = Monotype (Maybe_Polytype X)
5 Nothing (X:*) : Maybe X
6 = monotype (Maybe_Polytype X)
7 (λ(Data:*) (Nothing:Data) (Just:X -> Data) -> Nothing)
8 Just (X:*) (x:X) : Maybe X
9 = monotype (Maybe_Polytype X)
10 (λ(Data:*) (Nothing:Data) (Just:X -> Data) -> Just x)
11 maybe (X:*) (Data:*) (nothing:Data) (just:X -> Data) (m:Maybe X) : Data
12 = polytype (Maybe_Polytype X) m Data nothing just
17 : Monad_Return Maybe X
21 : Monad_Bind Maybe X Y
22 = λ(mx:Maybe X) (my:X -> Maybe Y) ->
23 maybe X (Maybe Y) (Nothing Y) my mx