Last active
February 16, 2016 15:37
-
-
Save hdgarrood/41c8f423a64ab218d681 to your computer and use it in GitHub Desktop.
`*>` is not `flip <*`!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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