aboutsummaryrefslogtreecommitdiff
path: root/source/program.lux
diff options
context:
space:
mode:
authorEduardo Julian2015-05-04 08:00:05 -0400
committerEduardo Julian2015-05-04 08:00:05 -0400
commitda7d3d23227e6d162ff287c8b1ba3f466caafdff (patch)
tree4b0396800c02de691c4de2848301088b9c5e0f47 /source/program.lux
parentfa251c2a22f004cd66461d2a8a101f2d88b15460 (diff)
- Added alias-lux to import lux.lux definitions.
- Fixed a few bugs both in lux.lux & the compiler. - Added exports to the language.
Diffstat (limited to 'source/program.lux')
-rw-r--r--source/program.lux12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/program.lux b/source/program.lux
new file mode 100644
index 000000000..6ec9db79e
--- /dev/null
+++ b/source/program.lux
@@ -0,0 +1,12 @@
+(;alias-lux)
+
+(def (filter p xs)
+ (All [a] (-> (-> a Bool) (List a) (List a)))
+ (case xs
+ #;Nil
+ (list)
+
+ (#;Cons [x xs'])
+ (if (p x)
+ (list& x (filter p xs'))
+ (filter p xs'))))