json 0.9.3 → 0.10
raw patch · 4 files changed
+12/−3 lines, 4 filesdep ~base
Dependency ranges changed: base
Files
- CHANGES +3/−0
- Text/JSON.hs +4/−1
- Text/JSON/String.hs +4/−1
- json.cabal +1/−1
CHANGES view
@@ -1,3 +1,6 @@+Version 0.10+ * Use MonadFail, so that it works with GHC 8.8+ Version 0.9.1 * Merge-in contributions from Neil Mitchell to support GHC 7.10
Text/JSON.hs view
@@ -45,6 +45,7 @@ import Data.Int import Data.Word+import qualified Control.Monad.Fail as Fail import Control.Monad(liftM,ap,MonadPlus(..)) import Control.Applicative @@ -137,9 +138,11 @@ instance Monad Result where return x = Ok x- fail x = Error x Ok a >>= f = f a Error x >>= _ = Error x++instance Fail.MonadFail Result where+ fail x = Error x -- | Convenient error generation mkError :: String -> Result a
Text/JSON/String.hs view
@@ -35,6 +35,7 @@ JSObject, toJSObject, fromJSObject) import Control.Monad (liftM, ap)+import qualified Control.Monad.Fail as Fail import Control.Applicative((<$>)) import qualified Control.Applicative as A import Data.Char (isSpace, isDigit, digitToInt)@@ -54,10 +55,12 @@ instance Monad GetJSON where return x = GetJSON (\s -> Right (x,s))- fail x = GetJSON (\_ -> Left x) GetJSON m >>= f = GetJSON (\s -> case m s of Left err -> Left err Right (a,s1) -> un (f a) s1)++instance Fail.MonadFail GetJSON where+ fail x = GetJSON (\_ -> Left x) -- | Run a JSON reader on an input String, returning some Haskell value. -- All input will be consumed.
json.cabal view
@@ -1,5 +1,5 @@ name: json-version: 0.9.3+version: 0.10 synopsis: Support for serialising Haskell to and from JSON description: JSON (JavaScript Object Notation) is a lightweight data-interchange