diff options
Diffstat (limited to 'stdlib/source/lux/control/monad.lux')
-rw-r--r-- | stdlib/source/lux/control/monad.lux | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/stdlib/source/lux/control/monad.lux b/stdlib/source/lux/control/monad.lux index fd940ea83..2e4045f3a 100644 --- a/stdlib/source/lux/control/monad.lux +++ b/stdlib/source/lux/control/monad.lux @@ -28,7 +28,7 @@ (def: (reverse xs) (All [a] (-> (List a) (List a))) - (list/fold (function [head tail] (#.Cons head tail)) + (list/fold (function (_ head tail) (#.Cons head tail)) #.Nil xs)) @@ -61,18 +61,19 @@ (case tokens (#.Cons monad (#.Cons [_ (#.Tuple bindings)] (#.Cons body #.Nil))) (if (|> bindings list/size (n/% +2) (n/= +0)) - (let [g!map (: Code [_cursor (#.Symbol ["" " map "])]) + (let [g!_ (: Code [_cursor (#.Symbol ["" " _ "])]) + g!map (: Code [_cursor (#.Symbol ["" " map "])]) g!join (: Code [_cursor (#.Symbol ["" " join "])]) g!apply (: Code [_cursor (#.Symbol ["" " apply "])]) body' (list/fold (: (-> [Code Code] Code Code) - (function [binding body'] + (function (_ binding body') (let [[var value] binding] (case var [_ (#.Tag ["" "let"])] (` (let (~ value) (~ body'))) _ - (` (|> (~ value) ((~ g!map) (function [(~ var)] (~ body'))) (~ g!join))) + (` (|> (~ value) ((~ g!map) (function ((~ g!_) (~ var)) (~ body'))) (~ g!join))) )))) body (reverse (as-pairs bindings)))] @@ -139,7 +140,7 @@ {#.doc "Lift a normal function into the space of monads."} (All [M a b] (-> (Monad M) (-> a b) (-> (M a) (M b)))) - (function [ma] + (function (_ ma) (do Monad<M> [a ma] (wrap (f a))))) @@ -179,7 +180,7 @@ [(#Effect ff) _] (#Effect (:: dsl map - (function [f] (apply f ea)) + (function (_ f) (apply f ea)) ff)) ))) |