semigroups 0.14 → 0.15
raw patch · 2 files changed
+20/−2 lines, 2 files
Files
- semigroups.cabal +2/−2
- src/Data/List/NonEmpty.hs +18/−0
semigroups.cabal view
@@ -1,6 +1,6 @@ name: semigroups category: Algebra, Data, Data Structures, Math-version: 0.14+version: 0.15 license: BSD3 cabal-version: >= 1.10 license-file: LICENSE@@ -26,7 +26,7 @@ . Disabling this is an unsupported configuration, but it may be useful for accelerating builds in sandboxes for expert users. .- If set we will not supply instances of `Hashable`+ If disabled we will not supply instances of `Hashable` . Note: `-f-hashable` implies `-f-unordered-containers`, as we are necessarily not able to supply those instances as well. default: True
src/Data/List/NonEmpty.hs view
@@ -17,6 +17,10 @@ #define LANGUAGE_DeriveGeneric {-# LANGUAGE DeriveGeneric #-} #endif++#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 708+{-# LANGUAGE TypeFamilies #-}+#endif ----------------------------------------------------------------------------- -- | -- Module : Data.List.NonEmpty@@ -134,6 +138,13 @@ import Data.Ord (comparing) import Data.Traversable +#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 708+import qualified GHC.Exts as Exts+#endif+-- import Data.Semigroup hiding (Last)+-- import Data.Semigroup.Foldable+-- import Data.Semigroup.Traversable+ #ifdef LANGUAGE_DeriveGeneric import GHC.Generics #endif@@ -157,6 +168,13 @@ #else hash (a :| as) = hash a `combine` hash as #endif+#endif++#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 708+instance Exts.IsList (NonEmpty a) where+ type Item (NonEmpty a) = a+ fromList = fromList+ toList = toList #endif length :: NonEmpty a -> Int