packages feed

xcb-types 0.12.0 → 0.13.0

raw patch · 4 files changed

+19/−7 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Data.XCB.Pretty: instance Data.XCB.Pretty.Pretty Data.XCB.Types.PadType
+ Data.XCB.Types: PadAlignment :: PadType
+ Data.XCB.Types: PadBytes :: PadType
+ Data.XCB.Types: data PadType
+ Data.XCB.Types: instance GHC.Show.Show Data.XCB.Types.PadType
- Data.XCB.Types: Pad :: Int -> GenStructElem typ
+ Data.XCB.Types: Pad :: PadType -> Int -> GenStructElem typ

Files

Data/XCB/FromXML.hs view
@@ -26,7 +26,7 @@  import Data.List as List import qualified Data.Map as Map-import Data.Maybe (catMaybes, mapMaybe)+import Data.Maybe (catMaybes, mapMaybe, maybeToList)  import Control.Monad (MonadPlus (mzero, mplus), guard, liftM, liftM2) import Control.Monad.Reader (ReaderT, runReaderT, ask, lift, withReaderT)@@ -57,7 +57,7 @@ fromStrings :: [String] -> [XHeader] fromStrings xs =    let rs = mapAlt fromString xs-       Just headers = runReaderT rs headers+       headers = concat $ maybeToList $ runReaderT rs headers    in headers  -- The 'Parse' monad.  Provides the name of the@@ -349,8 +349,10 @@         return $ SField name typ enum mask      | el `named` "pad" = do-        bytes <- el `attr` "bytes" >>= readM-        return $ Pad bytes+        let bytes = liftM (Pad PadBytes) $ el `attr` "bytes" >>= readM+        let align = liftM (Pad PadAlignment) $ el `attr` "align" >>= readM++        return $ head $ catMaybes $ [bytes, align]      | el `named` "list" = do         typ <- liftM mkType $ el `attr` "type"
Data/XCB/Pretty.hs view
@@ -97,8 +97,12 @@         = parens $ toDoc op <> toDoc expr     toDoc (ParamRef n) = toDoc n +instance Pretty PadType where+    pretty PadBytes = "bytes"+    pretty PadAlignment = "align"+ instance Pretty a => Pretty (GenStructElem a) where-    toDoc (Pad n) = braces $ toDoc n <+> text "bytes"+    toDoc (Pad typ n) = braces $ toDoc n <+> toDoc typ     toDoc (List nm typ len enums)         = text nm <+> text "::" <+> brackets (toDoc typ <+> toDoc enums) <+> toDoc len     toDoc (SField nm typ enums mask) = hsep [text nm
Data/XCB/Types.hs view
@@ -46,6 +46,7 @@     , MaskPadding     , Alignment ( .. )     , AllowedEvent ( .. )+    , PadType ( .. )     ) where  import Data.Map@@ -93,8 +94,13 @@     | XEventStruct Name [AllowedEvent]  deriving (Show, Functor) +data PadType+    = PadBytes+    | PadAlignment+ deriving (Show)+ data GenStructElem typ-    = Pad Int+    = Pad PadType Int     | List Name typ (Maybe (Expression typ)) (Maybe (EnumVals typ))     | SField Name typ (Maybe (EnumVals typ)) (Maybe (MaskVals typ))     | ExprField Name typ (Expression typ)
xcb-types.cabal view
@@ -1,5 +1,5 @@ Name:         xcb-types-Version:      0.12.0+Version:      0.13.0 Cabal-Version:  >= 1.10 Synopsis:     Parses XML files used by the XCB project Description:   This package provides types which mirror the structures