diff options
Diffstat (limited to 'stdlib/source/lux/abstract/apply.lux')
-rw-r--r-- | stdlib/source/lux/abstract/apply.lux | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/stdlib/source/lux/abstract/apply.lux b/stdlib/source/lux/abstract/apply.lux deleted file mode 100644 index 6f0e61ba8..000000000 --- a/stdlib/source/lux/abstract/apply.lux +++ /dev/null @@ -1,36 +0,0 @@ -(.module: - [lux #*] - [// - [monad (#+ Monad)] - ["." functor (#+ Functor)]]) - -(interface: #export (Apply f) - {#.doc "Applicative functors."} - (: (Functor f) - &functor) - (: (All [a b] - (-> (f (-> a b)) (f a) (f b))) - apply)) - -(implementation: #export (compose f-monad f-apply g-apply) - {#.doc "Applicative functor composition."} - (All [F G] - (-> (Monad F) (Apply F) (Apply G) - ## TODO: Replace (All [a] (F (G a))) with (functor.Then F G) - (Apply (All [a] (F (G a)))))) - - (def: &functor (functor.compose (get@ #&functor f-apply) (get@ #&functor g-apply))) - - (def: (apply fgf fgx) - ## TODO: Switch from this version to the one below (in comments) ASAP. - (let [fgf' (\ f-apply apply - (\ f-monad wrap (\ g-apply apply)) - fgf)] - (\ f-apply apply fgf' fgx)) - ## (let [applyF (\ f-apply apply) - ## applyG (\ g-apply apply)] - ## ($_ applyF - ## (\ f-monad wrap applyG) - ## fgf - ## fgx)) - )) |