We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26d253b commit 1ba4d72Copy full SHA for 1ba4d72
Examples/Typed/more.lam
@@ -0,0 +1,17 @@
1
+TYPEDEF PII := Int *T Int;
2
+DEFINE sum := lam x :: PII -> proj1 x + proj2 x;
3
+EVAL : sum . < 2, 3 >;
4
+
5
+TYPEDEF triple := Int *T Int *T Int;
6
+DEFINE sum3 := lam x :: triple -> proj1 x + (proj1 (proj2 x)) + (proj2 (proj2 x));
7
+EVAL : sum3 . < 3, <4, 5> >;
8
9
+DEFINE eqInt := lam x, y :: Int -> !(x < y) && !(y < x);
10
+EVAL: eqInt . 1 . 2;
11
+EVAL: eqInt . 2 . 2;
12
+EVAL: eqInt . 3 . 2;
13
+EVAL: eqInt . -10 . (0 - 1 - 9);
14
15
+TYPEDEF EitherIntFun := Int +T (Int => Int);
16
+DEFINE foo := lam x :: EitherIntFun -> case x of inl i => i | inr f => (f . 42);
17
+EVAL: foo . (inr (lam x :: Int -> x * 2) as EitherIntFun);
0 commit comments