aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/control/functor.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/lux/control/functor.lux')
-rw-r--r--stdlib/source/lux/control/functor.lux16
1 files changed, 16 insertions, 0 deletions
diff --git a/stdlib/source/lux/control/functor.lux b/stdlib/source/lux/control/functor.lux
new file mode 100644
index 000000000..711c5ae16
--- /dev/null
+++ b/stdlib/source/lux/control/functor.lux
@@ -0,0 +1,16 @@
+## Copyright (c) Eduardo Julian. All rights reserved.
+## This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+## If a copy of the MPL was not distributed with this file,
+## You can obtain one at http://mozilla.org/MPL/2.0/.
+
+(;module: lux)
+
+(sig: #export (Functor f)
+ (: (All [a b]
+ (-> (-> a b) (f a) (f b)))
+ map))
+
+(def: #export (compF Functor<F> Functor<G>)
+ (All [F G] (-> (Functor F) (Functor G) (Functor (All [a] (F (G a))))))
+ (struct (def: (map f fga)
+ (:: Functor<F> map (:: Functor<G> map f) fga))))