haxr 3000.10.1.1 → 3000.10.2
raw patch · 4 files changed
+22/−2 lines, 4 files
Files
- CHANGES +5/−0
- Network/XmlRpc/DTD_XMLRPC.hs +14/−0
- Network/XmlRpc/Internals.hs +2/−1
- haxr.cabal +1/−1
CHANGES view
@@ -1,3 +1,8 @@+* 3000.10.2 (30 January 2014)++ - Adds support for i8 (64-bit integer) types: see new I8 type in+ Network.XmlRpc.DTD_XMLRPC. Thanks to Jorge Peña for the patch.+ * 3000.10.1.1 (10 October 2013) - fix build under GHC 7.4
Network/XmlRpc/DTD_XMLRPC.hs view
@@ -8,6 +8,7 @@ {-Type decls-} newtype I4 = I4 String deriving (Eq,Show)+newtype I8 = I8 String deriving (Eq,Show) newtype AInt = AInt String deriving (Eq,Show) newtype Boolean = Boolean String deriving (Eq,Show) newtype AString = AString String deriving (Eq,Show)@@ -23,6 +24,7 @@ newtype Value = Value [Value_] deriving (Eq,Show) data Value_ = Value_Str String | Value_I4 I4+ | Value_I8 I8 | Value_AInt AInt | Value_Boolean Boolean | Value_AString AString@@ -55,6 +57,16 @@ ; interior e $ return (I4) `apply` (text `onFail` return "") } `adjustErr` ("in <i4>, "++) +instance HTypeable I8 where+ toHType x = Defined "i8" [] []+instance XmlContent I8 where+ toContents (I8 a) =+ [CElem (Elem (N "i8") [] (toText a)) ()]+ parseContents = do+ { e@(Elem _ [] _) <- element ["i8"]+ ; interior e $ return (I8) `apply` (text `onFail` return "")+ } `adjustErr` ("in <i8>, "++)+ instance HTypeable AInt where toHType x = Defined "int" [] [] instance XmlContent AInt where@@ -182,6 +194,7 @@ instance XmlContent Value_ where toContents (Value_Str a) = toText a toContents (Value_I4 a) = toContents a+ toContents (Value_I8 a) = toContents a toContents (Value_AInt a) = toContents a toContents (Value_Boolean a) = toContents a toContents (Value_AString a) = toContents a@@ -193,6 +206,7 @@ parseContents = oneOf [ return (Value_Str) `apply` text , return (Value_I4) `apply` parseContents+ , return (Value_I8) `apply` parseContents , return (Value_AInt) `apply` parseContents , return (Value_Boolean) `apply` parseContents , return (Value_AString) `apply` parseContents
Network/XmlRpc/Internals.hs view
@@ -144,7 +144,7 @@ -- | An XML-RPC value. data Value =- ValueInt Int -- ^ int or i4+ ValueInt Int -- ^ int, i4, or i8 | ValueBool Bool -- ^ bool | ValueString String -- ^ string | ValueUnwrapped String -- ^ no inner element@@ -432,6 +432,7 @@ unstr (XR.Value_Str x) = x f (XR.Value_I4 (XR.I4 x)) = liftM ValueInt (readInt x)+ f (XR.Value_I8 (XR.I8 x)) = liftM ValueInt (readInt x) f (XR.Value_AInt (XR.AInt x)) = liftM ValueInt (readInt x) f (XR.Value_Boolean (XR.Boolean x)) = liftM ValueBool (readBool x) f (XR.Value_ADouble (XR.ADouble x)) = liftM ValueDouble (readDouble x)
haxr.cabal view
@@ -1,5 +1,5 @@ Name: haxr-Version: 3000.10.1.1+Version: 3000.10.2 Cabal-version: >=1.10 Build-type: Simple Copyright: Bjorn Bringert, 2003-2006