Skip to content

Instantly share code, notes, and snippets.

@hdgarrood hdgarrood/Main.purs

Last active Feb 16, 2016
Embed
What would you like to do?
`*>` is not `flip <*`!
module Main where
import Prelude
import Data.Monoid
import Control.Apply as Apply
import Control.Monad.Writer
import Control.Monad.Eff.Console (log, print)
main = do
print (runWriter (f "hi" Apply.<* f " world"))
print (runWriter (f "hi" Apply.*> f " world"))
let (*>) = flip Apply.(<*)
print (runWriter (f "hi" *> f " world"))
f :: forall a. (Monoid a) => a -> Writer a a
f x = do
tell x
pure x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.