$cat app/Main.hs
module Main where
{-# LANGUAGE ExtendedDefaultRules #-}
import Control.Monad.Trans.List
import Conduit
import Control.Applicative
-- mapMC :: Monad m => (a -> m b) -> Conduit a m b
iterMC' :: Monad m => (a -> m ()) -> Conduit a m a
iterMC' f = mapMC (\a -> (f a) >> return a)
-- (<*>) :: f (a -> b) -> f a -> f b
-- liftA :: Applicative f => (a -> b) -> f a -> f b
sink' :: Monad m => ConduitM Int o m (String, Int)
sink' = liftA2 (,) a b
where
a = takeC 5 .| mapC show .| foldC
b = sumC
-
-
Save kevinmeredith/c164ee1b2e30446f7aeab6637cd865a5 to your computer and use it in GitHub Desktop.
Working on examples/exercises of snoyberg/conduit README
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment