tagged 0.4.5 → 0.5
raw patch · 4 files changed
+21/−2 lines, 4 files
Files
- CHANGELOG.markdown +4/−0
- Data/Proxy.hs +9/−0
- Data/Tagged.hs +6/−0
- tagged.cabal +2/−2
CHANGELOG.markdown view
@@ -1,3 +1,7 @@+0.5+---+* On GHC 7.7 we now simply export instances for `Data.Typeable.Proxy` rather than make our own type. We still re-export it.+ 0.4.5 ----- * Added `witness`
Data/Proxy.hs view
@@ -38,6 +38,10 @@ import Data.Data #endif +#if __GLASGOW_HASKELL__ >= 707+import Data.Data (Proxy)++#else data Proxy s = Proxy instance Eq (Proxy s) where@@ -53,6 +57,7 @@ readsPrec d = readParen (d > 10) (\r -> [(Proxy, s) | ("Proxy",s) <- lex r ]) #ifdef __GLASGOW_HASKELL__+#if __GLASGOW_HASKELL__ < 707 instance Typeable1 Proxy where typeOf1 _ = mkTyConApp proxyTyCon []@@ -64,6 +69,7 @@ proxyTyCon = mkTyCon3 "tagged" "Data.Proxy" "Proxy" #endif {-# NOINLINE proxyTyCon #-}+#endif instance Data s => Data (Proxy s) where gfoldl _ z _ = z Proxy@@ -156,6 +162,8 @@ sequence _ = return Proxy {-# INLINE sequence #-} +#endif+ -- | Some times you need to change the proxy you have lying around. -- Idiomatic usage is to make a new combinator for the relationship -- between the proxies that you want to enforce, and define that@@ -187,3 +195,4 @@ asProxyTypeOf :: a -> Proxy a -> a asProxyTypeOf = const {-# INLINE asProxyTypeOf #-}+
Data/Tagged.hs view
@@ -48,9 +48,13 @@ -- argument, because the newtype is \"free\" newtype Tagged s b = Tagged { unTagged :: b } deriving ( Eq, Ord, Ix, Bounded+#if __GLASGOW_HASKELL__ >= 707+ , Typeable+#endif ) #ifdef __GLASGOW_HASKELL__+#if __GLASGOW_HASKELL__ < 707 instance Typeable2 Tagged where typeOf2 _ = mkTyConApp taggedTyCon [] @@ -59,6 +63,8 @@ taggedTyCon = mkTyCon "Data.Tagged.Tagged" #else taggedTyCon = mkTyCon3 "tagged" "Data.Tagged" "Tagged"+#endif+ #endif instance (Data s, Data b) => Data (Tagged s b) where
tagged.cabal view
@@ -1,5 +1,5 @@ name: tagged-version: 0.4.5+version: 0.5 license: BSD3 license-file: LICENSE author: Edward A. Kmett@@ -9,7 +9,7 @@ synopsis: Haskell 98 phantom types to avoid unsafely passing dummy arguments homepage: http://github.com/ekmett/tagged bug-reports: http://github.com/ekmett/tagged/issues-copyright: 2009-2011 Edward A. Kmett+copyright: 2009-2013 Edward A. Kmett description: Haskell 98 phantom types to avoid unsafely passing dummy arguments build-type: Simple cabal-version: >= 1.10