on master help sign in
Add the "fmap" shortcut <$> to EffM

The `pure FancyConstructor <*> pure arg1 <*> hiddenlyEffectfulArg2 <*> (pure transform <*> effectfulArg3)` starts to get a little bit too noisy without the `<$>`.

commitf5457e02da998ecacb2c3e99efdca487b266cf34 authorMaxim Ivanov <ulidtko@gmail.com> dateWed 17 Feb 2016, 19:28 (11 years ago) parentdc7fd3b
1 file changed+5
libs/effects/Effects.idr+5
libs/effects/Effects.idr+5
@@ -256,6 +256,7 @@ return x = Value x
256256-- ------------------------------------------------------ [ for idiom brackets ]
257257
258258infixl 2 <*>
259+infixl 2 <$>
259260
260261pure : a -> EffM m a xs (\v => xs)
261262pure = Value
@@ -268,6 +269,10 @@ pureM = Value
268269(<*>) prog v = do fn <- prog
269270 arg <- v
270271 return (fn arg)
272+
273+(<$>) : (a -> b) ->
274+ EffM m a xs (\v => xs) -> EffM m b xs (\v => xs)
275+(<$>) f v = pure f <*> v
271276
272277(*>) : EffM m a xs (\v => xs) ->
273278 EffM m b xs (\v => xs) -> EffM m b xs (\v => xs)