distributed-closure 0.3.0.0 → 0.3.1.0
raw patch · 4 files changed
+19/−1 lines, 4 files
Files
- distributed-closure.cabal +1/−1
- src/Control/Distributed/Closure.hs +4/−0
- src/Control/Distributed/Closure/Internal.hs +5/−0
- src/Control/Distributed/Closure/TH.hs +9/−0
distributed-closure.cabal view
@@ -1,5 +1,5 @@ name: distributed-closure-version: 0.3.0.0+version: 0.3.1.0 synopsis: Serializable closures for distributed programming. description: See README. homepage: https://github.com/tweag/distributed-closure
src/Control/Distributed/Closure.hs view
@@ -6,10 +6,14 @@ -- for a longer introduction. {-# LANGUAGE ConstraintKinds #-}+{-# LANGUAGE CPP #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-}+#if __GLASGOW_HASKELL__ >= 800+{-# LANGUAGE UndecidableSuperClasses #-}+#endif module Control.Distributed.Closure ( Serializable
src/Control/Distributed/Closure/Internal.hs view
@@ -11,6 +11,9 @@ {-# OPTIONS_GHC -funbox-strict-fields #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -- for binary < 0.7.6 compat.+#if __GLASGOW_HASKELL__ >= 800+{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}+#endif module Control.Distributed.Closure.Internal ( Serializable@@ -29,7 +32,9 @@ import Data.Typeable (Typeable) import Data.ByteString.Lazy (ByteString) import GHC.Base (Any)+#if __GLASGOW_HASKELL__ < 800 import GHC.Fingerprint+#endif import GHC.StaticPtr import Unsafe.Coerce (unsafeCoerce) -- for dynClosureApply import System.IO.Unsafe (unsafePerformIO)
src/Control/Distributed/Closure/TH.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE StaticPointers #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeOperators #-}@@ -92,7 +93,11 @@ withStatic = (>>= go) where go [] = return []+#if MIN_VERSION_template_haskell(2,11,0)+ go (ins@(TH.InstanceD overlap cxt hd _):decls) = do+#else go (ins@(TH.InstanceD cxt hd _):decls) = do+#endif let n = length cxt dictsigs <- mapM (\c -> [t| Dict $(return c) |]) cxt retsig <- [t| Dict $(return hd) |]@@ -110,7 +115,11 @@ mapM (\c -> [t| Static $(return c) |]) cxt <*> mapM (\var -> [t| Typeable $(TH.varT var) |]) (fvT tyf) statichd <- [t| Static $(return hd) |]+#if MIN_VERSION_template_haskell(2,11,0)+ let staticins = TH.InstanceD overlap staticcxt statichd methods+#else let staticins = TH.InstanceD staticcxt statichd methods+#endif decls' <- go decls return (ins : sigf : declf : staticins : decls') go (decl:decls) = (decl:) <$> go decls