1 {-# LANGUAGE DeriveDataTypeable #-}
2 {-# LANGUAGE DeriveGeneric #-}
4 module Distribution
.Types
.ExposedModule
where
6 import Distribution
.Compat
.Prelude
9 import Distribution
.Backpack
10 import Distribution
.ModuleName
11 import Distribution
.Parsec
12 import Distribution
.Pretty
14 import qualified Distribution
.Compat
.CharParsing
as P
15 import qualified Text
.PrettyPrint
as Disp
17 data ExposedModule
= ExposedModule
18 { exposedName
:: ModuleName
19 , exposedReexport
:: Maybe OpenModule
21 deriving (Eq
, Generic
, Read, Show, Typeable
)
23 instance Pretty ExposedModule
where
24 pretty
(ExposedModule m reexport
) =
28 Just m
' -> Disp
.hsep
[Disp
.text
"from", pretty m
']
32 instance Parsec ExposedModule
where
34 m
<- parsecMaybeQuoted parsec
37 reexport
<- P
.optional
$ do
42 return (ExposedModule m reexport
)
44 instance Binary ExposedModule
45 instance Structured ExposedModule
46 instance NFData ExposedModule
where rnf
= genericRnf