Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
... ... @@ -1,4 +1,7 @@
1 1 {-# LANGUAGE CPP #-}
  2 +#ifdef LANGUAGE_DeriveDataTypeable
  3 +{-# LANGUAGE DeriveDataTypeable #-}
  4 +#endif
2 5 -----------------------------------------------------------------------------
3 6 -- |
4 7 -- Module : Data.List.NonEmpty
@@ -94,7 +97,7 @@ import Control.Monad
94 97 import Data.Foldable hiding (toList)
95 98 import qualified Data.Foldable as Foldable
96 99 import qualified Data.List as List
97   -import Data.Monoid hiding (Last)
  100 +import Data.Monoid (mappend)
98 101 import Data.Traversable
99 102 -- import Data.Semigroup hiding (Last)
100 103 -- import Data.Semigroup.Foldable
@@ -134,7 +137,9 @@ uncons ~(a :| as) = (a, nonEmpty as)
134 137
135 138 instance Functor NonEmpty where
136 139 fmap f ~(a :| as) = f a :| fmap f as
  140 +#if MIN_VERSION_base(4,2,0)
137 141 b <$ ~(_ :| as) = b :| (b <$ as)
  142 +#endif
138 143
139 144 {-
140 145 instance Extend NonEmpty where
6 Data/Semigroup.hs
... ... @@ -1,3 +1,7 @@
  1 +{-# LANGUAGE CPP #-}
  2 +#ifdef LANGUAGE_DeriveDataTypeable
  3 +{-# LANGUAGE DeriveDataTypeable #-}
  4 +#endif
1 5 -----------------------------------------------------------------------------
2 6 -- |
3 7 -- Module : Data.Semigroup
@@ -168,6 +172,7 @@ instance Num a => Semigroup (Sum a) where
168 172 instance Num a => Semigroup (Product a) where
169 173 Product a <> Product b = Product (a * b)
170 174
  175 +#if MIN_VERSION_base(3,0,0)
171 176 instance Semigroup (Monoid.First a) where
172 177 Monoid.First Nothing <> b = b
173 178 a <> _ = a
@@ -177,6 +182,7 @@ instance Semigroup (Monoid.Last a) where
177 182 a <> Monoid.Last Nothing = a
178 183 _ <> b = b
179 184 times1p _ a = a
  185 +#endif
180 186
181 187 instance Semigroup (NonEmpty a) where
182 188 (a :| as) <> ~(b :| bs) = a :| (as ++ b : bs)
3  Numeric/Natural/Internal.hs
@@ -19,7 +19,6 @@ module Numeric.Natural.Internal
19 19
20 20 import Data.Word
21 21 import Data.Bits
22   -import Text.Read
23 22 import Data.Ix
24 23
25 24 newtype Natural = Natural { runNatural :: Integer } deriving (Eq,Ord,Ix)
@@ -28,7 +27,7 @@ instance Show Natural where
28 27 showsPrec d (Natural n) = showsPrec d n
29 28
30 29 instance Read Natural where
31   - readPrec = fmap Natural $ step readPrec
  30 + readsPrec d = map (\(n, s) -> (Natural n, s)) . readsPrec d
32 31
33 32 instance Num Natural where
34 33 Natural n + Natural m = Natural (n + m)
10 semigroups.cabal
... ... @@ -1,8 +1,8 @@
1 1 name: semigroups
2 2 category: Algebra, Data, Data Structures, Math
3   -version: 0.8.2.1
  3 +version: 0.8.3
4 4 license: BSD3
5   -cabal-version: >= 1.6
  5 +cabal-version: >= 1.10
6 6 license-file: LICENSE
7 7 author: Edward A. Kmett
8 8 maintainer: Edward A. Kmett <ekmett@gmail.com>
@@ -25,8 +25,11 @@ flag base2
25 25 manual: False
26 26
27 27 library
  28 + default-language: Haskell98
  29 + other-extensions: CPP
  30 +
28 31 if !impl(hugs)
29   - extensions: DeriveDataTypeable
  32 + other-extensions: DeriveDataTypeable
30 33 cpp-options: -DLANGUAGE_DeriveDataTypeable
31 34
32 35 if flag(base2)
@@ -37,7 +40,6 @@ library
37 40 containers >= 0.3 && < 0.5
38 41
39 42 ghc-options: -Wall
40   - extensions: CPP
41 43
42 44 exposed-modules:
43 45 Data.Semigroup

0 comments on commit 93d1aeb

Please sign in to comment.
Something went wrong with that request. Please try again.