Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import Data.Aeson
import Data.Attoparsec
import qualified Data.Enumerator as E
import qualified Data.Enumerator.Binary as Eb
import qualified Data.Enumerator.List as El
import qualified Data.ByteString as BS
byteLines :: Monad m => E.Enumeratee BS.ByteString BS.ByteString m b
byteLines = Eb.splitWhen (== 10) -- 10 is LF
main :: IO ()
main =
E.run_ $ Eb.enumFile "events40k.json"
E.$= byteLines
E.$= El.map (parse json)
E.$$ El.mapM_ print
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.