safe 0.3.13 → 0.3.14
raw patch · 3 files changed
+29/−11 lines, 3 files
Files
- CHANGES.txt +2/−0
- Safe/Partial.hs +26/−10
- safe.cabal +1/−1
CHANGES.txt view
@@ -1,5 +1,7 @@ Changelog for Safe +0.3.14+ #20, fix for GHC 7.10.1 0.3.13 #20, require GHC 7.4 or above 0.3.12
Safe/Partial.hs view
@@ -2,26 +2,42 @@ {-# LANGUAGE KindSignatures #-} {-# LANGUAGE CPP #-} {-# LANGUAGE ImplicitParams #-}+ -- | ConstraintKind synonym for marking partial functions-module Safe.Partial(- Partial- ) where+module Safe.Partial(Partial) where -#if __GLASGOW_HASKELL__ < 710-import GHC.Exts (Constraint)-#elif __GLASGOW_HASKELL__ < 800-import GHC.Stack (CallStack)+-- Let things work through ghci alone+#ifndef MIN_VERSION_base+#define MIN_VERSION_base(x,y,z) 1+#endif++-- GHC has changed its opinion on the location a few times+-- v0: GHC 7.4.1, has ConstraintKinds+-- v1: GHC 7.10.2, base 4.8.1.0 = CallStack+-- v2: GHC 8.0.1, base 4.9.0.0 = HasCallStack++#if __GLASGOW_HASKELL__ >= 800+#define OPTION 2+#elif __GLASGOW_HASKELL__ >= 710 && MIN_VERSION_base(4,8,1)+#define OPTION 1 #else-import GHC.Stack (HasCallStack)+#define OPTION 0 #endif ++#if OPTION == 0+import GHC.Exts+#else+import GHC.Stack+#endif+ -- | A constraint synonym which denotes that the function is partial, and will -- (on GHC 8.* and up) produce a stack trace on failure. -- You may mark your own non-total functions as Partial, if necessary, and this -- will ensure that they produce useful stack traces.-#if __GLASGOW_HASKELL__ < 710+#if OPTION == 0 type Partial = (() :: Constraint)-#elif __GLASGOW_HASKELL__ < 800+#elif OPTION == 1 type Partial = (?loc :: CallStack) #else type Partial = HasCallStack
safe.cabal view
@@ -1,7 +1,7 @@ cabal-version: >= 1.18 build-type: Simple name: safe-version: 0.3.13+version: 0.3.14 license: BSD3 license-file: LICENSE category: Unclassified