Skip to content

Commit

Permalink
Add changelog entry, extract version macro for »Identity in Base«
Browse files Browse the repository at this point in the history
  • Loading branch information
quchen committed May 11, 2018
1 parent edea77d commit 5011204
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
3 changes: 2 additions & 1 deletion aux/version-compatibility-macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@

#define APPLICATIVE_MONAD MIN_VERSION_base(4,8,0)
#define FOLDABLE_TRAVERSABLE_IN_PRELUDE MIN_VERSION_base(4,8,0)
#define FUNCTOR_IDENTITY_IN_BASE MIN_VERSION_base(4,8,0)
#define MONOID_IN_PRELUDE MIN_VERSION_base(4,8,0)
#define NATURAL_IN_BASE MIN_VERSION_base(4,8,0)

#define SEMIGROUP_IN_BASE MIN_VERSION_base(4,9,0)
#define MONAD_FAIL MIN_VERSION_base(4,9,0)
#define SEMIGROUP_IN_BASE MIN_VERSION_base(4,9,0)

#endif
4 changes: 4 additions & 0 deletions prettyprinter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.2.1

- Add `Pretty` instances for `Identity` and `Const`

# 1.2.0.1

- Fix `alterAnnotationsS` (and thus `unAnnotateS`), which removed pushing, but
Expand Down
9 changes: 5 additions & 4 deletions prettyprinter/src/Data/Text/Prettyprint/Doc/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ module Data.Text.Prettyprint.Doc.Internal (


import Control.Applicative
#if MIN_VERSION_base(4,8,0)
import Data.Functor.Identity
#endif
import Data.Int
import Data.List.NonEmpty (NonEmpty (..))
import Data.Maybe
Expand Down Expand Up @@ -55,6 +52,10 @@ import Prelude hiding (foldr, foldr1)
import Data.Monoid hiding ((<>))
#endif

#if FUNCTOR_IDENTITY_IN_BASE
import Data.Functor.Identity
#endif

import Data.Text.Prettyprint.Doc.Render.Util.Panic


Expand Down Expand Up @@ -203,7 +204,7 @@ class Pretty a where
instance Pretty a => Pretty (Const a b) where
pretty = pretty . getConst

#if MIN_VERSION_base(4,8,0)
#if FUNCTOR_IDENTITY_IN_BASE
-- | >>> pretty (Identity 1)
-- 1
instance Pretty a => Pretty (Identity a) where
Expand Down

0 comments on commit 5011204

Please sign in to comment.