]> Git — Sourcephile - comptalang.git/blob - calculus/Calculus/Lambda/Omega/Explicit/lib/Bool.cloe
Correction : Calculus.Lambda.Omega.Explicit.REPL : broutille administrative.
[comptalang.git] / calculus / Calculus / Lambda / Omega / Explicit / lib / Bool.cloe
1 Bool_Polytype : *p = (Data:*) -> Data -> Data -> Data
2 Bool : *m = Monotype Bool_Polytype
3 True : Bool = monotype Bool_Polytype (λ(Data:*) (True:Data) (False:Data) -> True)
4 False : Bool = monotype Bool_Polytype (λ(Data:*) (True:Data) (False:Data) -> False)
5
6 and (x:Bool) (y:Bool) : Bool
7 = monotype Bool_Polytype
8 (λ(Data:*) (True:Data) (False:Data) ->
9 polytype Bool_Polytype x Data
10 (polytype Bool_Polytype y Data True False)
11 (polytype Bool_Polytype y Data False False)
12 )
13 or (x:Bool) (y:Bool) : Bool
14 = monotype Bool_Polytype
15 (λ(Data:*) (True:Data) (False:Data) ->
16 polytype Bool_Polytype x Data
17 (polytype Bool_Polytype y Data True True)
18 (polytype Bool_Polytype y Data True False)
19 )
20 xor (x:Bool) (y:Bool) : Bool
21 = monotype Bool_Polytype
22 (λ(Data:*) (True:Data) (False:Data) ->
23 polytype Bool_Polytype x Data
24 (polytype Bool_Polytype y Data False True)
25 (polytype Bool_Polytype y Data True False)
26 )
27 not (x:Bool) : Bool
28 = monotype Bool_Polytype
29 (λ(Data:*) (True:Data) (False:Data) ->
30 polytype Bool_Polytype x Data False True)