From f8578936553468785ff1c70fb7f4b0efebfbf55d Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Mon, 26 Sep 2022 16:29:32 +0300 Subject: Add maybe concept --- examples/algebraic-types-concept.lisp | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 examples/algebraic-types-concept.lisp (limited to 'examples/algebraic-types-concept.lisp') diff --git a/examples/algebraic-types-concept.lisp b/examples/algebraic-types-concept.lisp deleted file mode 100644 index 315a693..0000000 --- a/examples/algebraic-types-concept.lisp +++ /dev/null @@ -1,19 +0,0 @@ -(let just (\[a] - ["maybe" "just" a])) -(let nothing (\[] - ["maybe" "nothing"])) - -(let at (\[n seq] - (match seq - [] (nothing) - (match n - 0 (head seq) - (at (- n 1) (tail seq)))))) - -(let from-just (at 2)) -(let kind (at 1)) - -(let m (just 10)) -(match (kind m) - "just" (from-just m) - "nothing" "nothing") -- cgit v1.3