Skip to content

Commit c39c1a1

Browse files
augustssdterei
authored andcommitted
Make it compile with MicroHs
1 parent d7e3278 commit c39c1a1

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

pretty.cabal

+3-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ Library
4747
Text.PrettyPrint.Annotated.HughesPJ
4848
Text.PrettyPrint.Annotated.HughesPJClass
4949
build-depends: base >= 4.5 && < 5,
50-
deepseq >= 1.1,
51-
ghc-prim
50+
deepseq >= 1.1
51+
if impl(ghc)
52+
build-depends: ghc-prim
5253
extensions: CPP, BangPatterns, DeriveGeneric
5354
ghc-options: -Wall -fwarn-tabs
5455

src/Text/PrettyPrint/Annotated/HughesPJ.hs

+4-4
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ import Data.Function ( on )
8787
#if __GLASGOW_HASKELL__ >= 803
8888
import Prelude hiding ( (<>) )
8989
#endif
90-
#if __GLASGOW_HASKELL__ >= 800
90+
#if __GLASGOW_HASKELL__ >= 800 || __MHS__
9191
import qualified Data.Semigroup as Semi ( Semigroup((<>)) )
9292
#elif __GLASGOW_HASKELL__ < 709
9393
import Data.Monoid ( Monoid(mempty, mappend) )
@@ -258,12 +258,12 @@ data TextDetails = Chr {-# UNPACK #-} !Char -- ^ A single Char fragment
258258
| PStr String -- ^ Used to represent a Fast String fragment
259259
-- but now deprecated and identical to the
260260
-- Str constructor.
261-
#if __GLASGOW_HASKELL__ >= 701
261+
#if __GLASGOW_HASKELL__ >= 701 || __MHS__
262262
deriving (Show, Eq, Generic)
263263
#endif
264264

265265
-- Combining @Doc@ values
266-
#if __GLASGOW_HASKELL__ >= 800
266+
#if __GLASGOW_HASKELL__ >= 800 || __MHS__
267267
instance Semi.Semigroup (Doc a) where
268268
#ifndef TESTING
269269
(<>) = (Text.PrettyPrint.Annotated.HughesPJ.<>)
@@ -949,7 +949,7 @@ data Mode = PageMode
949949
| OneLineMode
950950
-- ^ All on one line, 'lineLength' ignored and explicit new lines
951951
-- (@$$@) are turned into spaces.
952-
#if __GLASGOW_HASKELL__ >= 701
952+
#if __GLASGOW_HASKELL__ >= 701 || __MHS__
953953
deriving (Show, Eq, Generic)
954954
#endif
955955

src/Text/PrettyPrint/HughesPJ.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ import Data.Function ( on )
8989
#if __GLASGOW_HASKELL__ >= 803
9090
import Prelude hiding ( (<>) )
9191
#endif
92-
#if __GLASGOW_HASKELL__ >= 800
92+
#if __GLASGOW_HASKELL__ >= 800 || __MHS__
9393
import qualified Data.Semigroup as Semi ( Semigroup((<>)) )
9494
#elif __GLASGOW_HASKELL__ < 709
9595
import Data.Monoid ( Monoid(mempty, mappend) )
@@ -130,7 +130,7 @@ liftBinary f (Doc a) (Doc b) = Doc (f a b)
130130
type RDoc = Doc
131131

132132
-- Combining @Doc@ values
133-
#if __GLASGOW_HASKELL__ >= 800
133+
#if __GLASGOW_HASKELL__ >= 800 || __MHS__
134134
instance Semi.Semigroup Doc where
135135
(<>) = (Text.PrettyPrint.HughesPJ.<>)
136136

0 commit comments

Comments
 (0)