Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:ekmett/semigroups

Conflicts:
	semigroups.cabal
  • Loading branch information...
commit 93d1aebdaacf04d72af83447967344c4b4b3a078 2 parents 190920f + e1a5df2
Edward Kmett authored
7 Data/List/NonEmpty.hs
View
@@ -1,4 +1,7 @@
{-# LANGUAGE CPP #-}
+#ifdef LANGUAGE_DeriveDataTypeable
+{-# LANGUAGE DeriveDataTypeable #-}
+#endif
-----------------------------------------------------------------------------
-- |
-- Module : Data.List.NonEmpty
@@ -94,7 +97,7 @@ import Control.Monad
import Data.Foldable hiding (toList)
import qualified Data.Foldable as Foldable
import qualified Data.List as List
-import Data.Monoid hiding (Last)
+import Data.Monoid (mappend)
import Data.Traversable
-- import Data.Semigroup hiding (Last)
-- import Data.Semigroup.Foldable
@@ -134,7 +137,9 @@ uncons ~(a :| as) = (a, nonEmpty as)
instance Functor NonEmpty where
fmap f ~(a :| as) = f a :| fmap f as
+#if MIN_VERSION_base(4,2,0)
b <$ ~(_ :| as) = b :| (b <$ as)
+#endif
{-
instance Extend NonEmpty where
6 Data/Semigroup.hs
View
@@ -1,3 +1,7 @@
+{-# LANGUAGE CPP #-}
+#ifdef LANGUAGE_DeriveDataTypeable
+{-# LANGUAGE DeriveDataTypeable #-}
+#endif
-----------------------------------------------------------------------------
-- |
-- Module : Data.Semigroup
@@ -168,6 +172,7 @@ instance Num a => Semigroup (Sum a) where
instance Num a => Semigroup (Product a) where
Product a <> Product b = Product (a * b)
+#if MIN_VERSION_base(3,0,0)
instance Semigroup (Monoid.First a) where
Monoid.First Nothing <> b = b
a <> _ = a
@@ -177,6 +182,7 @@ instance Semigroup (Monoid.Last a) where
a <> Monoid.Last Nothing = a
_ <> b = b
times1p _ a = a
+#endif
instance Semigroup (NonEmpty a) where
(a :| as) <> ~(b :| bs) = a :| (as ++ b : bs)
3  Numeric/Natural/Internal.hs
View
@@ -19,7 +19,6 @@ module Numeric.Natural.Internal
import Data.Word
import Data.Bits
-import Text.Read
import Data.Ix
newtype Natural = Natural { runNatural :: Integer } deriving (Eq,Ord,Ix)
@@ -28,7 +27,7 @@ instance Show Natural where
showsPrec d (Natural n) = showsPrec d n
instance Read Natural where
- readPrec = fmap Natural $ step readPrec
+ readsPrec d = map (\(n, s) -> (Natural n, s)) . readsPrec d
instance Num Natural where
Natural n + Natural m = Natural (n + m)
10 semigroups.cabal
View
@@ -1,8 +1,8 @@
name: semigroups
category: Algebra, Data, Data Structures, Math
-version: 0.8.2.1
+version: 0.8.3
license: BSD3
-cabal-version: >= 1.6
+cabal-version: >= 1.10
license-file: LICENSE
author: Edward A. Kmett
maintainer: Edward A. Kmett <ekmett@gmail.com>
@@ -25,8 +25,11 @@ flag base2
manual: False
library
+ default-language: Haskell98
+ other-extensions: CPP
+
if !impl(hugs)
- extensions: DeriveDataTypeable
+ other-extensions: DeriveDataTypeable
cpp-options: -DLANGUAGE_DeriveDataTypeable
if flag(base2)
@@ -37,7 +40,6 @@ library
containers >= 0.3 && < 0.5
ghc-options: -Wall
- extensions: CPP
exposed-modules:
Data.Semigroup
Please sign in to comment.
Something went wrong with that request. Please try again.