haskell-json nonexhaustive pattern Revision 373432623133 (Wed May 12 2010 at 19:44) - Diff Link to this snippet: https://friendpaste.com/3IvnChRMoczf0mIKpOtrYE Embed: manni perldoc borland colorful default murphy trac fruity autumn bw emacs pastie friendly Show line numbers Wrap lines 1234567891011121314151617181920212223242526-- test.hsmodule Main whereimport Text.JSONmain = do x <- getLine putStrLn (show $ (decode x :: Result JSValue)) main-- problem["this","is","some","json",{"that":"works"}]["this","doesnot"]-- nonexhaustive_pattern.patch--- Text/JSON/String.hs 2010-03-07 10:16:59.410835389 +0100+++ Text/JSON/String.hs_ 2010-03-07 10:04:39.627628526 +0100@@ -128,6 +128,7 @@ '\\' : c : ds -> esc rs c ds '"' : ds -> do setInput ds return (JSString (toJSString (reverse rs)))+ [] -> fail $ "Unexpected end of String: " ++ reverse (context rs) c : ds | c >= '\x20' && c <= '\xff' -> parse (c:rs) ds | c < '\x20' -> fail $ "Illegal unescaped character in string: " ++ context cs