Created
July 19, 2013 07:44
-
-
Save tonyday567/6037421 to your computer and use it in GitHub Desktop.
breadcrumbs for pipes 4.0.0
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
import Pipes | |
import qualified Pipes.Lift as L | |
import qualified Pipes.Prelude as P | |
import Data.Monoid (Sum) | |
echo = runEffect $ (P.stdin >-> P.stdout) () | |
list = runEffect $ L.execWriterP $ | |
((P.range $ take 5 [1..]) >-> P.toList) () :: IO [Int] | |
sum = do | |
t <- runEffect $ L.execWriterP $ | |
(P.range [(1::Int)..10000000] >-> P.sum) () :: IO (Sum Int) | |
print t |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment