diff options
author | Camil Staps | 2016-08-25 22:14:16 +0200 |
---|---|---|
committer | Camil Staps | 2016-08-25 22:14:16 +0200 |
commit | 1572515e8d3e1cf202fcaf7dec4f46ad7fd930f6 (patch) | |
tree | 5692b7fdb20dec02261c3e6ea19e718118a8c7e3 /examples/list.fusp | |
parent | Fix erroneous freeing (diff) |
Added examples
Diffstat (limited to 'examples/list.fusp')
-rw-r--r-- | examples/list.fusp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/examples/list.fusp b/examples/list.fusp new file mode 100644 index 0000000..2fce492 --- /dev/null +++ b/examples/list.fusp @@ -0,0 +1,11 @@ +append [] ys = ys; +append [x:xs] ys = [x:append xs ys]; + +flatten [] = []; +flatten [h:t] = append h (flatten t); + +isEmpty [] = 1; +isEmpty _ = 0; + +hd [x:_] = x; +tl [_:x] = x; |