44//│ Type: ⊤
55
66
7- fun andt(x)=x&& true
8- fun k(f:Nothing-> Bool)= 1
9- fun ap(f)=x=> f(x)
7+ fun andt(x) = x && true
8+ fun k(f: Nothing -> Bool) = 1
9+ fun ap(f) = x => f(x)
1010//│ Type: ⊤
1111
1212k(andt)
@@ -30,15 +30,28 @@ idIB(true)
3030idIB(if true then 1 else true)
3131//│ Type: Bool ∨ Int
3232
33- x=>
33+ x =>
3434 let y = x+1
3535 idIB(x)
3636//│ Type: ('x) ->{⊥} ⊥
3737//│ Where:
3838//│ 'x <: Int ∨ Bool
3939//│ 'x <: Int
40- //│ 'x#Bool ∨ Bool<:'app ∧ ⊥<:'eff}
4140//│ 'x#Int ∨ Int<:'app ∧ ⊥<:'eff}
41+ //│ 'x#Bool ∨ Bool<:'app ∧ ⊥<:'eff}
42+
43+ (x: Int) =>
44+ let y = x + 1
45+ idIB(x)
46+ //│ Type: (Int) ->{⊥} Int
47+
48+ (x: Bool) =>
49+ idIB(x)
50+ //│ Type: (Bool) ->{⊥} Bool
51+
52+ (x: Bool) =>
53+ idIB(idIB(x))
54+ //│ Type: (Bool) ->{⊥} Bool
4255
4356fun ap1(f)=f(1)
4457ap1(idIB)
@@ -48,32 +61,39 @@ ap(idIB)(1)
4861//│ Type: Int
4962
5063:todo
51- x=> idIB(x)
64+ x => idIB(x)
5265//│ Type: ('x) ->{⊥} ⊥
5366//│ Where:
5467//│ 'x <: Int ∨ Bool
55- //│ 'x#Int ∨ Int<:'app ∧ ⊥<:'eff}
5668//│ 'x#Bool ∨ Bool<:'app ∧ ⊥<:'eff}
69+ //│ 'x#Int ∨ Int<:'app ∧ ⊥<:'eff}
5770
5871
5972:todo // BbML
6073fun idIIBB: ([Int, Int] -> Int) & ([Bool, Bool] -> Bool)
6174//│ ╔══[ERROR] General type is not allowed here.
62- //│ ║ l.60 : fun idIIBB: ([Int, Int] -> Int) & ([Bool, Bool] -> Bool)
75+ //│ ║ l.73 : fun idIIBB: ([Int, Int] -> Int) & ([Bool, Bool] -> Bool)
6376//│ ╙── ^^^
6477//│ ╔══[ERROR] General type is not allowed here.
65- //│ ║ l.60 : fun idIIBB: ([Int, Int] -> Int) & ([Bool, Bool] -> Bool)
78+ //│ ║ l.73 : fun idIIBB: ([Int, Int] -> Int) & ([Bool, Bool] -> Bool)
6679//│ ╙── ^^^^
6780//│ Type: ⊤
6881
6982:todo // BbML
7083idIIBB([1, 2])
7184//│ ╔══[ERROR] Term shape not yet supported by BbML: Tup(List(Fld(‹›,Lit(IntLit(1)),None), Fld(‹›,Lit(IntLit(2)),None)))
72- //│ ║ l.70 : idIIBB([1, 2])
85+ //│ ║ l.83 : idIIBB([1, 2])
7386//│ ╙── ^^^^^^
7487//│ Type: ⊥
7588
7689
90+ x => if x is
91+ Int then 0
92+ Bool then 0
93+ //│ Type: (((¬Bool ∨ Int) ∨ Bool) ∧ (¬Int ∨ Int)) ->{⊥} Int
94+
95+
96+
7797class Pair[out A, out B](fst: A, snd: B)
7898//│ Type: ⊤
7999
@@ -99,7 +119,7 @@ idIIBB(new Pair(1, true))
99119:todo
100120fun foo: ["x": Int, "y": Int]
101121//│ ╔══[ERROR] Invalid type
102- //│ ║ l.100 : fun foo: ["x": Int, "y": Int]
122+ //│ ║ l.120 : fun foo: ["x": Int, "y": Int]
103123//│ ╙── ^^^^^^^^^^^^^^^^^^^^
104124//│ Type: ⊤
105125
0 commit comments