{-# LANGUAGE DeriveDataTypeable         #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}

{-| An info object contains additional information about a piece of abstract
    syntax that isn't part of the actual syntax. For instance, it might contain
    the source code position of an expression or the concrete syntax that
    an internal expression originates from.
-}

module Agda.Syntax.Info where

import Prelude hiding (null)

import Data.Data (Data)

import qualified Agda.Syntax.Concrete.Name as C
import Agda.Syntax.Common
import Agda.Syntax.Position
import Agda.Syntax.Concrete
import Agda.Syntax.Fixity
import Agda.Syntax.Scope.Base (ScopeInfo, emptyScopeInfo)

import Agda.Utils.Function
import Agda.Utils.Functor
import Agda.Utils.Null

{--------------------------------------------------------------------------
    Meta information
 --------------------------------------------------------------------------}

data MetaInfo = MetaInfo
  { MetaInfo -> Range
metaRange          :: Range
  , MetaInfo -> ScopeInfo
metaScope          :: ScopeInfo
  , MetaInfo -> Maybe MetaId
metaNumber         :: Maybe MetaId
  , MetaInfo -> String
metaNameSuggestion :: String
  }
  deriving (Typeable MetaInfo
DataType
Constr
Typeable MetaInfo
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> MetaInfo -> c MetaInfo)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c MetaInfo)
-> (MetaInfo -> Constr)
-> (MetaInfo -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c MetaInfo))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MetaInfo))
-> ((forall b. Data b => b -> b) -> MetaInfo -> MetaInfo)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> MetaInfo -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> MetaInfo -> r)
-> (forall u. (forall d. Data d => d -> u) -> MetaInfo -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> MetaInfo -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> MetaInfo -> m MetaInfo)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> MetaInfo -> m MetaInfo)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> MetaInfo -> m MetaInfo)
-> Data MetaInfo
MetaInfo -> DataType
MetaInfo -> Constr
(forall b. Data b => b -> b) -> MetaInfo -> MetaInfo
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MetaInfo -> c MetaInfo
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MetaInfo
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> MetaInfo -> u
forall u. (forall d. Data d => d -> u) -> MetaInfo -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MetaInfo -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MetaInfo -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> MetaInfo -> m MetaInfo
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> MetaInfo -> m MetaInfo
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MetaInfo
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MetaInfo -> c MetaInfo
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c MetaInfo)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MetaInfo)
$cMetaInfo :: Constr
$tMetaInfo :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> MetaInfo -> m MetaInfo
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> MetaInfo -> m MetaInfo
gmapMp :: (forall d. Data d => d -> m d) -> MetaInfo -> m MetaInfo
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> MetaInfo -> m MetaInfo
gmapM :: (forall d. Data d => d -> m d) -> MetaInfo -> m MetaInfo
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> MetaInfo -> m MetaInfo
gmapQi :: Int -> (forall d. Data d => d -> u) -> MetaInfo -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> MetaInfo -> u
gmapQ :: (forall d. Data d => d -> u) -> MetaInfo -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> MetaInfo -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MetaInfo -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MetaInfo -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MetaInfo -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MetaInfo -> r
gmapT :: (forall b. Data b => b -> b) -> MetaInfo -> MetaInfo
$cgmapT :: (forall b. Data b => b -> b) -> MetaInfo -> MetaInfo
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MetaInfo)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MetaInfo)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c MetaInfo)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c MetaInfo)
dataTypeOf :: MetaInfo -> DataType
$cdataTypeOf :: MetaInfo -> DataType
toConstr :: MetaInfo -> Constr
$ctoConstr :: MetaInfo -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MetaInfo
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MetaInfo
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MetaInfo -> c MetaInfo
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MetaInfo -> c MetaInfo
$cp1Data :: Typeable MetaInfo
Data, Int -> MetaInfo -> ShowS
[MetaInfo] -> ShowS
MetaInfo -> String
(Int -> MetaInfo -> ShowS)
-> (MetaInfo -> String) -> ([MetaInfo] -> ShowS) -> Show MetaInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MetaInfo] -> ShowS
$cshowList :: [MetaInfo] -> ShowS
show :: MetaInfo -> String
$cshow :: MetaInfo -> String
showsPrec :: Int -> MetaInfo -> ShowS
$cshowsPrec :: Int -> MetaInfo -> ShowS
Show, MetaInfo -> MetaInfo -> Bool
(MetaInfo -> MetaInfo -> Bool)
-> (MetaInfo -> MetaInfo -> Bool) -> Eq MetaInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MetaInfo -> MetaInfo -> Bool
$c/= :: MetaInfo -> MetaInfo -> Bool
== :: MetaInfo -> MetaInfo -> Bool
$c== :: MetaInfo -> MetaInfo -> Bool
Eq)

emptyMetaInfo :: MetaInfo
emptyMetaInfo :: MetaInfo
emptyMetaInfo = MetaInfo :: Range -> ScopeInfo -> Maybe MetaId -> String -> MetaInfo
MetaInfo
  { metaRange :: Range
metaRange          = Range
forall a. Range' a
noRange
  , metaScope :: ScopeInfo
metaScope          = ScopeInfo
emptyScopeInfo
  , metaNumber :: Maybe MetaId
metaNumber         = Maybe MetaId
forall a. Maybe a
Nothing
  , metaNameSuggestion :: String
metaNameSuggestion = String
""
  }

instance HasRange MetaInfo where
  getRange :: MetaInfo -> Range
getRange = MetaInfo -> Range
metaRange

instance KillRange MetaInfo where
  killRange :: MetaInfo -> MetaInfo
killRange MetaInfo
m = MetaInfo
m { metaRange :: Range
metaRange = Range
forall a. Range' a
noRange }

{--------------------------------------------------------------------------
    General expression information
 --------------------------------------------------------------------------}

newtype ExprInfo = ExprRange Range
  deriving (Typeable ExprInfo
DataType
Constr
Typeable ExprInfo
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> ExprInfo -> c ExprInfo)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c ExprInfo)
-> (ExprInfo -> Constr)
-> (ExprInfo -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c ExprInfo))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ExprInfo))
-> ((forall b. Data b => b -> b) -> ExprInfo -> ExprInfo)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ExprInfo -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ExprInfo -> r)
-> (forall u. (forall d. Data d => d -> u) -> ExprInfo -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> ExprInfo -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> ExprInfo -> m ExprInfo)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ExprInfo -> m ExprInfo)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ExprInfo -> m ExprInfo)
-> Data ExprInfo
ExprInfo -> DataType
ExprInfo -> Constr
(forall b. Data b => b -> b) -> ExprInfo -> ExprInfo
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ExprInfo -> c ExprInfo
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ExprInfo
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> ExprInfo -> u
forall u. (forall d. Data d => d -> u) -> ExprInfo -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ExprInfo -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ExprInfo -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ExprInfo -> m ExprInfo
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ExprInfo -> m ExprInfo
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ExprInfo
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ExprInfo -> c ExprInfo
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ExprInfo)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ExprInfo)
$cExprRange :: Constr
$tExprInfo :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> ExprInfo -> m ExprInfo
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ExprInfo -> m ExprInfo
gmapMp :: (forall d. Data d => d -> m d) -> ExprInfo -> m ExprInfo
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ExprInfo -> m ExprInfo
gmapM :: (forall d. Data d => d -> m d) -> ExprInfo -> m ExprInfo
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ExprInfo -> m ExprInfo
gmapQi :: Int -> (forall d. Data d => d -> u) -> ExprInfo -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ExprInfo -> u
gmapQ :: (forall d. Data d => d -> u) -> ExprInfo -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ExprInfo -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ExprInfo -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ExprInfo -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ExprInfo -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ExprInfo -> r
gmapT :: (forall b. Data b => b -> b) -> ExprInfo -> ExprInfo
$cgmapT :: (forall b. Data b => b -> b) -> ExprInfo -> ExprInfo
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ExprInfo)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ExprInfo)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c ExprInfo)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ExprInfo)
dataTypeOf :: ExprInfo -> DataType
$cdataTypeOf :: ExprInfo -> DataType
toConstr :: ExprInfo -> Constr
$ctoConstr :: ExprInfo -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ExprInfo
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ExprInfo
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ExprInfo -> c ExprInfo
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ExprInfo -> c ExprInfo
$cp1Data :: Typeable ExprInfo
Data, Int -> ExprInfo -> ShowS
[ExprInfo] -> ShowS
ExprInfo -> String
(Int -> ExprInfo -> ShowS)
-> (ExprInfo -> String) -> ([ExprInfo] -> ShowS) -> Show ExprInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExprInfo] -> ShowS
$cshowList :: [ExprInfo] -> ShowS
show :: ExprInfo -> String
$cshow :: ExprInfo -> String
showsPrec :: Int -> ExprInfo -> ShowS
$cshowsPrec :: Int -> ExprInfo -> ShowS
Show, ExprInfo -> ExprInfo -> Bool
(ExprInfo -> ExprInfo -> Bool)
-> (ExprInfo -> ExprInfo -> Bool) -> Eq ExprInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExprInfo -> ExprInfo -> Bool
$c/= :: ExprInfo -> ExprInfo -> Bool
== :: ExprInfo -> ExprInfo -> Bool
$c== :: ExprInfo -> ExprInfo -> Bool
Eq, ExprInfo
ExprInfo -> Bool
ExprInfo -> (ExprInfo -> Bool) -> Null ExprInfo
forall a. a -> (a -> Bool) -> Null a
null :: ExprInfo -> Bool
$cnull :: ExprInfo -> Bool
empty :: ExprInfo
$cempty :: ExprInfo
Null)

