Skip to content

Instantly share code, notes, and snippets.

@tonyday567
Created July 19, 2013 07:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonyday567/6037421 to your computer and use it in GitHub Desktop.
Save tonyday567/6037421 to your computer and use it in GitHub Desktop.
breadcrumbs for pipes 4.0.0
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