Wed Mar 11 20:47:07 MDT 2009 Denis Bueno * Add Data.Binary.Get.getError getError throws an an error with `error' along with an user-supplied message, including indicating the byte location where of the current parse. New patches: [Add Data.Binary.Get.getError Denis Bueno **20090312024707 Ignore-this: 56fbab362b6b4e6240822c958ea1a546 getError throws an an error with `error' along with an user-supplied message, including indicating the byte location where of the current parse. ] { hunk ./src/Data/Binary/Get.hs 44 , getBytes , remaining , isEmpty + , getError -- * Parsing particular types , getWord8 hunk ./src/Data/Binary/Get.hs 274 S s ss _ <- get return (B.null s && L.null ss) +-- | Immediately end the parse and throw a human-readable error including the +-- given message and indicating the current byte position. +getError :: String -> Get a +getError msg = do + pos <- bytesRead + error ("get error at byte " ++ show pos ++ ": " ++ msg) + ------------------------------------------------------------------------ -- Utility with ByteStrings } Context: [minor bump Don Stewart **20090307235733] [Fix laziness issue in getMany Spencer Janssen **20090307235426 Ignore-this: c5f3bda1dcc181f24517f3e1ac9a4efa ] [Document getMany Spencer Janssen **20090307231517 Ignore-this: cbbb51ee712b1375c7c71a5c480851ca ] [Replace all instances of replicateM Spencer Janssen **20090307225849 Ignore-this: 5ba6feed5d8d5e7d85b6e9ffea109f2d replicateM will cause a stack overflow when getting very large lists. We introduce getMany, which tail-recursively gets many elements and reverses them at the end. Compatibility with old versions is maintained. ] [tweaks Don Stewart **20090223181207] [Expose Builder/Put relationship, courtesy Ross Don Stewart **20090212174734] [Improved instance for Sequence Paulo Tanimoto **20090208032055 Ignore-this: 7807702af570384d3860decc7a6df3e4 The current implementation of put and get for Sequence merely converts it to (from) a list. This misses the fact that we can get the length of a Sequence in O(1). I wrote this patch with help from Ross Paterson, but I take responsibility for any omission. ] [Tim Newsham's runPutM patch Don Stewart **20090208175825] [Bump in fork Don Stewart **20090208175816] [Disable explicit inlining in Get.hs, GHC is smarter than we are. Don Stewart **20081108231059 Ignore-this: feef89376cca86e9f49b91b444b3e35c ] [now Map/Set.size is used instead of List.length in 'put' kr.angelov@gmail.com**20081105200003] [lower the required bytestring version Don Stewart **20080828051315] [Can't upload to hackage due to ghc < 6.5 flagggs Don Stewart **20080825210544] [WHNF the tail of a bytestring on decodeFile, will close the resource Don Stewart **20080825210109] [more typos Don Stewart **20080718215529] [typo Don Stewart **20080718184505] [testimonial Don Stewart **20080714183731] [some more inlining Don Stewart **20080509235555] [more inlining Don Stewart **20080509215837] [Use snd-strict pair for PutM state Don Stewart **20080509215809] [Minor updates to HCAR Lennart Kolmodin **20080509210801] [More attention to inlining of primitives Don Stewart **20080509185122] [Pay a bit more attention to inlining Put Don Stewart **20080509185058] [crank up flags Don Stewart **20080509185048] [Updates to the HCAR Lennart Kolmodin **20080508224247 Editing existing text to make it up to date ] [Update links in HCAR entry Lennart Kolmodin **20080505174053] [Last HCAR entry from 2007-12 Lennart Kolmodin **20080505165931] [-fallow-undecidable-instances really is a ghc option, not a cpp option Duncan Coutts **20080422084819] [TAG 0.4.2 Don Stewart **20080421231433] [index.html Don Stewart **20080421231211] [build tests with -fhpc Don Stewart **20080421231018] [+FlexibleContexts Don Stewart **20080421231006] [typos, spotted by Jim Teisher Don Stewart **20080417152434] [bump version Don Stewart **20080214215920] [update docs Don Stewart **20080107232425] [Use cpp-options rather than ghc-options where necessary Spencer Janssen **20071222055118] [Clean up Seq serialization Spencer Janssen **20071215082319] [Add Applicative instances for PutM and Get Spencer Janssen **20071215050620] [point to in-tree homepage Don Stewart **20071128185641] [update index.html Don Stewart **20071128185601] [add homepage Don Stewart **20071128183405] [TAG 0.4.1 Lennart Kolmodin **20071021151010] Patch bundle hash: 93ab8f7e8f4b22463c2723a1cc8c97b84c9379c1