exprNoRange :: ExprInfo
exprNoRange :: ExprInfo
exprNoRange = Range -> ExprInfo
ExprRange Range
forall a. Range' a
noRange

instance HasRange ExprInfo where
  getRange :: ExprInfo -> Range
getRange (ExprRange Range
r) = Range
r

instance KillRange ExprInfo where
  killRange :: ExprInfo -> ExprInfo
killRange (ExprRange Range
r) = ExprInfo
exprNoRange

{--------------------------------------------------------------------------
    Application information
 --------------------------------------------------------------------------}

-- | Information about application
data AppInfo = AppInfo
  { AppInfo -> Range
appRange  :: Range
  , AppInfo -> Origin
appOrigin :: Origin
  , AppInfo -> ParenPreference
appParens :: ParenPreference -- ^ Do we prefer a appbda argument with or without parens?
  }
  deriving (Typeable AppInfo
DataType
Constr
Typeable AppInfo
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> AppInfo -> c AppInfo)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c AppInfo)
-> (AppInfo -> Constr)
-> (AppInfo -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c AppInfo))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c AppInfo))
-> ((forall b. Data b => b -> b) -> AppInfo -> AppInfo)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> AppInfo -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> AppInfo -> r)
-> (forall u. (forall d. Data d => d -> u) -> AppInfo -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> AppInfo -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> AppInfo -> m AppInfo)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> AppInfo -> m AppInfo)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> AppInfo -> m AppInfo)
-> Data AppInfo
AppInfo -> DataType
AppInfo -> Constr
(forall b. Data b => b -> b) -> AppInfo -> AppInfo
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AppInfo -> c AppInfo
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c AppInfo
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> AppInfo -> u
forall u. (forall d. Data d => d -> u) -> AppInfo -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> AppInfo -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> AppInfo -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> AppInfo -> m AppInfo
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> AppInfo -> m AppInfo
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c AppInfo
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AppInfo -> c AppInfo
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c AppInfo)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c AppInfo)
$cAppInfo :: Constr
$tAppInfo :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> AppInfo -> m AppInfo
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> AppInfo -> m AppInfo
gmapMp :: (forall d. Data d => d -> m d) -> AppInfo -> m AppInfo
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> AppInfo -> m AppInfo
gmapM :: (forall d. Data d => d -> m d) -> AppInfo -> m AppInfo
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> AppInfo -> m AppInfo
gmapQi :: Int -> (forall d. Data d => d -> u) -> AppInfo -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> AppInfo -> u
gmapQ :: (forall d. Data d => d -> u) -> AppInfo -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> AppInfo -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> AppInfo -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> AppInfo -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> AppInfo -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> AppInfo -> r
gmapT :: (forall b. Data b => b -> b) -> AppInfo -> AppInfo
$cgmapT :: (forall b. Data b => b -> b) -> AppInfo -> AppInfo
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c AppInfo)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c AppInfo)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c AppInfo)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c AppInfo)
dataTypeOf :: AppInfo -> DataType
$cdataTypeOf :: AppInfo -> DataType
toConstr :: AppInfo -> Constr
$ctoConstr :: AppInfo -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c AppInfo
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c AppInfo
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AppInfo -> c AppInfo
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AppInfo -> c AppInfo
$cp1Data :: Typeable AppInfo
Data, Int -> AppInfo -> ShowS
[AppInfo] -> ShowS
AppInfo -> String
(Int -> AppInfo -> ShowS)
-> (AppInfo -> String) -> ([AppInfo] -> ShowS) -> Show AppInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AppInfo] -> ShowS
$cshowList :: [AppInfo] -> ShowS
show :: AppInfo -> String
$cshow :: AppInfo -> String
showsPrec :: Int -> AppInfo -> ShowS
$cshowsPrec :: Int -> AppInfo -> ShowS
Show, AppInfo -> AppInfo -> Bool
(AppInfo -> AppInfo -> Bool)
-> (AppInfo -> AppInfo -> Bool) -> Eq AppInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AppInfo -> AppInfo -> Bool
$c/= :: AppInfo -> AppInfo -> Bool
== :: AppInfo -> AppInfo -> Bool
$c== :: AppInfo -> AppInfo -> Bool
Eq, Eq AppInfo
Eq AppInfo
-> (AppInfo -> AppInfo -> Ordering)
-> (AppInfo -> AppInfo -> Bool)
-> (AppInfo -> AppInfo -> Bool)
-> (AppInfo -> AppInfo -> Bool)
-> (AppInfo -> AppInfo -> Bool)
-> (AppInfo -> AppInfo -> AppInfo)
-> (AppInfo -> AppInfo -> AppInfo)
-> Ord AppInfo
AppInfo -> AppInfo -> Bool
AppInfo -> AppInfo -> Ordering
AppInfo -> AppInfo -> AppInfo
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: AppInfo -> AppInfo -> AppInfo
$cmin :: AppInfo -> AppInfo -> AppInfo
max :: AppInfo -> AppInfo -> AppInfo
$cmax :: AppInfo -> AppInfo -> AppInfo
>= :: AppInfo -> AppInfo -> Bool
$c>= :: AppInfo -> AppInfo -> Bool
> :: AppInfo -> AppInfo -> Bool
$c> :: AppInfo -> AppInfo -> Bool
<= :: AppInfo -> AppInfo -> Bool
$c<= :: AppInfo -> AppInfo -> Bool
< :: AppInfo -> AppInfo -> Bool
$c< :: AppInfo -> AppInfo -> Bool
compare :: AppInfo -> AppInfo -> Ordering
$ccompare :: AppInfo -> AppInfo -> Ordering
$cp1Ord :: Eq AppInfo
Ord)

-- | Default is system inserted and prefer parens.
defaultAppInfo :: Range -> AppInfo
defaultAppInfo :: Range -> AppInfo
defaultAppInfo Range
r = AppInfo :: Range -> Origin -> ParenPreference -> AppInfo
AppInfo{ appRange :: Range
appRange = Range
r, appOrigin :: Origin
appOrigin = Origin
Inserted, appParens :: ParenPreference
appParens = ParenPreference
PreferParen }

-- | `AppInfo` with no range information.
defaultAppInfo_ :: AppInfo
defaultAppInfo_ :: AppInfo
defaultAppInfo_ = Range -> AppInfo
defaultAppInfo Range
forall a. Range' a
noRange

instance HasRange AppInfo where
  getRange :: AppInfo -> Range
getRange = AppInfo -> Range
appRange

instance KillRange AppInfo where
  killRange :: AppInfo -> AppInfo
killRange (AppInfo Range
r Origin
o ParenPreference
p) = Range -> Origin -> ParenPreference -> AppInfo
AppInfo (KillRangeT Range
forall a. KillRange a => KillRangeT a
killRange Range
r) Origin
o ParenPreference
p

instance LensOrigin AppInfo where
  getOrigin :: AppInfo -> Origin
getOrigin = AppInfo -> Origin
appOrigin
  mapOrigin :: (Origin -> Origin) -> AppInfo -> AppInfo
mapOrigin Origin -> Origin
f AppInfo
i = AppInfo
i { appOrigin :: Origin
appOrigin = Origin -> Origin
f (AppInfo -> Origin
appOrigin AppInfo
i) }

{--------------------------------------------------------------------------
    Module information
 --------------------------------------------------------------------------}

data ModuleInfo = ModuleInfo
  { ModuleInfo -> Range
minfoRange    :: Range
  , ModuleInfo -> Range
minfoAsTo     :: Range
    -- ^ The range of the \"as\" and \"to\" keywords,
    -- if any. Retained for highlighting purposes.
  , ModuleInfo -> Maybe Name
minfoAsName   :: Maybe C.Name
    -- ^ The \"as\" module name, if any. Retained for highlighting purposes.
  , ModuleInfo -> Maybe OpenShortHand
minfoOpenShort :: Maybe OpenShortHand
  , ModuleInfo -> Maybe ImportDirective
minfoDirective :: Maybe ImportDirective
    -- ^ Retained for @abstractToConcrete@ of 'ModuleMacro'.
  }
  deriving (Typeable ModuleInfo
DataType
Constr
Typeable ModuleInfo
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> ModuleInfo -> c ModuleInfo)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c ModuleInfo)
-> (ModuleInfo -> Constr)
-> (ModuleInfo -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c ModuleInfo))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c ModuleInfo))
-> ((forall b. Data b => b -> b) -> ModuleInfo -> ModuleInfo)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ModuleInfo -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ModuleInfo -> r)
-> (forall u. (forall d. Data d => d -> u) -> ModuleInfo -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> ModuleInfo -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> ModuleInfo -> m ModuleInfo)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ModuleInfo -> m ModuleInfo)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ModuleInfo -> m ModuleInfo)
-> Data ModuleInfo
ModuleInfo -> DataType
ModuleInfo -> Constr
(forall b. Data b => b -> b) -> ModuleInfo -> ModuleInfo
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ModuleInfo -> c ModuleInfo
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ModuleInfo
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> ModuleInfo -> u
forall u. (forall d. Data d => d -> u) -> ModuleInfo -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ModuleInfo -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ModuleInfo -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ModuleInfo -> m ModuleInfo
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ModuleInfo -> m ModuleInfo
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ModuleInfo
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ModuleInfo -> c ModuleInfo
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ModuleInfo)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ModuleInfo)
$cModuleInfo :: Constr
$tModuleInfo :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> ModuleInfo -> m ModuleInfo
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ModuleInfo -> m ModuleInfo
gmapMp :: (forall d. Data d => d -> m d) -> ModuleInfo -> m ModuleInfo
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ModuleInfo -> m ModuleInfo
gmapM :: (forall d. Data d => d -> m d) -> ModuleInfo -> m ModuleInfo
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ModuleInfo -> m ModuleInfo
gmapQi :: Int -> (forall d. Data d => d -> u) -> ModuleInfo -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ModuleInfo -> u
gmapQ :: (forall d. Data d => d -> u) -> ModuleInfo -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ModuleInfo -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ModuleInfo -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ModuleInfo -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ModuleInfo -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ModuleInfo -> r
gmapT :: (forall b. Data b => b -> b) -> ModuleInfo -> ModuleInfo
$cgmapT :: (forall b. Data b => b -> b) -> ModuleInfo -> ModuleInfo
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ModuleInfo)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ModuleInfo)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c ModuleInfo)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ModuleInfo)
dataTypeOf :: ModuleInfo -> DataType
$cdataTypeOf :: ModuleInfo -> DataType
toConstr :: ModuleInfo -> Constr
$ctoConstr :: ModuleInfo -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ModuleInfo
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ModuleInfo
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ModuleInfo -> c ModuleInfo
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ModuleInfo -> c ModuleInfo
$cp1Data :: Typeable ModuleInfo
Data, ModuleInfo -> ModuleInfo -> Bool
(ModuleInfo -> ModuleInfo -> Bool)
-> (ModuleInfo -> ModuleInfo -> Bool) -> Eq ModuleInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModuleInfo -> ModuleInfo -> Bool
$c/= :: ModuleInfo -> ModuleInfo -> Bool
== :: ModuleInfo -> ModuleInfo -> Bool
$c== :: ModuleInfo -> ModuleInfo -> Bool
Eq, Int -> ModuleInfo -> ShowS
[ModuleInfo] -> ShowS
ModuleInfo -> String
(Int -> ModuleInfo -> ShowS)
-> (ModuleInfo -> String)
-> ([ModuleInfo] -> ShowS)
-> Show ModuleInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModuleInfo] -> ShowS
$cshowList :: [ModuleInfo] -> ShowS
show :: ModuleInfo -> String
$cshow :: ModuleInfo -> String
showsPrec :: Int -> ModuleInfo -> ShowS
$cshowsPrec :: Int -> ModuleInfo -> ShowS
Show)

instance HasRange ModuleInfo where
  getRange :: ModuleInfo -> Range
getRange = ModuleInfo -> Range
minfoRange

instance SetRange ModuleInfo where
  setRange :: Range -> ModuleInfo -> ModuleInfo
setRange Range
r ModuleInfo
i = ModuleInfo
i { minfoRange :: Range
minfoRange = Range
r }

instance KillRange ModuleInfo where
  killRange :: ModuleInfo -> ModuleInfo
killRange ModuleInfo
m = ModuleInfo
m { minfoRange :: Range
minfoRange = Range
forall a. Range' a
noRange }

---------------------------------------------------------------------------
-- Let info
---------------------------------------------------------------------------

newtype LetInfo = LetRange Range
  deriving (Typeable LetInfo
DataType
Constr
Typeable LetInfo
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> LetInfo -> c LetInfo)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c LetInfo)
-> (LetInfo -> Constr)
-> (LetInfo -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c LetInfo))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LetInfo))
-> ((forall b. Data b => b -> b) -> LetInfo -> LetInfo)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> LetInfo -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> LetInfo -> r)
-> (forall u. (forall d. Data d => d -> u) -> LetInfo -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> LetInfo -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> LetInfo -> m LetInfo)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> LetInfo -> m LetInfo)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> LetInfo -> m LetInfo)
-> Data LetInfo
LetInfo -> DataType
LetInfo -> Constr
(forall b. Data b => b -> b) -> LetInfo -> LetInfo
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LetInfo -> c LetInfo
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c LetInfo
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> LetInfo -> u
forall u. (forall d. Data d => d -> u) -> LetInfo -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> LetInfo -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> LetInfo -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> LetInfo -> m LetInfo
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> LetInfo -> m LetInfo
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c LetInfo
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LetInfo -> c LetInfo
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c LetInfo)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LetInfo)
$cLetRange :: Constr
$tLetInfo :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> LetInfo -> m LetInfo
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> LetInfo -> m LetInfo
gmapMp :: (forall d. Data d => d -> m d) -> LetInfo -> m LetInfo
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> LetInfo -> m LetInfo
gmapM :: (forall d. Data d => d -> m d) -> LetInfo -> m LetInfo
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> LetInfo -> m LetInfo
gmapQi :: Int -> (forall d. Data d => d -> u) -> LetInfo -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> LetInfo -> u
gmapQ :: (forall d. Data d => d -> u) -> LetInfo -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> LetInfo -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> LetInfo -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> LetInfo -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> LetInfo -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> LetInfo -> r
gmapT :: (forall b. Data b => b -> b) -> LetInfo -> LetInfo
$cgmapT :: (forall b. Data b => b -> b) -> LetInfo -> LetInfo
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LetInfo)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LetInfo)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c LetInfo)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c LetInfo)
dataTypeOf :: LetInfo -> DataType
$cdataTypeOf :: LetInfo -> DataType
toConstr :: LetInfo -> Constr
$ctoConstr :: LetInfo -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c LetInfo
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c LetInfo
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LetInfo -> c LetInfo
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LetInfo -> c LetInfo
$cp1Data :: Typeable LetInfo
Data, Int -> LetInfo -> ShowS
[LetInfo] -> ShowS
LetInfo -> String
(Int -> LetInfo -> ShowS)
-> (LetInfo -> String) -> ([LetInfo] -> ShowS) -> Show LetInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LetInfo] -> ShowS
$cshowList :: [LetInfo] -> ShowS
show :: LetInfo -> String
$cshow :: LetInfo -> String
showsPrec :: Int -> LetInfo -> ShowS
$cshowsPrec :: Int -> LetInfo -> ShowS
Show, LetInfo -> LetInfo -> Bool
(LetInfo -> LetInfo -> Bool)
-> (LetInfo -> LetInfo -> Bool) -> Eq LetInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LetInfo -> LetInfo -> Bool
$c/= :: LetInfo -> LetInfo -> Bool
== :: LetInfo -> LetInfo -> Bool
$c== :: LetInfo -> LetInfo -> Bool
Eq, LetInfo
LetInfo -> Bool
LetInfo -> (LetInfo -> Bool) -> Null LetInfo
forall a. a -> (a -> Bool) -> Null a
null :: LetInfo -> Bool
$cnull :: LetInfo -> Bool
empty :: LetInfo
$cempty :: LetInfo
Null)

instance HasRange LetInfo where
  getRange :: LetInfo -> Range
getRange (LetRange Range
r)   = Range
r

instance KillRange LetInfo where
  killRange :: LetInfo -> LetInfo
killRange (LetRange Range
r) = Range -> LetInfo
LetRange Range
forall a. Range' a
noRange

{--------------------------------------------------------------------------
    Definition information (declarations that actually define something)
 --------------------------------------------------------------------------}

