Skip to content

Instantly share code, notes, and snippets.

Created April 10, 2013 14:31
Show Gist options
  • Save anonymous/5355148 to your computer and use it in GitHub Desktop.
Save anonymous/5355148 to your computer and use it in GitHub Desktop.
module Main where
import System.IO.MMap
import qualified Data.ByteString.Lazy as BL
somedata:: IO BL.ByteString
somedata = mmapFileByteStringLazy "some.data" Nothing
main = somedata >>= return . show . BL.last >>= putStrLn
{- some.data file is 1625424 bytes long (in case that matters)
- the code crashes with a nasty segfault
-}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment