aboutsummaryrefslogtreecommitdiffstats
path: root/examples/types-concept.lisp
diff options
context:
space:
mode:
authorJan Tuomi <jans.tuomi@gmail.com>2022-12-05 14:19:12 +0200
committerJan Tuomi <jans.tuomi@gmail.com>2022-12-05 14:21:53 +0200
commit4002b8988c799a904ef1f359d4267ef4ad80cba3 (patch)
treedbb67560f3a44c57df4b0e960861f60605ceb45f /examples/types-concept.lisp
parentbba047ae945ae7d7899d6e2c1610923bcedb0442 (diff)
Rename project to Milch
Diffstat (limited to 'examples/types-concept.lisp')
-rw-r--r--examples/types-concept.lisp34
1 files changed, 0 insertions, 34 deletions
diff --git a/examples/types-concept.lisp b/examples/types-concept.lisp
deleted file mode 100644
index 8359c6b..0000000
--- a/examples/types-concept.lisp
+++ /dev/null
@@ -1,34 +0,0 @@
-; lowercase types: polymorphic
-; everything else: monomorphic
-
-(type compose (\[
- (\[b] c) ; f
- (\[a] b)] ; g
- (\[a] c)))
-(let!
- compose (\[f g] (\[x] (f (g x)))))
-
-((compose (+ 1) (+ 2)) 3)
-
-(type id (\[a] a))
-(let! id (\[a] a))
-
-(type mod (\[Int Int] Int))
-(let! mod (\[n k]
- (- n (* k (/ n k)))))
-
-(type not (\[Bool] Bool))
-(let! not (\[b]
- (match b
- true false
- false true)))
-
-(type is-even (\[Int] Bool))
-(let! is-even (\[n]
- (match (mod n 2)
- 0 true
- 1 false)))
-
-; match cannot be type annotated because its variadic
-; but the match above is inferred as this:
-(type match (\[a a b a b] b))