data DefInfo' t = DefInfo
  { DefInfo' t -> Fixity'
defFixity   :: Fixity'
  , DefInfo' t -> Access
defAccess   :: Access
  , DefInfo' t -> IsAbstract
defAbstract :: IsAbstract
  , DefInfo' t -> IsInstance
defInstance :: IsInstance
  , DefInfo' t -> IsMacro
defMacro    :: IsMacro
  , DefInfo' t -> DeclInfo
defInfo     :: DeclInfo
  , DefInfo' t -> Maybe t
defTactic   :: Maybe t
  }
  deriving (Typeable (DefInfo' t)
DataType
Constr
Typeable (DefInfo' t)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> DefInfo' t -> c (DefInfo' t))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (DefInfo' t))
-> (DefInfo' t -> Constr)
-> (DefInfo' t -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (DefInfo' t)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (DefInfo' t)))
-> ((forall b. Data b => b -> b) -> DefInfo' t -> DefInfo' t)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> DefInfo' t -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> DefInfo' t -> r)
-> (forall u. (forall d. Data d => d -> u) -> DefInfo' t -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> DefInfo' t -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> DefInfo' t -> m (DefInfo' t))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> DefInfo' t -> m (DefInfo' t))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> DefInfo' t -> m (DefInfo' t))
-> Data (DefInfo' t)
DefInfo' t -> DataType
DefInfo' t -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (DefInfo' t))
(forall b. Data b => b -> b) -> DefInfo' t -> DefInfo' t
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DefInfo' t -> c (DefInfo' t)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (DefInfo' t)
forall t. Data t => Typeable (DefInfo' t)
forall t. Data t => DefInfo' t -> DataType
forall t. Data t => DefInfo' t -> Constr
forall t.
Data t =>
(forall b. Data b => b -> b) -> DefInfo' t -> DefInfo' t
forall t u.
Data t =>
Int -> (forall d. Data d => d -> u) -> DefInfo' t -> u
forall t u.
Data t =>
(forall d. Data d => d -> u) -> DefInfo' t -> [u]
forall t r r'.
Data t =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DefInfo' t -> r
forall t r r'.
Data t =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DefInfo' t -> r
forall t (m :: * -> *).
(Data t, Monad m) =>
(forall d. Data d => d -> m d) -> DefInfo' t -> m (DefInfo' t)
forall t (m :: * -> *).
(Data t, MonadPlus m) =>
(forall d. Data d => d -> m d) -> DefInfo' t -> m (DefInfo' t)
forall t (c :: * -> *).
Data t =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (DefInfo' t)
forall t (c :: * -> *).
Data t =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DefInfo' t -> c (DefInfo' t)
forall t (t :: * -> *) (c :: * -> *).
(Data t, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (DefInfo' t))
forall t (t :: * -> * -> *) (c :: * -> *).
(Data t, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (DefInfo' t))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> DefInfo' t -> u
forall u. (forall d. Data d => d -> u) -> DefInfo' t -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DefInfo' t -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DefInfo' t -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> DefInfo' t -> m (DefInfo' t)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DefInfo' t -> m (DefInfo' t)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (DefInfo' t)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DefInfo' t -> c (DefInfo' t)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (DefInfo' t))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (DefInfo' t))
$cDefInfo :: Constr
$tDefInfo' :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> DefInfo' t -> m (DefInfo' t)
$cgmapMo :: forall t (m :: * -> *).
(Data t, MonadPlus m) =>
(forall d. Data d => d -> m d) -> DefInfo' t -> m (DefInfo' t)
gmapMp :: (forall d. Data d => d -> m d) -> DefInfo' t -> m (DefInfo' t)
$cgmapMp :: forall t (m :: * -> *).
(Data t, MonadPlus m) =>
(forall d. Data d => d -> m d) -> DefInfo' t -> m (DefInfo' t)
gmapM :: (forall d. Data d => d -> m d) -> DefInfo' t -> m (DefInfo' t)
$cgmapM :: forall t (m :: * -> *).
(Data t, Monad m) =>
(forall d. Data d => d -> m d) -> DefInfo' t -> m (DefInfo' t)
gmapQi :: Int -> (forall d. Data d => d -> u) -> DefInfo' t -> u
$cgmapQi :: forall t u.
Data t =>
Int -> (forall d. Data d => d -> u) -> DefInfo' t -> u
gmapQ :: (forall d. Data d => d -> u) -> DefInfo' t -> [u]
$cgmapQ :: forall t u.
Data t =>
(forall d. Data d => d -> u) -> DefInfo' t -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DefInfo' t -> r
$cgmapQr :: forall t r r'.
Data t =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DefInfo' t -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DefInfo' t -> r
$cgmapQl :: forall t r r'.
Data t =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DefInfo' t -> r
gmapT :: (forall b. Data b => b -> b) -> DefInfo' t -> DefInfo' t
$cgmapT :: forall t.
Data t =>
(forall b. Data b => b -> b) -> DefInfo' t -> DefInfo' t
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (DefInfo' t))
$cdataCast2 :: forall t (t :: * -> * -> *) (c :: * -> *).
(Data t, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (DefInfo' t))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (DefInfo' t))
$cdataCast1 :: forall t (t :: * -> *) (c :: * -> *).
(Data t, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (DefInfo' t))
dataTypeOf :: DefInfo' t -> DataType
$cdataTypeOf :: forall t. Data t => DefInfo' t -> DataType
toConstr :: DefInfo' t -> Constr
$ctoConstr :: forall t. Data t => DefInfo' t -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (DefInfo' t)
$cgunfold :: forall t (c :: * -> *).
Data t =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (DefInfo' t)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DefInfo' t -> c (DefInfo' t)
$cgfoldl :: forall t (c :: * -> *).
Data t =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DefInfo' t -> c (DefInfo' t)
$cp1Data :: forall t. Data t => Typeable (DefInfo' t)
Data, Int -> DefInfo' t -> ShowS
[DefInfo' t] -> ShowS
DefInfo' t -> String
(Int -> DefInfo' t -> ShowS)
-> (DefInfo' t -> String)
-> ([DefInfo' t] -> ShowS)
-> Show (DefInfo' t)
forall t. Show t => Int -> DefInfo' t -> ShowS
forall t. Show t => [DefInfo' t] -> ShowS
forall t. Show t => DefInfo' t -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DefInfo' t] -> ShowS
$cshowList :: forall t. Show t => [DefInfo' t] -> ShowS
show :: DefInfo' t -> String
$cshow :: forall t. Show t => DefInfo' t -> String
showsPrec :: Int -> DefInfo' t -> ShowS
$cshowsPrec :: forall t. Show t => Int -> DefInfo' t -> ShowS
Show, DefInfo' t -> DefInfo' t -> Bool
(DefInfo' t -> DefInfo' t -> Bool)
-> (DefInfo' t -> DefInfo' t -> Bool) -> Eq (DefInfo' t)
forall t. Eq t => DefInfo' t -> DefInfo' t -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DefInfo' t -> DefInfo' t -> Bool
$c/= :: forall t. Eq t => DefInfo' t -> DefInfo' t -> Bool
== :: DefInfo' t -> DefInfo' t -> Bool
$c== :: forall t. Eq t => DefInfo' t -> DefInfo' t -> Bool
Eq)

mkDefInfo :: Name -> Fixity' -> Access -> IsAbstract -> Range -> DefInfo' t
mkDefInfo :: Name -> Fixity' -> Access -> IsAbstract -> Range -> DefInfo' t
mkDefInfo Name
x Fixity'
f Access
a IsAbstract
ab Range
r = Name
-> Fixity'
-> Access
-> IsAbstract
-> IsInstance
-> IsMacro
-> Range
-> DefInfo' t
forall t.
Name
-> Fixity'
-> Access
-> IsAbstract
-> IsInstance
-> IsMacro
-> Range
-> DefInfo' t
mkDefInfoInstance Name
x Fixity'
f Access
a IsAbstract
ab IsInstance
NotInstanceDef IsMacro
NotMacroDef Range
r

-- | Same as @mkDefInfo@ but where we can also give the @IsInstance@
mkDefInfoInstance :: Name -> Fixity' -> Access -> IsAbstract -> IsInstance -> IsMacro -> Range -> DefInfo' t
mkDefInfoInstance :: Name
-> Fixity'
-> Access
-> IsAbstract
-> IsInstance
-> IsMacro
-> Range
-> DefInfo' t
mkDefInfoInstance Name
x Fixity'
f Access
a IsAbstract
ab IsInstance
i IsMacro
m Range
r = Fixity'
-> Access
-> IsAbstract
-> IsInstance
-> IsMacro
-> DeclInfo
-> Maybe t
-> DefInfo' t
forall t.
Fixity'
-> Access
-> IsAbstract
-> IsInstance
-> IsMacro
-> DeclInfo
-> Maybe t
-> DefInfo' t
DefInfo Fixity'
f Access
a IsAbstract
ab IsInstance
i IsMacro
m (Name -> Range -> DeclInfo
DeclInfo Name
x Range
r) Maybe t
forall a. Maybe a
Nothing

instance HasRange (DefInfo' t) where
  getRange :: DefInfo' t -> Range
getRange = DeclInfo -> Range
forall t. HasRange t => t -> Range
getRange (DeclInfo -> Range)
-> (DefInfo' t -> DeclInfo) -> DefInfo' t -> Range
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DefInfo' t -> DeclInfo
forall t. DefInfo' t -> DeclInfo
defInfo

instance SetRange (DefInfo' t) where
  setRange :: Range -> DefInfo' t -> DefInfo' t
setRange Range
r DefInfo' t
i = DefInfo' t
i { defInfo :: DeclInfo
defInfo = Range -> DeclInfo -> DeclInfo
forall t. SetRange t => Range -> t -> t
setRange Range
r (DefInfo' t -> DeclInfo
forall t. DefInfo' t -> DeclInfo
defInfo DefInfo' t
i) }

instance KillRange t => KillRange (DefInfo' t) where
  killRange :: KillRangeT (DefInfo' t)
killRange DefInfo' t
i = DefInfo' t
i { defInfo :: DeclInfo
defInfo   = DeclInfo -> DeclInfo
forall a. KillRange a => KillRangeT a
killRange (DeclInfo -> DeclInfo) -> DeclInfo -> DeclInfo
forall a b. (a -> b) -> a -> b
$ DefInfo' t -> DeclInfo
forall t. DefInfo' t -> DeclInfo
defInfo DefInfo' t
i,
                    defTactic :: Maybe t
defTactic = KillRangeT (Maybe t)
forall a. KillRange a => KillRangeT a
killRange KillRangeT (Maybe t) -> KillRangeT (Maybe t)
forall a b. (a -> b) -> a -> b
$ DefInfo' t -> Maybe t
forall t. DefInfo' t -> Maybe t
defTactic DefInfo' t
i }

instance LensIsAbstract (DefInfo' t) where
  lensIsAbstract :: (IsAbstract -> f IsAbstract) -> DefInfo' t -> f (DefInfo' t)
lensIsAbstract IsAbstract -> f IsAbstract
f DefInfo' t
i = (IsAbstract -> f IsAbstract
f (IsAbstract -> f IsAbstract) -> IsAbstract -> f IsAbstract
forall a b. (a -> b) -> a -> b
$! DefInfo' t -> IsAbstract
forall t. DefInfo' t -> IsAbstract
defAbstract DefInfo' t
i) f IsAbstract -> (IsAbstract -> DefInfo' t) -> f (DefInfo' t)
forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ IsAbstract
a -> DefInfo' t
i { defAbstract :: IsAbstract
defAbstract = IsAbstract
a }

instance AnyIsAbstract (DefInfo' t) where
  anyIsAbstract :: DefInfo' t -> IsAbstract
anyIsAbstract = DefInfo' t -> IsAbstract
forall t. DefInfo' t -> IsAbstract
defAbstract


{--------------------------------------------------------------------------
    General declaration information
 --------------------------------------------------------------------------}

data DeclInfo = DeclInfo
  { DeclInfo -> Name
declName  :: Name
  , DeclInfo -> Range
declRange :: Range
  }
  deriving (Typeable DeclInfo
DataType
Constr
Typeable DeclInfo
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> DeclInfo -> c DeclInfo)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c DeclInfo)
-> (DeclInfo -> Constr)
-> (DeclInfo -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c DeclInfo))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DeclInfo))
-> ((forall b. Data b => b -> b) -> DeclInfo -> DeclInfo)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> DeclInfo -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> DeclInfo -> r)
-> (forall u. (forall d. Data d => d -> u) -> DeclInfo -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> DeclInfo -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> DeclInfo -> m DeclInfo)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> DeclInfo -> m DeclInfo)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> DeclInfo -> m DeclInfo)
-> Data DeclInfo
DeclInfo -> DataType
DeclInfo -> Constr
(forall b. Data b => b -> b) -> DeclInfo -> DeclInfo
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DeclInfo -> c DeclInfo
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DeclInfo
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> DeclInfo -> u
forall u. (forall d. Data d => d -> u) -> DeclInfo -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DeclInfo -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DeclInfo -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> DeclInfo -> m DeclInfo
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DeclInfo -> m DeclInfo
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DeclInfo
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DeclInfo -> c DeclInfo
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DeclInfo)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DeclInfo)
$cDeclInfo :: Constr
$tDeclInfo :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> DeclInfo -> m DeclInfo
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DeclInfo -> m DeclInfo
gmapMp :: (forall d. Data d => d -> m d) -> DeclInfo -> m DeclInfo
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DeclInfo -> m DeclInfo
gmapM :: (forall d. Data d => d -> m d) -> DeclInfo -> m DeclInfo
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> DeclInfo -> m DeclInfo
gmapQi :: Int -> (forall d. Data d => d -> u) -> DeclInfo -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> DeclInfo -> u
gmapQ :: (forall d. Data d => d -> u) -> DeclInfo -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> DeclInfo -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DeclInfo -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DeclInfo -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DeclInfo -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DeclInfo -> r
gmapT :: (forall b. Data b => b -> b) -> DeclInfo -> DeclInfo
$cgmapT :: (forall b. Data b => b -> b) -> DeclInfo -> DeclInfo
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DeclInfo)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DeclInfo)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c DeclInfo)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DeclInfo)
dataTypeOf :: DeclInfo -> DataType
$cdataTypeOf :: DeclInfo -> DataType
toConstr :: DeclInfo -> Constr
$ctoConstr :: DeclInfo -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DeclInfo
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DeclInfo
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DeclInfo -> c DeclInfo
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DeclInfo -> c DeclInfo
$cp1Data :: Typeable DeclInfo
Data, Int -> DeclInfo -> ShowS
[DeclInfo] -> ShowS
DeclInfo -> String
(Int -> DeclInfo -> ShowS)
-> (DeclInfo -> String) -> ([DeclInfo] -> ShowS) -> Show DeclInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeclInfo] -> ShowS
$cshowList :: [DeclInfo] -> ShowS
show :: DeclInfo -> String
$cshow :: DeclInfo -> String
showsPrec :: Int -> DeclInfo -> ShowS
$cshowsPrec :: Int -> DeclInfo -> ShowS
Show, DeclInfo -> DeclInfo -> Bool
(DeclInfo -> DeclInfo -> Bool)
-> (DeclInfo -> DeclInfo -> Bool) -> Eq DeclInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeclInfo -> DeclInfo -> Bool
$c/= :: DeclInfo -> DeclInfo -> Bool
== :: DeclInfo -> DeclInfo -> Bool
$c== :: DeclInfo -> DeclInfo -> Bool
Eq)

instance HasRange DeclInfo where
  getRange :: DeclInfo -> Range
getRange = DeclInfo -> Range
declRange

instance SetRange DeclInfo where
  setRange :: Range -> DeclInfo -> DeclInfo
setRange Range
r DeclInfo
i = DeclInfo
i { declRange :: Range
declRange = Range
r }

instance KillRange DeclInfo where
  killRange :: DeclInfo -> DeclInfo
killRange DeclInfo
i = DeclInfo
i { declRange :: Range
declRange = Range
forall a. Range' a
noRange }

{--------------------------------------------------------------------------
    Mutual block information
 --------------------------------------------------------------------------}

data MutualInfo = MutualInfo
  { MutualInfo -> TerminationCheck Name
mutualTerminationCheck :: TerminationCheck Name
  , MutualInfo -> CoverageCheck
mutualCoverageCheck    :: CoverageCheck
  , MutualInfo -> PositivityCheck
mutualPositivityCheck  :: PositivityCheck
  , MutualInfo -> Range
mutualRange            :: Range
  }
  deriving (Typeable MutualInfo
DataType
Constr
Typeable MutualInfo
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> MutualInfo -> c MutualInfo)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c MutualInfo)
-> (MutualInfo -> Constr)
-> (MutualInfo -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c MutualInfo))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c MutualInfo))
-> ((forall b. Data b => b -> b) -> MutualInfo -> MutualInfo)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> MutualInfo -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> MutualInfo -> r)
-> (forall u. (forall d. Data d => d -> u) -> MutualInfo -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> MutualInfo -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> MutualInfo -> m MutualInfo)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> MutualInfo -> m MutualInfo)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> MutualInfo -> m MutualInfo)
-> Data MutualInfo
MutualInfo -> DataType
MutualInfo -> Constr
(forall b. Data b => b -> b) -> MutualInfo -> MutualInfo
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MutualInfo -> c MutualInfo
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MutualInfo
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> MutualInfo -> u
forall u. (forall d. Data d => d -> u) -> MutualInfo -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MutualInfo -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MutualInfo -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> MutualInfo -> m MutualInfo
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> MutualInfo -> m MutualInfo
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MutualInfo
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MutualInfo -> c MutualInfo
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c MutualInfo)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MutualInfo)
$cMutualInfo :: Constr
$tMutualInfo :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> MutualInfo -> m MutualInfo
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> MutualInfo -> m MutualInfo
gmapMp :: (forall d. Data d => d -> m d) -> MutualInfo -> m MutualInfo
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> MutualInfo -> m MutualInfo
gmapM :: (forall d. Data d => d -> m d) -> MutualInfo -> m MutualInfo
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> MutualInfo -> m MutualInfo
gmapQi :: Int -> (forall d. Data d => d -> u) -> MutualInfo -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> MutualInfo -> u
gmapQ :: (forall d. Data d => d -> u) -> MutualInfo -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> MutualInfo -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MutualInfo -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MutualInfo -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MutualInfo -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MutualInfo -> r
gmapT :: (forall b. Data b => b -> b) -> MutualInfo -> MutualInfo
$cgmapT :: (forall b. Data b => b -> b) -> MutualInfo -> MutualInfo
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MutualInfo)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MutualInfo)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c MutualInfo)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c MutualInfo)
dataTypeOf :: MutualInfo -> DataType
$cdataTypeOf :: MutualInfo -> DataType
toConstr :: MutualInfo -> Constr
$ctoConstr :: MutualInfo -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MutualInfo
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MutualInfo
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MutualInfo -> c MutualInfo
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MutualInfo -> c MutualInfo
$cp1Data :: Typeable MutualInfo
Data, Int -> MutualInfo -> ShowS
[MutualInfo] -> ShowS
MutualInfo -> String
(Int -> MutualInfo -> ShowS)
-> (MutualInfo -> String)
-> ([MutualInfo] -> ShowS)
-> Show MutualInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MutualInfo] -> ShowS
$cshowList :: [MutualInfo] -> ShowS
show :: MutualInfo -> String
$cshow :: MutualInfo -> String
showsPrec :: Int -> MutualInfo -> ShowS
$cshowsPrec :: Int -> MutualInfo -> ShowS
Show, MutualInfo -> MutualInfo -> Bool
(MutualInfo -> MutualInfo -> Bool)
-> (MutualInfo -> MutualInfo -> Bool) -> Eq MutualInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MutualInfo -> MutualInfo -> Bool
$c/= :: MutualInfo -> MutualInfo -> Bool
== :: MutualInfo -> MutualInfo -> Bool
$c== :: MutualInfo -> MutualInfo -> Bool
Eq)

