{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Distribution.Types.Module
( Module(..)
) where
import Prelude ()
import Distribution.Compat.Prelude
import qualified Distribution.Compat.CharParsing as P
import qualified Text.PrettyPrint as Disp
import Distribution.Pretty
import Distribution.Parsec
import Distribution.Types.UnitId
import Distribution.ModuleName
data Module =
Module DefUnitId ModuleName
deriving (Generic, Read, Show, Eq, Ord, Typeable, Data)
instance Binary Module
instance Structured Module
instance Pretty Module where
pretty (Module uid mod_name) =
pretty uid <<>> Disp.text ":" <<>> pretty mod_name
instance Parsec Module where
parsec = do
uid <- parsec
_ <- P.char ':'
mod_name <- parsec
return (Module uid mod_name)
instance NFData Module where
rnf (Module uid mod_name) = rnf uid `seq` rnf mod_name