d-bus 0.1.4 → 0.1.5
raw patch · 3 files changed
+10/−3 lines, 3 files
Files
- d-bus.cabal +1/−1
- src/DBus/TH.hs +6/−0
- src/DBus/Types.hs +3/−2
d-bus.cabal view
@@ -1,5 +1,5 @@ name: d-bus-version: 0.1.4+version: 0.1.5 synopsis: Permissively licensed D-Bus client library description: This library uses modern extensions to the Haskell type system (including GADTs, DataKinds and TypeFamilies) and the
src/DBus/TH.hs view
@@ -2,6 +2,7 @@ {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE CPP #-} module DBus.TH where @@ -85,8 +86,13 @@ makeRepresentable name = do TyConI t <- reify name let (numTyParams, tyVarNames, cons) = case t of+#if MIN_VERSION_template_haskell(2,11,0)+ NewtypeD _ _ tvs _ c _ -> (length tvs, tyVarName <$> tvs, [c])+ DataD _ _ tvs _ cs _ -> (length tvs, tyVarName <$> tvs, cs)+#else NewtypeD _ _ tvs c _ -> (length tvs, tyVarName <$> tvs, [c]) DataD _ _ tvs cs _ -> (length tvs, tyVarName <$> tvs, cs)+#endif ctx1 = mapM (classP ''SingI . (:[]) . appT (conT ''RepType)) (varT <$> (relevantTyVars cons)) ctx2 = mapM (classP ''Representable . (:[])) (varT <$> relevantTyVars cons) ctx = liftM2 (++) ctx1 ctx2
src/DBus/Types.hs view
@@ -228,8 +228,10 @@ , signalInterface :: InterfaceName , signalMember :: MemberName , signalBody :: DBusArguments a- } deriving (Show)+ } +deriving instance (SingI a) => Show (Signal a)+ data SomeSignal where SomeSignal :: SingI a => Signal a -> SomeSignal @@ -435,7 +437,6 @@ DBVUnit == DBVUnit = True DBVArray x == DBVByteArray y = BS.pack (map (\(DBVByte w) -> w) x) == y DBVByteArray x == DBVArray y = BS.pack (map (\(DBVByte w) -> w) y) == x- _ == _ = False castDBV :: (SingI s, SingI t) => DBusValue s -> Maybe (DBusValue t) castDBV (v :: DBusValue s)