-- | Default value for 'MutualInfo'.
instance Null MutualInfo where
  empty :: MutualInfo
empty = TerminationCheck Name
-> CoverageCheck -> PositivityCheck -> Range -> MutualInfo
MutualInfo TerminationCheck Name
forall m. TerminationCheck m
TerminationCheck CoverageCheck
YesCoverageCheck PositivityCheck
YesPositivityCheck Range
forall a. Range' a
noRange

instance HasRange MutualInfo where
  getRange :: MutualInfo -> Range
getRange = MutualInfo -> Range
mutualRange

instance KillRange MutualInfo where
  killRange :: MutualInfo -> MutualInfo
killRange MutualInfo
i = MutualInfo
i { mutualRange :: Range
mutualRange = Range
forall a. Range' a
noRange }

{--------------------------------------------------------------------------
    Left hand side information
 --------------------------------------------------------------------------}

data LHSInfo = LHSInfo
  { LHSInfo -> Range
lhsRange    :: Range
  , LHSInfo -> ExpandedEllipsis
lhsEllipsis :: ExpandedEllipsis
  } deriving (Typeable LHSInfo
DataType
Constr
Typeable LHSInfo
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> LHSInfo -> c LHSInfo)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c LHSInfo)
-> (LHSInfo -> Constr)
-> (LHSInfo -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c LHSInfo))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LHSInfo))
-> ((forall b. Data b => b -> b) -> LHSInfo -> LHSInfo)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> LHSInfo -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> LHSInfo -> r)
-> (forall u. (forall d. Data d => d -> u) -> LHSInfo -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> LHSInfo -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> LHSInfo -> m LHSInfo)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> LHSInfo -> m LHSInfo)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> LHSInfo -> m LHSInfo)
-> Data LHSInfo
LHSInfo -> DataType
LHSInfo -> Constr
(forall b. Data b => b -> b) -> LHSInfo -> LHSInfo
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LHSInfo -> c LHSInfo
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c LHSInfo
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> LHSInfo -> u
forall u. (forall d. Data d => d -> u) -> LHSInfo -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> LHSInfo -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> LHSInfo -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> LHSInfo -> m LHSInfo
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> LHSInfo -> m LHSInfo
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c LHSInfo
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LHSInfo -> c LHSInfo
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c LHSInfo)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LHSInfo)
$cLHSInfo :: Constr
$tLHSInfo :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> LHSInfo -> m LHSInfo
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> LHSInfo -> m LHSInfo
gmapMp :: (forall d. Data d => d -> m d) -> LHSInfo -> m LHSInfo
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> LHSInfo -> m LHSInfo
gmapM :: (forall d. Data d => d -> m d) -> LHSInfo -> m LHSInfo
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> LHSInfo -> m LHSInfo
gmapQi :: Int -> (forall d. Data d => d -> u) -> LHSInfo -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> LHSInfo -> u
gmapQ :: (forall d. Data d => d -> u) -> LHSInfo -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> LHSInfo -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> LHSInfo -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> LHSInfo -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> LHSInfo -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> LHSInfo -> r
gmapT :: (forall b. Data b => b -> b) -> LHSInfo -> LHSInfo
$cgmapT :: (forall b. Data b => b -> b) -> LHSInfo -> LHSInfo
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LHSInfo)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LHSInfo)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c LHSInfo)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c LHSInfo)
dataTypeOf :: LHSInfo -> DataType
$cdataTypeOf :: LHSInfo -> DataType
toConstr :: LHSInfo -> Constr
$ctoConstr :: LHSInfo -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c LHSInfo
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c LHSInfo
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LHSInfo -> c LHSInfo
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LHSInfo -> c LHSInfo
$cp1Data :: Typeable LHSInfo
Data, Int -> LHSInfo -> ShowS
[LHSInfo] -> ShowS
LHSInfo -> String
(Int -> LHSInfo -> ShowS)
-> (LHSInfo -> String) -> ([LHSInfo] -> ShowS) -> Show LHSInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LHSInfo] -> ShowS
$cshowList :: [LHSInfo] -> ShowS
show :: LHSInfo -> String
$cshow :: LHSInfo -> String
showsPrec :: Int -> LHSInfo -> ShowS
$cshowsPrec :: Int -> LHSInfo -> ShowS
Show, LHSInfo -> LHSInfo -> Bool
(LHSInfo -> LHSInfo -> Bool)
-> (LHSInfo -> LHSInfo -> Bool) -> Eq LHSInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LHSInfo -> LHSInfo -> Bool
$c/= :: LHSInfo -> LHSInfo -> Bool
== :: LHSInfo -> LHSInfo -> Bool
$c== :: LHSInfo -> LHSInfo -> Bool
Eq)

instance HasRange LHSInfo where
  getRange :: LHSInfo -> Range
getRange (LHSInfo Range
r ExpandedEllipsis
_) = Range
r

instance KillRange LHSInfo where
  killRange :: LHSInfo -> LHSInfo
killRange (LHSInfo Range
r ExpandedEllipsis
ell) = Range -> ExpandedEllipsis -> LHSInfo
LHSInfo Range
forall a. Range' a
noRange ExpandedEllipsis
ell

instance Null LHSInfo where
  null :: LHSInfo -> Bool
null LHSInfo
i = Range -> Bool
forall a. Null a => a -> Bool
null (LHSInfo -> Range
lhsRange LHSInfo
i) Bool -> Bool -> Bool
&& ExpandedEllipsis -> Bool
forall a. Null a => a -> Bool
null (LHSInfo -> ExpandedEllipsis
lhsEllipsis LHSInfo
i)
  empty :: LHSInfo
empty  = Range -> ExpandedEllipsis -> LHSInfo
LHSInfo Range
forall a. Null a => a
empty ExpandedEllipsis
forall a. Null a => a
empty

{--------------------------------------------------------------------------
    Pattern information
 --------------------------------------------------------------------------}

-- | For a general pattern we remember the source code position.
newtype PatInfo
  = PatRange Range
  deriving (Typeable PatInfo
DataType
Constr
Typeable PatInfo
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> PatInfo -> c PatInfo)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c PatInfo)
-> (PatInfo -> Constr)
-> (PatInfo -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c PatInfo))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PatInfo))
-> ((forall b. Data b => b -> b) -> PatInfo -> PatInfo)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> PatInfo -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> PatInfo -> r)
-> (forall u. (forall d. Data d => d -> u) -> PatInfo -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> PatInfo -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> PatInfo -> m PatInfo)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> PatInfo -> m PatInfo)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> PatInfo -> m PatInfo)
-> Data PatInfo
PatInfo -> DataType
PatInfo -> Constr
(forall b. Data b => b -> b) -> PatInfo -> PatInfo
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PatInfo -> c PatInfo
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PatInfo
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> PatInfo -> u
forall u. (forall d. Data d => d -> u) -> PatInfo -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PatInfo -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PatInfo -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> PatInfo -> m PatInfo
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PatInfo -> m PatInfo
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PatInfo
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PatInfo -> c PatInfo
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PatInfo)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PatInfo)
$cPatRange :: Constr
$tPatInfo :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> PatInfo -> m PatInfo
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PatInfo -> m PatInfo
gmapMp :: (forall d. Data d => d -> m d) -> PatInfo -> m PatInfo
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PatInfo -> m PatInfo
gmapM :: (forall d. Data d => d -> m d) -> PatInfo -> m PatInfo
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> PatInfo -> m PatInfo
gmapQi :: Int -> (forall d. Data d => d -> u) -> PatInfo -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> PatInfo -> u
gmapQ :: (forall d. Data d => d -> u) -> PatInfo -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> PatInfo -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PatInfo -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PatInfo -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PatInfo -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PatInfo -> r
gmapT :: (forall b. Data b => b -> b) -> PatInfo -> PatInfo
$cgmapT :: (forall b. Data b => b -> b) -> PatInfo -> PatInfo
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PatInfo)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PatInfo)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c PatInfo)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PatInfo)
dataTypeOf :: PatInfo -> DataType
$cdataTypeOf :: PatInfo -> DataType
toConstr :: PatInfo -> Constr
$ctoConstr :: PatInfo -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PatInfo
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PatInfo
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PatInfo -> c PatInfo
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PatInfo -> c PatInfo
$cp1Data :: Typeable PatInfo
Data, PatInfo -> PatInfo -> Bool
(PatInfo -> PatInfo -> Bool)
-> (PatInfo -> PatInfo -> Bool) -> Eq PatInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PatInfo -> PatInfo -> Bool
$c/= :: PatInfo -> PatInfo -> Bool
== :: PatInfo -> PatInfo -> Bool
$c== :: PatInfo -> PatInfo -> Bool
Eq, PatInfo
PatInfo -> Bool
PatInfo -> (PatInfo -> Bool) -> Null PatInfo
forall a. a -> (a -> Bool) -> Null a
null :: PatInfo -> Bool
$cnull :: PatInfo -> Bool
empty :: PatInfo
$cempty :: PatInfo
Null, Int -> PatInfo -> ShowS
[PatInfo] -> ShowS
PatInfo -> String
(Int -> PatInfo -> ShowS)
-> (PatInfo -> String) -> ([PatInfo] -> ShowS) -> Show PatInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PatInfo] -> ShowS
$cshowList :: [PatInfo] -> ShowS
show :: PatInfo -> String
$cshow :: PatInfo -> String
showsPrec :: Int -> PatInfo -> ShowS
$cshowsPrec :: Int -> PatInfo -> ShowS
Show, HasRange PatInfo
HasRange PatInfo
-> (Range -> PatInfo -> PatInfo) -> SetRange PatInfo
Range -> PatInfo -> PatInfo
forall t. HasRange t -> (Range -> t -> t) -> SetRange t
setRange :: Range -> PatInfo -> PatInfo
$csetRange :: Range -> PatInfo -> PatInfo
$cp1SetRange :: HasRange PatInfo
SetRange, PatInfo -> Range
(PatInfo -> Range) -> HasRange PatInfo
forall t. (t -> Range) -> HasRange t
getRange :: PatInfo -> Range
$cgetRange :: PatInfo -> Range
HasRange, PatInfo -> PatInfo
(PatInfo -> PatInfo) -> KillRange PatInfo
forall a. KillRangeT a -> KillRange a
killRange :: PatInfo -> PatInfo
$ckillRange :: PatInfo -> PatInfo
KillRange)

-- | Empty range for patterns.
patNoRange :: PatInfo
patNoRange :: PatInfo
patNoRange = Range -> PatInfo
PatRange Range
forall a. Range' a
noRange

-- | Constructor pattern info.
data ConPatInfo = ConPatInfo
  { ConPatInfo -> ConOrigin
conPatOrigin   :: ConOrigin
    -- ^ Does this pattern come form the eta-expansion of an implicit pattern?
    ---  Or from a user written constructor or record pattern?
  , ConPatInfo -> PatInfo
conPatInfo     :: PatInfo
  , ConPatInfo -> ConPatLazy
conPatLazy     :: ConPatLazy
  }
  deriving (Typeable ConPatInfo
DataType
Constr
Typeable ConPatInfo
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> ConPatInfo -> c ConPatInfo)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c ConPatInfo)
-> (ConPatInfo -> Constr)
-> (ConPatInfo -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c ConPatInfo))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c ConPatInfo))
-> ((forall b. Data b => b -> b) -> ConPatInfo -> ConPatInfo)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ConPatInfo -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ConPatInfo -> r)
-> (forall u. (forall d. Data d => d -> u) -> ConPatInfo -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> ConPatInfo -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> ConPatInfo -> m ConPatInfo)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ConPatInfo -> m ConPatInfo)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ConPatInfo -> m ConPatInfo)
-> Data ConPatInfo
ConPatInfo -> DataType
ConPatInfo -> Constr
(forall b. Data b => b -> b) -> ConPatInfo -> ConPatInfo
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConPatInfo -> c ConPatInfo
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConPatInfo
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> ConPatInfo -> u
forall u. (forall d. Data d => d -> u) -> ConPatInfo -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ConPatInfo -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ConPatInfo -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ConPatInfo -> m ConPatInfo
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConPatInfo -> m ConPatInfo
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConPatInfo
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConPatInfo -> c ConPatInfo
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ConPatInfo)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ConPatInfo)
$cConPatInfo :: Constr
$tConPatInfo :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> ConPatInfo -> m ConPatInfo
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConPatInfo -> m ConPatInfo
gmapMp :: (forall d. Data d => d -> m d) -> ConPatInfo -> m ConPatInfo
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConPatInfo -> m ConPatInfo
gmapM :: (forall d. Data d => d -> m d) -> ConPatInfo -> m ConPatInfo
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ConPatInfo -> m ConPatInfo
gmapQi :: Int -> (forall d. Data d => d -> u) -> ConPatInfo -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ConPatInfo -> u
gmapQ :: (forall d. Data d => d -> u) -> ConPatInfo -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ConPatInfo -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ConPatInfo -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ConPatInfo -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ConPatInfo -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ConPatInfo -> r
gmapT :: (forall b. Data b => b -> b) -> ConPatInfo -> ConPatInfo
$cgmapT :: (forall b. Data b => b -> b) -> ConPatInfo -> ConPatInfo
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ConPatInfo)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ConPatInfo)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c ConPatInfo)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ConPatInfo)
dataTypeOf :: ConPatInfo -> DataType
$cdataTypeOf :: ConPatInfo -> DataType
toConstr :: ConPatInfo -> Constr
$ctoConstr :: ConPatInfo -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConPatInfo
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConPatInfo
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConPatInfo -> c ConPatInfo
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConPatInfo -> c ConPatInfo
$cp1Data :: Typeable ConPatInfo
Data, ConPatInfo -> ConPatInfo -> Bool
(ConPatInfo -> ConPatInfo -> Bool)
-> (ConPatInfo -> ConPatInfo -> Bool) -> Eq ConPatInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConPatInfo -> ConPatInfo -> Bool
$c/= :: ConPatInfo -> ConPatInfo -> Bool
== :: ConPatInfo -> ConPatInfo -> Bool
$c== :: ConPatInfo -> ConPatInfo -> Bool
Eq, Int -> ConPatInfo -> ShowS
[ConPatInfo] -> ShowS
ConPatInfo -> String
(Int -> ConPatInfo -> ShowS)
-> (ConPatInfo -> String)
-> ([ConPatInfo] -> ShowS)
-> Show ConPatInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConPatInfo] -> ShowS
$cshowList :: [ConPatInfo] -> ShowS
show :: ConPatInfo -> String
$cshow :: ConPatInfo -> String
showsPrec :: Int -> ConPatInfo -> ShowS
$cshowsPrec :: Int -> ConPatInfo -> ShowS
Show)

instance HasRange ConPatInfo where
  getRange :: ConPatInfo -> Range
getRange = PatInfo -> Range
forall t. HasRange t => t -> Range
getRange (PatInfo -> Range)
-> (ConPatInfo -> PatInfo) -> ConPatInfo -> Range
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ConPatInfo -> PatInfo
conPatInfo

instance KillRange ConPatInfo where
  killRange :: ConPatInfo -> ConPatInfo
killRange (ConPatInfo ConOrigin
b PatInfo
i ConPatLazy
l) = ConOrigin -> PatInfo -> ConPatLazy -> ConPatInfo
ConPatInfo ConOrigin
b (PatInfo -> PatInfo
forall a. KillRange a => KillRangeT a
killRange PatInfo
i) ConPatLazy
l

instance SetRange ConPatInfo where
  setRange :: Range -> ConPatInfo -> ConPatInfo
setRange Range
r (ConPatInfo ConOrigin
b PatInfo
i ConPatLazy
l) = ConOrigin -> PatInfo -> ConPatLazy -> ConPatInfo
ConPatInfo ConOrigin
b (Range -> PatInfo
PatRange Range
r) ConPatLazy
l

-- | Has the constructor pattern a dotted (forced) constructor?
data ConPatLazy
  = ConPatLazy   -- ^ Dotted constructor.
  | ConPatEager  -- ^ Ordinary constructor.
  deriving (Typeable ConPatLazy
DataType
Constr
Typeable ConPatLazy
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> ConPatLazy -> c ConPatLazy)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c ConPatLazy)
-> (ConPatLazy -> Constr)
-> (ConPatLazy -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c ConPatLazy))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c ConPatLazy))
-> ((forall b. Data b => b -> b) -> ConPatLazy -> ConPatLazy)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ConPatLazy -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ConPatLazy -> r)
-> (forall u. (forall d. Data d => d -> u) -> ConPatLazy -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> ConPatLazy -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> ConPatLazy -> m ConPatLazy)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ConPatLazy -> m ConPatLazy)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ConPatLazy -> m ConPatLazy)
-> Data ConPatLazy
ConPatLazy -> DataType
ConPatLazy -> Constr
(forall b. Data b => b -> b) -> ConPatLazy -> ConPatLazy
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConPatLazy -> c ConPatLazy
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConPatLazy
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> ConPatLazy -> u
forall u. (forall d. Data d => d -> u) -> ConPatLazy -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ConPatLazy -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ConPatLazy -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ConPatLazy -> m ConPatLazy
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConPatLazy -> m ConPatLazy
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConPatLazy
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConPatLazy -> c ConPatLazy
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ConPatLazy)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ConPatLazy)
$cConPatEager :: Constr
$cConPatLazy :: Constr
$tConPatLazy :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> ConPatLazy -> m ConPatLazy
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConPatLazy -> m ConPatLazy
gmapMp :: (forall d. Data d => d -> m d) -> ConPatLazy -> m ConPatLazy
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ConPatLazy -> m ConPatLazy
gmapM :: (forall d. Data d => d -> m d) -> ConPatLazy -> m ConPatLazy
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ConPatLazy -> m ConPatLazy
gmapQi :: Int -> (forall d. Data d => d -> u) -> ConPatLazy -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ConPatLazy -> u
gmapQ :: (forall d. Data d => d -> u) -> ConPatLazy -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ConPatLazy -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ConPatLazy -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ConPatLazy -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ConPatLazy -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ConPatLazy -> r
gmapT :: (forall b. Data b => b -> b) -> ConPatLazy -> ConPatLazy
$cgmapT :: (forall b. Data b => b -> b) -> ConPatLazy -> ConPatLazy
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ConPatLazy)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ConPatLazy)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c ConPatLazy)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ConPatLazy)
dataTypeOf :: ConPatLazy -> DataType
$cdataTypeOf :: ConPatLazy -> DataType
toConstr :: ConPatLazy -> Constr
$ctoConstr :: ConPatLazy -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConPatLazy
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ConPatLazy
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConPatLazy -> c ConPatLazy
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ConPatLazy -> c ConPatLazy
$cp1Data :: Typeable ConPatLazy
Data, ConPatLazy -> ConPatLazy -> Bool
(ConPatLazy -> ConPatLazy -> Bool)
-> (ConPatLazy -> ConPatLazy -> Bool) -> Eq ConPatLazy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConPatLazy -> ConPatLazy -> Bool
$c/= :: ConPatLazy -> ConPatLazy -> Bool
== :: ConPatLazy -> ConPatLazy -> Bool
$c== :: ConPatLazy -> ConPatLazy -> Bool
Eq, Eq ConPatLazy
Eq ConPatLazy
-> (ConPatLazy -> ConPatLazy -> Ordering)
-> (ConPatLazy -> ConPatLazy -> Bool)
-> (ConPatLazy -> ConPatLazy -> Bool)
-> (ConPatLazy -> ConPatLazy -> Bool)
-> (ConPatLazy -> ConPatLazy -> Bool)
-> (ConPatLazy -> ConPatLazy -> ConPatLazy)
-> (ConPatLazy -> ConPatLazy -> ConPatLazy)
-> Ord ConPatLazy
ConPatLazy -> ConPatLazy -> Bool
ConPatLazy -> ConPatLazy -> Ordering
ConPatLazy -> ConPatLazy -> ConPatLazy
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ConPatLazy -> ConPatLazy -> ConPatLazy
$cmin :: ConPatLazy -> ConPatLazy -> ConPatLazy
max :: ConPatLazy -> ConPatLazy -> ConPatLazy
$cmax :: ConPatLazy -> ConPatLazy -> ConPatLazy
>= :: ConPatLazy -> ConPatLazy -> Bool
$c>= :: ConPatLazy -> ConPatLazy -> Bool
> :: ConPatLazy -> ConPatLazy -> Bool
$c> :: ConPatLazy -> ConPatLazy -> Bool
<= :: ConPatLazy -> ConPatLazy -> Bool
$c<= :: ConPatLazy -> ConPatLazy -> Bool
< :: ConPatLazy -> ConPatLazy -> Bool
$c< :: ConPatLazy -> ConPatLazy -> Bool
compare :: ConPatLazy -> ConPatLazy -> Ordering
$ccompare :: ConPatLazy -> ConPatLazy -> Ordering
$cp1Ord :: Eq ConPatLazy
Ord, Int -> ConPatLazy -> ShowS
[ConPatLazy] -> ShowS
ConPatLazy -> String
(Int -> ConPatLazy -> ShowS)
-> (ConPatLazy -> String)
-> ([ConPatLazy] -> ShowS)
-> Show ConPatLazy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConPatLazy] -> ShowS
$cshowList :: [ConPatLazy] -> ShowS
show :: ConPatLazy -> String
$cshow :: ConPatLazy -> String
showsPrec :: Int -> ConPatLazy -> ShowS
$cshowsPrec :: Int -> ConPatLazy -> ShowS
Show, ConPatLazy
ConPatLazy -> ConPatLazy -> Bounded ConPatLazy
forall a. a -> a -> Bounded a
maxBound :: ConPatLazy
$cmaxBound :: ConPatLazy
minBound :: ConPatLazy
$cminBound :: ConPatLazy
Bounded, Int -> ConPatLazy
ConPatLazy -> Int
ConPatLazy -> [ConPatLazy]
ConPatLazy -> ConPatLazy
ConPatLazy -> ConPatLazy -> [ConPatLazy]
ConPatLazy -> ConPatLazy -> ConPatLazy -> [ConPatLazy]
(ConPatLazy -> ConPatLazy)
-> (ConPatLazy -> ConPatLazy)
-> (Int -> ConPatLazy)
-> (ConPatLazy -> Int)
-> (ConPatLazy -> [ConPatLazy])
-> (ConPatLazy -> ConPatLazy -> [ConPatLazy])
-> (ConPatLazy -> ConPatLazy -> [ConPatLazy])
-> (ConPatLazy -> ConPatLazy -> ConPatLazy -> [ConPatLazy])
-> Enum ConPatLazy
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: ConPatLazy -> ConPatLazy -> ConPatLazy -> [ConPatLazy]
$cenumFromThenTo :: ConPatLazy -> ConPatLazy -> ConPatLazy -> [ConPatLazy]
enumFromTo :: ConPatLazy -> ConPatLazy -> [ConPatLazy]
$cenumFromTo :: ConPatLazy -> ConPatLazy -> [ConPatLazy]
enumFromThen :: ConPatLazy -> ConPatLazy -> [ConPatLazy]
$cenumFromThen :: ConPatLazy -> ConPatLazy -> [ConPatLazy]
enumFrom :: ConPatLazy -> [ConPatLazy]
$cenumFrom :: ConPatLazy -> [ConPatLazy]
fromEnum :: ConPatLazy -> Int
$cfromEnum :: ConPatLazy -> Int
toEnum :: Int -> ConPatLazy
$ctoEnum :: Int -> ConPatLazy
pred :: ConPatLazy -> ConPatLazy
$cpred :: ConPatLazy -> ConPatLazy
succ :: ConPatLazy -> ConPatLazy
$csucc :: ConPatLazy -> ConPatLazy
Enum)