{-# LANGUAGE CPP #-}
{-# LANGUAGE RecursiveDo #-}
module Agda.TypeChecking.Monad.Base
( module Agda.TypeChecking.Monad.Base
, HasOptions (..)
) where
import Prelude hiding (null)
import Control.Applicative hiding (empty)
import qualified Control.Concurrent as C
import Control.DeepSeq
import qualified Control.Exception as E
import qualified Control.Monad.Fail as Fail
import Control.Monad ( void )
import Control.Monad.Except
import Control.Monad.Fix
import Control.Monad.IO.Class ( MonadIO(..) )
import Control.Monad.State ( MonadState(..), modify, StateT(..), runStateT )
import Control.Monad.Reader ( MonadReader(..), ReaderT(..), runReaderT )
import Control.Monad.Writer ( WriterT )
import Control.Monad.Trans ( MonadTrans(..), lift )
import Control.Monad.Trans.Control ( MonadTransControl(..), liftThrough )
import Control.Monad.Trans.Identity ( IdentityT(..), runIdentityT )
import Control.Monad.Trans.Maybe ( MaybeT(..) )
import Control.Parallel ( pseq )
import Data.Array (Ix)
import Data.DList (DList)
import Data.Function
import Data.Int
import Data.IntMap (IntMap)
import qualified Data.IntMap as IntMap
import qualified Data.List as List
import Data.Maybe
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Sequence (Seq)
import Data.Set (Set)
import qualified Data.Set as Set
import Data.HashMap.Strict (HashMap)
import qualified Data.HashMap.Strict as HMap
import Data.HashSet (HashSet)
import Data.Semigroup ( Semigroup, (<>))
import Data.String
import Data.Text (Text)
import qualified Data.Text as T
import qualified Data.Text.Lazy as TL
import Data.IORef
import GHC.Generics (Generic)
import Agda.Benchmarking (Benchmark, Phase)
import Agda.Syntax.Common
import qualified Agda.Syntax.Concrete as C
import Agda.Syntax.Concrete.Definitions
(NiceDeclaration, DeclarationWarning, dwWarning, declarationWarningName)
import qualified Agda.Syntax.Abstract as A
import Agda.Syntax.Internal as I
import Agda.Syntax.Internal.MetaVars
import Agda.Syntax.Internal.Generic (TermLike(..))
import Agda.Syntax.Parser (ParseWarning)
import Agda.Syntax.Parser.Monad (parseWarningName)
import Agda.Syntax.TopLevelModuleName
(RawTopLevelModuleName, TopLevelModuleName)
import Agda.Syntax.Treeless (Compiled)
import Agda.Syntax.Notation
import Agda.Syntax.Position
import Agda.Syntax.Scope.Base
import qualified Agda.Syntax.Info as Info
import Agda.TypeChecking.CompiledClause
import Agda.TypeChecking.Coverage.SplitTree
import Agda.TypeChecking.Positivity.Occurrence
import Agda.TypeChecking.Free.Lazy (Free(freeVars'), underBinder', underBinder)
import {-# SOURCE #-} Agda.Compiler.Backend hiding (Args)
import Agda.Interaction.Options
import Agda.Interaction.Options.Warnings
import {-# SOURCE #-} Agda.Interaction.Response
(InteractionOutputCallback, defaultInteractionOutputCallback)
import Agda.Interaction.Highlighting.Precise
(HighlightingInfo, NameKind)
import Agda.Interaction.Library
import Agda.Utils.Benchmark (MonadBench(..))
import Agda.Utils.BiMap (BiMap, HasTag(..))
import qualified Agda.Utils.BiMap as BiMap
import Agda.Utils.CallStack ( CallStack, HasCallStack, withCallerCallStack )
import Agda.Utils.FileName
import Agda.Utils.Functor
import Agda.Utils.Hash
import Agda.Utils.Lens
import Agda.Utils.List
import Agda.Utils.ListT
import Agda.Utils.List1 (List1, pattern (:|))
import Agda.Utils.List2 (List2, pattern List2)
import qualified Agda.Utils.List1 as List1
import qualified Agda.Utils.Maybe.Strict as Strict
import Agda.Utils.Monad
import Agda.Utils.Null
import Agda.Utils.Permutation
import Agda.Utils.Pretty
import Agda.Utils.Singleton
import Agda.Utils.SmallSet (SmallSet)
import qualified Agda.Utils.SmallSet as SmallSet
import Agda.Utils.Update
import Agda.Utils.WithDefault ( collapseDefault )
import Agda.Utils.Impossible
data TCState = TCSt
{ TCState -> PreScopeState
stPreScopeState :: !PreScopeState
, TCState -> PostScopeState
stPostScopeState :: !PostScopeState
, TCState -> PersistentTCState
stPersistentState :: !PersistentTCState
}
deriving forall x. Rep TCState x -> TCState
forall x. TCState -> Rep TCState x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TCState x -> TCState
$cfrom :: forall x. TCState -> Rep TCState x
Generic
class Monad m => ReadTCState m where
getTCState :: m TCState
locallyTCState :: Lens' a TCState -> (a -> a) -> m b -> m b
withTCState :: (TCState -> TCState) -> m a -> m a
withTCState = forall (m :: * -> *) a b.
ReadTCState m =>
Lens' a TCState -> (a -> a) -> m b -> m b
locallyTCState forall a. a -> a
id
default getTCState :: (MonadTrans t, ReadTCState n, t n ~ m) => m TCState
getTCState = forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall (m :: * -> *). ReadTCState m => m TCState
getTCState
default locallyTCState
:: (MonadTransControl t, ReadTCState n, t n ~ m)
=> Lens' a TCState -> (a -> a) -> m b -> m b
locallyTCState Lens' a TCState
l = forall (t :: (* -> *) -> * -> *) (m :: * -> *) a b.
(MonadTransControl t, Monad (t m), Monad m) =>
(m (StT t a) -> m (StT t b)) -> t m a -> t m b
liftThrough forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
ReadTCState m =>
Lens' a TCState -> (a -> a) -> m b -> m b
locallyTCState Lens' a TCState
l
instance ReadTCState m => ReadTCState (ListT m) where
locallyTCState :: forall a b. Lens' a TCState -> (a -> a) -> ListT m b -> ListT m b
locallyTCState Lens' a TCState
l = forall (m :: * -> *) a (n :: * -> *) b.
(m (Maybe (a, ListT m a)) -> n (Maybe (b, ListT n b)))
-> ListT m a -> ListT n b
mapListT forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a b.
ReadTCState m =>
Lens' a TCState -> (a -> a) -> m b -> m b
locallyTCState Lens' a TCState
l
instance ReadTCState m => ReadTCState (ChangeT m)
instance ReadTCState m => ReadTCState (ExceptT err m)
instance ReadTCState m => ReadTCState (IdentityT m)
instance ReadTCState m => ReadTCState (MaybeT m)
instance ReadTCState m => ReadTCState (ReaderT r m)
instance ReadTCState m => ReadTCState (StateT s m)
instance (Monoid w, ReadTCState m) => ReadTCState (WriterT w m)
instance Show TCState where
show :: TCState -> String
show TCState
_ = String
"TCSt{}"
data PreScopeState = PreScopeState
{ PreScopeState -> HighlightingInfo
stPreTokens :: !HighlightingInfo
, PreScopeState -> Signature
stPreImports :: !Signature
, PreScopeState -> HashSet TopLevelModuleName
stPreImportedModules :: !(HashSet TopLevelModuleName)
, PreScopeState -> ModuleToSource
stPreModuleToSource :: !ModuleToSource
, PreScopeState -> DecodedModules
stPreVisitedModules :: !VisitedModules
, PreScopeState -> ScopeInfo
stPreScope :: !ScopeInfo
, PreScopeState -> PatternSynDefns
stPrePatternSyns :: !A.PatternSynDefns
, PreScopeState -> PatternSynDefns
stPrePatternSynImports :: !A.PatternSynDefns
, PreScopeState -> Maybe (Set QName)
stPreGeneralizedVars :: !(Strict.Maybe (Set QName))
, PreScopeState -> PragmaOptions
stPrePragmaOptions :: !PragmaOptions
, PreScopeState -> BuiltinThings PrimFun
stPreImportedBuiltins :: !(BuiltinThings PrimFun)
, PreScopeState -> DisplayForms
stPreImportedDisplayForms :: !DisplayForms
, PreScopeState -> Map QName (Set QName)
stPreImportedInstanceDefs :: !InstanceTable
, PreScopeState -> Map String [ForeignCode]
stPreForeignCode :: !(Map BackendName [ForeignCode])
, PreScopeState -> InteractionId
stPreFreshInteractionId :: !InteractionId
, PreScopeState -> Map QName Text
stPreImportedUserWarnings :: !(Map A.QName Text)
, PreScopeState -> Map QName Text
stPreLocalUserWarnings :: !(Map A.QName Text)
, PreScopeState -> Maybe Text
stPreWarningOnImport :: !(Strict.Maybe Text)
, PreScopeState -> Set QName
stPreImportedPartialDefs :: !(Set QName)
, PreScopeState -> Map String ProjectConfig
stPreProjectConfigs :: !(Map FilePath ProjectConfig)
, PreScopeState -> Map String AgdaLibFile
stPreAgdaLibFiles :: !(Map FilePath AgdaLibFile)
, PreScopeState -> RemoteMetaStore
stPreImportedMetaStore :: !RemoteMetaStore
}
deriving forall x. Rep PreScopeState x -> PreScopeState
forall x. PreScopeState -> Rep PreScopeState x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PreScopeState x -> PreScopeState
$cfrom :: forall x. PreScopeState -> Rep PreScopeState x
Generic
data DisambiguatedName = DisambiguatedName NameKind A.QName
deriving forall x. Rep DisambiguatedName x -> DisambiguatedName
forall x. DisambiguatedName -> Rep DisambiguatedName x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DisambiguatedName x -> DisambiguatedName
$cfrom :: forall x. DisambiguatedName -> Rep DisambiguatedName x
Generic
type DisambiguatedNames = IntMap DisambiguatedName
type ConcreteNames = Map Name [C.Name]
data PostScopeState = PostScopeState
{ PostScopeState -> HighlightingInfo
stPostSyntaxInfo :: !HighlightingInfo
, PostScopeState -> DisambiguatedNames
stPostDisambiguatedNames :: !DisambiguatedNames
, PostScopeState -> LocalMetaStore
stPostOpenMetaStore :: !LocalMetaStore
, PostScopeState -> LocalMetaStore
stPostSolvedMetaStore :: !LocalMetaStore
, PostScopeState -> InteractionPoints
stPostInteractionPoints :: !InteractionPoints
, PostScopeState -> Constraints
stPostAwakeConstraints :: !Constraints
, PostScopeState -> Constraints
stPostSleepingConstraints :: !Constraints
, PostScopeState -> Bool
stPostDirty :: !Bool
, PostScopeState -> Set QName
stPostOccursCheckDefs :: !(Set QName)
, PostScopeState -> Signature
stPostSignature :: !Signature
, PostScopeState -> Map ModuleName CheckpointId
stPostModuleCheckpoints :: !(Map ModuleName CheckpointId)
, PostScopeState -> DisplayForms
stPostImportsDisplayForms :: !DisplayForms
, PostScopeState -> Maybe (ModuleName, TopLevelModuleName)
stPostCurrentModule ::
!(Maybe (ModuleName, TopLevelModuleName))
, PostScopeState -> TempInstanceTable
stPostInstanceDefs :: !TempInstanceTable
, PostScopeState -> ConcreteNames
stPostConcreteNames :: !ConcreteNames
, PostScopeState -> Map String (DList String)
stPostUsedNames :: !(Map RawName (DList RawName))
, PostScopeState -> Map Name (DList String)
stPostShadowingNames :: !(Map Name (DList RawName))
, PostScopeState -> Statistics
stPostStatistics :: !Statistics
, PostScopeState -> [TCWarning]
stPostTCWarnings :: ![TCWarning]
, PostScopeState -> Map MutualId MutualBlock
stPostMutualBlocks :: !(Map MutualId MutualBlock)
, PostScopeState -> BuiltinThings PrimFun
stPostLocalBuiltins :: !(BuiltinThings PrimFun)
, PostScopeState -> MetaId
stPostFreshMetaId :: !MetaId
, PostScopeState -> MutualId
stPostFreshMutualId :: !MutualId
, PostScopeState -> ProblemId
stPostFreshProblemId :: !ProblemId
, PostScopeState -> CheckpointId
stPostFreshCheckpointId :: !CheckpointId
, PostScopeState -> Int
stPostFreshInt :: !Int
, PostScopeState -> NameId
stPostFreshNameId :: !NameId
, PostScopeState -> Bool
stPostAreWeCaching :: !Bool
, PostScopeState -> Bool
stPostPostponeInstanceSearch :: !Bool
, PostScopeState -> Bool
stPostConsideringInstance :: !Bool
, PostScopeState -> Bool
stPostInstantiateBlocking :: !Bool
, PostScopeState -> Set QName
stPostLocalPartialDefs :: !(Set QName)
}
deriving (forall x. Rep PostScopeState x -> PostScopeState
forall x. PostScopeState -> Rep PostScopeState x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PostScopeState x -> PostScopeState
$cfrom :: forall x. PostScopeState -> Rep PostScopeState x
Generic)
data MutualBlock = MutualBlock
{ MutualBlock -> MutualInfo
mutualInfo :: Info.MutualInfo
, MutualBlock -> Set QName
mutualNames :: Set QName
} deriving (Int -> MutualBlock -> ShowS
[MutualBlock] -> ShowS
MutualBlock -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MutualBlock] -> ShowS
$cshowList :: [MutualBlock] -> ShowS
show :: MutualBlock -> String
$cshow :: MutualBlock -> String
showsPrec :: Int -> MutualBlock -> ShowS
$cshowsPrec :: Int -> MutualBlock -> ShowS
Show, MutualBlock -> MutualBlock -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MutualBlock -> MutualBlock -> Bool
$c/= :: MutualBlock -> MutualBlock -> Bool
== :: MutualBlock -> MutualBlock -> Bool
$c== :: MutualBlock -> MutualBlock -> Bool
Eq, forall x. Rep MutualBlock x -> MutualBlock
forall x. MutualBlock -> Rep MutualBlock x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MutualBlock x -> MutualBlock
$cfrom :: forall x. MutualBlock -> Rep MutualBlock x
Generic)
instance Null MutualBlock where
empty :: MutualBlock
empty = MutualInfo -> Set QName -> MutualBlock
MutualBlock forall a. Null a => a
empty forall a. Null a => a
empty
data PersistentTCState = PersistentTCSt
{ PersistentTCState -> DecodedModules
stDecodedModules :: !DecodedModules
, PersistentTCState -> BiMap RawTopLevelModuleName ModuleNameHash
stPersistentTopLevelModuleNames ::
!(BiMap RawTopLevelModuleName ModuleNameHash)
, PersistentTCState -> CommandLineOptions
stPersistentOptions :: CommandLineOptions
, PersistentTCState -> InteractionOutputCallback
stInteractionOutputCallback :: InteractionOutputCallback
, PersistentTCState -> Benchmark
stBenchmark :: !Benchmark
, PersistentTCState -> Statistics
stAccumStatistics :: !Statistics
, PersistentTCState -> Maybe LoadedFileCache
stPersistLoadedFileCache :: !(Strict.Maybe LoadedFileCache)
, PersistentTCState -> [Backend]
stPersistBackends :: [Backend]
}
deriving forall x. Rep PersistentTCState x -> PersistentTCState
forall x. PersistentTCState -> Rep PersistentTCState x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PersistentTCState x -> PersistentTCState
$cfrom :: forall x. PersistentTCState -> Rep PersistentTCState x
Generic
data LoadedFileCache = LoadedFileCache
{ LoadedFileCache -> CachedTypeCheckLog
lfcCached :: !CachedTypeCheckLog
, LoadedFileCache -> CachedTypeCheckLog
lfcCurrent :: !CurrentTypeCheckLog
}
deriving forall x. Rep LoadedFileCache x -> LoadedFileCache
forall x. LoadedFileCache -> Rep LoadedFileCache x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LoadedFileCache x -> LoadedFileCache
$cfrom :: forall x. LoadedFileCache -> Rep LoadedFileCache x
Generic
type CachedTypeCheckLog = [(TypeCheckAction, PostScopeState)]
type CurrentTypeCheckLog = [(TypeCheckAction, PostScopeState)]
data TypeCheckAction
= EnterSection !ModuleName !A.Telescope
| LeaveSection !ModuleName
| Decl !A.Declaration
| Pragmas !PragmaOptions
deriving (forall x. Rep TypeCheckAction x -> TypeCheckAction
forall x. TypeCheckAction -> Rep TypeCheckAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TypeCheckAction x -> TypeCheckAction
$cfrom :: forall x. TypeCheckAction -> Rep TypeCheckAction x
Generic)
initPersistentState :: PersistentTCState
initPersistentState :: PersistentTCState
initPersistentState = PersistentTCSt
{ stPersistentOptions :: CommandLineOptions
stPersistentOptions = CommandLineOptions
defaultOptions
, stPersistentTopLevelModuleNames :: BiMap RawTopLevelModuleName ModuleNameHash
stPersistentTopLevelModuleNames = forall a. Null a => a
empty
, stDecodedModules :: DecodedModules
stDecodedModules = forall k a. Map k a
Map.empty
, stInteractionOutputCallback :: InteractionOutputCallback
stInteractionOutputCallback = InteractionOutputCallback
defaultInteractionOutputCallback
, stBenchmark :: Benchmark
stBenchmark = forall a. Null a => a
empty
, stAccumStatistics :: Statistics
stAccumStatistics = forall k a. Map k a
Map.empty
, stPersistLoadedFileCache :: Maybe LoadedFileCache
stPersistLoadedFileCache = forall a. Null a => a
empty
, stPersistBackends :: [Backend]
stPersistBackends = []
}
initialMetaId :: MetaId
initialMetaId :: MetaId
initialMetaId = MetaId
{ metaId :: Hash
metaId = Hash
0
, metaModule :: ModuleNameHash
metaModule = ModuleNameHash
noModuleNameHash
}
initPreScopeState :: PreScopeState
initPreScopeState :: PreScopeState
initPreScopeState = PreScopeState
{ stPreTokens :: HighlightingInfo
stPreTokens = forall a. Monoid a => a
mempty
, stPreImports :: Signature
stPreImports = Signature
emptySignature
, stPreImportedModules :: HashSet TopLevelModuleName
stPreImportedModules = forall a. Null a => a
empty
, stPreModuleToSource :: ModuleToSource
stPreModuleToSource = forall k a. Map k a
Map.empty
, stPreVisitedModules :: DecodedModules
stPreVisitedModules = forall k a. Map k a
Map.empty
, stPreScope :: ScopeInfo
stPreScope = ScopeInfo
emptyScopeInfo
, stPrePatternSyns :: PatternSynDefns
stPrePatternSyns = forall k a. Map k a
Map.empty
, stPrePatternSynImports :: PatternSynDefns
stPrePatternSynImports = forall k a. Map k a
Map.empty
, stPreGeneralizedVars :: Maybe (Set QName)
stPreGeneralizedVars = forall a. Monoid a => a
mempty
, stPrePragmaOptions :: PragmaOptions
stPrePragmaOptions = PragmaOptions
defaultInteractionOptions
, stPreImportedBuiltins :: BuiltinThings PrimFun
stPreImportedBuiltins = forall k a. Map k a
Map.empty
, stPreImportedDisplayForms :: DisplayForms
stPreImportedDisplayForms = forall k v. HashMap k v
HMap.empty
, stPreImportedInstanceDefs :: Map QName (Set QName)
stPreImportedInstanceDefs = forall k a. Map k a
Map.empty
, stPreForeignCode :: Map String [ForeignCode]
stPreForeignCode = forall k a. Map k a
Map.empty
, stPreFreshInteractionId :: InteractionId
stPreFreshInteractionId = InteractionId
0
, stPreImportedUserWarnings :: Map QName Text
stPreImportedUserWarnings = forall k a. Map k a
Map.empty
, stPreLocalUserWarnings :: Map QName Text
stPreLocalUserWarnings = forall k a. Map k a
Map.empty
, stPreWarningOnImport :: Maybe Text
stPreWarningOnImport = forall a. Null a => a
empty
, stPreImportedPartialDefs :: Set QName
stPreImportedPartialDefs = forall a. Set a
Set.empty
, stPreProjectConfigs :: Map String ProjectConfig
stPreProjectConfigs = forall k a. Map k a
Map.empty
, stPreAgdaLibFiles :: Map String AgdaLibFile
stPreAgdaLibFiles = forall k a. Map k a
Map.empty
, stPreImportedMetaStore :: RemoteMetaStore
stPreImportedMetaStore = forall k v. HashMap k v
HMap.empty
}
initPostScopeState :: PostScopeState
initPostScopeState :: PostScopeState
initPostScopeState = PostScopeState
{ stPostSyntaxInfo :: HighlightingInfo
stPostSyntaxInfo = forall a. Monoid a => a
mempty
, stPostDisambiguatedNames :: DisambiguatedNames
stPostDisambiguatedNames = forall a. IntMap a
IntMap.empty
, stPostOpenMetaStore :: LocalMetaStore
stPostOpenMetaStore = forall k a. Map k a
Map.empty
, stPostSolvedMetaStore :: LocalMetaStore
stPostSolvedMetaStore = forall k a. Map k a
Map.empty
, stPostInteractionPoints :: InteractionPoints
stPostInteractionPoints = forall a. Null a => a
empty
, stPostAwakeConstraints :: Constraints
stPostAwakeConstraints = []
, stPostSleepingConstraints :: Constraints
stPostSleepingConstraints = []
, stPostDirty :: Bool
stPostDirty = Bool
False
, stPostOccursCheckDefs :: Set QName
stPostOccursCheckDefs = forall a. Set a
Set.empty
, stPostSignature :: Signature
stPostSignature = Signature
emptySignature
, stPostModuleCheckpoints :: Map ModuleName CheckpointId
stPostModuleCheckpoints = forall k a. Map k a
Map.empty
, stPostImportsDisplayForms :: DisplayForms
stPostImportsDisplayForms = forall k v. HashMap k v
HMap.empty
, stPostCurrentModule :: Maybe (ModuleName, TopLevelModuleName)
stPostCurrentModule = forall a. Null a => a
empty
, stPostInstanceDefs :: TempInstanceTable
stPostInstanceDefs = (forall k a. Map k a
Map.empty , forall a. Set a
Set.empty)
, stPostConcreteNames :: ConcreteNames
stPostConcreteNames = forall k a. Map k a
Map.empty
, stPostUsedNames :: Map String (DList String)
stPostUsedNames = forall k a. Map k a
Map.empty
, stPostShadowingNames :: Map Name (DList String)
stPostShadowingNames = forall k a. Map k a
Map.empty
, stPostStatistics :: Statistics
stPostStatistics = forall k a. Map k a
Map.empty
, stPostTCWarnings :: [TCWarning]
stPostTCWarnings = []
, stPostMutualBlocks :: Map MutualId MutualBlock
stPostMutualBlocks = forall k a. Map k a
Map.empty
, stPostLocalBuiltins :: BuiltinThings PrimFun
stPostLocalBuiltins = forall k a. Map k a
Map.empty
, stPostFreshMetaId :: MetaId
stPostFreshMetaId = MetaId
initialMetaId
, stPostFreshMutualId :: MutualId
stPostFreshMutualId = MutualId
0
, stPostFreshProblemId :: ProblemId
stPostFreshProblemId = ProblemId
1
, stPostFreshCheckpointId :: CheckpointId
stPostFreshCheckpointId = CheckpointId
1
, stPostFreshInt :: Int
stPostFreshInt = Int
0
, stPostFreshNameId :: NameId
stPostFreshNameId = Hash -> ModuleNameHash -> NameId
NameId Hash
0 ModuleNameHash
noModuleNameHash
, stPostAreWeCaching :: Bool
stPostAreWeCaching = Bool
False
, stPostPostponeInstanceSearch :: Bool
stPostPostponeInstanceSearch = Bool
False
, stPostConsideringInstance :: Bool
stPostConsideringInstance = Bool
False
, stPostInstantiateBlocking :: Bool
stPostInstantiateBlocking = Bool
False
, stPostLocalPartialDefs :: Set QName
stPostLocalPartialDefs = forall a. Set a
Set.empty
}
initState :: TCState
initState :: TCState
initState = TCSt
{ stPreScopeState :: PreScopeState
stPreScopeState = PreScopeState
initPreScopeState
, stPostScopeState :: PostScopeState
stPostScopeState = PostScopeState
initPostScopeState
, stPersistentState :: PersistentTCState
stPersistentState = PersistentTCState
initPersistentState
}
stTokens :: Lens' HighlightingInfo TCState
stTokens :: Lens' HighlightingInfo TCState
stTokens HighlightingInfo -> f HighlightingInfo
f TCState
s =
HighlightingInfo -> f HighlightingInfo
f (PreScopeState -> HighlightingInfo
stPreTokens (TCState -> PreScopeState
stPreScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\HighlightingInfo
x -> TCState
s {stPreScopeState :: PreScopeState
stPreScopeState = (TCState -> PreScopeState
stPreScopeState TCState
s) {stPreTokens :: HighlightingInfo
stPreTokens = HighlightingInfo
x}}
stImports :: Lens' Signature TCState
stImports :: Lens' Signature TCState
stImports Signature -> f Signature
f TCState
s =
Signature -> f Signature
f (PreScopeState -> Signature
stPreImports (TCState -> PreScopeState
stPreScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\Signature
x -> TCState
s {stPreScopeState :: PreScopeState
stPreScopeState = (TCState -> PreScopeState
stPreScopeState TCState
s) {stPreImports :: Signature
stPreImports = Signature
x}}
stImportedModules ::
Lens' (HashSet TopLevelModuleName) TCState
stImportedModules :: Lens' (HashSet TopLevelModuleName) TCState
stImportedModules HashSet TopLevelModuleName -> f (HashSet TopLevelModuleName)
f TCState
s =
HashSet TopLevelModuleName -> f (HashSet TopLevelModuleName)
f (PreScopeState -> HashSet TopLevelModuleName
stPreImportedModules (TCState -> PreScopeState
stPreScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\HashSet TopLevelModuleName
x -> TCState
s {stPreScopeState :: PreScopeState
stPreScopeState = (TCState -> PreScopeState
stPreScopeState TCState
s) {stPreImportedModules :: HashSet TopLevelModuleName
stPreImportedModules = HashSet TopLevelModuleName
x}}
stModuleToSource :: Lens' ModuleToSource TCState
stModuleToSource :: Lens' ModuleToSource TCState
stModuleToSource ModuleToSource -> f ModuleToSource
f TCState
s =
ModuleToSource -> f ModuleToSource
f (PreScopeState -> ModuleToSource
stPreModuleToSource (TCState -> PreScopeState
stPreScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\ModuleToSource
x -> TCState
s {stPreScopeState :: PreScopeState
stPreScopeState = (TCState -> PreScopeState
stPreScopeState TCState
s) {stPreModuleToSource :: ModuleToSource
stPreModuleToSource = ModuleToSource
x}}
stVisitedModules :: Lens' VisitedModules TCState
stVisitedModules :: Lens' DecodedModules TCState
stVisitedModules DecodedModules -> f DecodedModules
f TCState
s =
DecodedModules -> f DecodedModules
f (PreScopeState -> DecodedModules
stPreVisitedModules (TCState -> PreScopeState
stPreScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\DecodedModules
x -> TCState
s {stPreScopeState :: PreScopeState
stPreScopeState = (TCState -> PreScopeState
stPreScopeState TCState
s) {stPreVisitedModules :: DecodedModules
stPreVisitedModules = DecodedModules
x}}
stScope :: Lens' ScopeInfo TCState
stScope :: Lens' ScopeInfo TCState
stScope ScopeInfo -> f ScopeInfo
f TCState
s =
ScopeInfo -> f ScopeInfo
f (PreScopeState -> ScopeInfo
stPreScope (TCState -> PreScopeState
stPreScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\ScopeInfo
x -> TCState
s {stPreScopeState :: PreScopeState
stPreScopeState = (TCState -> PreScopeState
stPreScopeState TCState
s) {stPreScope :: ScopeInfo
stPreScope = ScopeInfo
x}}
stPatternSyns :: Lens' A.PatternSynDefns TCState
stPatternSyns :: Lens' PatternSynDefns TCState
stPatternSyns PatternSynDefns -> f PatternSynDefns
f TCState
s =
PatternSynDefns -> f PatternSynDefns
f (PreScopeState -> PatternSynDefns
stPrePatternSyns (TCState -> PreScopeState
stPreScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\PatternSynDefns
x -> TCState
s {stPreScopeState :: PreScopeState
stPreScopeState = (TCState -> PreScopeState
stPreScopeState TCState
s) {stPrePatternSyns :: PatternSynDefns
stPrePatternSyns = PatternSynDefns
x}}
stPatternSynImports :: Lens' A.PatternSynDefns TCState
stPatternSynImports :: Lens' PatternSynDefns TCState
stPatternSynImports PatternSynDefns -> f PatternSynDefns
f TCState
s =
PatternSynDefns -> f PatternSynDefns
f (PreScopeState -> PatternSynDefns
stPrePatternSynImports (TCState -> PreScopeState
stPreScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\PatternSynDefns
x -> TCState
s {stPreScopeState :: PreScopeState
stPreScopeState = (TCState -> PreScopeState
stPreScopeState TCState
s) {stPrePatternSynImports :: PatternSynDefns
stPrePatternSynImports = PatternSynDefns
x}}
stGeneralizedVars :: Lens' (Maybe (Set QName)) TCState
stGeneralizedVars :: Lens' (Maybe (Set QName)) TCState
stGeneralizedVars Maybe (Set QName) -> f (Maybe (Set QName))
f TCState
s =
Maybe (Set QName) -> f (Maybe (Set QName))
f (forall lazy strict. Strict lazy strict => strict -> lazy
Strict.toLazy forall a b. (a -> b) -> a -> b
$ PreScopeState -> Maybe (Set QName)
stPreGeneralizedVars (TCState -> PreScopeState
stPreScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\Maybe (Set QName)
x -> TCState
s {stPreScopeState :: PreScopeState
stPreScopeState = (TCState -> PreScopeState
stPreScopeState TCState
s) {stPreGeneralizedVars :: Maybe (Set QName)
stPreGeneralizedVars = forall lazy strict. Strict lazy strict => lazy -> strict
Strict.toStrict Maybe (Set QName)
x}}
stPragmaOptions :: Lens' PragmaOptions TCState
stPragmaOptions :: Lens' PragmaOptions TCState
stPragmaOptions PragmaOptions -> f PragmaOptions
f TCState
s =
PragmaOptions -> f PragmaOptions
f (PreScopeState -> PragmaOptions
stPrePragmaOptions (TCState -> PreScopeState
stPreScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\PragmaOptions
x -> TCState
s {stPreScopeState :: PreScopeState
stPreScopeState = (TCState -> PreScopeState
stPreScopeState TCState
s) {stPrePragmaOptions :: PragmaOptions
stPrePragmaOptions = PragmaOptions
x}}
stImportedBuiltins :: Lens' (BuiltinThings PrimFun) TCState
stImportedBuiltins :: Lens' (BuiltinThings PrimFun) TCState
stImportedBuiltins BuiltinThings PrimFun -> f (BuiltinThings PrimFun)
f TCState
s =
BuiltinThings PrimFun -> f (BuiltinThings PrimFun)
f (PreScopeState -> BuiltinThings PrimFun
stPreImportedBuiltins (TCState -> PreScopeState
stPreScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\BuiltinThings PrimFun
x -> TCState
s {stPreScopeState :: PreScopeState
stPreScopeState = (TCState -> PreScopeState
stPreScopeState TCState
s) {stPreImportedBuiltins :: BuiltinThings PrimFun
stPreImportedBuiltins = BuiltinThings PrimFun
x}}
stForeignCode :: Lens' (Map BackendName [ForeignCode]) TCState
stForeignCode :: Lens' (Map String [ForeignCode]) TCState
stForeignCode Map String [ForeignCode] -> f (Map String [ForeignCode])
f TCState
s =
Map String [ForeignCode] -> f (Map String [ForeignCode])
f (PreScopeState -> Map String [ForeignCode]
stPreForeignCode (TCState -> PreScopeState
stPreScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\Map String [ForeignCode]
x -> TCState
s {stPreScopeState :: PreScopeState
stPreScopeState = (TCState -> PreScopeState
stPreScopeState TCState
s) {stPreForeignCode :: Map String [ForeignCode]
stPreForeignCode = Map String [ForeignCode]
x}}
stFreshInteractionId :: Lens' InteractionId TCState
stFreshInteractionId :: Lens' InteractionId TCState
stFreshInteractionId InteractionId -> f InteractionId
f TCState
s =
InteractionId -> f InteractionId
f (PreScopeState -> InteractionId
stPreFreshInteractionId (TCState -> PreScopeState
stPreScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\InteractionId
x -> TCState
s {stPreScopeState :: PreScopeState
stPreScopeState = (TCState -> PreScopeState
stPreScopeState TCState
s) {stPreFreshInteractionId :: InteractionId
stPreFreshInteractionId = InteractionId
x}}
stImportedUserWarnings :: Lens' (Map A.QName Text) TCState
stImportedUserWarnings :: Lens' (Map QName Text) TCState
stImportedUserWarnings Map QName Text -> f (Map QName Text)
f TCState
s =
Map QName Text -> f (Map QName Text)
f (PreScopeState -> Map QName Text
stPreImportedUserWarnings (TCState -> PreScopeState
stPreScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\ Map QName Text
x -> TCState
s {stPreScopeState :: PreScopeState
stPreScopeState = (TCState -> PreScopeState
stPreScopeState TCState
s) {stPreImportedUserWarnings :: Map QName Text
stPreImportedUserWarnings = Map QName Text
x}}
stLocalUserWarnings :: Lens' (Map A.QName Text) TCState
stLocalUserWarnings :: Lens' (Map QName Text) TCState
stLocalUserWarnings Map QName Text -> f (Map QName Text)
f TCState
s =
Map QName Text -> f (Map QName Text)
f (PreScopeState -> Map QName Text
stPreLocalUserWarnings (TCState -> PreScopeState
stPreScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\ Map QName Text
x -> TCState
s {stPreScopeState :: PreScopeState
stPreScopeState = (TCState -> PreScopeState
stPreScopeState TCState
s) {stPreLocalUserWarnings :: Map QName Text
stPreLocalUserWarnings = Map QName Text
x}}
getUserWarnings :: ReadTCState m => m (Map A.QName Text)
getUserWarnings :: forall (m :: * -> *). ReadTCState m => m (Map QName Text)
getUserWarnings = do
Map QName Text
iuw <- forall (m :: * -> *) a. ReadTCState m => Lens' a TCState -> m a
useR Lens' (Map QName Text) TCState
stImportedUserWarnings
Map QName Text
luw <- forall (m :: * -> *) a. ReadTCState m => Lens' a TCState -> m a
useR Lens' (Map QName Text) TCState
stLocalUserWarnings
forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ Map QName Text
iuw forall k a. Ord k => Map k a -> Map k a -> Map k a
`Map.union` Map QName Text
luw
stWarningOnImport :: Lens' (Maybe Text) TCState
stWarningOnImport :: Lens' (Maybe Text) TCState
stWarningOnImport Maybe Text -> f (Maybe Text)
f TCState
s =
Maybe Text -> f (Maybe Text)
f (forall lazy strict. Strict lazy strict => strict -> lazy
Strict.toLazy forall a b. (a -> b) -> a -> b
$ PreScopeState -> Maybe Text
stPreWarningOnImport (TCState -> PreScopeState
stPreScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\ Maybe Text
x -> TCState
s {stPreScopeState :: PreScopeState
stPreScopeState = (TCState -> PreScopeState
stPreScopeState TCState
s) {stPreWarningOnImport :: Maybe Text
stPreWarningOnImport = forall lazy strict. Strict lazy strict => lazy -> strict
Strict.toStrict Maybe Text
x}}
stImportedPartialDefs :: Lens' (Set QName) TCState
stImportedPartialDefs :: Lens' (Set QName) TCState
stImportedPartialDefs Set QName -> f (Set QName)
f TCState
s =
Set QName -> f (Set QName)
f (PreScopeState -> Set QName
stPreImportedPartialDefs (TCState -> PreScopeState
stPreScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\ Set QName
x -> TCState
s {stPreScopeState :: PreScopeState
stPreScopeState = (TCState -> PreScopeState
stPreScopeState TCState
s) {stPreImportedPartialDefs :: Set QName
stPreImportedPartialDefs = Set QName
x}}
stLocalPartialDefs :: Lens' (Set QName) TCState
stLocalPartialDefs :: Lens' (Set QName) TCState
stLocalPartialDefs Set QName -> f (Set QName)
f TCState
s =
Set QName -> f (Set QName)
f (PostScopeState -> Set QName
stPostLocalPartialDefs (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\ Set QName
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState = (TCState -> PostScopeState
stPostScopeState TCState
s) {stPostLocalPartialDefs :: Set QName
stPostLocalPartialDefs = Set QName
x}}
getPartialDefs :: ReadTCState m => m (Set QName)
getPartialDefs :: forall (m :: * -> *). ReadTCState m => m (Set QName)
getPartialDefs = do
Set QName
ipd <- forall (m :: * -> *) a. ReadTCState m => Lens' a TCState -> m a
useR Lens' (Set QName) TCState
stImportedPartialDefs
Set QName
lpd <- forall (m :: * -> *) a. ReadTCState m => Lens' a TCState -> m a
useR Lens' (Set QName) TCState
stLocalPartialDefs
forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ Set QName
ipd forall a. Ord a => Set a -> Set a -> Set a
`Set.union` Set QName
lpd
stLoadedFileCache :: Lens' (Maybe LoadedFileCache) TCState
stLoadedFileCache :: Lens' (Maybe LoadedFileCache) TCState
stLoadedFileCache Maybe LoadedFileCache -> f (Maybe LoadedFileCache)
f TCState
s =
Maybe LoadedFileCache -> f (Maybe LoadedFileCache)
f (forall lazy strict. Strict lazy strict => strict -> lazy
Strict.toLazy forall a b. (a -> b) -> a -> b
$ PersistentTCState -> Maybe LoadedFileCache
stPersistLoadedFileCache (TCState -> PersistentTCState
stPersistentState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\Maybe LoadedFileCache
x -> TCState
s {stPersistentState :: PersistentTCState
stPersistentState = (TCState -> PersistentTCState
stPersistentState TCState
s) {stPersistLoadedFileCache :: Maybe LoadedFileCache
stPersistLoadedFileCache = forall lazy strict. Strict lazy strict => lazy -> strict
Strict.toStrict Maybe LoadedFileCache
x}}
stBackends :: Lens' [Backend] TCState
stBackends :: Lens' [Backend] TCState
stBackends [Backend] -> f [Backend]
f TCState
s =
[Backend] -> f [Backend]
f (PersistentTCState -> [Backend]
stPersistBackends (TCState -> PersistentTCState
stPersistentState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\[Backend]
x -> TCState
s {stPersistentState :: PersistentTCState
stPersistentState = (TCState -> PersistentTCState
stPersistentState TCState
s) {stPersistBackends :: [Backend]
stPersistBackends = [Backend]
x}}
stProjectConfigs :: Lens' (Map FilePath ProjectConfig) TCState
stProjectConfigs :: Lens' (Map String ProjectConfig) TCState
stProjectConfigs Map String ProjectConfig -> f (Map String ProjectConfig)
f TCState
s =
Map String ProjectConfig -> f (Map String ProjectConfig)
f (PreScopeState -> Map String ProjectConfig
stPreProjectConfigs (TCState -> PreScopeState
stPreScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\ Map String ProjectConfig
x -> TCState
s {stPreScopeState :: PreScopeState
stPreScopeState = (TCState -> PreScopeState
stPreScopeState TCState
s) {stPreProjectConfigs :: Map String ProjectConfig
stPreProjectConfigs = Map String ProjectConfig
x}}
stAgdaLibFiles :: Lens' (Map FilePath AgdaLibFile) TCState
stAgdaLibFiles :: Lens' (Map String AgdaLibFile) TCState
stAgdaLibFiles Map String AgdaLibFile -> f (Map String AgdaLibFile)
f TCState
s =
Map String AgdaLibFile -> f (Map String AgdaLibFile)
f (PreScopeState -> Map String AgdaLibFile
stPreAgdaLibFiles (TCState -> PreScopeState
stPreScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\ Map String AgdaLibFile
x -> TCState
s {stPreScopeState :: PreScopeState
stPreScopeState = (TCState -> PreScopeState
stPreScopeState TCState
s) {stPreAgdaLibFiles :: Map String AgdaLibFile
stPreAgdaLibFiles = Map String AgdaLibFile
x}}
stTopLevelModuleNames ::
Lens' (BiMap RawTopLevelModuleName ModuleNameHash) TCState
stTopLevelModuleNames :: Lens' (BiMap RawTopLevelModuleName ModuleNameHash) TCState
stTopLevelModuleNames BiMap RawTopLevelModuleName ModuleNameHash
-> f (BiMap RawTopLevelModuleName ModuleNameHash)
f TCState
s =
BiMap RawTopLevelModuleName ModuleNameHash
-> f (BiMap RawTopLevelModuleName ModuleNameHash)
f (PersistentTCState -> BiMap RawTopLevelModuleName ModuleNameHash
stPersistentTopLevelModuleNames (TCState -> PersistentTCState
stPersistentState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\ BiMap RawTopLevelModuleName ModuleNameHash
x -> TCState
s {stPersistentState :: PersistentTCState
stPersistentState =
(TCState -> PersistentTCState
stPersistentState TCState
s) {stPersistentTopLevelModuleNames :: BiMap RawTopLevelModuleName ModuleNameHash
stPersistentTopLevelModuleNames = BiMap RawTopLevelModuleName ModuleNameHash
x}}
stImportedMetaStore :: Lens' RemoteMetaStore TCState
stImportedMetaStore :: Lens' RemoteMetaStore TCState
stImportedMetaStore RemoteMetaStore -> f RemoteMetaStore
f TCState
s =
RemoteMetaStore -> f RemoteMetaStore
f (PreScopeState -> RemoteMetaStore
stPreImportedMetaStore (TCState -> PreScopeState
stPreScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\RemoteMetaStore
x -> TCState
s {stPreScopeState :: PreScopeState
stPreScopeState = (TCState -> PreScopeState
stPreScopeState TCState
s) {stPreImportedMetaStore :: RemoteMetaStore
stPreImportedMetaStore = RemoteMetaStore
x}}
stFreshNameId :: Lens' NameId TCState
stFreshNameId :: Lens' NameId TCState
stFreshNameId NameId -> f NameId
f TCState
s =
NameId -> f NameId
f (PostScopeState -> NameId
stPostFreshNameId (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\NameId
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState = (TCState -> PostScopeState
stPostScopeState TCState
s) {stPostFreshNameId :: NameId
stPostFreshNameId = NameId
x}}
stSyntaxInfo :: Lens' HighlightingInfo TCState
stSyntaxInfo :: Lens' HighlightingInfo TCState
stSyntaxInfo HighlightingInfo -> f HighlightingInfo
f TCState
s =
HighlightingInfo -> f HighlightingInfo
f (PostScopeState -> HighlightingInfo
stPostSyntaxInfo (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\HighlightingInfo
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState = (TCState -> PostScopeState
stPostScopeState TCState
s) {stPostSyntaxInfo :: HighlightingInfo
stPostSyntaxInfo = HighlightingInfo
x}}
stDisambiguatedNames :: Lens' DisambiguatedNames TCState
stDisambiguatedNames :: Lens' DisambiguatedNames TCState
stDisambiguatedNames DisambiguatedNames -> f DisambiguatedNames
f TCState
s =
DisambiguatedNames -> f DisambiguatedNames
f (PostScopeState -> DisambiguatedNames
stPostDisambiguatedNames (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\DisambiguatedNames
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState = (TCState -> PostScopeState
stPostScopeState TCState
s) {stPostDisambiguatedNames :: DisambiguatedNames
stPostDisambiguatedNames = DisambiguatedNames
x}}
stOpenMetaStore :: Lens' LocalMetaStore TCState
stOpenMetaStore :: Lens' LocalMetaStore TCState
stOpenMetaStore LocalMetaStore -> f LocalMetaStore
f TCState
s =
LocalMetaStore -> f LocalMetaStore
f (PostScopeState -> LocalMetaStore
stPostOpenMetaStore (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\LocalMetaStore
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState = (TCState -> PostScopeState
stPostScopeState TCState
s) {stPostOpenMetaStore :: LocalMetaStore
stPostOpenMetaStore = LocalMetaStore
x}}
stSolvedMetaStore :: Lens' LocalMetaStore TCState
stSolvedMetaStore :: Lens' LocalMetaStore TCState
stSolvedMetaStore LocalMetaStore -> f LocalMetaStore
f TCState
s =
LocalMetaStore -> f LocalMetaStore
f (PostScopeState -> LocalMetaStore
stPostSolvedMetaStore (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\LocalMetaStore
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState = (TCState -> PostScopeState
stPostScopeState TCState
s) {stPostSolvedMetaStore :: LocalMetaStore
stPostSolvedMetaStore = LocalMetaStore
x}}
stInteractionPoints :: Lens' InteractionPoints TCState
stInteractionPoints :: Lens' InteractionPoints TCState
stInteractionPoints InteractionPoints -> f InteractionPoints
f TCState
s =
InteractionPoints -> f InteractionPoints
f (PostScopeState -> InteractionPoints
stPostInteractionPoints (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\InteractionPoints
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState = (TCState -> PostScopeState
stPostScopeState TCState
s) {stPostInteractionPoints :: InteractionPoints
stPostInteractionPoints = InteractionPoints
x}}
stAwakeConstraints :: Lens' Constraints TCState
stAwakeConstraints :: Lens' Constraints TCState
stAwakeConstraints Constraints -> f Constraints
f TCState
s =
Constraints -> f Constraints
f (PostScopeState -> Constraints
stPostAwakeConstraints (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\Constraints
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState = (TCState -> PostScopeState
stPostScopeState TCState
s) {stPostAwakeConstraints :: Constraints
stPostAwakeConstraints = Constraints
x}}
stSleepingConstraints :: Lens' Constraints TCState
stSleepingConstraints :: Lens' Constraints TCState
stSleepingConstraints Constraints -> f Constraints
f TCState
s =
Constraints -> f Constraints
f (PostScopeState -> Constraints
stPostSleepingConstraints (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\Constraints
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState = (TCState -> PostScopeState
stPostScopeState TCState
s) {stPostSleepingConstraints :: Constraints
stPostSleepingConstraints = Constraints
x}}
stDirty :: Lens' Bool TCState
stDirty :: Lens' Bool TCState
stDirty Bool -> f Bool
f TCState
s =
Bool -> f Bool
f (PostScopeState -> Bool
stPostDirty (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\Bool
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState = (TCState -> PostScopeState
stPostScopeState TCState
s) {stPostDirty :: Bool
stPostDirty = Bool
x}}
stOccursCheckDefs :: Lens' (Set QName) TCState
stOccursCheckDefs :: Lens' (Set QName) TCState
stOccursCheckDefs Set QName -> f (Set QName)
f TCState
s =
Set QName -> f (Set QName)
f (PostScopeState -> Set QName
stPostOccursCheckDefs (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\Set QName
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState = (TCState -> PostScopeState
stPostScopeState TCState
s) {stPostOccursCheckDefs :: Set QName
stPostOccursCheckDefs = Set QName
x}}
stSignature :: Lens' Signature TCState
stSignature :: Lens' Signature TCState
stSignature Signature -> f Signature
f TCState
s =
Signature -> f Signature
f (PostScopeState -> Signature
stPostSignature (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\Signature
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState = (TCState -> PostScopeState
stPostScopeState TCState
s) {stPostSignature :: Signature
stPostSignature = Signature
x}}
stModuleCheckpoints :: Lens' (Map ModuleName CheckpointId) TCState
stModuleCheckpoints :: Lens' (Map ModuleName CheckpointId) TCState
stModuleCheckpoints Map ModuleName CheckpointId -> f (Map ModuleName CheckpointId)
f TCState
s =
Map ModuleName CheckpointId -> f (Map ModuleName CheckpointId)
f (PostScopeState -> Map ModuleName CheckpointId
stPostModuleCheckpoints (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\Map ModuleName CheckpointId
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState = (TCState -> PostScopeState
stPostScopeState TCState
s) {stPostModuleCheckpoints :: Map ModuleName CheckpointId
stPostModuleCheckpoints = Map ModuleName CheckpointId
x}}
stImportsDisplayForms :: Lens' DisplayForms TCState
stImportsDisplayForms :: Lens' DisplayForms TCState
stImportsDisplayForms DisplayForms -> f DisplayForms
f TCState
s =
DisplayForms -> f DisplayForms
f (PostScopeState -> DisplayForms
stPostImportsDisplayForms (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\DisplayForms
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState = (TCState -> PostScopeState
stPostScopeState TCState
s) {stPostImportsDisplayForms :: DisplayForms
stPostImportsDisplayForms = DisplayForms
x}}
stImportedDisplayForms :: Lens' DisplayForms TCState
stImportedDisplayForms :: Lens' DisplayForms TCState
stImportedDisplayForms DisplayForms -> f DisplayForms
f TCState
s =
DisplayForms -> f DisplayForms
f (PreScopeState -> DisplayForms
stPreImportedDisplayForms (TCState -> PreScopeState
stPreScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\DisplayForms
x -> TCState
s {stPreScopeState :: PreScopeState
stPreScopeState = (TCState -> PreScopeState
stPreScopeState TCState
s) {stPreImportedDisplayForms :: DisplayForms
stPreImportedDisplayForms = DisplayForms
x}}
stCurrentModule ::
Lens' (Maybe (ModuleName, TopLevelModuleName)) TCState
stCurrentModule :: Lens' (Maybe (ModuleName, TopLevelModuleName)) TCState
stCurrentModule Maybe (ModuleName, TopLevelModuleName)
-> f (Maybe (ModuleName, TopLevelModuleName))
f TCState
s =
Maybe (ModuleName, TopLevelModuleName)
-> f (Maybe (ModuleName, TopLevelModuleName))
f (PostScopeState -> Maybe (ModuleName, TopLevelModuleName)
stPostCurrentModule (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\Maybe (ModuleName, TopLevelModuleName)
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState =
(TCState -> PostScopeState
stPostScopeState TCState
s)
{stPostCurrentModule :: Maybe (ModuleName, TopLevelModuleName)
stPostCurrentModule = case Maybe (ModuleName, TopLevelModuleName)
x of
Maybe (ModuleName, TopLevelModuleName)
Nothing -> forall a. Maybe a
Nothing
Just (!ModuleName
m, !TopLevelModuleName
top) -> forall a. a -> Maybe a
Just (ModuleName
m, TopLevelModuleName
top)}}
stImportedInstanceDefs :: Lens' InstanceTable TCState
stImportedInstanceDefs :: Lens' (Map QName (Set QName)) TCState
stImportedInstanceDefs Map QName (Set QName) -> f (Map QName (Set QName))
f TCState
s =
Map QName (Set QName) -> f (Map QName (Set QName))
f (PreScopeState -> Map QName (Set QName)
stPreImportedInstanceDefs (TCState -> PreScopeState
stPreScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\Map QName (Set QName)
x -> TCState
s {stPreScopeState :: PreScopeState
stPreScopeState = (TCState -> PreScopeState
stPreScopeState TCState
s) {stPreImportedInstanceDefs :: Map QName (Set QName)
stPreImportedInstanceDefs = Map QName (Set QName)
x}}
stInstanceDefs :: Lens' TempInstanceTable TCState
stInstanceDefs :: Lens' TempInstanceTable TCState
stInstanceDefs TempInstanceTable -> f TempInstanceTable
f TCState
s =
TempInstanceTable -> f TempInstanceTable
f (PostScopeState -> TempInstanceTable
stPostInstanceDefs (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\TempInstanceTable
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState = (TCState -> PostScopeState
stPostScopeState TCState
s) {stPostInstanceDefs :: TempInstanceTable
stPostInstanceDefs = TempInstanceTable
x}}
stConcreteNames :: Lens' ConcreteNames TCState
stConcreteNames :: Lens' ConcreteNames TCState
stConcreteNames ConcreteNames -> f ConcreteNames
f TCState
s =
ConcreteNames -> f ConcreteNames
f (PostScopeState -> ConcreteNames
stPostConcreteNames (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\ConcreteNames
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState = (TCState -> PostScopeState
stPostScopeState TCState
s) {stPostConcreteNames :: ConcreteNames
stPostConcreteNames = ConcreteNames
x}}
stUsedNames :: Lens' (Map RawName (DList RawName)) TCState
stUsedNames :: Lens' (Map String (DList String)) TCState
stUsedNames Map String (DList String) -> f (Map String (DList String))
f TCState
s =
Map String (DList String) -> f (Map String (DList String))
f (PostScopeState -> Map String (DList String)
stPostUsedNames (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\Map String (DList String)
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState = (TCState -> PostScopeState
stPostScopeState TCState
s) {stPostUsedNames :: Map String (DList String)
stPostUsedNames = Map String (DList String)
x}}
stShadowingNames :: Lens' (Map Name (DList RawName)) TCState
stShadowingNames :: Lens' (Map Name (DList String)) TCState
stShadowingNames Map Name (DList String) -> f (Map Name (DList String))
f TCState
s =
Map Name (DList String) -> f (Map Name (DList String))
f (PostScopeState -> Map Name (DList String)
stPostShadowingNames (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\Map Name (DList String)
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState = (TCState -> PostScopeState
stPostScopeState TCState
s) {stPostShadowingNames :: Map Name (DList String)
stPostShadowingNames = Map Name (DList String)
x}}
stStatistics :: Lens' Statistics TCState
stStatistics :: Lens' Statistics TCState
stStatistics Statistics -> f Statistics
f TCState
s =
Statistics -> f Statistics
f (PostScopeState -> Statistics
stPostStatistics (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\Statistics
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState = (TCState -> PostScopeState
stPostScopeState TCState
s) {stPostStatistics :: Statistics
stPostStatistics = Statistics
x}}
stTCWarnings :: Lens' [TCWarning] TCState
stTCWarnings :: Lens' [TCWarning] TCState
stTCWarnings [TCWarning] -> f [TCWarning]
f TCState
s =
[TCWarning] -> f [TCWarning]
f (PostScopeState -> [TCWarning]
stPostTCWarnings (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\[TCWarning]
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState = (TCState -> PostScopeState
stPostScopeState TCState
s) {stPostTCWarnings :: [TCWarning]
stPostTCWarnings = [TCWarning]
x}}
stMutualBlocks :: Lens' (Map MutualId MutualBlock) TCState
stMutualBlocks :: Lens' (Map MutualId MutualBlock) TCState
stMutualBlocks Map MutualId MutualBlock -> f (Map MutualId MutualBlock)
f TCState
s =
Map MutualId MutualBlock -> f (Map MutualId MutualBlock)
f (PostScopeState -> Map MutualId MutualBlock
stPostMutualBlocks (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\Map MutualId MutualBlock
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState = (TCState -> PostScopeState
stPostScopeState TCState
s) {stPostMutualBlocks :: Map MutualId MutualBlock
stPostMutualBlocks = Map MutualId MutualBlock
x}}
stLocalBuiltins :: Lens' (BuiltinThings PrimFun) TCState
stLocalBuiltins :: Lens' (BuiltinThings PrimFun) TCState
stLocalBuiltins BuiltinThings PrimFun -> f (BuiltinThings PrimFun)
f TCState
s =
BuiltinThings PrimFun -> f (BuiltinThings PrimFun)
f (PostScopeState -> BuiltinThings PrimFun
stPostLocalBuiltins (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\BuiltinThings PrimFun
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState = (TCState -> PostScopeState
stPostScopeState TCState
s) {stPostLocalBuiltins :: BuiltinThings PrimFun
stPostLocalBuiltins = BuiltinThings PrimFun
x}}
stFreshMetaId :: Lens' MetaId TCState
stFreshMetaId :: Lens' MetaId TCState
stFreshMetaId MetaId -> f MetaId
f TCState
s =
MetaId -> f MetaId
f (PostScopeState -> MetaId
stPostFreshMetaId (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\MetaId
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState = (TCState -> PostScopeState
stPostScopeState TCState
s) {stPostFreshMetaId :: MetaId
stPostFreshMetaId = MetaId
x}}
stFreshMutualId :: Lens' MutualId TCState
stFreshMutualId :: Lens' MutualId TCState
stFreshMutualId MutualId -> f MutualId
f TCState
s =
MutualId -> f MutualId
f (PostScopeState -> MutualId
stPostFreshMutualId (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\MutualId
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState = (TCState -> PostScopeState
stPostScopeState TCState
s) {stPostFreshMutualId :: MutualId
stPostFreshMutualId = MutualId
x}}
stFreshProblemId :: Lens' ProblemId TCState
stFreshProblemId :: Lens' ProblemId TCState
stFreshProblemId ProblemId -> f ProblemId
f TCState
s =
ProblemId -> f ProblemId
f (PostScopeState -> ProblemId
stPostFreshProblemId (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\ProblemId
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState = (TCState -> PostScopeState
stPostScopeState TCState
s) {stPostFreshProblemId :: ProblemId
stPostFreshProblemId = ProblemId
x}}
stFreshCheckpointId :: Lens' CheckpointId TCState
stFreshCheckpointId :: Lens' CheckpointId TCState
stFreshCheckpointId CheckpointId -> f CheckpointId
f TCState
s =
CheckpointId -> f CheckpointId
f (PostScopeState -> CheckpointId
stPostFreshCheckpointId (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\CheckpointId
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState = (TCState -> PostScopeState
stPostScopeState TCState
s) {stPostFreshCheckpointId :: CheckpointId
stPostFreshCheckpointId = CheckpointId
x}}
stFreshInt :: Lens' Int TCState
stFreshInt :: Lens' Int TCState
stFreshInt Int -> f Int
f TCState
s =
Int -> f Int
f (PostScopeState -> Int
stPostFreshInt (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\Int
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState = (TCState -> PostScopeState
stPostScopeState TCState
s) {stPostFreshInt :: Int
stPostFreshInt = Int
x}}
stAreWeCaching :: Lens' Bool TCState
stAreWeCaching :: Lens' Bool TCState
stAreWeCaching Bool -> f Bool
f TCState
s =
Bool -> f Bool
f (PostScopeState -> Bool
stPostAreWeCaching (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\Bool
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState = (TCState -> PostScopeState
stPostScopeState TCState
s) {stPostAreWeCaching :: Bool
stPostAreWeCaching = Bool
x}}
stPostponeInstanceSearch :: Lens' Bool TCState
stPostponeInstanceSearch :: Lens' Bool TCState
stPostponeInstanceSearch Bool -> f Bool
f TCState
s =
Bool -> f Bool
f (PostScopeState -> Bool
stPostPostponeInstanceSearch (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\Bool
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState = (TCState -> PostScopeState
stPostScopeState TCState
s) {stPostPostponeInstanceSearch :: Bool
stPostPostponeInstanceSearch = Bool
x}}
stConsideringInstance :: Lens' Bool TCState
stConsideringInstance :: Lens' Bool TCState
stConsideringInstance Bool -> f Bool
f TCState
s =
Bool -> f Bool
f (PostScopeState -> Bool
stPostConsideringInstance (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\Bool
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState = (TCState -> PostScopeState
stPostScopeState TCState
s) {stPostConsideringInstance :: Bool
stPostConsideringInstance = Bool
x}}
stInstantiateBlocking :: Lens' Bool TCState
stInstantiateBlocking :: Lens' Bool TCState
stInstantiateBlocking Bool -> f Bool
f TCState
s =
Bool -> f Bool
f (PostScopeState -> Bool
stPostInstantiateBlocking (TCState -> PostScopeState
stPostScopeState TCState
s)) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\Bool
x -> TCState
s {stPostScopeState :: PostScopeState
stPostScopeState = (TCState -> PostScopeState
stPostScopeState TCState
s) {stPostInstantiateBlocking :: Bool
stPostInstantiateBlocking = Bool
x}}
stBuiltinThings :: TCState -> BuiltinThings PrimFun
stBuiltinThings :: TCState -> BuiltinThings PrimFun
stBuiltinThings TCState
s = forall k a. Ord k => (a -> a -> a) -> Map k a -> Map k a -> Map k a
Map.unionWith forall a. Builtin a -> Builtin a -> Builtin a
unionBuiltin (TCState
sforall o i. o -> Lens' i o -> i
^.Lens' (BuiltinThings PrimFun) TCState
stLocalBuiltins) (TCState
sforall o i. o -> Lens' i o -> i
^.Lens' (BuiltinThings PrimFun) TCState
stImportedBuiltins)
unionBuiltin :: Builtin a -> Builtin a -> Builtin a
unionBuiltin :: forall a. Builtin a -> Builtin a -> Builtin a
unionBuiltin = forall a b c. ((a, b) -> c) -> a -> b -> c
curry forall a b. (a -> b) -> a -> b
$ \case
(BuiltinRewriteRelations Set QName
xs, BuiltinRewriteRelations Set QName
ys) -> forall pf. Set QName -> Builtin pf
BuiltinRewriteRelations forall a b. (a -> b) -> a -> b
$ Set QName
xs forall a. Semigroup a => a -> a -> a
<> Set QName
ys
(Builtin a, Builtin a)
_ -> forall a. HasCallStack => a
__IMPOSSIBLE__
class Enum i => HasFresh i where
freshLens :: Lens' i TCState
nextFresh' :: i -> i
nextFresh' = forall a. Enum a => a -> a
succ
nextFresh :: HasFresh i => TCState -> (i, TCState)
nextFresh :: forall i. HasFresh i => TCState -> (i, TCState)
nextFresh TCState
s =
let !c :: i
c = TCState
sforall o i. o -> Lens' i o -> i
^.forall i. HasFresh i => Lens' i TCState
freshLens
in (i
c, forall i o. Lens' i o -> LensSet i o
set forall i. HasFresh i => Lens' i TCState
freshLens (forall i. HasFresh i => i -> i
nextFresh' i
c) TCState
s)
class Monad m => MonadFresh i m where
fresh :: m i
default fresh :: (MonadTrans t, MonadFresh i n, t n ~ m) => m i
fresh = forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall i (m :: * -> *). MonadFresh i m => m i
fresh
instance MonadFresh i m => MonadFresh i (ReaderT r m)
instance MonadFresh i m => MonadFresh i (StateT s m)
instance MonadFresh i m => MonadFresh i (ListT m)
instance MonadFresh i m => MonadFresh i (IdentityT m)
instance HasFresh i => MonadFresh i TCM where
fresh :: TCM i
fresh = do
!TCState
s <- forall (m :: * -> *). MonadTCState m => m TCState
getTC
let (!i
c , !TCState
s') = forall i. HasFresh i => TCState -> (i, TCState)
nextFresh TCState
s
forall (m :: * -> *). MonadTCState m => TCState -> m ()
putTC TCState
s'
forall (m :: * -> *) a. Monad m => a -> m a
return i
c
instance HasFresh MetaId where
freshLens :: Lens' MetaId TCState
freshLens = Lens' MetaId TCState
stFreshMetaId
instance HasFresh MutualId where
freshLens :: Lens' MutualId TCState
freshLens = Lens' MutualId TCState
stFreshMutualId
instance HasFresh InteractionId where
freshLens :: Lens' InteractionId TCState
freshLens = Lens' InteractionId TCState
stFreshInteractionId
instance HasFresh NameId where
freshLens :: Lens' NameId TCState
freshLens = Lens' NameId TCState
stFreshNameId
nextFresh' :: NameId -> NameId
nextFresh' = forall a. Enum a => a -> a
succ forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Enum a => a -> a
succ
instance HasFresh Int where
freshLens :: Lens' Int TCState
freshLens = Lens' Int TCState
stFreshInt
instance HasFresh ProblemId where
freshLens :: Lens' ProblemId TCState
freshLens = Lens' ProblemId TCState
stFreshProblemId
newtype CheckpointId = CheckpointId Int
deriving (CheckpointId -> CheckpointId -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CheckpointId -> CheckpointId -> Bool
$c/= :: CheckpointId -> CheckpointId -> Bool
== :: CheckpointId -> CheckpointId -> Bool
$c== :: CheckpointId -> CheckpointId -> Bool
Eq, Eq CheckpointId
CheckpointId -> CheckpointId -> Bool
CheckpointId -> CheckpointId -> Ordering
CheckpointId -> CheckpointId -> CheckpointId
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 :: CheckpointId -> CheckpointId -> CheckpointId
$cmin :: CheckpointId -> CheckpointId -> CheckpointId
max :: CheckpointId -> CheckpointId -> CheckpointId
$cmax :: CheckpointId -> CheckpointId -> CheckpointId
>= :: CheckpointId -> CheckpointId -> Bool
$c>= :: CheckpointId -> CheckpointId -> Bool
> :: CheckpointId -> CheckpointId -> Bool
$c> :: CheckpointId -> CheckpointId -> Bool
<= :: CheckpointId -> CheckpointId -> Bool
$c<= :: CheckpointId -> CheckpointId -> Bool
< :: CheckpointId -> CheckpointId -> Bool
$c< :: CheckpointId -> CheckpointId -> Bool
compare :: CheckpointId -> CheckpointId -> Ordering
$ccompare :: CheckpointId -> CheckpointId -> Ordering
Ord, Int -> CheckpointId
CheckpointId -> Int
CheckpointId -> [CheckpointId]
CheckpointId -> CheckpointId
CheckpointId -> CheckpointId -> [CheckpointId]
CheckpointId -> CheckpointId -> CheckpointId -> [CheckpointId]
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 :: CheckpointId -> CheckpointId -> CheckpointId -> [CheckpointId]
$cenumFromThenTo :: CheckpointId -> CheckpointId -> CheckpointId -> [CheckpointId]
enumFromTo :: CheckpointId -> CheckpointId -> [CheckpointId]
$cenumFromTo :: CheckpointId -> CheckpointId -> [CheckpointId]
enumFromThen :: CheckpointId -> CheckpointId -> [CheckpointId]
$cenumFromThen :: CheckpointId -> CheckpointId -> [CheckpointId]
enumFrom :: CheckpointId -> [CheckpointId]
$cenumFrom :: CheckpointId -> [CheckpointId]
fromEnum :: CheckpointId -> Int
$cfromEnum :: CheckpointId -> Int
toEnum :: Int -> CheckpointId
$ctoEnum :: Int -> CheckpointId
pred :: CheckpointId -> CheckpointId
$cpred :: CheckpointId -> CheckpointId
succ :: CheckpointId -> CheckpointId
$csucc :: CheckpointId -> CheckpointId
Enum, Num CheckpointId
Ord CheckpointId
CheckpointId -> Rational
forall a. Num a -> Ord a -> (a -> Rational) -> Real a
toRational :: CheckpointId -> Rational
$ctoRational :: CheckpointId -> Rational
Real, Enum CheckpointId
Real CheckpointId
CheckpointId -> Integer
CheckpointId -> CheckpointId -> (CheckpointId, CheckpointId)
CheckpointId -> CheckpointId -> CheckpointId
forall a.
Real a
-> Enum a
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> (a, a))
-> (a -> a -> (a, a))
-> (a -> Integer)
-> Integral a
toInteger :: CheckpointId -> Integer
$ctoInteger :: CheckpointId -> Integer
divMod :: CheckpointId -> CheckpointId -> (CheckpointId, CheckpointId)
$cdivMod :: CheckpointId -> CheckpointId -> (CheckpointId, CheckpointId)
quotRem :: CheckpointId -> CheckpointId -> (CheckpointId, CheckpointId)
$cquotRem :: CheckpointId -> CheckpointId -> (CheckpointId, CheckpointId)
mod :: CheckpointId -> CheckpointId -> CheckpointId
$cmod :: CheckpointId -> CheckpointId -> CheckpointId
div :: CheckpointId -> CheckpointId -> CheckpointId
$cdiv :: CheckpointId -> CheckpointId -> CheckpointId
rem :: CheckpointId -> CheckpointId -> CheckpointId
$crem :: CheckpointId -> CheckpointId -> CheckpointId
quot :: CheckpointId -> CheckpointId -> CheckpointId
$cquot :: CheckpointId -> CheckpointId -> CheckpointId
Integral, Integer -> CheckpointId
CheckpointId -> CheckpointId
CheckpointId -> CheckpointId -> CheckpointId
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
fromInteger :: Integer -> CheckpointId
$cfromInteger :: Integer -> CheckpointId
signum :: CheckpointId -> CheckpointId
$csignum :: CheckpointId -> CheckpointId
abs :: CheckpointId -> CheckpointId
$cabs :: CheckpointId -> CheckpointId
negate :: CheckpointId -> CheckpointId
$cnegate :: CheckpointId -> CheckpointId
* :: CheckpointId -> CheckpointId -> CheckpointId
$c* :: CheckpointId -> CheckpointId -> CheckpointId
- :: CheckpointId -> CheckpointId -> CheckpointId
$c- :: CheckpointId -> CheckpointId -> CheckpointId
+ :: CheckpointId -> CheckpointId -> CheckpointId
$c+ :: CheckpointId -> CheckpointId -> CheckpointId
Num, CheckpointId -> ()
forall a. (a -> ()) -> NFData a
rnf :: CheckpointId -> ()
$crnf :: CheckpointId -> ()
NFData)
instance Show CheckpointId where
show :: CheckpointId -> String
show (CheckpointId Int
n) = forall a. Show a => a -> String
show Int
n
instance Pretty CheckpointId where
pretty :: CheckpointId -> Doc
pretty (CheckpointId Int
n) = forall a. Pretty a => a -> Doc
pretty Int
n
instance HasFresh CheckpointId where
freshLens :: Lens' CheckpointId TCState
freshLens = Lens' CheckpointId TCState
stFreshCheckpointId
freshName :: MonadFresh NameId m => Range -> String -> m Name
freshName :: forall (m :: * -> *).
MonadFresh NameId m =>
Range -> String -> m Name
freshName Range
r String
s = do
NameId
i <- forall i (m :: * -> *). MonadFresh i m => m i
fresh
forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ forall a. MkName a => Range -> NameId -> a -> Name
mkName Range
r NameId
i String
s
freshNoName :: MonadFresh NameId m => Range -> m Name
freshNoName :: forall (m :: * -> *). MonadFresh NameId m => Range -> m Name
freshNoName Range
r =
do NameId
i <- forall i (m :: * -> *). MonadFresh i m => m i
fresh
forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ NameId -> Name -> Range -> Fixity' -> Bool -> Name
makeName NameId
i (Range -> NameId -> Name
C.NoName forall a. Range' a
noRange NameId
i) Range
r Fixity'
noFixity' Bool
False
freshNoName_ :: MonadFresh NameId m => m Name
freshNoName_ :: forall (m :: * -> *). MonadFresh NameId m => m Name
freshNoName_ = forall (m :: * -> *). MonadFresh NameId m => Range -> m Name
freshNoName forall a. Range' a
noRange
freshRecordName :: MonadFresh NameId m => m Name
freshRecordName :: forall (m :: * -> *). MonadFresh NameId m => m Name
freshRecordName = do
NameId
i <- forall i (m :: * -> *). MonadFresh i m => m i
fresh
forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ NameId -> Name -> Range -> Fixity' -> Bool -> Name
makeName NameId
i (forall a. LensInScope a => a -> a
C.setNotInScope forall a b. (a -> b) -> a -> b
$ String -> Name
C.simpleName String
"r") forall a. Range' a
noRange Fixity'
noFixity' Bool
True
class FreshName a where
freshName_ :: MonadFresh NameId m => a -> m Name
instance FreshName (Range, String) where
freshName_ :: forall (m :: * -> *).
MonadFresh NameId m =>
(Range, String) -> m Name
freshName_ = forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry forall (m :: * -> *).
MonadFresh NameId m =>
Range -> String -> m Name
freshName
instance FreshName String where
freshName_ :: forall (m :: * -> *). MonadFresh NameId m => String -> m Name
freshName_ = forall (m :: * -> *).
MonadFresh NameId m =>
Range -> String -> m Name
freshName forall a. Range' a
noRange
instance FreshName Range where
freshName_ :: forall (m :: * -> *). MonadFresh NameId m => Range -> m Name
freshName_ = forall (m :: * -> *). MonadFresh NameId m => Range -> m Name
freshNoName
instance FreshName () where
freshName_ :: forall (m :: * -> *). MonadFresh NameId m => () -> m Name
freshName_ () = forall (m :: * -> *). MonadFresh NameId m => m Name
freshNoName_
type ModuleToSource = Map TopLevelModuleName AbsolutePath
class Monad m => MonadStConcreteNames m where
runStConcreteNames :: StateT ConcreteNames m a -> m a
useConcreteNames :: m ConcreteNames
useConcreteNames = forall (m :: * -> *) a.
MonadStConcreteNames m =>
StateT ConcreteNames m a -> m a
runStConcreteNames forall s (m :: * -> *). MonadState s m => m s
get
modifyConcreteNames :: (ConcreteNames -> ConcreteNames) -> m ()
modifyConcreteNames = forall (m :: * -> *) a.
MonadStConcreteNames m =>
StateT ConcreteNames m a -> m a
runStConcreteNames forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall s (m :: * -> *). MonadState s m => (s -> s) -> m ()
modify
instance MonadStConcreteNames TCM where
runStConcreteNames :: forall a. StateT ConcreteNames TCM a -> TCM a
runStConcreteNames StateT ConcreteNames TCM a
m = forall (m :: * -> *) a r.
MonadTCState m =>
Lens' a TCState -> (a -> m (r, a)) -> m r
stateTCLensM Lens' ConcreteNames TCState
stConcreteNames forall a b. (a -> b) -> a -> b
$ forall s (m :: * -> *) a. StateT s m a -> s -> m (a, s)
runStateT StateT ConcreteNames TCM a
m
instance MonadStConcreteNames m => MonadStConcreteNames (IdentityT m) where
runStConcreteNames :: forall a. StateT ConcreteNames (IdentityT m) a -> IdentityT m a
runStConcreteNames StateT ConcreteNames (IdentityT m) a
m = forall {k} (f :: k -> *) (a :: k). f a -> IdentityT f a
IdentityT forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a.
MonadStConcreteNames m =>
StateT ConcreteNames m a -> m a
runStConcreteNames forall a b. (a -> b) -> a -> b
$ forall s (m :: * -> *) a. (s -> m (a, s)) -> StateT s m a
StateT forall a b. (a -> b) -> a -> b
$ forall {k} (f :: k -> *) (a :: k). IdentityT f a -> f a
runIdentityT forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall s (m :: * -> *) a. StateT s m a -> s -> m (a, s)
runStateT StateT ConcreteNames (IdentityT m) a
m
instance MonadStConcreteNames m => MonadStConcreteNames (ReaderT r m) where
runStConcreteNames :: forall a. StateT ConcreteNames (ReaderT r m) a -> ReaderT r m a
runStConcreteNames StateT ConcreteNames (ReaderT r m) a
m = forall r (m :: * -> *) a. (r -> m a) -> ReaderT r m a
ReaderT forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a.
MonadStConcreteNames m =>
StateT ConcreteNames m a -> m a
runStConcreteNames forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall s (m :: * -> *) a. (s -> m (a, s)) -> StateT s m a
StateT forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b c. (a -> b -> c) -> b -> a -> c
flip (forall r (m :: * -> *) a. ReaderT r m a -> r -> m a
runReaderT forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall s (m :: * -> *) a. StateT s m a -> s -> m (a, s)
runStateT StateT ConcreteNames (ReaderT r m) a
m)
instance MonadStConcreteNames m => MonadStConcreteNames (StateT s m) where
runStConcreteNames :: forall a. StateT ConcreteNames (StateT s m) a -> StateT s m a
runStConcreteNames StateT ConcreteNames (StateT s m) a
m = forall s (m :: * -> *) a. (s -> m (a, s)) -> StateT s m a
StateT forall a b. (a -> b) -> a -> b
$ \s
s -> forall (m :: * -> *) a.
MonadStConcreteNames m =>
StateT ConcreteNames m a -> m a
runStConcreteNames forall a b. (a -> b) -> a -> b
$ forall s (m :: * -> *) a. (s -> m (a, s)) -> StateT s m a
StateT forall a b. (a -> b) -> a -> b
$ \ConcreteNames
ns -> do
((a
x,ConcreteNames
ns'),s
s') <- forall s (m :: * -> *) a. StateT s m a -> s -> m (a, s)
runStateT (forall s (m :: * -> *) a. StateT s m a -> s -> m (a, s)
runStateT StateT ConcreteNames (StateT s m) a
m ConcreteNames
ns) s
s
forall (m :: * -> *) a. Monad m => a -> m a
return ((a
x,s
s'),ConcreteNames
ns')
data ModuleCheckMode
= ModuleScopeChecked
| ModuleTypeChecked
deriving (ModuleCheckMode -> ModuleCheckMode -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModuleCheckMode -> ModuleCheckMode -> Bool
$c/= :: ModuleCheckMode -> ModuleCheckMode -> Bool
== :: ModuleCheckMode -> ModuleCheckMode -> Bool
$c== :: ModuleCheckMode -> ModuleCheckMode -> Bool
Eq, Eq ModuleCheckMode
ModuleCheckMode -> ModuleCheckMode -> Bool
ModuleCheckMode -> ModuleCheckMode -> Ordering
ModuleCheckMode -> ModuleCheckMode -> ModuleCheckMode
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 :: ModuleCheckMode -> ModuleCheckMode -> ModuleCheckMode
$cmin :: ModuleCheckMode -> ModuleCheckMode -> ModuleCheckMode
max :: ModuleCheckMode -> ModuleCheckMode -> ModuleCheckMode
$cmax :: ModuleCheckMode -> ModuleCheckMode -> ModuleCheckMode
>= :: ModuleCheckMode -> ModuleCheckMode -> Bool
$c>= :: ModuleCheckMode -> ModuleCheckMode -> Bool
> :: ModuleCheckMode -> ModuleCheckMode -> Bool
$c> :: ModuleCheckMode -> ModuleCheckMode -> Bool
<= :: ModuleCheckMode -> ModuleCheckMode -> Bool
$c<= :: ModuleCheckMode -> ModuleCheckMode -> Bool
< :: ModuleCheckMode -> ModuleCheckMode -> Bool
$c< :: ModuleCheckMode -> ModuleCheckMode -> Bool
compare :: ModuleCheckMode -> ModuleCheckMode -> Ordering
$ccompare :: ModuleCheckMode -> ModuleCheckMode -> Ordering
Ord, ModuleCheckMode
forall a. a -> a -> Bounded a
maxBound :: ModuleCheckMode
$cmaxBound :: ModuleCheckMode
minBound :: ModuleCheckMode
$cminBound :: ModuleCheckMode
Bounded, Int -> ModuleCheckMode
ModuleCheckMode -> Int
ModuleCheckMode -> [ModuleCheckMode]
ModuleCheckMode -> ModuleCheckMode
ModuleCheckMode -> ModuleCheckMode -> [ModuleCheckMode]
ModuleCheckMode
-> ModuleCheckMode -> ModuleCheckMode -> [ModuleCheckMode]
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 :: ModuleCheckMode
-> ModuleCheckMode -> ModuleCheckMode -> [ModuleCheckMode]
$cenumFromThenTo :: ModuleCheckMode
-> ModuleCheckMode -> ModuleCheckMode -> [ModuleCheckMode]
enumFromTo :: ModuleCheckMode -> ModuleCheckMode -> [ModuleCheckMode]
$cenumFromTo :: ModuleCheckMode -> ModuleCheckMode -> [ModuleCheckMode]
enumFromThen :: ModuleCheckMode -> ModuleCheckMode -> [ModuleCheckMode]
$cenumFromThen :: ModuleCheckMode -> ModuleCheckMode -> [ModuleCheckMode]
enumFrom :: ModuleCheckMode -> [ModuleCheckMode]
$cenumFrom :: ModuleCheckMode -> [ModuleCheckMode]
fromEnum :: ModuleCheckMode -> Int
$cfromEnum :: ModuleCheckMode -> Int
toEnum :: Int -> ModuleCheckMode
$ctoEnum :: Int -> ModuleCheckMode
pred :: ModuleCheckMode -> ModuleCheckMode
$cpred :: ModuleCheckMode -> ModuleCheckMode
succ :: ModuleCheckMode -> ModuleCheckMode
$csucc :: ModuleCheckMode -> ModuleCheckMode
Enum, Int -> ModuleCheckMode -> ShowS
[ModuleCheckMode] -> ShowS
ModuleCheckMode -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModuleCheckMode] -> ShowS
$cshowList :: [ModuleCheckMode] -> ShowS
show :: ModuleCheckMode -> String
$cshow :: ModuleCheckMode -> String
showsPrec :: Int -> ModuleCheckMode -> ShowS
$cshowsPrec :: Int -> ModuleCheckMode -> ShowS
Show, forall x. Rep ModuleCheckMode x -> ModuleCheckMode
forall x. ModuleCheckMode -> Rep ModuleCheckMode x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModuleCheckMode x -> ModuleCheckMode
$cfrom :: forall x. ModuleCheckMode -> Rep ModuleCheckMode x
Generic)
data ModuleInfo = ModuleInfo
{ ModuleInfo -> Interface
miInterface :: Interface
, ModuleInfo -> [TCWarning]
miWarnings :: [TCWarning]
, ModuleInfo -> Bool
miPrimitive :: Bool
, ModuleInfo -> ModuleCheckMode
miMode :: ModuleCheckMode
}
deriving forall x. Rep ModuleInfo x -> ModuleInfo
forall x. ModuleInfo -> Rep ModuleInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModuleInfo x -> ModuleInfo
$cfrom :: forall x. ModuleInfo -> Rep ModuleInfo x
Generic
type VisitedModules = Map TopLevelModuleName ModuleInfo
type DecodedModules = Map TopLevelModuleName ModuleInfo
data ForeignCode = ForeignCode Range String
deriving (Int -> ForeignCode -> ShowS
[ForeignCode] -> ShowS
ForeignCode -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ForeignCode] -> ShowS
$cshowList :: [ForeignCode] -> ShowS
show :: ForeignCode -> String
$cshow :: ForeignCode -> String
showsPrec :: Int -> ForeignCode -> ShowS
$cshowsPrec :: Int -> ForeignCode -> ShowS
Show, forall x. Rep ForeignCode x -> ForeignCode
forall x. ForeignCode -> Rep ForeignCode x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ForeignCode x -> ForeignCode
$cfrom :: forall x. ForeignCode -> Rep ForeignCode x
Generic)
data Interface = Interface
{ Interface -> Hash
iSourceHash :: Hash
, Interface -> Text
iSource :: TL.Text
, Interface -> FileType
iFileType :: FileType
, Interface -> [(TopLevelModuleName, Hash)]
iImportedModules :: [(TopLevelModuleName, Hash)]
, Interface -> ModuleName
iModuleName :: ModuleName
, Interface -> TopLevelModuleName
iTopLevelModuleName :: TopLevelModuleName
, Interface -> Map ModuleName Scope
iScope :: Map ModuleName Scope
, Interface -> ScopeInfo
iInsideScope :: ScopeInfo
, Interface -> Signature
iSignature :: Signature
, Interface -> RemoteMetaStore
iMetaBindings :: RemoteMetaStore
, Interface -> DisplayForms
iDisplayForms :: DisplayForms
, Interface -> Map QName Text
iUserWarnings :: Map A.QName Text
, Interface -> Maybe Text
iImportWarning :: Maybe Text
, Interface -> BuiltinThings (String, QName)
iBuiltin :: BuiltinThings (String, QName)
, Interface -> Map String [ForeignCode]
iForeignCode :: Map BackendName [ForeignCode]
, Interface -> HighlightingInfo
iHighlighting :: HighlightingInfo
, Interface -> [[String]]
iDefaultPragmaOptions :: [OptionsPragma]
, Interface -> [[String]]
iFilePragmaOptions :: [OptionsPragma]
, Interface -> PragmaOptions
iOptionsUsed :: PragmaOptions
, Interface -> PatternSynDefns
iPatternSyns :: A.PatternSynDefns
, Interface -> [TCWarning]
iWarnings :: [TCWarning]
, Interface -> Set QName
iPartialDefs :: Set QName
}
deriving (Int -> Interface -> ShowS
[Interface] -> ShowS
Interface -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Interface] -> ShowS
$cshowList :: [Interface] -> ShowS
show :: Interface -> String
$cshow :: Interface -> String
showsPrec :: Int -> Interface -> ShowS
$cshowsPrec :: Int -> Interface -> ShowS
Show, forall x. Rep Interface x -> Interface
forall x. Interface -> Rep Interface x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Interface x -> Interface
$cfrom :: forall x. Interface -> Rep Interface x
Generic)
instance Pretty Interface where
pretty :: Interface -> Doc
pretty (Interface
Hash
sourceH Text
source FileType
fileT [(TopLevelModuleName, Hash)]
importedM ModuleName
moduleN TopLevelModuleName
topModN Map ModuleName Scope
scope ScopeInfo
insideS
Signature
signature RemoteMetaStore
metas DisplayForms
display Map QName Text
userwarn Maybe Text
importwarn BuiltinThings (String, QName)
builtin
Map String [ForeignCode]
foreignCode HighlightingInfo
highlighting [[String]]
libPragmaO [[String]]
filePragmaO PragmaOptions
oUsed
PatternSynDefns
patternS [TCWarning]
warnings Set QName
partialdefs) =
Doc -> Int -> Doc -> Doc
hang Doc
"Interface" Int
2 forall a b. (a -> b) -> a -> b
$ forall (t :: * -> *). Foldable t => t Doc -> Doc
vcat
[ Doc
"source hash:" Doc -> Doc -> Doc
<+> (forall a. Pretty a => a -> Doc
pretty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> String
show) Hash
sourceH
, Doc
"source:" Doc -> Doc -> Doc
$$ Int -> Doc -> Doc
nest Int
2 (String -> Doc
text forall a b. (a -> b) -> a -> b
$ Text -> String
TL.unpack Text
source)
, Doc
"file type:" Doc -> Doc -> Doc
<+> (forall a. Pretty a => a -> Doc
pretty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> String
show) FileType
fileT
, Doc
"imported modules:" Doc -> Doc -> Doc
<+> (forall a. Pretty a => a -> Doc
pretty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> String
show) [(TopLevelModuleName, Hash)]
importedM
, Doc
"module name:" Doc -> Doc -> Doc
<+> forall a. Pretty a => a -> Doc
pretty ModuleName
moduleN
, Doc
"top-level module name:" Doc -> Doc -> Doc
<+> forall a. Pretty a => a -> Doc
pretty TopLevelModuleName
topModN
, Doc
"scope:" Doc -> Doc -> Doc
<+> (forall a. Pretty a => a -> Doc
pretty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> String
show) Map ModuleName Scope
scope
, Doc
"inside scope:" Doc -> Doc -> Doc
<+> (forall a. Pretty a => a -> Doc
pretty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> String
show) ScopeInfo
insideS
, Doc
"signature:" Doc -> Doc -> Doc
<+> (forall a. Pretty a => a -> Doc
pretty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> String
show) Signature
signature
, Doc
"meta-variables:" Doc -> Doc -> Doc
<+> (forall a. Pretty a => a -> Doc
pretty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> String
show) RemoteMetaStore
metas
, Doc
"display:" Doc -> Doc -> Doc
<+> (forall a. Pretty a => a -> Doc
pretty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> String
show) DisplayForms
display
, Doc
"user warnings:" Doc -> Doc -> Doc
<+> (forall a. Pretty a => a -> Doc
pretty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> String
show) Map QName Text
userwarn
, Doc
"import warning:" Doc -> Doc -> Doc
<+> (forall a. Pretty a => a -> Doc
pretty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> String
show) Maybe Text
importwarn
, Doc
"builtin:" Doc -> Doc -> Doc
<+> (forall a. Pretty a => a -> Doc
pretty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> String
show) BuiltinThings (String, QName)
builtin
, Doc
"Foreign code:" Doc -> Doc -> Doc
<+> (forall a. Pretty a => a -> Doc
pretty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> String
show) Map String [ForeignCode]
foreignCode
, Doc
"highlighting:" Doc -> Doc -> Doc
<+> (forall a. Pretty a => a -> Doc
pretty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> String
show) HighlightingInfo
highlighting
, Doc
"library pragma options:" Doc -> Doc -> Doc
<+> (forall a. Pretty a => a -> Doc
pretty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> String
show) [[String]]
libPragmaO
, Doc
"file pragma options:" Doc -> Doc -> Doc
<+> (forall a. Pretty a => a -> Doc
pretty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> String
show) [[String]]
filePragmaO
, Doc
"options used:" Doc -> Doc -> Doc
<+> (forall a. Pretty a => a -> Doc
pretty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> String
show) PragmaOptions
oUsed
, Doc
"pattern syns:" Doc -> Doc -> Doc
<+> (forall a. Pretty a => a -> Doc
pretty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> String
show) PatternSynDefns
patternS
, Doc
"warnings:" Doc -> Doc -> Doc
<+> (forall a. Pretty a => a -> Doc
pretty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> String
show) [TCWarning]
warnings
, Doc
"partial definitions:" Doc -> Doc -> Doc
<+> (forall a. Pretty a => a -> Doc
pretty forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> String
show) Set QName
partialdefs
]
iFullHash :: Interface -> Hash
iFullHash :: Interface -> Hash
iFullHash Interface
i = [Hash] -> Hash
combineHashes forall a b. (a -> b) -> a -> b
$ Interface -> Hash
iSourceHash Interface
i forall a. a -> [a] -> [a]
: forall a b. (a -> b) -> [a] -> [b]
List.map forall a b. (a, b) -> b
snd (Interface -> [(TopLevelModuleName, Hash)]
iImportedModules Interface
i)
intSignature :: Lens' Signature Interface
intSignature :: Lens' Signature Interface
intSignature Signature -> f Signature
f Interface
i = Signature -> f Signature
f (Interface -> Signature
iSignature Interface
i) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \Signature
s -> Interface
i { iSignature :: Signature
iSignature = Signature
s }
data Closure a = Closure
{ forall a. Closure a -> Signature
clSignature :: Signature
, forall a. Closure a -> TCEnv
clEnv :: TCEnv
, forall a. Closure a -> ScopeInfo
clScope :: ScopeInfo
, forall a. Closure a -> Map ModuleName CheckpointId
clModuleCheckpoints :: Map ModuleName CheckpointId
, forall a. Closure a -> a
clValue :: a
}
deriving (forall a b. a -> Closure b -> Closure a
forall a b. (a -> b) -> Closure a -> Closure b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: forall a b. a -> Closure b -> Closure a
$c<$ :: forall a b. a -> Closure b -> Closure a
fmap :: forall a b. (a -> b) -> Closure a -> Closure b
$cfmap :: forall a b. (a -> b) -> Closure a -> Closure b
Functor, forall a. Eq a => a -> Closure a -> Bool
forall a. Num a => Closure a -> a
forall a. Ord a => Closure a -> a
forall m. Monoid m => Closure m -> m
forall a. Closure a -> Bool
forall a. Closure a -> Int
forall a. Closure a -> [a]
forall a. (a -> a -> a) -> Closure a -> a
forall m a. Monoid m => (a -> m) -> Closure a -> m
forall b a. (b -> a -> b) -> b -> Closure a -> b
forall a b. (a -> b -> b) -> b -> Closure a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: forall a. Num a => Closure a -> a
$cproduct :: forall a. Num a => Closure a -> a
sum :: forall a. Num a => Closure a -> a
$csum :: forall a. Num a => Closure a -> a
minimum :: forall a. Ord a => Closure a -> a
$cminimum :: forall a. Ord a => Closure a -> a
maximum :: forall a. Ord a => Closure a -> a
$cmaximum :: forall a. Ord a => Closure a -> a
elem :: forall a. Eq a => a -> Closure a -> Bool
$celem :: forall a. Eq a => a -> Closure a -> Bool
length :: forall a. Closure a -> Int
$clength :: forall a. Closure a -> Int
null :: forall a. Closure a -> Bool
$cnull :: forall a. Closure a -> Bool
toList :: forall a. Closure a -> [a]
$ctoList :: forall a. Closure a -> [a]
foldl1 :: forall a. (a -> a -> a) -> Closure a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> Closure a -> a
foldr1 :: forall a. (a -> a -> a) -> Closure a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> Closure a -> a
foldl' :: forall b a. (b -> a -> b) -> b -> Closure a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> Closure a -> b
foldl :: forall b a. (b -> a -> b) -> b -> Closure a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> Closure a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> Closure a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> Closure a -> b
foldr :: forall a b. (a -> b -> b) -> b -> Closure a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> Closure a -> b
foldMap' :: forall m a. Monoid m => (a -> m) -> Closure a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> Closure a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> Closure a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> Closure a -> m
fold :: forall m. Monoid m => Closure m -> m
$cfold :: forall m. Monoid m => Closure m -> m
Foldable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (Closure a) x -> Closure a
forall a x. Closure a -> Rep (Closure a) x
$cto :: forall a x. Rep (Closure a) x -> Closure a
$cfrom :: forall a x. Closure a -> Rep (Closure a) x
Generic)
instance Show a => Show (Closure a) where
show :: Closure a -> String
show Closure a
cl = String
"Closure { clValue = " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall a. Closure a -> a
clValue Closure a
cl) forall a. [a] -> [a] -> [a]
++ String
" }"
instance HasRange a => HasRange (Closure a) where
getRange :: Closure a -> Range
getRange = forall a. HasRange a => a -> Range
getRange forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Closure a -> a
clValue
class LensClosure a b | b -> a where
lensClosure :: Lens' (Closure a) b
instance LensClosure a (Closure a) where
lensClosure :: Lens' (Closure a) (Closure a)
lensClosure = forall a. a -> a
id
instance LensTCEnv (Closure a) where
lensTCEnv :: Lens' TCEnv (Closure a)
lensTCEnv TCEnv -> f TCEnv
f Closure a
cl = (TCEnv -> f TCEnv
f forall a b. (a -> b) -> a -> b
$! forall a. Closure a -> TCEnv
clEnv Closure a
cl) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ TCEnv
env -> Closure a
cl { clEnv :: TCEnv
clEnv = TCEnv
env }
buildClosure :: (MonadTCEnv m, ReadTCState m) => a -> m (Closure a)
buildClosure :: forall (m :: * -> *) a.
(MonadTCEnv m, ReadTCState m) =>
a -> m (Closure a)
buildClosure a
x = do
TCEnv
env <- forall (m :: * -> *). MonadTCEnv m => m TCEnv
askTC
Signature
sig <- forall (m :: * -> *) a. ReadTCState m => Lens' a TCState -> m a
useR Lens' Signature TCState
stSignature
ScopeInfo
scope <- forall (m :: * -> *) a. ReadTCState m => Lens' a TCState -> m a
useR Lens' ScopeInfo TCState
stScope
Map ModuleName CheckpointId
cps <- forall (m :: * -> *) a. ReadTCState m => Lens' a TCState -> m a
useR Lens' (Map ModuleName CheckpointId) TCState
stModuleCheckpoints
forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ forall a.
Signature
-> TCEnv
-> ScopeInfo
-> Map ModuleName CheckpointId
-> a
-> Closure a
Closure Signature
sig TCEnv
env ScopeInfo
scope Map ModuleName CheckpointId
cps a
x
type Constraints = [ProblemConstraint]
data ProblemConstraint = PConstr
{ ProblemConstraint -> Set ProblemId
constraintProblems :: Set ProblemId
, ProblemConstraint -> Blocker
constraintUnblocker :: Blocker
, ProblemConstraint -> Closure Constraint
theConstraint :: Closure Constraint
}
deriving (Int -> ProblemConstraint -> ShowS
Constraints -> ShowS
ProblemConstraint -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: Constraints -> ShowS
$cshowList :: Constraints -> ShowS
show :: ProblemConstraint -> String
$cshow :: ProblemConstraint -> String
showsPrec :: Int -> ProblemConstraint -> ShowS
$cshowsPrec :: Int -> ProblemConstraint -> ShowS
Show, forall x. Rep ProblemConstraint x -> ProblemConstraint
forall x. ProblemConstraint -> Rep ProblemConstraint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProblemConstraint x -> ProblemConstraint
$cfrom :: forall x. ProblemConstraint -> Rep ProblemConstraint x
Generic)
instance HasRange ProblemConstraint where
getRange :: ProblemConstraint -> Range
getRange = forall a. HasRange a => a -> Range
getRange forall b c a. (b -> c) -> (a -> b) -> a -> c
. ProblemConstraint -> Closure Constraint
theConstraint
data WhyCheckModality
= ConstructorType
| IndexedClause
| IndexedClauseArg Name Name
| GeneratedClause
deriving (Int -> WhyCheckModality -> ShowS
[WhyCheckModality] -> ShowS
WhyCheckModality -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WhyCheckModality] -> ShowS
$cshowList :: [WhyCheckModality] -> ShowS
show :: WhyCheckModality -> String
$cshow :: WhyCheckModality -> String
showsPrec :: Int -> WhyCheckModality -> ShowS
$cshowsPrec :: Int -> WhyCheckModality -> ShowS
Show, forall x. Rep WhyCheckModality x -> WhyCheckModality
forall x. WhyCheckModality -> Rep WhyCheckModality x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WhyCheckModality x -> WhyCheckModality
$cfrom :: forall x. WhyCheckModality -> Rep WhyCheckModality x
Generic)
data Constraint
= ValueCmp Comparison CompareAs Term Term
| ValueCmpOnFace Comparison Term Type Term Term
| ElimCmp [Polarity] [IsForced] Type Term [Elim] [Elim]
| SortCmp Comparison Sort Sort
| LevelCmp Comparison Level Level
| HasBiggerSort Sort
| HasPTSRule (Dom Type) (Abs Sort)
| CheckDataSort QName Sort
| CheckMetaInst MetaId
| CheckType Type
| UnBlock MetaId
| IsEmpty Range Type
| CheckSizeLtSat Term
| FindInstance MetaId (Maybe [Candidate])
| CheckFunDef Delayed A.DefInfo QName [A.Clause] TCErr
| UnquoteTactic Term Term Type
| CheckLockedVars Term Type (Arg Term) Type
| UsableAtModality WhyCheckModality (Maybe Sort) Modality Term
deriving (Int -> Constraint -> ShowS
[Constraint] -> ShowS
Constraint -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Constraint] -> ShowS
$cshowList :: [Constraint] -> ShowS
show :: Constraint -> String
$cshow :: Constraint -> String
showsPrec :: Int -> Constraint -> ShowS
$cshowsPrec :: Int -> Constraint -> ShowS
Show, forall x. Rep Constraint x -> Constraint
forall x. Constraint -> Rep Constraint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Constraint x -> Constraint
$cfrom :: forall x. Constraint -> Rep Constraint x
Generic)
instance HasRange Constraint where
getRange :: Constraint -> Range
getRange (IsEmpty Range
r Type
t) = Range
r
getRange Constraint
_ = forall a. Range' a
noRange
instance Free Constraint where
freeVars' :: forall a c. IsVarSet a c => Constraint -> FreeM a c
freeVars' Constraint
c =
case Constraint
c of
ValueCmp Comparison
_ CompareAs
t Term
u Term
v -> forall t a c. (Free t, IsVarSet a c) => t -> FreeM a c
freeVars' (CompareAs
t, (Term
u, Term
v))
ValueCmpOnFace Comparison
_ Term
p Type
t Term
u Term
v -> forall t a c. (Free t, IsVarSet a c) => t -> FreeM a c
freeVars' (Term
p, (Type
t, (Term
u, Term
v)))
ElimCmp [Polarity]
_ [IsForced]
_ Type
t Term
u [Elim]
es [Elim]
es' -> forall t a c. (Free t, IsVarSet a c) => t -> FreeM a c
freeVars' ((Type
t, Term
u), ([Elim]
es, [Elim]
es'))
SortCmp Comparison
_ Sort
s Sort
s' -> forall t a c. (Free t, IsVarSet a c) => t -> FreeM a c
freeVars' (Sort
s, Sort
s')
LevelCmp Comparison
_ Level
l Level
l' -> forall t a c. (Free t, IsVarSet a c) => t -> FreeM a c
freeVars' (Level
l, Level
l')
UnBlock MetaId
_ -> forall a. Monoid a => a
mempty
IsEmpty Range
_ Type
t -> forall t a c. (Free t, IsVarSet a c) => t -> FreeM a c
freeVars' Type
t
CheckSizeLtSat Term
u -> forall t a c. (Free t, IsVarSet a c) => t -> FreeM a c
freeVars' Term
u
FindInstance MetaId
_ Maybe [Candidate]
cs -> forall t a c. (Free t, IsVarSet a c) => t -> FreeM a c
freeVars' Maybe [Candidate]
cs
CheckFunDef{} -> forall a. Monoid a => a
mempty
HasBiggerSort Sort
s -> forall t a c. (Free t, IsVarSet a c) => t -> FreeM a c
freeVars' Sort
s
HasPTSRule Dom Type
a Abs Sort
s -> forall t a c. (Free t, IsVarSet a c) => t -> FreeM a c
freeVars' (Dom Type
a , Abs Sort
s)
CheckLockedVars Term
a Type
b Arg Term
c Type
d -> forall t a c. (Free t, IsVarSet a c) => t -> FreeM a c
freeVars' ((Term
a,Type
b),(Arg Term
c,Type
d))
UnquoteTactic Term
t Term
h Type
g -> forall t a c. (Free t, IsVarSet a c) => t -> FreeM a c
freeVars' (Term
t, (Term
h, Type
g))
CheckDataSort QName
_ Sort
s -> forall t a c. (Free t, IsVarSet a c) => t -> FreeM a c
freeVars' Sort
s
CheckMetaInst MetaId
m -> forall a. Monoid a => a
mempty
CheckType Type
t -> forall t a c. (Free t, IsVarSet a c) => t -> FreeM a c
freeVars' Type
t
UsableAtModality WhyCheckModality
_ Maybe Sort
ms Modality
mod Term
t -> forall t a c. (Free t, IsVarSet a c) => t -> FreeM a c
freeVars' (Maybe Sort
ms, Term
t)
instance TermLike Constraint where
foldTerm :: forall m. Monoid m => (Term -> m) -> Constraint -> m
foldTerm Term -> m
f = \case
ValueCmp Comparison
_ CompareAs
t Term
u Term
v -> forall a m. (TermLike a, Monoid m) => (Term -> m) -> a -> m
foldTerm Term -> m
f (CompareAs
t, Term
u, Term
v)
ValueCmpOnFace Comparison
_ Term
p Type
t Term
u Term
v -> forall a m. (TermLike a, Monoid m) => (Term -> m) -> a -> m
foldTerm Term -> m
f (Term
p, Type
t, Term
u, Term
v)
ElimCmp [Polarity]
_ [IsForced]
_ Type
t Term
u [Elim]
es [Elim]
es' -> forall a m. (TermLike a, Monoid m) => (Term -> m) -> a -> m
foldTerm Term -> m
f (Type
t, Term
u, [Elim]
es, [Elim]
es')
LevelCmp Comparison
_ Level
l Level
l' -> forall a m. (TermLike a, Monoid m) => (Term -> m) -> a -> m
foldTerm Term -> m
f (Level -> Term
Level Level
l, Level -> Term
Level Level
l')
IsEmpty Range
_ Type
t -> forall a m. (TermLike a, Monoid m) => (Term -> m) -> a -> m
foldTerm Term -> m
f Type
t
CheckSizeLtSat Term
u -> forall a m. (TermLike a, Monoid m) => (Term -> m) -> a -> m
foldTerm Term -> m
f Term
u
UnquoteTactic Term
t Term
h Type
g -> forall a m. (TermLike a, Monoid m) => (Term -> m) -> a -> m
foldTerm Term -> m
f (Term
t, Term
h, Type
g)
SortCmp Comparison
_ Sort
s1 Sort
s2 -> forall a m. (TermLike a, Monoid m) => (Term -> m) -> a -> m
foldTerm Term -> m
f (Sort -> Term
Sort Sort
s1, Sort -> Term
Sort Sort
s2)
UnBlock MetaId
_ -> forall a. Monoid a => a
mempty
CheckLockedVars Term
a Type
b Arg Term
c Type
d -> forall a m. (TermLike a, Monoid m) => (Term -> m) -> a -> m
foldTerm Term -> m
f (Term
a, Type
b, Arg Term
c, Type
d)
FindInstance MetaId
_ Maybe [Candidate]
_ -> forall a. Monoid a => a
mempty
CheckFunDef{} -> forall a. Monoid a => a
mempty
HasBiggerSort Sort
s -> forall a m. (TermLike a, Monoid m) => (Term -> m) -> a -> m
foldTerm Term -> m
f Sort
s
HasPTSRule Dom Type
a Abs Sort
s -> forall a m. (TermLike a, Monoid m) => (Term -> m) -> a -> m
foldTerm Term -> m
f (Dom Type
a, Sort -> Term
Sort forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Abs Sort
s)
CheckDataSort QName
_ Sort
s -> forall a m. (TermLike a, Monoid m) => (Term -> m) -> a -> m
foldTerm Term -> m
f Sort
s
CheckMetaInst MetaId
m -> forall a. Monoid a => a
mempty
CheckType Type
t -> forall a m. (TermLike a, Monoid m) => (Term -> m) -> a -> m
foldTerm Term -> m
f Type
t
UsableAtModality WhyCheckModality
_ Maybe Sort
ms Modality
m Term
t -> forall a m. (TermLike a, Monoid m) => (Term -> m) -> a -> m
foldTerm Term -> m
f (Sort -> Term
Sort forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe Sort
ms, Term
t)
traverseTermM :: forall (m :: * -> *).
Monad m =>
(Term -> m Term) -> Constraint -> m Constraint
traverseTermM Term -> m Term
f Constraint
c = forall a. HasCallStack => a
__IMPOSSIBLE__
instance AllMetas Constraint
data Comparison = CmpEq | CmpLeq
deriving (Comparison -> Comparison -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Comparison -> Comparison -> Bool
$c/= :: Comparison -> Comparison -> Bool
== :: Comparison -> Comparison -> Bool
$c== :: Comparison -> Comparison -> Bool
Eq, Int -> Comparison -> ShowS
[Comparison] -> ShowS
Comparison -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Comparison] -> ShowS
$cshowList :: [Comparison] -> ShowS
show :: Comparison -> String
$cshow :: Comparison -> String
showsPrec :: Int -> Comparison -> ShowS
$cshowsPrec :: Int -> Comparison -> ShowS
Show, forall x. Rep Comparison x -> Comparison
forall x. Comparison -> Rep Comparison x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Comparison x -> Comparison
$cfrom :: forall x. Comparison -> Rep Comparison x
Generic)
instance Pretty Comparison where
pretty :: Comparison -> Doc
pretty Comparison
CmpEq = Doc
"="
pretty Comparison
CmpLeq = Doc
"=<"
data CompareDirection = DirEq | DirLeq | DirGeq
deriving (CompareDirection -> CompareDirection -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CompareDirection -> CompareDirection -> Bool
$c/= :: CompareDirection -> CompareDirection -> Bool
== :: CompareDirection -> CompareDirection -> Bool
$c== :: CompareDirection -> CompareDirection -> Bool
Eq, Int -> CompareDirection -> ShowS
[CompareDirection] -> ShowS
CompareDirection -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CompareDirection] -> ShowS
$cshowList :: [CompareDirection] -> ShowS
show :: CompareDirection -> String
$cshow :: CompareDirection -> String
showsPrec :: Int -> CompareDirection -> ShowS
$cshowsPrec :: Int -> CompareDirection -> ShowS
Show)
instance Pretty CompareDirection where
pretty :: CompareDirection -> Doc
pretty = String -> Doc
text forall b c a. (b -> c) -> (a -> b) -> a -> c
. \case
CompareDirection
DirEq -> String
"="
CompareDirection
DirLeq -> String
"=<"
CompareDirection
DirGeq -> String
">="
fromCmp :: Comparison -> CompareDirection
fromCmp :: Comparison -> CompareDirection
fromCmp Comparison
CmpEq = CompareDirection
DirEq
fromCmp Comparison
CmpLeq = CompareDirection
DirLeq
flipCmp :: CompareDirection -> CompareDirection
flipCmp :: CompareDirection -> CompareDirection
flipCmp CompareDirection
DirEq = CompareDirection
DirEq
flipCmp CompareDirection
DirLeq = CompareDirection
DirGeq
flipCmp CompareDirection
DirGeq = CompareDirection
DirLeq
dirToCmp :: (Comparison -> a -> a -> c) -> CompareDirection -> a -> a -> c
dirToCmp :: forall a c.
(Comparison -> a -> a -> c) -> CompareDirection -> a -> a -> c
dirToCmp Comparison -> a -> a -> c
cont CompareDirection
DirEq = Comparison -> a -> a -> c
cont Comparison
CmpEq
dirToCmp Comparison -> a -> a -> c
cont CompareDirection
DirLeq = Comparison -> a -> a -> c
cont Comparison
CmpLeq
dirToCmp Comparison -> a -> a -> c
cont CompareDirection
DirGeq = forall a b c. (a -> b -> c) -> b -> a -> c
flip forall a b. (a -> b) -> a -> b
$ Comparison -> a -> a -> c
cont Comparison
CmpLeq
data CompareAs
= AsTermsOf Type
| AsSizes
| AsTypes
deriving (Int -> CompareAs -> ShowS
[CompareAs] -> ShowS
CompareAs -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CompareAs] -> ShowS
$cshowList :: [CompareAs] -> ShowS
show :: CompareAs -> String
$cshow :: CompareAs -> String
showsPrec :: Int -> CompareAs -> ShowS
$cshowsPrec :: Int -> CompareAs -> ShowS
Show, forall x. Rep CompareAs x -> CompareAs
forall x. CompareAs -> Rep CompareAs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CompareAs x -> CompareAs
$cfrom :: forall x. CompareAs -> Rep CompareAs x
Generic)
instance Free CompareAs where
freeVars' :: forall a c. IsVarSet a c => CompareAs -> FreeM a c
freeVars' (AsTermsOf Type
a) = forall t a c. (Free t, IsVarSet a c) => t -> FreeM a c
freeVars' Type
a
freeVars' CompareAs
AsSizes = forall a. Monoid a => a
mempty
freeVars' CompareAs
AsTypes = forall a. Monoid a => a
mempty
instance TermLike CompareAs where
foldTerm :: forall m. Monoid m => (Term -> m) -> CompareAs -> m
foldTerm Term -> m
f (AsTermsOf Type
a) = forall a m. (TermLike a, Monoid m) => (Term -> m) -> a -> m
foldTerm Term -> m
f Type
a
foldTerm Term -> m
f CompareAs
AsSizes = forall a. Monoid a => a
mempty
foldTerm Term -> m
f CompareAs
AsTypes = forall a. Monoid a => a
mempty
traverseTermM :: forall (m :: * -> *).
Monad m =>
(Term -> m Term) -> CompareAs -> m CompareAs
traverseTermM Term -> m Term
f = \case
AsTermsOf Type
a -> Type -> CompareAs
AsTermsOf forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a (m :: * -> *).
(TermLike a, Monad m) =>
(Term -> m Term) -> a -> m a
traverseTermM Term -> m Term
f Type
a
CompareAs
AsSizes -> forall (m :: * -> *) a. Monad m => a -> m a
return CompareAs
AsSizes
CompareAs
AsTypes -> forall (m :: * -> *) a. Monad m => a -> m a
return CompareAs
AsTypes
instance AllMetas CompareAs
instance Pretty CompareAs where
pretty :: CompareAs -> Doc
pretty (AsTermsOf Type
a) = Doc
":" Doc -> Doc -> Doc
<+> forall a. Pretty a => a -> Doc
pretty Type
a
pretty CompareAs
AsSizes = Doc
":" Doc -> Doc -> Doc
<+> String -> Doc
text String
"Size"
pretty CompareAs
AsTypes = forall a. Null a => a
empty
data Open a = OpenThing { forall a. Open a -> CheckpointId
openThingCheckpoint :: CheckpointId
, forall a. Open a -> Map CheckpointId Substitution
openThingCheckpointMap :: Map CheckpointId Substitution
, forall a. Open a -> ModuleNameHash
openThingModule :: ModuleNameHash
, forall a. Open a -> a
openThing :: a }
deriving (Int -> Open a -> ShowS
forall a. Show a => Int -> Open a -> ShowS
forall a. Show a => [Open a] -> ShowS
forall a. Show a => Open a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Open a] -> ShowS
$cshowList :: forall a. Show a => [Open a] -> ShowS
show :: Open a -> String
$cshow :: forall a. Show a => Open a -> String
showsPrec :: Int -> Open a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> Open a -> ShowS
Show, forall a b. a -> Open b -> Open a
forall a b. (a -> b) -> Open a -> Open b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: forall a b. a -> Open b -> Open a
$c<$ :: forall a b. a -> Open b -> Open a
fmap :: forall a b. (a -> b) -> Open a -> Open b
$cfmap :: forall a b. (a -> b) -> Open a -> Open b
Functor, forall a. Eq a => a -> Open a -> Bool
forall a. Num a => Open a -> a
forall a. Ord a => Open a -> a
forall m. Monoid m => Open m -> m
forall a. Open a -> Bool
forall a. Open a -> Int
forall a. Open a -> [a]
forall a. (a -> a -> a) -> Open a -> a
forall m a. Monoid m => (a -> m) -> Open a -> m
forall b a. (b -> a -> b) -> b -> Open a -> b
forall a b. (a -> b -> b) -> b -> Open a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: forall a. Num a => Open a -> a
$cproduct :: forall a. Num a => Open a -> a
sum :: forall a. Num a => Open a -> a
$csum :: forall a. Num a => Open a -> a
minimum :: forall a. Ord a => Open a -> a
$cminimum :: forall a. Ord a => Open a -> a
maximum :: forall a. Ord a => Open a -> a
$cmaximum :: forall a. Ord a => Open a -> a
elem :: forall a. Eq a => a -> Open a -> Bool
$celem :: forall a. Eq a => a -> Open a -> Bool
length :: forall a. Open a -> Int
$clength :: forall a. Open a -> Int
null :: forall a. Open a -> Bool
$cnull :: forall a. Open a -> Bool
toList :: forall a. Open a -> [a]
$ctoList :: forall a. Open a -> [a]
foldl1 :: forall a. (a -> a -> a) -> Open a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> Open a -> a
foldr1 :: forall a. (a -> a -> a) -> Open a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> Open a -> a
foldl' :: forall b a. (b -> a -> b) -> b -> Open a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> Open a -> b
foldl :: forall b a. (b -> a -> b) -> b -> Open a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> Open a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> Open a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> Open a -> b
foldr :: forall a b. (a -> b -> b) -> b -> Open a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> Open a -> b
foldMap' :: forall m a. Monoid m => (a -> m) -> Open a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> Open a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> Open a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> Open a -> m
fold :: forall m. Monoid m => Open m -> m
$cfold :: forall m. Monoid m => Open m -> m
Foldable, Functor Open
Foldable Open
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a. Monad m => Open (m a) -> m (Open a)
forall (f :: * -> *) a. Applicative f => Open (f a) -> f (Open a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Open a -> m (Open b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Open a -> f (Open b)
sequence :: forall (m :: * -> *) a. Monad m => Open (m a) -> m (Open a)
$csequence :: forall (m :: * -> *) a. Monad m => Open (m a) -> m (Open a)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Open a -> m (Open b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Open a -> m (Open b)
sequenceA :: forall (f :: * -> *) a. Applicative f => Open (f a) -> f (Open a)
$csequenceA :: forall (f :: * -> *) a. Applicative f => Open (f a) -> f (Open a)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Open a -> f (Open b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Open a -> f (Open b)
Traversable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (Open a) x -> Open a
forall a x. Open a -> Rep (Open a) x
$cto :: forall a x. Rep (Open a) x -> Open a
$cfrom :: forall a x. Open a -> Rep (Open a) x
Generic)
instance Decoration Open where
traverseF :: forall (m :: * -> *) a b.
Functor m =>
(a -> m b) -> Open a -> m (Open b)
traverseF a -> m b
f (OpenThing CheckpointId
cp Map CheckpointId Substitution
env ModuleNameHash
m a
x) = forall a.
CheckpointId
-> Map CheckpointId Substitution -> ModuleNameHash -> a -> Open a
OpenThing CheckpointId
cp Map CheckpointId Substitution
env ModuleNameHash
m forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> a -> m b
f a
x
instance Pretty a => Pretty (Open a) where
prettyPrec :: Int -> Open a -> Doc
prettyPrec Int
p (OpenThing CheckpointId
cp Map CheckpointId Substitution
env ModuleNameHash
_ a
x) = Bool -> Doc -> Doc
mparens (Int
p forall a. Ord a => a -> a -> Bool
> Int
9) forall a b. (a -> b) -> a -> b
$
Doc
"OpenThing" Doc -> Doc -> Doc
<+> forall a. Pretty a => a -> Doc
pretty CheckpointId
cp Doc -> Doc -> Doc
<+> forall a. Pretty a => a -> Doc
pretty (forall k a. Map k a -> [(k, a)]
Map.toList Map CheckpointId Substitution
env) Doc -> Doc -> Doc
<?> forall a. Pretty a => Int -> a -> Doc
prettyPrec Int
10 a
x
data Judgement a
= HasType
{ forall a. Judgement a -> a
jMetaId :: a
, forall a. Judgement a -> Comparison
jComparison :: Comparison
, forall a. Judgement a -> Type
jMetaType :: Type
}
| IsSort
{ jMetaId :: a
, jMetaType :: Type
}
deriving (Int -> Judgement a -> ShowS
forall a. Show a => Int -> Judgement a -> ShowS
forall a. Show a => [Judgement a] -> ShowS
forall a. Show a => Judgement a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Judgement a] -> ShowS
$cshowList :: forall a. Show a => [Judgement a] -> ShowS
show :: Judgement a -> String
$cshow :: forall a. Show a => Judgement a -> String
showsPrec :: Int -> Judgement a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> Judgement a -> ShowS
Show, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (Judgement a) x -> Judgement a
forall a x. Judgement a -> Rep (Judgement a) x
$cto :: forall a x. Rep (Judgement a) x -> Judgement a
$cfrom :: forall a x. Judgement a -> Rep (Judgement a) x
Generic)
instance Pretty a => Pretty (Judgement a) where
pretty :: Judgement a -> Doc
pretty (HasType a
a Comparison
cmp Type
t) = forall (t :: * -> *). Foldable t => t Doc -> Doc
hsep [ forall a. Pretty a => a -> Doc
pretty a
a, Doc
":" , forall a. Pretty a => a -> Doc
pretty Type
t ]
pretty (IsSort a
a Type
t) = forall (t :: * -> *). Foldable t => t Doc -> Doc
hsep [ forall a. Pretty a => a -> Doc
pretty a
a, Doc
":sort", forall a. Pretty a => a -> Doc
pretty Type
t ]
data DoGeneralize
= YesGeneralizeVar
| YesGeneralizeMeta
| NoGeneralize
deriving (DoGeneralize -> DoGeneralize -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DoGeneralize -> DoGeneralize -> Bool
$c/= :: DoGeneralize -> DoGeneralize -> Bool
== :: DoGeneralize -> DoGeneralize -> Bool
$c== :: DoGeneralize -> DoGeneralize -> Bool
Eq, Eq DoGeneralize
DoGeneralize -> DoGeneralize -> Bool
DoGeneralize -> DoGeneralize -> Ordering
DoGeneralize -> DoGeneralize -> DoGeneralize
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 :: DoGeneralize -> DoGeneralize -> DoGeneralize
$cmin :: DoGeneralize -> DoGeneralize -> DoGeneralize
max :: DoGeneralize -> DoGeneralize -> DoGeneralize
$cmax :: DoGeneralize -> DoGeneralize -> DoGeneralize
>= :: DoGeneralize -> DoGeneralize -> Bool
$c>= :: DoGeneralize -> DoGeneralize -> Bool
> :: DoGeneralize -> DoGeneralize -> Bool
$c> :: DoGeneralize -> DoGeneralize -> Bool
<= :: DoGeneralize -> DoGeneralize -> Bool
$c<= :: DoGeneralize -> DoGeneralize -> Bool
< :: DoGeneralize -> DoGeneralize -> Bool
$c< :: DoGeneralize -> DoGeneralize -> Bool
compare :: DoGeneralize -> DoGeneralize -> Ordering
$ccompare :: DoGeneralize -> DoGeneralize -> Ordering
Ord, Int -> DoGeneralize -> ShowS
[DoGeneralize] -> ShowS
DoGeneralize -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DoGeneralize] -> ShowS
$cshowList :: [DoGeneralize] -> ShowS
show :: DoGeneralize -> String
$cshow :: DoGeneralize -> String
showsPrec :: Int -> DoGeneralize -> ShowS
$cshowsPrec :: Int -> DoGeneralize -> ShowS
Show, forall x. Rep DoGeneralize x -> DoGeneralize
forall x. DoGeneralize -> Rep DoGeneralize x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DoGeneralize x -> DoGeneralize
$cfrom :: forall x. DoGeneralize -> Rep DoGeneralize x
Generic)
data GeneralizedValue = GeneralizedValue
{ GeneralizedValue -> CheckpointId
genvalCheckpoint :: CheckpointId
, GeneralizedValue -> Term
genvalTerm :: Term
, GeneralizedValue -> Type
genvalType :: Type
} deriving (Int -> GeneralizedValue -> ShowS
[GeneralizedValue] -> ShowS
GeneralizedValue -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GeneralizedValue] -> ShowS
$cshowList :: [GeneralizedValue] -> ShowS
show :: GeneralizedValue -> String
$cshow :: GeneralizedValue -> String
showsPrec :: Int -> GeneralizedValue -> ShowS
$cshowsPrec :: Int -> GeneralizedValue -> ShowS
Show, forall x. Rep GeneralizedValue x -> GeneralizedValue
forall x. GeneralizedValue -> Rep GeneralizedValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GeneralizedValue x -> GeneralizedValue
$cfrom :: forall x. GeneralizedValue -> Rep GeneralizedValue x
Generic)
data MetaVariable =
MetaVar { MetaVariable -> MetaInfo
mvInfo :: MetaInfo
, MetaVariable -> MetaPriority
mvPriority :: MetaPriority
, MetaVariable -> Permutation
mvPermutation :: Permutation
, MetaVariable -> Judgement MetaId
mvJudgement :: Judgement MetaId
, MetaVariable -> MetaInstantiation
mvInstantiation :: MetaInstantiation
, MetaVariable -> Set Listener
mvListeners :: Set Listener
, MetaVariable -> Frozen
mvFrozen :: Frozen
, MetaVariable -> Maybe MetaId
mvTwin :: Maybe MetaId
}
deriving forall x. Rep MetaVariable x -> MetaVariable
forall x. MetaVariable -> Rep MetaVariable x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MetaVariable x -> MetaVariable
$cfrom :: forall x. MetaVariable -> Rep MetaVariable x
Generic
data Listener = EtaExpand MetaId
| CheckConstraint Nat ProblemConstraint
deriving forall x. Rep Listener x -> Listener
forall x. Listener -> Rep Listener x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Listener x -> Listener
$cfrom :: forall x. Listener -> Rep Listener x
Generic
instance Eq Listener where
EtaExpand MetaId
x == :: Listener -> Listener -> Bool
== EtaExpand MetaId
y = MetaId
x forall a. Eq a => a -> a -> Bool
== MetaId
y
CheckConstraint Int
x ProblemConstraint
_ == CheckConstraint Int
y ProblemConstraint
_ = Int
x forall a. Eq a => a -> a -> Bool
== Int
y
Listener
_ == Listener
_ = Bool
False
instance Ord Listener where
EtaExpand MetaId
x compare :: Listener -> Listener -> Ordering
`compare` EtaExpand MetaId
y = MetaId
x forall a. Ord a => a -> a -> Ordering
`compare` MetaId
y
CheckConstraint Int
x ProblemConstraint
_ `compare` CheckConstraint Int
y ProblemConstraint
_ = Int
x forall a. Ord a => a -> a -> Ordering
`compare` Int
y
EtaExpand{} `compare` CheckConstraint{} = Ordering
LT
CheckConstraint{} `compare` EtaExpand{} = Ordering
GT
data Frozen
= Frozen
| Instantiable
deriving (Frozen -> Frozen -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Frozen -> Frozen -> Bool
$c/= :: Frozen -> Frozen -> Bool
== :: Frozen -> Frozen -> Bool
$c== :: Frozen -> Frozen -> Bool
Eq, Int -> Frozen -> ShowS
[Frozen] -> ShowS
Frozen -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Frozen] -> ShowS
$cshowList :: [Frozen] -> ShowS
show :: Frozen -> String
$cshow :: Frozen -> String
showsPrec :: Int -> Frozen -> ShowS
$cshowsPrec :: Int -> Frozen -> ShowS
Show, forall x. Rep Frozen x -> Frozen
forall x. Frozen -> Rep Frozen x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Frozen x -> Frozen
$cfrom :: forall x. Frozen -> Rep Frozen x
Generic)
data MetaInstantiation
= InstV Instantiation
| Open
| OpenInstance
| BlockedConst Term
| PostponedTypeCheckingProblem (Closure TypeCheckingProblem)
deriving forall x. Rep MetaInstantiation x -> MetaInstantiation
forall x. MetaInstantiation -> Rep MetaInstantiation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MetaInstantiation x -> MetaInstantiation
$cfrom :: forall x. MetaInstantiation -> Rep MetaInstantiation x
Generic
data Instantiation = Instantiation
{ Instantiation -> [Arg String]
instTel :: [Arg String]
, Instantiation -> Term
instBody :: Term
}
deriving (Int -> Instantiation -> ShowS
[Instantiation] -> ShowS
Instantiation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Instantiation] -> ShowS
$cshowList :: [Instantiation] -> ShowS
show :: Instantiation -> String
$cshow :: Instantiation -> String
showsPrec :: Int -> Instantiation -> ShowS
$cshowsPrec :: Int -> Instantiation -> ShowS
Show, forall x. Rep Instantiation x -> Instantiation
forall x. Instantiation -> Rep Instantiation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Instantiation x -> Instantiation
$cfrom :: forall x. Instantiation -> Rep Instantiation x
Generic)
data RemoteMetaVariable = RemoteMetaVariable
{ RemoteMetaVariable -> Instantiation
rmvInstantiation :: Instantiation
, RemoteMetaVariable -> Modality
rmvModality :: Modality
, RemoteMetaVariable -> Judgement MetaId
rmvJudgement :: Judgement MetaId
}
deriving (Int -> RemoteMetaVariable -> ShowS
[RemoteMetaVariable] -> ShowS
RemoteMetaVariable -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RemoteMetaVariable] -> ShowS
$cshowList :: [RemoteMetaVariable] -> ShowS
show :: RemoteMetaVariable -> String
$cshow :: RemoteMetaVariable -> String
showsPrec :: Int -> RemoteMetaVariable -> ShowS
$cshowsPrec :: Int -> RemoteMetaVariable -> ShowS
Show, forall x. Rep RemoteMetaVariable x -> RemoteMetaVariable
forall x. RemoteMetaVariable -> Rep RemoteMetaVariable x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RemoteMetaVariable x -> RemoteMetaVariable
$cfrom :: forall x. RemoteMetaVariable -> Rep RemoteMetaVariable x
Generic)
data CheckedTarget = CheckedTarget (Maybe ProblemId)
| NotCheckedTarget
data PrincipalArgTypeMetas = PrincipalArgTypeMetas
{ PrincipalArgTypeMetas -> [Arg Term]
patmMetas :: Args
, PrincipalArgTypeMetas -> Type
patmRemainder :: Type
}
deriving forall x. Rep PrincipalArgTypeMetas x -> PrincipalArgTypeMetas
forall x. PrincipalArgTypeMetas -> Rep PrincipalArgTypeMetas x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PrincipalArgTypeMetas x -> PrincipalArgTypeMetas
$cfrom :: forall x. PrincipalArgTypeMetas -> Rep PrincipalArgTypeMetas x
Generic
data TypeCheckingProblem
= CheckExpr Comparison A.Expr Type
| CheckArgs Comparison ExpandHidden Range [NamedArg A.Expr] Type Type (ArgsCheckState CheckedTarget -> TCM Term)
| CheckProjAppToKnownPrincipalArg Comparison A.Expr ProjOrigin (List1 QName) A.Args Type Int Term Type PrincipalArgTypeMetas
| CheckLambda Comparison (Arg (List1 (WithHiding Name), Maybe Type)) A.Expr Type
| DoQuoteTerm Comparison Term Type
deriving forall x. Rep TypeCheckingProblem x -> TypeCheckingProblem
forall x. TypeCheckingProblem -> Rep TypeCheckingProblem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TypeCheckingProblem x -> TypeCheckingProblem
$cfrom :: forall x. TypeCheckingProblem -> Rep TypeCheckingProblem x
Generic
instance Pretty MetaInstantiation where
pretty :: MetaInstantiation -> Doc
pretty = \case
MetaInstantiation
Open -> Doc
"Open"
MetaInstantiation
OpenInstance -> Doc
"OpenInstance"
PostponedTypeCheckingProblem{} -> Doc
"PostponedTypeCheckingProblem (...)"
BlockedConst Term
t -> forall (t :: * -> *). Foldable t => t Doc -> Doc
hsep [ Doc
"BlockedConst", Doc -> Doc
parens (forall a. Pretty a => a -> Doc
pretty Term
t) ]
InstV Instantiation{ [Arg String]
instTel :: [Arg String]
instTel :: Instantiation -> [Arg String]
instTel, Term
instBody :: Term
instBody :: Instantiation -> Term
instBody } -> forall (t :: * -> *). Foldable t => t Doc -> Doc
hsep [ Doc
"InstV", forall a. Pretty a => a -> Doc
pretty [Arg String]
instTel, Doc -> Doc
parens (forall a. Pretty a => a -> Doc
pretty Term
instBody) ]
newtype MetaPriority = MetaPriority Int
deriving (MetaPriority -> MetaPriority -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MetaPriority -> MetaPriority -> Bool
$c/= :: MetaPriority -> MetaPriority -> Bool
== :: MetaPriority -> MetaPriority -> Bool
$c== :: MetaPriority -> MetaPriority -> Bool
Eq, Eq MetaPriority
MetaPriority -> MetaPriority -> Bool
MetaPriority -> MetaPriority -> Ordering
MetaPriority -> MetaPriority -> MetaPriority
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 :: MetaPriority -> MetaPriority -> MetaPriority
$cmin :: MetaPriority -> MetaPriority -> MetaPriority
max :: MetaPriority -> MetaPriority -> MetaPriority
$cmax :: MetaPriority -> MetaPriority -> MetaPriority
>= :: MetaPriority -> MetaPriority -> Bool
$c>= :: MetaPriority -> MetaPriority -> Bool
> :: MetaPriority -> MetaPriority -> Bool
$c> :: MetaPriority -> MetaPriority -> Bool
<= :: MetaPriority -> MetaPriority -> Bool
$c<= :: MetaPriority -> MetaPriority -> Bool
< :: MetaPriority -> MetaPriority -> Bool
$c< :: MetaPriority -> MetaPriority -> Bool
compare :: MetaPriority -> MetaPriority -> Ordering
$ccompare :: MetaPriority -> MetaPriority -> Ordering
Ord, Int -> MetaPriority -> ShowS
[MetaPriority] -> ShowS
MetaPriority -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MetaPriority] -> ShowS
$cshowList :: [MetaPriority] -> ShowS
show :: MetaPriority -> String
$cshow :: MetaPriority -> String
showsPrec :: Int -> MetaPriority -> ShowS
$cshowsPrec :: Int -> MetaPriority -> ShowS
Show, MetaPriority -> ()
forall a. (a -> ()) -> NFData a
rnf :: MetaPriority -> ()
$crnf :: MetaPriority -> ()
NFData)
data RunMetaOccursCheck
= RunMetaOccursCheck
| DontRunMetaOccursCheck
deriving (RunMetaOccursCheck -> RunMetaOccursCheck -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RunMetaOccursCheck -> RunMetaOccursCheck -> Bool
$c/= :: RunMetaOccursCheck -> RunMetaOccursCheck -> Bool
== :: RunMetaOccursCheck -> RunMetaOccursCheck -> Bool
$c== :: RunMetaOccursCheck -> RunMetaOccursCheck -> Bool
Eq, Eq RunMetaOccursCheck
RunMetaOccursCheck -> RunMetaOccursCheck -> Bool
RunMetaOccursCheck -> RunMetaOccursCheck -> Ordering
RunMetaOccursCheck -> RunMetaOccursCheck -> RunMetaOccursCheck
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 :: RunMetaOccursCheck -> RunMetaOccursCheck -> RunMetaOccursCheck
$cmin :: RunMetaOccursCheck -> RunMetaOccursCheck -> RunMetaOccursCheck
max :: RunMetaOccursCheck -> RunMetaOccursCheck -> RunMetaOccursCheck
$cmax :: RunMetaOccursCheck -> RunMetaOccursCheck -> RunMetaOccursCheck
>= :: RunMetaOccursCheck -> RunMetaOccursCheck -> Bool
$c>= :: RunMetaOccursCheck -> RunMetaOccursCheck -> Bool
> :: RunMetaOccursCheck -> RunMetaOccursCheck -> Bool
$c> :: RunMetaOccursCheck -> RunMetaOccursCheck -> Bool
<= :: RunMetaOccursCheck -> RunMetaOccursCheck -> Bool
$c<= :: RunMetaOccursCheck -> RunMetaOccursCheck -> Bool
< :: RunMetaOccursCheck -> RunMetaOccursCheck -> Bool
$c< :: RunMetaOccursCheck -> RunMetaOccursCheck -> Bool
compare :: RunMetaOccursCheck -> RunMetaOccursCheck -> Ordering
$ccompare :: RunMetaOccursCheck -> RunMetaOccursCheck -> Ordering
Ord, Int -> RunMetaOccursCheck -> ShowS
[RunMetaOccursCheck] -> ShowS
RunMetaOccursCheck -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RunMetaOccursCheck] -> ShowS
$cshowList :: [RunMetaOccursCheck] -> ShowS
show :: RunMetaOccursCheck -> String
$cshow :: RunMetaOccursCheck -> String
showsPrec :: Int -> RunMetaOccursCheck -> ShowS
$cshowsPrec :: Int -> RunMetaOccursCheck -> ShowS
Show, forall x. Rep RunMetaOccursCheck x -> RunMetaOccursCheck
forall x. RunMetaOccursCheck -> Rep RunMetaOccursCheck x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RunMetaOccursCheck x -> RunMetaOccursCheck
$cfrom :: forall x. RunMetaOccursCheck -> Rep RunMetaOccursCheck x
Generic)
data MetaInfo = MetaInfo
{ MetaInfo -> Closure Range
miClosRange :: Closure Range
, MetaInfo -> Modality
miModality :: Modality
, MetaInfo -> RunMetaOccursCheck
miMetaOccursCheck :: RunMetaOccursCheck
, MetaInfo -> String
miNameSuggestion :: MetaNameSuggestion
, MetaInfo -> Arg DoGeneralize
miGeneralizable :: Arg DoGeneralize
}
deriving forall x. Rep MetaInfo x -> MetaInfo
forall x. MetaInfo -> Rep MetaInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MetaInfo x -> MetaInfo
$cfrom :: forall x. MetaInfo -> Rep MetaInfo x
Generic
instance LensModality MetaInfo where
getModality :: MetaInfo -> Modality
getModality = MetaInfo -> Modality
miModality
setModality :: Modality -> MetaInfo -> MetaInfo
setModality Modality
mod MetaInfo
mi = MetaInfo
mi { miModality :: Modality
miModality = Modality
mod }
mapModality :: (Modality -> Modality) -> MetaInfo -> MetaInfo
mapModality Modality -> Modality
f MetaInfo
mi = MetaInfo
mi { miModality :: Modality
miModality = Modality -> Modality
f forall a b. (a -> b) -> a -> b
$ MetaInfo -> Modality
miModality MetaInfo
mi }
instance LensQuantity MetaInfo where
getQuantity :: MetaInfo -> Quantity
getQuantity = forall a. LensQuantity a => a -> Quantity
getQuantity forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. LensModality a => a -> Modality
getModality
mapQuantity :: (Quantity -> Quantity) -> MetaInfo -> MetaInfo
mapQuantity Quantity -> Quantity
f = forall a. LensModality a => (Modality -> Modality) -> a -> a
mapModality (forall a. LensQuantity a => (Quantity -> Quantity) -> a -> a
mapQuantity Quantity -> Quantity
f)
instance LensRelevance MetaInfo where
mapRelevance :: (Relevance -> Relevance) -> MetaInfo -> MetaInfo
mapRelevance Relevance -> Relevance
f = forall a. LensModality a => (Modality -> Modality) -> a -> a
mapModality (forall a. LensRelevance a => (Relevance -> Relevance) -> a -> a
mapRelevance Relevance -> Relevance
f)
type MetaNameSuggestion = String
data NamedMeta = NamedMeta
{ NamedMeta -> String
nmSuggestion :: MetaNameSuggestion
, NamedMeta -> MetaId
nmid :: MetaId
}
instance Pretty NamedMeta where
pretty :: NamedMeta -> Doc
pretty (NamedMeta String
"" MetaId
x) = forall a. Pretty a => a -> Doc
pretty MetaId
x
pretty (NamedMeta String
"_" MetaId
x) = forall a. Pretty a => a -> Doc
pretty MetaId
x
pretty (NamedMeta String
s MetaId
x) = String -> Doc
text forall a b. (a -> b) -> a -> b
$ String
"_" forall a. [a] -> [a] -> [a]
++ String
s forall a. [a] -> [a] -> [a]
++ forall a. Pretty a => a -> String
prettyShow MetaId
x
type LocalMetaStore = Map MetaId MetaVariable
type RemoteMetaStore = HashMap MetaId RemoteMetaVariable
instance HasRange MetaInfo where
getRange :: MetaInfo -> Range
getRange = forall a. Closure a -> a
clValue forall b c a. (b -> c) -> (a -> b) -> a -> c
. MetaInfo -> Closure Range
miClosRange
instance HasRange MetaVariable where
getRange :: MetaVariable -> Range
getRange MetaVariable
m = forall a. HasRange a => a -> Range
getRange forall a b. (a -> b) -> a -> b
$ MetaVariable -> Closure Range
getMetaInfo MetaVariable
m
instance SetRange MetaInfo where
setRange :: Range -> MetaInfo -> MetaInfo
setRange Range
r MetaInfo
m = MetaInfo
m { miClosRange :: Closure Range
miClosRange = (MetaInfo -> Closure Range
miClosRange MetaInfo
m) { clValue :: Range
clValue = Range
r }}
instance SetRange MetaVariable where
setRange :: Range -> MetaVariable -> MetaVariable
setRange Range
r MetaVariable
m = MetaVariable
m { mvInfo :: MetaInfo
mvInfo = forall a. SetRange a => Range -> a -> a
setRange Range
r (MetaVariable -> MetaInfo
mvInfo MetaVariable
m) }
instance LensModality MetaVariable where
getModality :: MetaVariable -> Modality
getModality = forall a. LensModality a => a -> Modality
getModality forall b c a. (b -> c) -> (a -> b) -> a -> c
. MetaVariable -> MetaInfo
mvInfo
setModality :: Modality -> MetaVariable -> MetaVariable
setModality Modality
mod MetaVariable
mv = MetaVariable
mv { mvInfo :: MetaInfo
mvInfo = forall a. LensModality a => Modality -> a -> a
setModality Modality
mod forall a b. (a -> b) -> a -> b
$ MetaVariable -> MetaInfo
mvInfo MetaVariable
mv }
mapModality :: (Modality -> Modality) -> MetaVariable -> MetaVariable
mapModality Modality -> Modality
f MetaVariable
mv = MetaVariable
mv { mvInfo :: MetaInfo
mvInfo = forall a. LensModality a => (Modality -> Modality) -> a -> a
mapModality Modality -> Modality
f forall a b. (a -> b) -> a -> b
$ MetaVariable -> MetaInfo
mvInfo MetaVariable
mv }
instance LensRelevance MetaVariable where
setRelevance :: Relevance -> MetaVariable -> MetaVariable
setRelevance Relevance
mod MetaVariable
mv = MetaVariable
mv { mvInfo :: MetaInfo
mvInfo = forall a. LensRelevance a => Relevance -> a -> a
setRelevance Relevance
mod forall a b. (a -> b) -> a -> b
$ MetaVariable -> MetaInfo
mvInfo MetaVariable
mv }
instance LensQuantity MetaVariable where
getQuantity :: MetaVariable -> Quantity
getQuantity = forall a. LensQuantity a => a -> Quantity
getQuantity forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. LensModality a => a -> Modality
getModality
mapQuantity :: (Quantity -> Quantity) -> MetaVariable -> MetaVariable
mapQuantity Quantity -> Quantity
f = forall a. LensModality a => (Modality -> Modality) -> a -> a
mapModality (forall a. LensQuantity a => (Quantity -> Quantity) -> a -> a
mapQuantity Quantity -> Quantity
f)
instance LensModality RemoteMetaVariable where
getModality :: RemoteMetaVariable -> Modality
getModality = RemoteMetaVariable -> Modality
rmvModality
mapModality :: (Modality -> Modality) -> RemoteMetaVariable -> RemoteMetaVariable
mapModality Modality -> Modality
f RemoteMetaVariable
mv = RemoteMetaVariable
mv { rmvModality :: Modality
rmvModality = Modality -> Modality
f forall a b. (a -> b) -> a -> b
$ RemoteMetaVariable -> Modality
rmvModality RemoteMetaVariable
mv }
instance LensRelevance RemoteMetaVariable where
mapRelevance :: (Relevance -> Relevance)
-> RemoteMetaVariable -> RemoteMetaVariable
mapRelevance Relevance -> Relevance
f = forall a. LensModality a => (Modality -> Modality) -> a -> a
mapModality (forall a. LensRelevance a => (Relevance -> Relevance) -> a -> a
mapRelevance Relevance -> Relevance
f)
instance LensQuantity RemoteMetaVariable where
mapQuantity :: (Quantity -> Quantity) -> RemoteMetaVariable -> RemoteMetaVariable
mapQuantity Quantity -> Quantity
f = forall a. LensModality a => (Modality -> Modality) -> a -> a
mapModality (forall a. LensQuantity a => (Quantity -> Quantity) -> a -> a
mapQuantity Quantity -> Quantity
f)
normalMetaPriority :: MetaPriority
normalMetaPriority :: MetaPriority
normalMetaPriority = Int -> MetaPriority
MetaPriority Int
0
lowMetaPriority :: MetaPriority
lowMetaPriority :: MetaPriority
lowMetaPriority = Int -> MetaPriority
MetaPriority (-Int
10)
highMetaPriority :: MetaPriority
highMetaPriority :: MetaPriority
highMetaPriority = Int -> MetaPriority
MetaPriority Int
10
getMetaInfo :: MetaVariable -> Closure Range
getMetaInfo :: MetaVariable -> Closure Range
getMetaInfo = MetaInfo -> Closure Range
miClosRange forall b c a. (b -> c) -> (a -> b) -> a -> c
. MetaVariable -> MetaInfo
mvInfo
getMetaScope :: MetaVariable -> ScopeInfo
getMetaScope :: MetaVariable -> ScopeInfo
getMetaScope MetaVariable
m = forall a. Closure a -> ScopeInfo
clScope forall a b. (a -> b) -> a -> b
$ MetaVariable -> Closure Range
getMetaInfo MetaVariable
m
getMetaEnv :: MetaVariable -> TCEnv
getMetaEnv :: MetaVariable -> TCEnv
getMetaEnv MetaVariable
m = forall a. Closure a -> TCEnv
clEnv forall a b. (a -> b) -> a -> b
$ MetaVariable -> Closure Range
getMetaInfo MetaVariable
m
getMetaSig :: MetaVariable -> Signature
getMetaSig :: MetaVariable -> Signature
getMetaSig MetaVariable
m = forall a. Closure a -> Signature
clSignature forall a b. (a -> b) -> a -> b
$ MetaVariable -> Closure Range
getMetaInfo MetaVariable
m
metaFrozen :: Lens' Frozen MetaVariable
metaFrozen :: Lens' Frozen MetaVariable
metaFrozen Frozen -> f Frozen
f MetaVariable
mv = Frozen -> f Frozen
f (MetaVariable -> Frozen
mvFrozen MetaVariable
mv) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Frozen
x -> MetaVariable
mv { mvFrozen :: Frozen
mvFrozen = Frozen
x }
_mvInfo :: Lens' MetaInfo MetaVariable
_mvInfo :: Lens' MetaInfo MetaVariable
_mvInfo MetaInfo -> f MetaInfo
f MetaVariable
mv = (MetaInfo -> f MetaInfo
f forall a b. (a -> b) -> a -> b
$! MetaVariable -> MetaInfo
mvInfo MetaVariable
mv) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ MetaInfo
mi -> MetaVariable
mv { mvInfo :: MetaInfo
mvInfo = MetaInfo
mi }
instance LensClosure Range MetaInfo where
lensClosure :: Lens' (Closure Range) MetaInfo
lensClosure Closure Range -> f (Closure Range)
f MetaInfo
mi = (Closure Range -> f (Closure Range)
f forall a b. (a -> b) -> a -> b
$! MetaInfo -> Closure Range
miClosRange MetaInfo
mi) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Closure Range
cl -> MetaInfo
mi { miClosRange :: Closure Range
miClosRange = Closure Range
cl }
instance LensClosure Range MetaVariable where
lensClosure :: Lens' (Closure Range) MetaVariable
lensClosure = Lens' MetaInfo MetaVariable
_mvInfo forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. LensClosure a b => Lens' (Closure a) b
lensClosure
instance LensIsAbstract TCEnv where
lensIsAbstract :: Lens' IsAbstract TCEnv
lensIsAbstract IsAbstract -> f IsAbstract
f TCEnv
env =
(IsAbstract -> f IsAbstract
f forall a b. (a -> b) -> a -> b
$! forall a. a -> Maybe a -> a
fromMaybe forall a. HasCallStack => a
__IMPOSSIBLE__ (AbstractMode -> Maybe IsAbstract
aModeToDef forall a b. (a -> b) -> a -> b
$ TCEnv -> AbstractMode
envAbstractMode TCEnv
env))
forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ IsAbstract
a -> TCEnv
env { envAbstractMode :: AbstractMode
envAbstractMode = IsAbstract -> AbstractMode
aDefToMode IsAbstract
a }
instance LensIsAbstract (Closure a) where
lensIsAbstract :: Lens' IsAbstract (Closure a)
lensIsAbstract = forall a. LensTCEnv a => Lens' TCEnv a
lensTCEnv forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. LensIsAbstract a => Lens' IsAbstract a
lensIsAbstract
instance LensIsAbstract MetaInfo where
lensIsAbstract :: Lens' IsAbstract MetaInfo
lensIsAbstract = forall a b. LensClosure a b => Lens' (Closure a) b
lensClosure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. LensIsAbstract a => Lens' IsAbstract a
lensIsAbstract
data InteractionPoint = InteractionPoint
{ InteractionPoint -> Range
ipRange :: Range
, InteractionPoint -> Maybe MetaId
ipMeta :: Maybe MetaId
, InteractionPoint -> Bool
ipSolved:: Bool
, InteractionPoint -> IPClause
ipClause:: IPClause
}
deriving forall x. Rep InteractionPoint x -> InteractionPoint
forall x. InteractionPoint -> Rep InteractionPoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InteractionPoint x -> InteractionPoint
$cfrom :: forall x. InteractionPoint -> Rep InteractionPoint x
Generic
instance Eq InteractionPoint where == :: InteractionPoint -> InteractionPoint -> Bool
(==) = forall a. Eq a => a -> a -> Bool
(==) forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
`on` InteractionPoint -> Maybe MetaId
ipMeta
instance HasTag InteractionPoint where
type Tag InteractionPoint = MetaId
tag :: InteractionPoint -> Maybe (Tag InteractionPoint)
tag = InteractionPoint -> Maybe MetaId
ipMeta
type InteractionPoints = BiMap InteractionId InteractionPoint
data Overapplied = Overapplied | NotOverapplied
deriving (Overapplied -> Overapplied -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Overapplied -> Overapplied -> Bool
$c/= :: Overapplied -> Overapplied -> Bool
== :: Overapplied -> Overapplied -> Bool
$c== :: Overapplied -> Overapplied -> Bool
Eq, Int -> Overapplied -> ShowS
[Overapplied] -> ShowS
Overapplied -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Overapplied] -> ShowS
$cshowList :: [Overapplied] -> ShowS
show :: Overapplied -> String
$cshow :: Overapplied -> String
showsPrec :: Int -> Overapplied -> ShowS
$cshowsPrec :: Int -> Overapplied -> ShowS
Show, forall x. Rep Overapplied x -> Overapplied
forall x. Overapplied -> Rep Overapplied x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Overapplied x -> Overapplied
$cfrom :: forall x. Overapplied -> Rep Overapplied x
Generic)
data IPBoundary' t = IPBoundary
{ forall t. IPBoundary' t -> [(t, t)]
ipbEquations :: [(t,t)]
, forall t. IPBoundary' t -> t
ipbValue :: t
, forall t. IPBoundary' t -> t
ipbMetaApp :: t
, forall t. IPBoundary' t -> Overapplied
ipbOverapplied :: Overapplied
}
deriving (Int -> IPBoundary' t -> ShowS
forall t. Show t => Int -> IPBoundary' t -> ShowS
forall t. Show t => [IPBoundary' t] -> ShowS
forall t. Show t => IPBoundary' t -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IPBoundary' t] -> ShowS
$cshowList :: forall t. Show t => [IPBoundary' t] -> ShowS
show :: IPBoundary' t -> String
$cshow :: forall t. Show t => IPBoundary' t -> String
showsPrec :: Int -> IPBoundary' t -> ShowS
$cshowsPrec :: forall t. Show t => Int -> IPBoundary' t -> ShowS
Show, forall a b. a -> IPBoundary' b -> IPBoundary' a
forall a b. (a -> b) -> IPBoundary' a -> IPBoundary' b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: forall a b. a -> IPBoundary' b -> IPBoundary' a
$c<$ :: forall a b. a -> IPBoundary' b -> IPBoundary' a
fmap :: forall a b. (a -> b) -> IPBoundary' a -> IPBoundary' b
$cfmap :: forall a b. (a -> b) -> IPBoundary' a -> IPBoundary' b
Functor, forall a. Eq a => a -> IPBoundary' a -> Bool
forall a. Num a => IPBoundary' a -> a
forall a. Ord a => IPBoundary' a -> a
forall m. Monoid m => IPBoundary' m -> m
forall a. IPBoundary' a -> Bool
forall a. IPBoundary' a -> Int
forall a. IPBoundary' a -> [a]
forall a. (a -> a -> a) -> IPBoundary' a -> a
forall m a. Monoid m => (a -> m) -> IPBoundary' a -> m
forall b a. (b -> a -> b) -> b -> IPBoundary' a -> b
forall a b. (a -> b -> b) -> b -> IPBoundary' a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: forall a. Num a => IPBoundary' a -> a
$cproduct :: forall a. Num a => IPBoundary' a -> a
sum :: forall a. Num a => IPBoundary' a -> a
$csum :: forall a. Num a => IPBoundary' a -> a
minimum :: forall a. Ord a => IPBoundary' a -> a
$cminimum :: forall a. Ord a => IPBoundary' a -> a
maximum :: forall a. Ord a => IPBoundary' a -> a
$cmaximum :: forall a. Ord a => IPBoundary' a -> a
elem :: forall a. Eq a => a -> IPBoundary' a -> Bool
$celem :: forall a. Eq a => a -> IPBoundary' a -> Bool
length :: forall a. IPBoundary' a -> Int
$clength :: forall a. IPBoundary' a -> Int
null :: forall a. IPBoundary' a -> Bool
$cnull :: forall a. IPBoundary' a -> Bool
toList :: forall a. IPBoundary' a -> [a]
$ctoList :: forall a. IPBoundary' a -> [a]
foldl1 :: forall a. (a -> a -> a) -> IPBoundary' a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> IPBoundary' a -> a
foldr1 :: forall a. (a -> a -> a) -> IPBoundary' a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> IPBoundary' a -> a
foldl' :: forall b a. (b -> a -> b) -> b -> IPBoundary' a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> IPBoundary' a -> b
foldl :: forall b a. (b -> a -> b) -> b -> IPBoundary' a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> IPBoundary' a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> IPBoundary' a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> IPBoundary' a -> b
foldr :: forall a b. (a -> b -> b) -> b -> IPBoundary' a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> IPBoundary' a -> b
foldMap' :: forall m a. Monoid m => (a -> m) -> IPBoundary' a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> IPBoundary' a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> IPBoundary' a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> IPBoundary' a -> m
fold :: forall m. Monoid m => IPBoundary' m -> m
$cfold :: forall m. Monoid m => IPBoundary' m -> m
Foldable, Functor IPBoundary'
Foldable IPBoundary'
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
IPBoundary' (m a) -> m (IPBoundary' a)
forall (f :: * -> *) a.
Applicative f =>
IPBoundary' (f a) -> f (IPBoundary' a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> IPBoundary' a -> m (IPBoundary' b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> IPBoundary' a -> f (IPBoundary' b)
sequence :: forall (m :: * -> *) a.
Monad m =>
IPBoundary' (m a) -> m (IPBoundary' a)
$csequence :: forall (m :: * -> *) a.
Monad m =>
IPBoundary' (m a) -> m (IPBoundary' a)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> IPBoundary' a -> m (IPBoundary' b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> IPBoundary' a -> m (IPBoundary' b)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
IPBoundary' (f a) -> f (IPBoundary' a)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
IPBoundary' (f a) -> f (IPBoundary' a)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> IPBoundary' a -> f (IPBoundary' b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> IPBoundary' a -> f (IPBoundary' b)
Traversable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall t x. Rep (IPBoundary' t) x -> IPBoundary' t
forall t x. IPBoundary' t -> Rep (IPBoundary' t) x
$cto :: forall t x. Rep (IPBoundary' t) x -> IPBoundary' t
$cfrom :: forall t x. IPBoundary' t -> Rep (IPBoundary' t) x
Generic)
type IPBoundary = IPBoundary' Term
data IPClause = IPClause
{ IPClause -> QName
ipcQName :: QName
, IPClause -> Int
ipcClauseNo :: Int
, IPClause -> Type
ipcType :: Type
, IPClause -> Maybe Substitution
ipcWithSub :: Maybe Substitution
, IPClause -> SpineClause
ipcClause :: A.SpineClause
, IPClause -> Closure ()
ipcClosure :: Closure ()
, IPClause -> [Closure IPBoundary]
ipcBoundary :: [Closure IPBoundary]
}
| IPNoClause
deriving (forall x. Rep IPClause x -> IPClause
forall x. IPClause -> Rep IPClause x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IPClause x -> IPClause
$cfrom :: forall x. IPClause -> Rep IPClause x
Generic)
instance Eq IPClause where
IPClause
IPNoClause == :: IPClause -> IPClause -> Bool
== IPClause
IPNoClause = Bool
True
IPClause QName
x Int
i Type
_ Maybe Substitution
_ SpineClause
_ Closure ()
_ [Closure IPBoundary]
_ == IPClause QName
x' Int
i' Type
_ Maybe Substitution
_ SpineClause
_ Closure ()
_ [Closure IPBoundary]
_ = QName
x forall a. Eq a => a -> a -> Bool
== QName
x' Bool -> Bool -> Bool
&& Int
i forall a. Eq a => a -> a -> Bool
== Int
i'
IPClause
_ == IPClause
_ = Bool
False
data Signature = Sig
{ Signature -> Sections
_sigSections :: Sections
, Signature -> Definitions
_sigDefinitions :: Definitions
, Signature -> RewriteRuleMap
_sigRewriteRules:: RewriteRuleMap
}
deriving (Int -> Signature -> ShowS
[Signature] -> ShowS
Signature -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Signature] -> ShowS
$cshowList :: [Signature] -> ShowS
show :: Signature -> String
$cshow :: Signature -> String
showsPrec :: Int -> Signature -> ShowS
$cshowsPrec :: Int -> Signature -> ShowS
Show, forall x. Rep Signature x -> Signature
forall x. Signature -> Rep Signature x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Signature x -> Signature
$cfrom :: forall x. Signature -> Rep Signature x
Generic)
sigSections :: Lens' Sections Signature
sigSections :: Lens' Sections Signature
sigSections Sections -> f Sections
f Signature
s =
Sections -> f Sections
f (Signature -> Sections
_sigSections Signature
s) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\Sections
x -> Signature
s {_sigSections :: Sections
_sigSections = Sections
x}
sigDefinitions :: Lens' Definitions Signature
sigDefinitions :: Lens' Definitions Signature
sigDefinitions Definitions -> f Definitions
f Signature
s =
Definitions -> f Definitions
f (Signature -> Definitions
_sigDefinitions Signature
s) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\Definitions
x -> Signature
s {_sigDefinitions :: Definitions
_sigDefinitions = Definitions
x}
sigRewriteRules :: Lens' RewriteRuleMap Signature
sigRewriteRules :: Lens' RewriteRuleMap Signature
sigRewriteRules RewriteRuleMap -> f RewriteRuleMap
f Signature
s =
RewriteRuleMap -> f RewriteRuleMap
f (Signature -> RewriteRuleMap
_sigRewriteRules Signature
s) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\RewriteRuleMap
x -> Signature
s {_sigRewriteRules :: RewriteRuleMap
_sigRewriteRules = RewriteRuleMap
x}
type Sections = Map ModuleName Section
type Definitions = HashMap QName Definition
type RewriteRuleMap = HashMap QName RewriteRules
type DisplayForms = HashMap QName [LocalDisplayForm]
newtype Section = Section { Section -> Telescope
_secTelescope :: Telescope }
deriving (Int -> Section -> ShowS
[Section] -> ShowS
Section -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Section] -> ShowS
$cshowList :: [Section] -> ShowS
show :: Section -> String
$cshow :: Section -> String
showsPrec :: Int -> Section -> ShowS
$cshowsPrec :: Int -> Section -> ShowS
Show, Section -> ()
forall a. (a -> ()) -> NFData a
rnf :: Section -> ()
$crnf :: Section -> ()
NFData)
instance Pretty Section where
pretty :: Section -> Doc
pretty = forall a. Pretty a => a -> Doc
pretty forall b c a. (b -> c) -> (a -> b) -> a -> c
. Section -> Telescope
_secTelescope
secTelescope :: Lens' Telescope Section
secTelescope :: Lens' Telescope Section
secTelescope Telescope -> f Telescope
f Section
s =
Telescope -> f Telescope
f (Section -> Telescope
_secTelescope Section
s) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\Telescope
x -> Section
s {_secTelescope :: Telescope
_secTelescope = Telescope
x}
emptySignature :: Signature
emptySignature :: Signature
emptySignature = Sections -> Definitions -> RewriteRuleMap -> Signature
Sig forall k a. Map k a
Map.empty forall k v. HashMap k v
HMap.empty forall k v. HashMap k v
HMap.empty
data DisplayForm = Display
{ DisplayForm -> Int
dfPatternVars :: Nat
, DisplayForm -> [Elim]
dfPats :: Elims
, DisplayForm -> DisplayTerm
dfRHS :: DisplayTerm
}
deriving (Int -> DisplayForm -> ShowS
[DisplayForm] -> ShowS
DisplayForm -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisplayForm] -> ShowS
$cshowList :: [DisplayForm] -> ShowS
show :: DisplayForm -> String
$cshow :: DisplayForm -> String
showsPrec :: Int -> DisplayForm -> ShowS
$cshowsPrec :: Int -> DisplayForm -> ShowS
Show, forall x. Rep DisplayForm x -> DisplayForm
forall x. DisplayForm -> Rep DisplayForm x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DisplayForm x -> DisplayForm
$cfrom :: forall x. DisplayForm -> Rep DisplayForm x
Generic)
type LocalDisplayForm = Open DisplayForm
data DisplayTerm
= DWithApp DisplayTerm [DisplayTerm] Elims
| DCon ConHead ConInfo [Arg DisplayTerm]
| DDef QName [Elim' DisplayTerm]
| DDot Term
| DTerm Term
deriving (Int -> DisplayTerm -> ShowS
[DisplayTerm] -> ShowS
DisplayTerm -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisplayTerm] -> ShowS
$cshowList :: [DisplayTerm] -> ShowS
show :: DisplayTerm -> String
$cshow :: DisplayTerm -> String
showsPrec :: Int -> DisplayTerm -> ShowS
$cshowsPrec :: Int -> DisplayTerm -> ShowS
Show, forall x. Rep DisplayTerm x -> DisplayTerm
forall x. DisplayTerm -> Rep DisplayTerm x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DisplayTerm x -> DisplayTerm
$cfrom :: forall x. DisplayTerm -> Rep DisplayTerm x
Generic)
instance Free DisplayForm where
freeVars' :: forall a c. IsVarSet a c => DisplayForm -> FreeM a c
freeVars' (Display Int
n [Elim]
ps DisplayTerm
t) = forall a b c (m :: * -> *) z.
MonadReader (FreeEnv' a b c) m =>
m z -> m z
underBinder (forall t a c. (Free t, IsVarSet a c) => t -> FreeM a c
freeVars' [Elim]
ps) forall a. Monoid a => a -> a -> a
`mappend` forall a b c (m :: * -> *) z.
MonadReader (FreeEnv' a b c) m =>
Int -> m z -> m z
underBinder' Int
n (forall t a c. (Free t, IsVarSet a c) => t -> FreeM a c
freeVars' DisplayTerm
t)
instance Free DisplayTerm where
freeVars' :: forall a c. IsVarSet a c => DisplayTerm -> FreeM a c
freeVars' (DWithApp DisplayTerm
t [DisplayTerm]
ws [Elim]
es) = forall t a c. (Free t, IsVarSet a c) => t -> FreeM a c
freeVars' (DisplayTerm
t, ([DisplayTerm]
ws, [Elim]
es))
freeVars' (DCon ConHead
_ ConInfo
_ [Arg DisplayTerm]
vs) = forall t a c. (Free t, IsVarSet a c) => t -> FreeM a c
freeVars' [Arg DisplayTerm]
vs
freeVars' (DDef QName
_ [Elim' DisplayTerm]
es) = forall t a c. (Free t, IsVarSet a c) => t -> FreeM a c
freeVars' [Elim' DisplayTerm]
es
freeVars' (DDot Term
v) = forall t a c. (Free t, IsVarSet a c) => t -> FreeM a c
freeVars' Term
v
freeVars' (DTerm Term
v) = forall t a c. (Free t, IsVarSet a c) => t -> FreeM a c
freeVars' Term
v
instance Pretty DisplayTerm where
prettyPrec :: Int -> DisplayTerm -> Doc
prettyPrec Int
p DisplayTerm
v =
case DisplayTerm
v of
DTerm Term
v -> forall a. Pretty a => Int -> a -> Doc
prettyPrec Int
p Term
v
DDot Term
v -> Doc
"." forall a. Semigroup a => a -> a -> a
<> forall a. Pretty a => Int -> a -> Doc
prettyPrec Int
10 Term
v
DDef QName
f [Elim' DisplayTerm]
es -> forall a. Pretty a => a -> Doc
pretty QName
f forall el. Pretty el => Doc -> [el] -> Doc
`pApp` [Elim' DisplayTerm]
es
DCon ConHead
c ConInfo
_ [Arg DisplayTerm]
vs -> forall a. Pretty a => a -> Doc
pretty (ConHead -> QName
conName ConHead
c) forall el. Pretty el => Doc -> [el] -> Doc
`pApp` forall a b. (a -> b) -> [a] -> [b]
map forall a. Arg a -> Elim' a
Apply [Arg DisplayTerm]
vs
DWithApp DisplayTerm
h [DisplayTerm]
ws [Elim]
es ->
Bool -> Doc -> Doc
mparens (Int
p forall a. Ord a => a -> a -> Bool
> Int
0)
(forall (t :: * -> *). Foldable t => t Doc -> Doc
sep [ forall a. Pretty a => a -> Doc
pretty DisplayTerm
h
, Int -> Doc -> Doc
nest Int
2 forall a b. (a -> b) -> a -> b
$ forall (t :: * -> *). Foldable t => t Doc -> Doc
fsep [ Doc
"|" Doc -> Doc -> Doc
<+> forall a. Pretty a => a -> Doc
pretty DisplayTerm
w | DisplayTerm
w <- [DisplayTerm]
ws ] ])
forall el. Pretty el => Doc -> [el] -> Doc
`pApp` [Elim]
es
where
pApp :: Pretty el => Doc -> [el] -> Doc
pApp :: forall el. Pretty el => Doc -> [el] -> Doc
pApp Doc
d [el]
els = Bool -> Doc -> Doc
mparens (Bool -> Bool
not (forall a. Null a => a -> Bool
null [el]
els) Bool -> Bool -> Bool
&& Int
p forall a. Ord a => a -> a -> Bool
> Int
9) forall a b. (a -> b) -> a -> b
$
forall (t :: * -> *). Foldable t => t Doc -> Doc
sep [Doc
d, Int -> Doc -> Doc
nest Int
2 forall a b. (a -> b) -> a -> b
$ forall (t :: * -> *). Foldable t => t Doc -> Doc
fsep (forall a b. (a -> b) -> [a] -> [b]
map (forall a. Pretty a => Int -> a -> Doc
prettyPrec Int
10) [el]
els)]
instance Pretty DisplayForm where
prettyPrec :: Int -> DisplayForm -> Doc
prettyPrec Int
p (Display Int
fv [Elim]
lhs DisplayTerm
rhs) = Bool -> Doc -> Doc
mparens (Int
p forall a. Ord a => a -> a -> Bool
> Int
9) forall a b. (a -> b) -> a -> b
$
Doc
"Display" Doc -> Doc -> Doc
<?> forall (t :: * -> *). Foldable t => t Doc -> Doc
fsep [ forall a. Show a => a -> Doc
pshow Int
fv, forall a. Pretty a => Int -> a -> Doc
prettyPrec Int
10 [Elim]
lhs, forall a. Pretty a => Int -> a -> Doc
prettyPrec Int
10 DisplayTerm
rhs ]
defaultDisplayForm :: QName -> [LocalDisplayForm]
defaultDisplayForm :: QName -> [LocalDisplayForm]
defaultDisplayForm QName
c = []
data NLPat
= PVar !Int [Arg Int]
| PDef QName PElims
| PLam ArgInfo (Abs NLPat)
| PPi (Dom NLPType) (Abs NLPType)
| PSort NLPSort
| PBoundVar {-# UNPACK #-} !Int PElims
| PTerm Term
deriving (Int -> NLPat -> ShowS
[NLPat] -> ShowS
NLPat -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NLPat] -> ShowS
$cshowList :: [NLPat] -> ShowS
show :: NLPat -> String
$cshow :: NLPat -> String
showsPrec :: Int -> NLPat -> ShowS
$cshowsPrec :: Int -> NLPat -> ShowS
Show, forall x. Rep NLPat x -> NLPat
forall x. NLPat -> Rep NLPat x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NLPat x -> NLPat
$cfrom :: forall x. NLPat -> Rep NLPat x
Generic)
type PElims = [Elim' NLPat]
instance TermLike NLPat where
traverseTermM :: forall (m :: * -> *).
Monad m =>
(Term -> m Term) -> NLPat -> m NLPat
traverseTermM Term -> m Term
f = \case
p :: NLPat
p@PVar{} -> forall (m :: * -> *) a. Monad m => a -> m a
return NLPat
p
PDef QName
d PElims
ps -> QName -> PElims -> NLPat
PDef QName
d forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a (m :: * -> *).
(TermLike a, Monad m) =>
(Term -> m Term) -> a -> m a
traverseTermM Term -> m Term
f PElims
ps
PLam ArgInfo
i Abs NLPat
p -> ArgInfo -> Abs NLPat -> NLPat
PLam ArgInfo
i forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a (m :: * -> *).
(TermLike a, Monad m) =>
(Term -> m Term) -> a -> m a
traverseTermM Term -> m Term
f Abs NLPat
p
PPi Dom NLPType
a Abs NLPType
b -> Dom NLPType -> Abs NLPType -> NLPat
PPi forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a (m :: * -> *).
(TermLike a, Monad m) =>
(Term -> m Term) -> a -> m a
traverseTermM Term -> m Term
f Dom NLPType
a forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> forall a (m :: * -> *).
(TermLike a, Monad m) =>
(Term -> m Term) -> a -> m a
traverseTermM Term -> m Term
f Abs NLPType
b
PSort NLPSort
s -> NLPSort -> NLPat
PSort forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a (m :: * -> *).
(TermLike a, Monad m) =>
(Term -> m Term) -> a -> m a
traverseTermM Term -> m Term
f NLPSort
s
PBoundVar Int
i PElims
ps -> Int -> PElims -> NLPat
PBoundVar Int
i forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a (m :: * -> *).
(TermLike a, Monad m) =>
(Term -> m Term) -> a -> m a
traverseTermM Term -> m Term
f PElims
ps
PTerm Term
t -> Term -> NLPat
PTerm forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Term -> m Term
f Term
t
foldTerm :: forall m. Monoid m => (Term -> m) -> NLPat -> m
foldTerm Term -> m
f NLPat
t = case NLPat
t of
PVar{} -> forall a. Monoid a => a
mempty
PDef QName
d PElims
ps -> forall a m. (TermLike a, Monoid m) => (Term -> m) -> a -> m
foldTerm Term -> m
f PElims
ps
PLam ArgInfo
i Abs NLPat
p -> forall a m. (TermLike a, Monoid m) => (Term -> m) -> a -> m
foldTerm Term -> m
f Abs NLPat
p
PPi Dom NLPType
a Abs NLPType
b -> forall a m. (TermLike a, Monoid m) => (Term -> m) -> a -> m
foldTerm Term -> m
f (Dom NLPType
a, Abs NLPType
b)
PSort NLPSort
s -> forall a m. (TermLike a, Monoid m) => (Term -> m) -> a -> m
foldTerm Term -> m
f NLPSort
s
PBoundVar Int
i PElims
ps -> forall a m. (TermLike a, Monoid m) => (Term -> m) -> a -> m
foldTerm Term -> m
f PElims
ps
PTerm Term
t -> forall a m. (TermLike a, Monoid m) => (Term -> m) -> a -> m
foldTerm Term -> m
f Term
t
instance AllMetas NLPat
data NLPType = NLPType
{ NLPType -> NLPSort
nlpTypeSort :: NLPSort
, NLPType -> NLPat
nlpTypeUnEl :: NLPat
} deriving (Int -> NLPType -> ShowS
[NLPType] -> ShowS
NLPType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NLPType] -> ShowS
$cshowList :: [NLPType] -> ShowS
show :: NLPType -> String
$cshow :: NLPType -> String
showsPrec :: Int -> NLPType -> ShowS
$cshowsPrec :: Int -> NLPType -> ShowS
Show, forall x. Rep NLPType x -> NLPType
forall x. NLPType -> Rep NLPType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NLPType x -> NLPType
$cfrom :: forall x. NLPType -> Rep NLPType x
Generic)
instance TermLike NLPType where
traverseTermM :: forall (m :: * -> *).
Monad m =>
(Term -> m Term) -> NLPType -> m NLPType
traverseTermM Term -> m Term
f (NLPType NLPSort
s NLPat
t) = NLPSort -> NLPat -> NLPType
NLPType forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a (m :: * -> *).
(TermLike a, Monad m) =>
(Term -> m Term) -> a -> m a
traverseTermM Term -> m Term
f NLPSort
s forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> forall a (m :: * -> *).
(TermLike a, Monad m) =>
(Term -> m Term) -> a -> m a
traverseTermM Term -> m Term
f NLPat
t
foldTerm :: forall m. Monoid m => (Term -> m) -> NLPType -> m
foldTerm Term -> m
f (NLPType NLPSort
s NLPat
t) = forall a m. (TermLike a, Monoid m) => (Term -> m) -> a -> m
foldTerm Term -> m
f (NLPSort
s, NLPat
t)
instance AllMetas NLPType
data NLPSort
= PType NLPat
| PProp NLPat
| PSSet NLPat
| PInf IsFibrant Integer
| PSizeUniv
| PLockUniv
| PIntervalUniv
deriving (Int -> NLPSort -> ShowS
[NLPSort] -> ShowS
NLPSort -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NLPSort] -> ShowS
$cshowList :: [NLPSort] -> ShowS
show :: NLPSort -> String
$cshow :: NLPSort -> String
showsPrec :: Int -> NLPSort -> ShowS
$cshowsPrec :: Int -> NLPSort -> ShowS
Show, forall x. Rep NLPSort x -> NLPSort
forall x. NLPSort -> Rep NLPSort x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NLPSort x -> NLPSort
$cfrom :: forall x. NLPSort -> Rep NLPSort x
Generic)
instance TermLike NLPSort where
traverseTermM :: forall (m :: * -> *).
Monad m =>
(Term -> m Term) -> NLPSort -> m NLPSort
traverseTermM Term -> m Term
f = \case
PType NLPat
p -> NLPat -> NLPSort
PType forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a (m :: * -> *).
(TermLike a, Monad m) =>
(Term -> m Term) -> a -> m a
traverseTermM Term -> m Term
f NLPat
p
PProp NLPat
p -> NLPat -> NLPSort
PProp forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a (m :: * -> *).
(TermLike a, Monad m) =>
(Term -> m Term) -> a -> m a
traverseTermM Term -> m Term
f NLPat
p
PSSet NLPat
p -> NLPat -> NLPSort
PSSet forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a (m :: * -> *).
(TermLike a, Monad m) =>
(Term -> m Term) -> a -> m a
traverseTermM Term -> m Term
f NLPat
p
s :: NLPSort
s@PInf{} -> forall (m :: * -> *) a. Monad m => a -> m a
return NLPSort
s
s :: NLPSort
s@PSizeUniv{} -> forall (m :: * -> *) a. Monad m => a -> m a
return NLPSort
s
s :: NLPSort
s@PLockUniv{} -> forall (m :: * -> *) a. Monad m => a -> m a
return NLPSort
s
s :: NLPSort
s@PIntervalUniv{} -> forall (m :: * -> *) a. Monad m => a -> m a
return NLPSort
s
foldTerm :: forall m. Monoid m => (Term -> m) -> NLPSort -> m
foldTerm Term -> m
f NLPSort
t = case NLPSort
t of
PType NLPat
p -> forall a m. (TermLike a, Monoid m) => (Term -> m) -> a -> m
foldTerm Term -> m
f NLPat
p
PProp NLPat
p -> forall a m. (TermLike a, Monoid m) => (Term -> m) -> a -> m
foldTerm Term -> m
f NLPat
p
PSSet NLPat
p -> forall a m. (TermLike a, Monoid m) => (Term -> m) -> a -> m
foldTerm Term -> m
f NLPat
p
s :: NLPSort
s@PInf{} -> forall a. Monoid a => a
mempty
s :: NLPSort
s@PSizeUniv{} -> forall a. Monoid a => a
mempty
s :: NLPSort
s@PLockUniv{} -> forall a. Monoid a => a
mempty
s :: NLPSort
s@PIntervalUniv{} -> forall a. Monoid a => a
mempty
instance AllMetas NLPSort
type RewriteRules = [RewriteRule]
data RewriteRule = RewriteRule
{ RewriteRule -> QName
rewName :: QName
, RewriteRule -> Telescope
rewContext :: Telescope
, RewriteRule -> QName
rewHead :: QName
, RewriteRule -> PElims
rewPats :: PElims
, RewriteRule -> Term
rewRHS :: Term
, RewriteRule -> Type
rewType :: Type
, RewriteRule -> Bool
rewFromClause :: Bool
}
deriving (Int -> RewriteRule -> ShowS
[RewriteRule] -> ShowS
RewriteRule -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RewriteRule] -> ShowS
$cshowList :: [RewriteRule] -> ShowS
show :: RewriteRule -> String
$cshow :: RewriteRule -> String
showsPrec :: Int -> RewriteRule -> ShowS
$cshowsPrec :: Int -> RewriteRule -> ShowS
Show, forall x. Rep RewriteRule x -> RewriteRule
forall x. RewriteRule -> Rep RewriteRule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RewriteRule x -> RewriteRule
$cfrom :: forall x. RewriteRule -> Rep RewriteRule x
Generic)
data Definition = Defn
{ Definition -> ArgInfo
defArgInfo :: ArgInfo
, Definition -> QName
defName :: QName
, Definition -> Type
defType :: Type
, Definition -> [Polarity]
defPolarity :: [Polarity]
, Definition -> [Occurrence]
defArgOccurrences :: [Occurrence]
, Definition -> NumGeneralizableArgs
defArgGeneralizable :: NumGeneralizableArgs
, Definition -> [Maybe Name]
defGeneralizedParams :: [Maybe Name]
, Definition -> [LocalDisplayForm]
defDisplay :: [LocalDisplayForm]
, Definition -> MutualId
defMutual :: MutualId
, Definition -> CompiledRepresentation
defCompiledRep :: CompiledRepresentation
, Definition -> Maybe QName
defInstance :: Maybe QName
, Definition -> Bool
defCopy :: Bool
, Definition -> Set QName
defMatchable :: Set QName
, Definition -> Bool
defNoCompilation :: Bool
, Definition -> Bool
defInjective :: Bool
, Definition -> Bool
defCopatternLHS :: Bool
, Definition -> Blocked_
defBlocked :: Blocked_
, Definition -> Language
defLanguage :: !Language
, Definition -> Defn
theDef :: Defn
}
deriving (Int -> Definition -> ShowS
[Definition] -> ShowS
Definition -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Definition] -> ShowS
$cshowList :: [Definition] -> ShowS
show :: Definition -> String
$cshow :: Definition -> String
showsPrec :: Int -> Definition -> ShowS
$cshowsPrec :: Int -> Definition -> ShowS
Show, forall x. Rep Definition x -> Definition
forall x. Definition -> Rep Definition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Definition x -> Definition
$cfrom :: forall x. Definition -> Rep Definition x
Generic)
instance LensArgInfo Definition where
getArgInfo :: Definition -> ArgInfo
getArgInfo = Definition -> ArgInfo
defArgInfo
mapArgInfo :: (ArgInfo -> ArgInfo) -> Definition -> Definition
mapArgInfo ArgInfo -> ArgInfo
f Definition
def = Definition
def { defArgInfo :: ArgInfo
defArgInfo = ArgInfo -> ArgInfo
f forall a b. (a -> b) -> a -> b
$ Definition -> ArgInfo
defArgInfo Definition
def }
instance LensModality Definition where
instance LensQuantity Definition where
instance LensRelevance Definition where
data NumGeneralizableArgs
= NoGeneralizableArgs
| SomeGeneralizableArgs !Int
deriving Int -> NumGeneralizableArgs -> ShowS
[NumGeneralizableArgs] -> ShowS
NumGeneralizableArgs -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NumGeneralizableArgs] -> ShowS
$cshowList :: [NumGeneralizableArgs] -> ShowS
show :: NumGeneralizableArgs -> String
$cshow :: NumGeneralizableArgs -> String
showsPrec :: Int -> NumGeneralizableArgs -> ShowS
$cshowsPrec :: Int -> NumGeneralizableArgs -> ShowS
Show
lensTheDef :: Lens' Defn Definition
lensTheDef :: Lens' Defn Definition
lensTheDef Defn -> f Defn
f Definition
d = Defn -> f Defn
f (Definition -> Defn
theDef Definition
d) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Defn
df -> Definition
d { theDef :: Defn
theDef = Defn
df }
defaultDefn ::
ArgInfo -> QName -> Type -> Language -> Defn -> Definition
defaultDefn :: ArgInfo -> QName -> Type -> Language -> Defn -> Definition
defaultDefn ArgInfo
info QName
x Type
t Language
lang Defn
def = Defn
{ defArgInfo :: ArgInfo
defArgInfo = ArgInfo
info
, defName :: QName
defName = QName
x
, defType :: Type
defType = Type
t
, defPolarity :: [Polarity]
defPolarity = []
, defArgOccurrences :: [Occurrence]
defArgOccurrences = []
, defArgGeneralizable :: NumGeneralizableArgs
defArgGeneralizable = NumGeneralizableArgs
NoGeneralizableArgs
, defGeneralizedParams :: [Maybe Name]
defGeneralizedParams = []
, defDisplay :: [LocalDisplayForm]
defDisplay = QName -> [LocalDisplayForm]
defaultDisplayForm QName
x
, defMutual :: MutualId
defMutual = MutualId
0
, defCompiledRep :: CompiledRepresentation
defCompiledRep = CompiledRepresentation
noCompiledRep
, defInstance :: Maybe QName
defInstance = forall a. Maybe a
Nothing
, defCopy :: Bool
defCopy = Bool
False
, defMatchable :: Set QName
defMatchable = forall a. Set a
Set.empty
, defNoCompilation :: Bool
defNoCompilation = Bool
False
, defInjective :: Bool
defInjective = Bool
False
, defCopatternLHS :: Bool
defCopatternLHS = Bool
False
, defBlocked :: Blocked_
defBlocked = forall t a. NotBlocked' t -> a -> Blocked' t a
NotBlocked forall t. NotBlocked' t
ReallyNotBlocked ()
, defLanguage :: Language
defLanguage = Language
lang
, theDef :: Defn
theDef = Defn
def
}
data Polarity
= Covariant
| Contravariant
| Invariant
| Nonvariant
deriving (Int -> Polarity -> ShowS
[Polarity] -> ShowS
Polarity -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Polarity] -> ShowS
$cshowList :: [Polarity] -> ShowS
show :: Polarity -> String
$cshow :: Polarity -> String
showsPrec :: Int -> Polarity -> ShowS
$cshowsPrec :: Int -> Polarity -> ShowS
Show, Polarity -> Polarity -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Polarity -> Polarity -> Bool
$c/= :: Polarity -> Polarity -> Bool
== :: Polarity -> Polarity -> Bool
$c== :: Polarity -> Polarity -> Bool
Eq, forall x. Rep Polarity x -> Polarity
forall x. Polarity -> Rep Polarity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Polarity x -> Polarity
$cfrom :: forall x. Polarity -> Rep Polarity x
Generic)
instance Pretty Polarity where
pretty :: Polarity -> Doc
pretty = String -> Doc
text forall b c a. (b -> c) -> (a -> b) -> a -> c
. \case
Polarity
Covariant -> String
"+"
Polarity
Contravariant -> String
"-"
Polarity
Invariant -> String
"*"
Polarity
Nonvariant -> String
"_"
data IsForced
= Forced
| NotForced
deriving (Int -> IsForced -> ShowS
[IsForced] -> ShowS
IsForced -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IsForced] -> ShowS
$cshowList :: [IsForced] -> ShowS
show :: IsForced -> String
$cshow :: IsForced -> String
showsPrec :: Int -> IsForced -> ShowS
$cshowsPrec :: Int -> IsForced -> ShowS
Show, IsForced -> IsForced -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IsForced -> IsForced -> Bool
$c/= :: IsForced -> IsForced -> Bool
== :: IsForced -> IsForced -> Bool
$c== :: IsForced -> IsForced -> Bool
Eq, forall x. Rep IsForced x -> IsForced
forall x. IsForced -> Rep IsForced x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IsForced x -> IsForced
$cfrom :: forall x. IsForced -> Rep IsForced x
Generic)
data CompilerPragma = CompilerPragma Range String
deriving (Int -> CompilerPragma -> ShowS
[CompilerPragma] -> ShowS
CompilerPragma -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CompilerPragma] -> ShowS
$cshowList :: [CompilerPragma] -> ShowS
show :: CompilerPragma -> String
$cshow :: CompilerPragma -> String
showsPrec :: Int -> CompilerPragma -> ShowS
$cshowsPrec :: Int -> CompilerPragma -> ShowS
Show, CompilerPragma -> CompilerPragma -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CompilerPragma -> CompilerPragma -> Bool
$c/= :: CompilerPragma -> CompilerPragma -> Bool
== :: CompilerPragma -> CompilerPragma -> Bool
$c== :: CompilerPragma -> CompilerPragma -> Bool
Eq, forall x. Rep CompilerPragma x -> CompilerPragma
forall x. CompilerPragma -> Rep CompilerPragma x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CompilerPragma x -> CompilerPragma
$cfrom :: forall x. CompilerPragma -> Rep CompilerPragma x
Generic)
instance HasRange CompilerPragma where
getRange :: CompilerPragma -> Range
getRange (CompilerPragma Range
r String
_) = Range
r
type BackendName = String
jsBackendName, ghcBackendName :: BackendName
jsBackendName :: String
jsBackendName = String
"JS"
ghcBackendName :: String
ghcBackendName = String
"GHC"
type CompiledRepresentation = Map BackendName [CompilerPragma]
noCompiledRep :: CompiledRepresentation
noCompiledRep :: CompiledRepresentation
noCompiledRep = forall k a. Map k a
Map.empty
type Face = [(Term,Bool)]
data System = System
{ System -> Telescope
systemTel :: Telescope
, System -> [(Face, Term)]
systemClauses :: [(Face,Term)]
} deriving (Int -> System -> ShowS
[System] -> ShowS
System -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [System] -> ShowS
$cshowList :: [System] -> ShowS
show :: System -> String
$cshow :: System -> String
showsPrec :: Int -> System -> ShowS
$cshowsPrec :: Int -> System -> ShowS
Show, forall x. Rep System x -> System
forall x. System -> Rep System x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep System x -> System
$cfrom :: forall x. System -> Rep System x
Generic)
data ExtLamInfo = ExtLamInfo
{ ExtLamInfo -> ModuleName
extLamModule :: ModuleName
, ExtLamInfo -> Bool
extLamAbsurd :: Bool
, ExtLamInfo -> Maybe System
extLamSys :: !(Strict.Maybe System)
} deriving (Int -> ExtLamInfo -> ShowS
[ExtLamInfo] -> ShowS
ExtLamInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExtLamInfo] -> ShowS
$cshowList :: [ExtLamInfo] -> ShowS
show :: ExtLamInfo -> String
$cshow :: ExtLamInfo -> String
showsPrec :: Int -> ExtLamInfo -> ShowS
$cshowsPrec :: Int -> ExtLamInfo -> ShowS
Show, forall x. Rep ExtLamInfo x -> ExtLamInfo
forall x. ExtLamInfo -> Rep ExtLamInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExtLamInfo x -> ExtLamInfo
$cfrom :: forall x. ExtLamInfo -> Rep ExtLamInfo x
Generic)
modifySystem :: (System -> System) -> ExtLamInfo -> ExtLamInfo
modifySystem :: (System -> System) -> ExtLamInfo -> ExtLamInfo
modifySystem System -> System
f ExtLamInfo
e = let !e' :: ExtLamInfo
e' = ExtLamInfo
e { extLamSys :: Maybe System
extLamSys = System -> System
f forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ExtLamInfo -> Maybe System
extLamSys ExtLamInfo
e } in ExtLamInfo
e'
data Projection = Projection
{ Projection -> Maybe QName
projProper :: Maybe QName
, Projection -> QName
projOrig :: QName
, Projection -> Arg QName
projFromType :: Arg QName
, Projection -> Int
projIndex :: Int
, Projection -> ProjLams
projLams :: ProjLams
} deriving (Int -> Projection -> ShowS
[Projection] -> ShowS
Projection -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Projection] -> ShowS
$cshowList :: [Projection] -> ShowS
show :: Projection -> String
$cshow :: Projection -> String
showsPrec :: Int -> Projection -> ShowS
$cshowsPrec :: Int -> Projection -> ShowS
Show, forall x. Rep Projection x -> Projection
forall x. Projection -> Rep Projection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Projection x -> Projection
$cfrom :: forall x. Projection -> Rep Projection x
Generic)
newtype ProjLams = ProjLams { ProjLams -> [Arg String]
getProjLams :: [Arg ArgName] }
deriving (Int -> ProjLams -> ShowS
[ProjLams] -> ShowS
ProjLams -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProjLams] -> ShowS
$cshowList :: [ProjLams] -> ShowS
show :: ProjLams -> String
$cshow :: ProjLams -> String
showsPrec :: Int -> ProjLams -> ShowS
$cshowsPrec :: Int -> ProjLams -> ShowS
Show, ProjLams
ProjLams -> Bool
forall a. a -> (a -> Bool) -> Null a
null :: ProjLams -> Bool
$cnull :: ProjLams -> Bool
empty :: ProjLams
$cempty :: ProjLams
Null, forall x. Rep ProjLams x -> ProjLams
forall x. ProjLams -> Rep ProjLams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProjLams x -> ProjLams
$cfrom :: forall x. ProjLams -> Rep ProjLams x
Generic)
projDropPars :: Projection -> ProjOrigin -> Term
projDropPars :: Projection -> ProjOrigin -> Term
projDropPars (Projection Just{} QName
d Arg QName
_ Int
_ ProjLams
lams) ProjOrigin
o =
case forall a. [a] -> Maybe ([a], a)
initLast forall a b. (a -> b) -> a -> b
$ ProjLams -> [Arg String]
getProjLams ProjLams
lams of
Maybe ([Arg String], Arg String)
Nothing -> QName -> [Elim] -> Term
Def QName
d []
Just ([Arg String]
pars, Arg ArgInfo
i String
y) ->
let core :: Term
core = ArgInfo -> Abs Term -> Term
Lam ArgInfo
i forall a b. (a -> b) -> a -> b
$ forall a. String -> a -> Abs a
Abs String
y forall a b. (a -> b) -> a -> b
$ Int -> [Elim] -> Term
Var Int
0 [forall a. ProjOrigin -> QName -> Elim' a
Proj ProjOrigin
o QName
d] in
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
List.foldr (\ (Arg ArgInfo
ai String
x) -> ArgInfo -> Abs Term -> Term
Lam ArgInfo
ai forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. String -> a -> Abs a
NoAbs String
x) Term
core [Arg String]
pars
projDropPars (Projection Maybe QName
Nothing QName
d Arg QName
_ Int
_ ProjLams
lams) ProjOrigin
o =
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
List.foldr (\ (Arg ArgInfo
ai String
x) -> ArgInfo -> Abs Term -> Term
Lam ArgInfo
ai forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. String -> a -> Abs a
NoAbs String
x) (QName -> [Elim] -> Term
Def QName
d []) forall a b. (a -> b) -> a -> b
$
forall a. [a] -> [a] -> [a]
initWithDefault forall a. HasCallStack => a
__IMPOSSIBLE__ forall a b. (a -> b) -> a -> b
$ ProjLams -> [Arg String]
getProjLams ProjLams
lams
projArgInfo :: Projection -> ArgInfo
projArgInfo :: Projection -> ArgInfo
projArgInfo (Projection Maybe QName
_ QName
_ Arg QName
_ Int
_ ProjLams
lams) =
forall b a. b -> (a -> b) -> Maybe a -> b
maybe forall a. HasCallStack => a
__IMPOSSIBLE__ forall a. LensArgInfo a => a -> ArgInfo
getArgInfo forall a b. (a -> b) -> a -> b
$ forall a. [a] -> Maybe a
lastMaybe forall a b. (a -> b) -> a -> b
$ ProjLams -> [Arg String]
getProjLams ProjLams
lams
data EtaEquality
= Specified { EtaEquality -> HasEta
theEtaEquality :: !HasEta }
| Inferred { theEtaEquality :: !HasEta }
deriving (Int -> EtaEquality -> ShowS
[EtaEquality] -> ShowS
EtaEquality -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EtaEquality] -> ShowS
$cshowList :: [EtaEquality] -> ShowS
show :: EtaEquality -> String
$cshow :: EtaEquality -> String
showsPrec :: Int -> EtaEquality -> ShowS
$cshowsPrec :: Int -> EtaEquality -> ShowS
Show, EtaEquality -> EtaEquality -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EtaEquality -> EtaEquality -> Bool
$c/= :: EtaEquality -> EtaEquality -> Bool
== :: EtaEquality -> EtaEquality -> Bool
$c== :: EtaEquality -> EtaEquality -> Bool
Eq, forall x. Rep EtaEquality x -> EtaEquality
forall x. EtaEquality -> Rep EtaEquality x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EtaEquality x -> EtaEquality
$cfrom :: forall x. EtaEquality -> Rep EtaEquality x
Generic)
instance PatternMatchingAllowed EtaEquality where
patternMatchingAllowed :: EtaEquality -> Bool
patternMatchingAllowed = forall a. PatternMatchingAllowed a => a -> Bool
patternMatchingAllowed forall b c a. (b -> c) -> (a -> b) -> a -> c
. EtaEquality -> HasEta
theEtaEquality
instance CopatternMatchingAllowed EtaEquality where
copatternMatchingAllowed :: EtaEquality -> Bool
copatternMatchingAllowed = forall a. CopatternMatchingAllowed a => a -> Bool
copatternMatchingAllowed forall b c a. (b -> c) -> (a -> b) -> a -> c
. EtaEquality -> HasEta
theEtaEquality
setEtaEquality :: EtaEquality -> HasEta -> EtaEquality
setEtaEquality :: EtaEquality -> HasEta -> EtaEquality
setEtaEquality e :: EtaEquality
e@Specified{} HasEta
_ = EtaEquality
e
setEtaEquality EtaEquality
_ HasEta
b = HasEta -> EtaEquality
Inferred HasEta
b
data FunctionFlag
= FunStatic
| FunInline
| FunMacro
deriving (FunctionFlag -> FunctionFlag -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FunctionFlag -> FunctionFlag -> Bool
$c/= :: FunctionFlag -> FunctionFlag -> Bool
== :: FunctionFlag -> FunctionFlag -> Bool
$c== :: FunctionFlag -> FunctionFlag -> Bool
Eq, Eq FunctionFlag
FunctionFlag -> FunctionFlag -> Bool
FunctionFlag -> FunctionFlag -> Ordering
FunctionFlag -> FunctionFlag -> FunctionFlag
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 :: FunctionFlag -> FunctionFlag -> FunctionFlag
$cmin :: FunctionFlag -> FunctionFlag -> FunctionFlag
max :: FunctionFlag -> FunctionFlag -> FunctionFlag
$cmax :: FunctionFlag -> FunctionFlag -> FunctionFlag
>= :: FunctionFlag -> FunctionFlag -> Bool
$c>= :: FunctionFlag -> FunctionFlag -> Bool
> :: FunctionFlag -> FunctionFlag -> Bool
$c> :: FunctionFlag -> FunctionFlag -> Bool
<= :: FunctionFlag -> FunctionFlag -> Bool
$c<= :: FunctionFlag -> FunctionFlag -> Bool
< :: FunctionFlag -> FunctionFlag -> Bool
$c< :: FunctionFlag -> FunctionFlag -> Bool
compare :: FunctionFlag -> FunctionFlag -> Ordering
$ccompare :: FunctionFlag -> FunctionFlag -> Ordering
Ord, Int -> FunctionFlag
FunctionFlag -> Int
FunctionFlag -> [FunctionFlag]
FunctionFlag -> FunctionFlag
FunctionFlag -> FunctionFlag -> [FunctionFlag]
FunctionFlag -> FunctionFlag -> FunctionFlag -> [FunctionFlag]
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 :: FunctionFlag -> FunctionFlag -> FunctionFlag -> [FunctionFlag]
$cenumFromThenTo :: FunctionFlag -> FunctionFlag -> FunctionFlag -> [FunctionFlag]
enumFromTo :: FunctionFlag -> FunctionFlag -> [FunctionFlag]
$cenumFromTo :: FunctionFlag -> FunctionFlag -> [FunctionFlag]
enumFromThen :: FunctionFlag -> FunctionFlag -> [FunctionFlag]
$cenumFromThen :: FunctionFlag -> FunctionFlag -> [FunctionFlag]
enumFrom :: FunctionFlag -> [FunctionFlag]
$cenumFrom :: FunctionFlag -> [FunctionFlag]
fromEnum :: FunctionFlag -> Int
$cfromEnum :: FunctionFlag -> Int
toEnum :: Int -> FunctionFlag
$ctoEnum :: Int -> FunctionFlag
pred :: FunctionFlag -> FunctionFlag
$cpred :: FunctionFlag -> FunctionFlag
succ :: FunctionFlag -> FunctionFlag
$csucc :: FunctionFlag -> FunctionFlag
Enum, Int -> FunctionFlag -> ShowS
[FunctionFlag] -> ShowS
FunctionFlag -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FunctionFlag] -> ShowS
$cshowList :: [FunctionFlag] -> ShowS
show :: FunctionFlag -> String
$cshow :: FunctionFlag -> String
showsPrec :: Int -> FunctionFlag -> ShowS
$cshowsPrec :: Int -> FunctionFlag -> ShowS
Show, forall x. Rep FunctionFlag x -> FunctionFlag
forall x. FunctionFlag -> Rep FunctionFlag x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FunctionFlag x -> FunctionFlag
$cfrom :: forall x. FunctionFlag -> Rep FunctionFlag x
Generic)
data CompKit = CompKit
{ CompKit -> Maybe QName
nameOfHComp :: Maybe QName
, CompKit -> Maybe QName
nameOfTransp :: Maybe QName
}
deriving (CompKit -> CompKit -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CompKit -> CompKit -> Bool
$c/= :: CompKit -> CompKit -> Bool
== :: CompKit -> CompKit -> Bool
$c== :: CompKit -> CompKit -> Bool
Eq, Eq CompKit
CompKit -> CompKit -> Bool
CompKit -> CompKit -> Ordering
CompKit -> CompKit -> CompKit
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 :: CompKit -> CompKit -> CompKit
$cmin :: CompKit -> CompKit -> CompKit
max :: CompKit -> CompKit -> CompKit
$cmax :: CompKit -> CompKit -> CompKit
>= :: CompKit -> CompKit -> Bool
$c>= :: CompKit -> CompKit -> Bool
> :: CompKit -> CompKit -> Bool
$c> :: CompKit -> CompKit -> Bool
<= :: CompKit -> CompKit -> Bool
$c<= :: CompKit -> CompKit -> Bool
< :: CompKit -> CompKit -> Bool
$c< :: CompKit -> CompKit -> Bool
compare :: CompKit -> CompKit -> Ordering
$ccompare :: CompKit -> CompKit -> Ordering
Ord, Int -> CompKit -> ShowS
[CompKit] -> ShowS
CompKit -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CompKit] -> ShowS
$cshowList :: [CompKit] -> ShowS
show :: CompKit -> String
$cshow :: CompKit -> String
showsPrec :: Int -> CompKit -> ShowS
$cshowsPrec :: Int -> CompKit -> ShowS
Show, forall x. Rep CompKit x -> CompKit
forall x. CompKit -> Rep CompKit x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CompKit x -> CompKit
$cfrom :: forall x. CompKit -> Rep CompKit x
Generic)
emptyCompKit :: CompKit
emptyCompKit :: CompKit
emptyCompKit = Maybe QName -> Maybe QName -> CompKit
CompKit forall a. Maybe a
Nothing forall a. Maybe a
Nothing
defaultAxiom :: Defn
defaultAxiom :: Defn
defaultAxiom = Bool -> Defn
Axiom Bool
False
constTranspAxiom :: Defn
constTranspAxiom :: Defn
constTranspAxiom = Bool -> Defn
Axiom Bool
True
data Defn
= AxiomDefn AxiomData
| DataOrRecSigDefn DataOrRecSigData
| GeneralizableVar
| AbstractDefn Defn
| FunctionDefn FunctionData
| DatatypeDefn DatatypeData
| RecordDefn RecordData
| ConstructorDefn ConstructorData
| PrimitiveDefn PrimitiveData
| PrimitiveSortDefn PrimitiveSortData
deriving (Int -> Defn -> ShowS
[Defn] -> ShowS
Defn -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Defn] -> ShowS
$cshowList :: [Defn] -> ShowS
show :: Defn -> String
$cshow :: Defn -> String
showsPrec :: Int -> Defn -> ShowS
$cshowsPrec :: Int -> Defn -> ShowS
Show, forall x. Rep Defn x -> Defn
forall x. Defn -> Rep Defn x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Defn x -> Defn
$cfrom :: forall x. Defn -> Rep Defn x
Generic)
#if __GLASGOW_HASKELL__ >= 802
{-# COMPLETE
Axiom, DataOrRecSig, GeneralizableVar, AbstractDefn,
Function, Datatype, Record, Constructor, Primitive, PrimitiveSort #-}
#endif
data AxiomData = AxiomData
{ AxiomData -> Bool
_axiomConstTransp :: Bool
} deriving (Int -> AxiomData -> ShowS
[AxiomData] -> ShowS
AxiomData -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AxiomData] -> ShowS
$cshowList :: [AxiomData] -> ShowS
show :: AxiomData -> String
$cshow :: AxiomData -> String
showsPrec :: Int -> AxiomData -> ShowS
$cshowsPrec :: Int -> AxiomData -> ShowS
Show, forall x. Rep AxiomData x -> AxiomData
forall x. AxiomData -> Rep AxiomData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AxiomData x -> AxiomData
$cfrom :: forall x. AxiomData -> Rep AxiomData x
Generic)
pattern Axiom :: Bool -> Defn
pattern $bAxiom :: Bool -> Defn
$mAxiom :: forall {r}. Defn -> (Bool -> r) -> ((# #) -> r) -> r
Axiom{ Defn -> Bool
axiomConstTransp } = AxiomDefn (AxiomData axiomConstTransp)
data DataOrRecSigData = DataOrRecSigData
{ DataOrRecSigData -> Int
_datarecPars :: Int
} deriving (Int -> DataOrRecSigData -> ShowS
[DataOrRecSigData] -> ShowS
DataOrRecSigData -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DataOrRecSigData] -> ShowS
$cshowList :: [DataOrRecSigData] -> ShowS
show :: DataOrRecSigData -> String
$cshow :: DataOrRecSigData -> String
showsPrec :: Int -> DataOrRecSigData -> ShowS
$cshowsPrec :: Int -> DataOrRecSigData -> ShowS
Show, forall x. Rep DataOrRecSigData x -> DataOrRecSigData
forall x. DataOrRecSigData -> Rep DataOrRecSigData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DataOrRecSigData x -> DataOrRecSigData
$cfrom :: forall x. DataOrRecSigData -> Rep DataOrRecSigData x
Generic)
pattern DataOrRecSig :: Int -> Defn
pattern $bDataOrRecSig :: Int -> Defn
$mDataOrRecSig :: forall {r}. Defn -> (Int -> r) -> ((# #) -> r) -> r
DataOrRecSig{ Defn -> Int
datarecPars } = DataOrRecSigDefn (DataOrRecSigData datarecPars)
data ProjectionLikenessMissing
= MaybeProjection
| NeverProjection
deriving (Int -> ProjectionLikenessMissing -> ShowS
[ProjectionLikenessMissing] -> ShowS
ProjectionLikenessMissing -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProjectionLikenessMissing] -> ShowS
$cshowList :: [ProjectionLikenessMissing] -> ShowS
show :: ProjectionLikenessMissing -> String
$cshow :: ProjectionLikenessMissing -> String
showsPrec :: Int -> ProjectionLikenessMissing -> ShowS
$cshowsPrec :: Int -> ProjectionLikenessMissing -> ShowS
Show, forall x.
Rep ProjectionLikenessMissing x -> ProjectionLikenessMissing
forall x.
ProjectionLikenessMissing -> Rep ProjectionLikenessMissing x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ProjectionLikenessMissing x -> ProjectionLikenessMissing
$cfrom :: forall x.
ProjectionLikenessMissing -> Rep ProjectionLikenessMissing x
Generic, Int -> ProjectionLikenessMissing
ProjectionLikenessMissing -> Int
ProjectionLikenessMissing -> [ProjectionLikenessMissing]
ProjectionLikenessMissing -> ProjectionLikenessMissing
ProjectionLikenessMissing
-> ProjectionLikenessMissing -> [ProjectionLikenessMissing]
ProjectionLikenessMissing
-> ProjectionLikenessMissing
-> ProjectionLikenessMissing
-> [ProjectionLikenessMissing]
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 :: ProjectionLikenessMissing
-> ProjectionLikenessMissing
-> ProjectionLikenessMissing
-> [ProjectionLikenessMissing]
$cenumFromThenTo :: ProjectionLikenessMissing
-> ProjectionLikenessMissing
-> ProjectionLikenessMissing
-> [ProjectionLikenessMissing]
enumFromTo :: ProjectionLikenessMissing
-> ProjectionLikenessMissing -> [ProjectionLikenessMissing]
$cenumFromTo :: ProjectionLikenessMissing
-> ProjectionLikenessMissing -> [ProjectionLikenessMissing]
enumFromThen :: ProjectionLikenessMissing
-> ProjectionLikenessMissing -> [ProjectionLikenessMissing]
$cenumFromThen :: ProjectionLikenessMissing
-> ProjectionLikenessMissing -> [ProjectionLikenessMissing]
enumFrom :: ProjectionLikenessMissing -> [ProjectionLikenessMissing]
$cenumFrom :: ProjectionLikenessMissing -> [ProjectionLikenessMissing]
fromEnum :: ProjectionLikenessMissing -> Int
$cfromEnum :: ProjectionLikenessMissing -> Int
toEnum :: Int -> ProjectionLikenessMissing
$ctoEnum :: Int -> ProjectionLikenessMissing
pred :: ProjectionLikenessMissing -> ProjectionLikenessMissing
$cpred :: ProjectionLikenessMissing -> ProjectionLikenessMissing
succ :: ProjectionLikenessMissing -> ProjectionLikenessMissing
$csucc :: ProjectionLikenessMissing -> ProjectionLikenessMissing
Enum, ProjectionLikenessMissing
forall a. a -> a -> Bounded a
maxBound :: ProjectionLikenessMissing
$cmaxBound :: ProjectionLikenessMissing
minBound :: ProjectionLikenessMissing
$cminBound :: ProjectionLikenessMissing
Bounded)
data FunctionData = FunctionData
{ FunctionData -> [Clause]
_funClauses :: [Clause]
, FunctionData -> Maybe CompiledClauses
_funCompiled :: Maybe CompiledClauses
, FunctionData -> Maybe SplitTree
_funSplitTree :: Maybe SplitTree
, FunctionData -> Maybe Compiled
_funTreeless :: Maybe Compiled
, FunctionData -> [Clause]
_funCovering :: [Clause]
, FunctionData -> FunctionInverse
_funInv :: FunctionInverse
, FunctionData -> Maybe [QName]
_funMutual :: Maybe [QName]
, FunctionData -> IsAbstract
_funAbstr :: IsAbstract
, FunctionData -> Delayed
_funDelayed :: Delayed
, FunctionData -> Either ProjectionLikenessMissing Projection
_funProjection :: Either ProjectionLikenessMissing Projection
, FunctionData -> Set FunctionFlag
_funFlags :: Set FunctionFlag
, FunctionData -> Maybe Bool
_funTerminates :: Maybe Bool
, FunctionData -> Maybe ExtLamInfo
_funExtLam :: Maybe ExtLamInfo
, FunctionData -> Maybe QName
_funWith :: Maybe QName
, FunctionData -> Maybe QName
_funIsKanOp :: Maybe QName
} deriving (Int -> FunctionData -> ShowS
[FunctionData] -> ShowS
FunctionData -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FunctionData] -> ShowS
$cshowList :: [FunctionData] -> ShowS
show :: FunctionData -> String
$cshow :: FunctionData -> String
showsPrec :: Int -> FunctionData -> ShowS
$cshowsPrec :: Int -> FunctionData -> ShowS
Show, forall x. Rep FunctionData x -> FunctionData
forall x. FunctionData -> Rep FunctionData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FunctionData x -> FunctionData
$cfrom :: forall x. FunctionData -> Rep FunctionData x
Generic)
pattern Function
:: [Clause]
-> Maybe CompiledClauses
-> Maybe SplitTree
-> Maybe Compiled
-> [Clause]
-> FunctionInverse
-> Maybe [QName]
-> IsAbstract
-> Delayed
-> Either ProjectionLikenessMissing Projection
-> Set FunctionFlag
-> Maybe Bool
-> Maybe ExtLamInfo
-> Maybe QName
-> Maybe QName
-> Defn
pattern $bFunction :: [Clause]
-> Maybe CompiledClauses
-> Maybe SplitTree
-> Maybe Compiled
-> [Clause]
-> FunctionInverse
-> Maybe [QName]
-> IsAbstract
-> Delayed
-> Either ProjectionLikenessMissing Projection
-> Set FunctionFlag
-> Maybe Bool
-> Maybe ExtLamInfo
-> Maybe QName
-> Maybe QName
-> Defn
$mFunction :: forall {r}.
Defn
-> ([Clause]
-> Maybe CompiledClauses
-> Maybe SplitTree
-> Maybe Compiled
-> [Clause]
-> FunctionInverse
-> Maybe [QName]
-> IsAbstract
-> Delayed
-> Either ProjectionLikenessMissing Projection
-> Set FunctionFlag
-> Maybe Bool
-> Maybe ExtLamInfo
-> Maybe QName
-> Maybe QName
-> r)
-> ((# #) -> r)
-> r
Function
{ Defn -> [Clause]
funClauses
, Defn -> Maybe CompiledClauses
funCompiled
, Defn -> Maybe SplitTree
funSplitTree
, Defn -> Maybe Compiled
funTreeless
, Defn -> [Clause]
funCovering
, Defn -> FunctionInverse
funInv
, Defn -> Maybe [QName]
funMutual
, Defn -> IsAbstract
funAbstr
, Defn -> Delayed
funDelayed
, Defn -> Either ProjectionLikenessMissing Projection
funProjection
, Defn -> Set FunctionFlag
funFlags
, Defn -> Maybe Bool
funTerminates
, Defn -> Maybe ExtLamInfo
funExtLam
, Defn -> Maybe QName
funWith
, Defn -> Maybe QName
funIsKanOp
} = FunctionDefn (FunctionData
funClauses
funCompiled
funSplitTree
funTreeless
funCovering
funInv
funMutual
funAbstr
funDelayed
funProjection
funFlags
funTerminates
funExtLam
funWith
funIsKanOp
)
data DatatypeData = DatatypeData
{ DatatypeData -> Int
_dataPars :: Nat
, DatatypeData -> Int
_dataIxs :: Nat
, DatatypeData -> Maybe Clause
_dataClause :: Maybe Clause
, DatatypeData -> [QName]
_dataCons :: [QName]
, DatatypeData -> Sort
_dataSort :: Sort
, DatatypeData -> Maybe [QName]
_dataMutual :: Maybe [QName]
, DatatypeData -> IsAbstract
_dataAbstr :: IsAbstract
, DatatypeData -> [QName]
_dataPathCons :: [QName]
, DatatypeData -> Maybe QName
_dataTranspIx :: Maybe QName
, DatatypeData -> Maybe QName
_dataTransp :: Maybe QName
} deriving (Int -> DatatypeData -> ShowS
[DatatypeData] -> ShowS
DatatypeData -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DatatypeData] -> ShowS
$cshowList :: [DatatypeData] -> ShowS
show :: DatatypeData -> String
$cshow :: DatatypeData -> String
showsPrec :: Int -> DatatypeData -> ShowS
$cshowsPrec :: Int -> DatatypeData -> ShowS
Show, forall x. Rep DatatypeData x -> DatatypeData
forall x. DatatypeData -> Rep DatatypeData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DatatypeData x -> DatatypeData
$cfrom :: forall x. DatatypeData -> Rep DatatypeData x
Generic)
pattern Datatype
:: Nat
-> Nat
-> (Maybe Clause)
-> [QName]
-> Sort
-> Maybe [QName]
-> IsAbstract
-> [QName]
-> Maybe QName
-> Maybe QName
-> Defn
pattern $bDatatype :: Int
-> Int
-> Maybe Clause
-> [QName]
-> Sort
-> Maybe [QName]
-> IsAbstract
-> [QName]
-> Maybe QName
-> Maybe QName
-> Defn
$mDatatype :: forall {r}.
Defn
-> (Int
-> Int
-> Maybe Clause
-> [QName]
-> Sort
-> Maybe [QName]
-> IsAbstract
-> [QName]
-> Maybe QName
-> Maybe QName
-> r)
-> ((# #) -> r)
-> r
Datatype
{ Defn -> Int
dataPars
, Defn -> Int
dataIxs
, Defn -> Maybe Clause
dataClause
, Defn -> [QName]
dataCons
, Defn -> Sort
dataSort
, Defn -> Maybe [QName]
dataMutual
, Defn -> IsAbstract
dataAbstr
, Defn -> [QName]
dataPathCons
, Defn -> Maybe QName
dataTranspIx
, Defn -> Maybe QName
dataTransp
} = DatatypeDefn (DatatypeData
dataPars
dataIxs
dataClause
dataCons
dataSort
dataMutual
dataAbstr
dataPathCons
dataTranspIx
dataTransp
)
data RecordData = RecordData
{ RecordData -> Int
_recPars :: Nat
, RecordData -> Maybe Clause
_recClause :: Maybe Clause
, RecordData -> ConHead
_recConHead :: ConHead
, RecordData -> Bool
_recNamedCon :: Bool
, RecordData -> [Dom QName]
_recFields :: [Dom QName]
, RecordData -> Telescope
_recTel :: Telescope
, RecordData -> Maybe [QName]
_recMutual :: Maybe [QName]
, RecordData -> EtaEquality
_recEtaEquality' :: EtaEquality
, RecordData -> PatternOrCopattern
_recPatternMatching :: PatternOrCopattern
, RecordData -> Maybe Induction
_recInduction :: Maybe Induction
, RecordData -> Maybe Bool
_recTerminates :: Maybe Bool
, RecordData -> IsAbstract
_recAbstr :: IsAbstract
, RecordData -> CompKit
_recComp :: CompKit
} deriving (Int -> RecordData -> ShowS
[RecordData] -> ShowS
RecordData -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RecordData] -> ShowS
$cshowList :: [RecordData] -> ShowS
show :: RecordData -> String
$cshow :: RecordData -> String
showsPrec :: Int -> RecordData -> ShowS
$cshowsPrec :: Int -> RecordData -> ShowS
Show, forall x. Rep RecordData x -> RecordData
forall x. RecordData -> Rep RecordData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RecordData x -> RecordData
$cfrom :: forall x. RecordData -> Rep RecordData x
Generic)
pattern Record
:: Nat
-> Maybe Clause
-> ConHead
-> Bool
-> [Dom QName]
-> Telescope
-> Maybe [QName]
-> EtaEquality
-> PatternOrCopattern
-> Maybe Induction
-> Maybe Bool
-> IsAbstract
-> CompKit
-> Defn
pattern $bRecord :: Int
-> Maybe Clause
-> ConHead
-> Bool
-> [Dom QName]
-> Telescope
-> Maybe [QName]
-> EtaEquality
-> PatternOrCopattern
-> Maybe Induction
-> Maybe Bool
-> IsAbstract
-> CompKit
-> Defn
$mRecord :: forall {r}.
Defn
-> (Int
-> Maybe Clause
-> ConHead
-> Bool
-> [Dom QName]
-> Telescope
-> Maybe [QName]
-> EtaEquality
-> PatternOrCopattern
-> Maybe Induction
-> Maybe Bool
-> IsAbstract
-> CompKit
-> r)
-> ((# #) -> r)
-> r
Record
{ Defn -> Int
recPars
, Defn -> Maybe Clause
recClause
, Defn -> ConHead
recConHead
, Defn -> Bool
recNamedCon
, Defn -> [Dom QName]
recFields
, Defn -> Telescope
recTel
, Defn -> Maybe [QName]
recMutual
, Defn -> EtaEquality
recEtaEquality'
, Defn -> PatternOrCopattern
recPatternMatching
, Defn -> Maybe Induction
recInduction
, Defn -> Maybe Bool
recTerminates
, Defn -> IsAbstract
recAbstr
, Defn -> CompKit
recComp
} = RecordDefn (RecordData
recPars
recClause
recConHead
recNamedCon
recFields
recTel
recMutual
recEtaEquality'
recPatternMatching
recInduction
recTerminates
recAbstr
recComp
)
data ConstructorData = ConstructorData
{ ConstructorData -> Int
_conPars :: Int
, ConstructorData -> Int
_conArity :: Int
, ConstructorData -> ConHead
_conSrcCon :: ConHead
, ConstructorData -> QName
_conData :: QName
, ConstructorData -> IsAbstract
_conAbstr :: IsAbstract
, ConstructorData -> Induction
_conInd :: Induction
, ConstructorData -> CompKit
_conComp :: CompKit
, ConstructorData -> Maybe [QName]
_conProj :: Maybe [QName]
, ConstructorData -> [IsForced]
_conForced :: [IsForced]
, ConstructorData -> Maybe [Bool]
_conErased :: Maybe [Bool]
} deriving (Int -> ConstructorData -> ShowS
[ConstructorData] -> ShowS
ConstructorData -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConstructorData] -> ShowS
$cshowList :: [ConstructorData] -> ShowS
show :: ConstructorData -> String
$cshow :: ConstructorData -> String
showsPrec :: Int -> ConstructorData -> ShowS
$cshowsPrec :: Int -> ConstructorData -> ShowS
Show, forall x. Rep ConstructorData x -> ConstructorData
forall x. ConstructorData -> Rep ConstructorData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ConstructorData x -> ConstructorData
$cfrom :: forall x. ConstructorData -> Rep ConstructorData x
Generic)
pattern Constructor
:: Int
-> Int
-> ConHead
-> QName
-> IsAbstract
-> Induction
-> CompKit
-> Maybe [QName]
-> [IsForced]
-> Maybe [Bool]
-> Defn
pattern $bConstructor :: Int
-> Int
-> ConHead
-> QName
-> IsAbstract
-> Induction
-> CompKit
-> Maybe [QName]
-> [IsForced]
-> Maybe [Bool]
-> Defn
$mConstructor :: forall {r}.
Defn
-> (Int
-> Int
-> ConHead
-> QName
-> IsAbstract
-> Induction
-> CompKit
-> Maybe [QName]
-> [IsForced]
-> Maybe [Bool]
-> r)
-> ((# #) -> r)
-> r
Constructor
{ Defn -> Int
conPars
, Defn -> Int
conArity
, Defn -> ConHead
conSrcCon
, Defn -> QName
conData
, Defn -> IsAbstract
conAbstr
, Defn -> Induction
conInd
, Defn -> CompKit
conComp
, Defn -> Maybe [QName]
conProj
, Defn -> [IsForced]
conForced
, Defn -> Maybe [Bool]
conErased
} = ConstructorDefn (ConstructorData
conPars
conArity
conSrcCon
conData
conAbstr
conInd
conComp
conProj
conForced
conErased
)
data PrimitiveData = PrimitiveData
{ PrimitiveData -> IsAbstract
_primAbstr :: IsAbstract
, PrimitiveData -> String
_primName :: String
, PrimitiveData -> [Clause]
_primClauses :: [Clause]
, PrimitiveData -> FunctionInverse
_primInv :: FunctionInverse
, PrimitiveData -> Maybe CompiledClauses
_primCompiled :: Maybe CompiledClauses
} deriving (Int -> PrimitiveData -> ShowS
[PrimitiveData] -> ShowS
PrimitiveData -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PrimitiveData] -> ShowS
$cshowList :: [PrimitiveData] -> ShowS
show :: PrimitiveData -> String
$cshow :: PrimitiveData -> String
showsPrec :: Int -> PrimitiveData -> ShowS
$cshowsPrec :: Int -> PrimitiveData -> ShowS
Show, forall x. Rep PrimitiveData x -> PrimitiveData
forall x. PrimitiveData -> Rep PrimitiveData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PrimitiveData x -> PrimitiveData
$cfrom :: forall x. PrimitiveData -> Rep PrimitiveData x
Generic)
pattern Primitive
:: IsAbstract
-> String
-> [Clause]
-> FunctionInverse
-> Maybe CompiledClauses
-> Defn
pattern $bPrimitive :: IsAbstract
-> String
-> [Clause]
-> FunctionInverse
-> Maybe CompiledClauses
-> Defn
$mPrimitive :: forall {r}.
Defn
-> (IsAbstract
-> String
-> [Clause]
-> FunctionInverse
-> Maybe CompiledClauses
-> r)
-> ((# #) -> r)
-> r
Primitive
{ Defn -> IsAbstract
primAbstr
, Defn -> String
primName
, Defn -> [Clause]
primClauses
, Defn -> FunctionInverse
primInv
, Defn -> Maybe CompiledClauses
primCompiled
} = PrimitiveDefn (PrimitiveData
primAbstr
primName
primClauses
primInv
primCompiled
)
data PrimitiveSortData = PrimitiveSortData
{ PrimitiveSortData -> String
_primSortName :: String
, PrimitiveSortData -> Sort
_primSortSort :: Sort
} deriving (Int -> PrimitiveSortData -> ShowS
[PrimitiveSortData] -> ShowS
PrimitiveSortData -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PrimitiveSortData] -> ShowS
$cshowList :: [PrimitiveSortData] -> ShowS
show :: PrimitiveSortData -> String
$cshow :: PrimitiveSortData -> String
showsPrec :: Int -> PrimitiveSortData -> ShowS
$cshowsPrec :: Int -> PrimitiveSortData -> ShowS
Show, forall x. Rep PrimitiveSortData x -> PrimitiveSortData
forall x. PrimitiveSortData -> Rep PrimitiveSortData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PrimitiveSortData x -> PrimitiveSortData
$cfrom :: forall x. PrimitiveSortData -> Rep PrimitiveSortData x
Generic)
pattern PrimitiveSort
:: String
-> Sort
-> Defn
pattern $bPrimitiveSort :: String -> Sort -> Defn
$mPrimitiveSort :: forall {r}. Defn -> (String -> Sort -> r) -> ((# #) -> r) -> r
PrimitiveSort
{ Defn -> String
primSortName
, Defn -> Sort
primSortSort
} = PrimitiveSortDefn (PrimitiveSortData
primSortName
primSortSort
)
lensFunction :: Lens' FunctionData Defn
lensFunction :: Lens' FunctionData Defn
lensFunction FunctionData -> f FunctionData
f = \case
FunctionDefn FunctionData
d -> FunctionData -> Defn
FunctionDefn forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> FunctionData -> f FunctionData
f FunctionData
d
Defn
_ -> forall a. HasCallStack => a
__IMPOSSIBLE__
lensConstructor :: Lens' ConstructorData Defn
lensConstructor :: Lens' ConstructorData Defn
lensConstructor ConstructorData -> f ConstructorData
f = \case
ConstructorDefn ConstructorData
d -> ConstructorData -> Defn
ConstructorDefn forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ConstructorData -> f ConstructorData
f ConstructorData
d
Defn
_ -> forall a. HasCallStack => a
__IMPOSSIBLE__
lensRecord :: Lens' RecordData Defn
lensRecord :: Lens' RecordData Defn
lensRecord RecordData -> f RecordData
f = \case
RecordDefn RecordData
d -> RecordData -> Defn
RecordDefn forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> RecordData -> f RecordData
f RecordData
d
Defn
_ -> forall a. HasCallStack => a
__IMPOSSIBLE__
lensRecTel :: Lens' Telescope RecordData
lensRecTel :: Lens' Telescope RecordData
lensRecTel Telescope -> f Telescope
f RecordData
r =
Telescope -> f Telescope
f (RecordData -> Telescope
_recTel RecordData
r) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Telescope
tel -> RecordData
r { _recTel :: Telescope
_recTel = Telescope
tel }
instance Pretty Definition where
pretty :: Definition -> Doc
pretty Defn{Bool
[Maybe Name]
[Occurrence]
[Polarity]
[LocalDisplayForm]
Maybe QName
CompiledRepresentation
Set QName
ArgInfo
Language
QName
Blocked_
Type
MutualId
Defn
NumGeneralizableArgs
theDef :: Defn
defLanguage :: Language
defBlocked :: Blocked_
defCopatternLHS :: Bool
defInjective :: Bool
defNoCompilation :: Bool
defMatchable :: Set QName
defCopy :: Bool
defInstance :: Maybe QName
defCompiledRep :: CompiledRepresentation
defMutual :: MutualId
defDisplay :: [LocalDisplayForm]
defGeneralizedParams :: [Maybe Name]
defArgGeneralizable :: NumGeneralizableArgs
defArgOccurrences :: [Occurrence]
defPolarity :: [Polarity]
defType :: Type
defName :: QName
defArgInfo :: ArgInfo
theDef :: Definition -> Defn
defLanguage :: Definition -> Language
defBlocked :: Definition -> Blocked_
defCopatternLHS :: Definition -> Bool
defInjective :: Definition -> Bool
defNoCompilation :: Definition -> Bool
defMatchable :: Definition -> Set QName
defCopy :: Definition -> Bool
defInstance :: Definition -> Maybe QName
defCompiledRep :: Definition -> CompiledRepresentation
defMutual :: Definition -> MutualId
defDisplay :: Definition -> [LocalDisplayForm]
defGeneralizedParams :: Definition -> [Maybe Name]
defArgGeneralizable :: Definition -> NumGeneralizableArgs
defArgOccurrences :: Definition -> [Occurrence]
defPolarity :: Definition -> [Polarity]
defType :: Definition -> Type
defName :: Definition -> QName
defArgInfo :: Definition -> ArgInfo
..} =
Doc
"Defn {" Doc -> Doc -> Doc
<?> forall (t :: * -> *). Foldable t => t Doc -> Doc
vcat
[ Doc
"defArgInfo =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow ArgInfo
defArgInfo
, Doc
"defName =" Doc -> Doc -> Doc
<?> forall a. Pretty a => a -> Doc
pretty QName
defName
, Doc
"defType =" Doc -> Doc -> Doc
<?> forall a. Pretty a => a -> Doc
pretty Type
defType
, Doc
"defPolarity =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow [Polarity]
defPolarity
, Doc
"defArgOccurrences =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow [Occurrence]
defArgOccurrences
, Doc
"defGeneralizedParams =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow [Maybe Name]
defGeneralizedParams
, Doc
"defDisplay =" Doc -> Doc -> Doc
<?> forall a. Pretty a => a -> Doc
pretty [LocalDisplayForm]
defDisplay
, Doc
"defMutual =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow MutualId
defMutual
, Doc
"defCompiledRep =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow CompiledRepresentation
defCompiledRep
, Doc
"defInstance =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow Maybe QName
defInstance
, Doc
"defCopy =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow Bool
defCopy
, Doc
"defMatchable =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow (forall a. Set a -> [a]
Set.toList Set QName
defMatchable)
, Doc
"defInjective =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow Bool
defInjective
, Doc
"defCopatternLHS =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow Bool
defCopatternLHS
, Doc
"theDef =" Doc -> Doc -> Doc
<?> forall a. Pretty a => a -> Doc
pretty Defn
theDef ] Doc -> Doc -> Doc
<+> Doc
"}"
instance Pretty Defn where
pretty :: Defn -> Doc
pretty = \case
AxiomDefn AxiomData
_ -> Doc
"Axiom"
DataOrRecSigDefn DataOrRecSigData
d -> forall a. Pretty a => a -> Doc
pretty DataOrRecSigData
d
Defn
GeneralizableVar -> Doc
"GeneralizableVar"
AbstractDefn Defn
def -> Doc
"AbstractDefn" Doc -> Doc -> Doc
<?> Doc -> Doc
parens (forall a. Pretty a => a -> Doc
pretty Defn
def)
FunctionDefn FunctionData
d -> forall a. Pretty a => a -> Doc
pretty FunctionData
d
DatatypeDefn DatatypeData
d -> forall a. Pretty a => a -> Doc
pretty DatatypeData
d
RecordDefn RecordData
d -> forall a. Pretty a => a -> Doc
pretty RecordData
d
ConstructorDefn ConstructorData
d -> forall a. Pretty a => a -> Doc
pretty ConstructorData
d
PrimitiveDefn PrimitiveData
d -> forall a. Pretty a => a -> Doc
pretty PrimitiveData
d
PrimitiveSortDefn PrimitiveSortData
d -> forall a. Pretty a => a -> Doc
pretty PrimitiveSortData
d
instance Pretty DataOrRecSigData where
pretty :: DataOrRecSigData -> Doc
pretty (DataOrRecSigData Int
n) = Doc
"DataOrRecSig" Doc -> Doc -> Doc
<+> forall a. Pretty a => a -> Doc
pretty Int
n
instance Pretty ProjectionLikenessMissing where
pretty :: ProjectionLikenessMissing -> Doc
pretty ProjectionLikenessMissing
MaybeProjection = Doc
"MaybeProjection"
pretty ProjectionLikenessMissing
NeverProjection = Doc
"NeverProjection"
instance Pretty FunctionData where
pretty :: FunctionData -> Doc
pretty (FunctionData
[Clause]
funClauses
Maybe CompiledClauses
funCompiled
Maybe SplitTree
funSplitTree
Maybe Compiled
funTreeless
[Clause]
_funCovering
FunctionInverse
funInv
Maybe [QName]
funMutual
IsAbstract
funAbstr
Delayed
funDelayed
Either ProjectionLikenessMissing Projection
funProjection
Set FunctionFlag
funFlags
Maybe Bool
funTerminates
Maybe ExtLamInfo
_funExtLam
Maybe QName
funWith
Maybe QName
funIsKanOp
) =
Doc
"Function {" Doc -> Doc -> Doc
<?> forall (t :: * -> *). Foldable t => t Doc -> Doc
vcat
[ Doc
"funClauses =" Doc -> Doc -> Doc
<?> forall (t :: * -> *). Foldable t => t Doc -> Doc
vcat (forall a b. (a -> b) -> [a] -> [b]
map forall a. Pretty a => a -> Doc
pretty [Clause]
funClauses)
, Doc
"funCompiled =" Doc -> Doc -> Doc
<?> forall a. Pretty a => a -> Doc
pretty Maybe CompiledClauses
funCompiled
, Doc
"funSplitTree =" Doc -> Doc -> Doc
<?> forall a. Pretty a => a -> Doc
pretty Maybe SplitTree
funSplitTree
, Doc
"funTreeless =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow Maybe Compiled
funTreeless
, Doc
"funInv =" Doc -> Doc -> Doc
<?> forall a. Pretty a => a -> Doc
pretty FunctionInverse
funInv
, Doc
"funMutual =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow Maybe [QName]
funMutual
, Doc
"funAbstr =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow IsAbstract
funAbstr
, Doc
"funDelayed =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow Delayed
funDelayed
, Doc
"funProjection =" Doc -> Doc -> Doc
<?> forall a. Pretty a => a -> Doc
pretty Either ProjectionLikenessMissing Projection
funProjection
, Doc
"funFlags =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow Set FunctionFlag
funFlags
, Doc
"funTerminates =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow Maybe Bool
funTerminates
, Doc
"funWith =" Doc -> Doc -> Doc
<?> forall a. Pretty a => a -> Doc
pretty Maybe QName
funWith
, Doc
"funIsKanOp =" Doc -> Doc -> Doc
<?> forall a. Pretty a => a -> Doc
pretty Maybe QName
funWith
] Doc -> Doc -> Doc
<?> Doc
"}"
instance Pretty DatatypeData where
pretty :: DatatypeData -> Doc
pretty (DatatypeData
Int
dataPars
Int
dataIxs
Maybe Clause
dataClause
[QName]
dataCons
Sort
dataSort
Maybe [QName]
dataMutual
IsAbstract
_dataAbstr
[QName]
_dataPathCons
Maybe QName
_dataTranspIx
Maybe QName
_dataTransp
) =
Doc
"Datatype {" Doc -> Doc -> Doc
<?> forall (t :: * -> *). Foldable t => t Doc -> Doc
vcat
[ Doc
"dataPars =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow Int
dataPars
, Doc
"dataIxs =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow Int
dataIxs
, Doc
"dataClause =" Doc -> Doc -> Doc
<?> forall a. Pretty a => a -> Doc
pretty Maybe Clause
dataClause
, Doc
"dataCons =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow [QName]
dataCons
, Doc
"dataSort =" Doc -> Doc -> Doc
<?> forall a. Pretty a => a -> Doc
pretty Sort
dataSort
, Doc
"dataMutual =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow Maybe [QName]
dataMutual
, Doc
"dataAbstr =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow Defn -> IsAbstract
dataAbstr
] Doc -> Doc -> Doc
<?> Doc
"}"
instance Pretty RecordData where
pretty :: RecordData -> Doc
pretty (RecordData
Int
recPars
Maybe Clause
recClause
ConHead
recConHead
Bool
recNamedCon
[Dom QName]
recFields
Telescope
recTel
Maybe [QName]
recMutual
EtaEquality
recEtaEquality'
PatternOrCopattern
_recPatternMatching
Maybe Induction
recInduction
Maybe Bool
_recTerminates
IsAbstract
recAbstr
CompKit
_recComp
) =
Doc
"Record {" Doc -> Doc -> Doc
<?> forall (t :: * -> *). Foldable t => t Doc -> Doc
vcat
[ Doc
"recPars =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow Int
recPars
, Doc
"recClause =" Doc -> Doc -> Doc
<?> forall a. Pretty a => a -> Doc
pretty Maybe Clause
recClause
, Doc
"recConHead =" Doc -> Doc -> Doc
<?> forall a. Pretty a => a -> Doc
pretty ConHead
recConHead
, Doc
"recNamedCon =" Doc -> Doc -> Doc
<?> forall a. Pretty a => a -> Doc
pretty Bool
recNamedCon
, Doc
"recFields =" Doc -> Doc -> Doc
<?> forall a. Pretty a => a -> Doc
pretty [Dom QName]
recFields
, Doc
"recTel =" Doc -> Doc -> Doc
<?> forall a. Pretty a => a -> Doc
pretty Telescope
recTel
, Doc
"recMutual =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow Maybe [QName]
recMutual
, Doc
"recEtaEquality' =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow EtaEquality
recEtaEquality'
, Doc
"recInduction =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow Maybe Induction
recInduction
, Doc
"recAbstr =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow IsAbstract
recAbstr
] Doc -> Doc -> Doc
<?> Doc
"}"
instance Pretty ConstructorData where
pretty :: ConstructorData -> Doc
pretty (ConstructorData
Int
conPars
Int
conArity
ConHead
conSrcCon
QName
conData
IsAbstract
conAbstr
Induction
conInd
CompKit
_conComp
Maybe [QName]
_conProj
[IsForced]
_conForced
Maybe [Bool]
conErased
) =
Doc
"Constructor {" Doc -> Doc -> Doc
<?> forall (t :: * -> *). Foldable t => t Doc -> Doc
vcat
[ Doc
"conPars =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow Int
conPars
, Doc
"conArity =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow Int
conArity
, Doc
"conSrcCon =" Doc -> Doc -> Doc
<?> forall a. Pretty a => a -> Doc
pretty ConHead
conSrcCon
, Doc
"conData =" Doc -> Doc -> Doc
<?> forall a. Pretty a => a -> Doc
pretty QName
conData
, Doc
"conAbstr =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow IsAbstract
conAbstr
, Doc
"conInd =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow Induction
conInd
, Doc
"conErased =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow Maybe [Bool]
conErased
] Doc -> Doc -> Doc
<?> Doc
"}"
instance Pretty PrimitiveData where
pretty :: PrimitiveData -> Doc
pretty (PrimitiveData
IsAbstract
primAbstr
String
primName
[Clause]
primClauses
FunctionInverse
_primInv
Maybe CompiledClauses
primCompiled
) =
Doc
"Primitive {" Doc -> Doc -> Doc
<?> forall (t :: * -> *). Foldable t => t Doc -> Doc
vcat
[ Doc
"primAbstr =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow IsAbstract
primAbstr
, Doc
"primName =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow String
primName
, Doc
"primClauses =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow [Clause]
primClauses
, Doc
"primCompiled =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow Maybe CompiledClauses
primCompiled
] Doc -> Doc -> Doc
<?> Doc
"}"
instance Pretty PrimitiveSortData where
pretty :: PrimitiveSortData -> Doc
pretty (PrimitiveSortData String
primSortName Sort
primSortSort) =
Doc
"PrimitiveSort {" Doc -> Doc -> Doc
<?> forall (t :: * -> *). Foldable t => t Doc -> Doc
vcat
[ Doc
"primSortName =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow String
primSortName
, Doc
"primSortSort =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow Sort
primSortSort
] Doc -> Doc -> Doc
<?> Doc
"}"
instance Pretty Projection where
pretty :: Projection -> Doc
pretty Projection{Int
Maybe QName
Arg QName
QName
ProjLams
projLams :: ProjLams
projIndex :: Int
projFromType :: Arg QName
projOrig :: QName
projProper :: Maybe QName
projLams :: Projection -> ProjLams
projIndex :: Projection -> Int
projFromType :: Projection -> Arg QName
projOrig :: Projection -> QName
projProper :: Projection -> Maybe QName
..} =
Doc
"Projection {" Doc -> Doc -> Doc
<?> forall (t :: * -> *). Foldable t => t Doc -> Doc
vcat
[ Doc
"projProper =" Doc -> Doc -> Doc
<?> forall a. Pretty a => a -> Doc
pretty Maybe QName
projProper
, Doc
"projOrig =" Doc -> Doc -> Doc
<?> forall a. Pretty a => a -> Doc
pretty QName
projOrig
, Doc
"projFromType =" Doc -> Doc -> Doc
<?> forall a. Pretty a => a -> Doc
pretty Arg QName
projFromType
, Doc
"projIndex =" Doc -> Doc -> Doc
<?> forall a. Show a => a -> Doc
pshow Int
projIndex
, Doc
"projLams =" Doc -> Doc -> Doc
<?> forall a. Pretty a => a -> Doc
pretty ProjLams
projLams
]
instance Pretty c => Pretty (FunctionInverse' c) where
pretty :: FunctionInverse' c -> Doc
pretty FunctionInverse' c
NotInjective = Doc
"NotInjective"
pretty (Inverse InversionMap c
inv) = Doc
"Inverse" Doc -> Doc -> Doc
<?>
forall (t :: * -> *). Foldable t => t Doc -> Doc
vcat [ forall a. Pretty a => a -> Doc
pretty TermHead
h Doc -> Doc -> Doc
<+> Doc
"->" Doc -> Doc -> Doc
<?> forall a. Pretty a => a -> Doc
pretty [c]
cs
| (TermHead
h, [c]
cs) <- forall k a. Map k a -> [(k, a)]
Map.toList InversionMap c
inv ]
instance Pretty ProjLams where
pretty :: ProjLams -> Doc
pretty (ProjLams [Arg String]
args) = forall a. Pretty a => a -> Doc
pretty [Arg String]
args
recRecursive :: Defn -> Bool
recRecursive :: Defn -> Bool
recRecursive (Record { recMutual :: Defn -> Maybe [QName]
recMutual = Just [QName]
qs }) = Bool -> Bool
not forall a b. (a -> b) -> a -> b
$ forall a. Null a => a -> Bool
null [QName]
qs
recRecursive Defn
_ = forall a. HasCallStack => a
__IMPOSSIBLE__
recEtaEquality :: Defn -> HasEta
recEtaEquality :: Defn -> HasEta
recEtaEquality = EtaEquality -> HasEta
theEtaEquality forall b c a. (b -> c) -> (a -> b) -> a -> c
. Defn -> EtaEquality
recEtaEquality'
emptyFunctionData :: FunctionData
emptyFunctionData :: FunctionData
emptyFunctionData = FunctionData
{ _funClauses :: [Clause]
_funClauses = []
, _funCompiled :: Maybe CompiledClauses
_funCompiled = forall a. Maybe a
Nothing
, _funSplitTree :: Maybe SplitTree
_funSplitTree = forall a. Maybe a
Nothing
, _funTreeless :: Maybe Compiled
_funTreeless = forall a. Maybe a
Nothing
, _funInv :: FunctionInverse
_funInv = forall c. FunctionInverse' c
NotInjective
, _funMutual :: Maybe [QName]
_funMutual = forall a. Maybe a
Nothing
, _funAbstr :: IsAbstract
_funAbstr = IsAbstract
ConcreteDef
, _funDelayed :: Delayed
_funDelayed = Delayed
NotDelayed
, _funProjection :: Either ProjectionLikenessMissing Projection
_funProjection = forall a b. a -> Either a b
Left ProjectionLikenessMissing
MaybeProjection
, _funFlags :: Set FunctionFlag
_funFlags = forall a. Set a
Set.empty
, _funTerminates :: Maybe Bool
_funTerminates = forall a. Maybe a
Nothing
, _funExtLam :: Maybe ExtLamInfo
_funExtLam = forall a. Maybe a
Nothing
, _funWith :: Maybe QName
_funWith = forall a. Maybe a
Nothing
, _funCovering :: [Clause]
_funCovering = []
, _funIsKanOp :: Maybe QName
_funIsKanOp = forall a. Maybe a
Nothing
}
emptyFunction :: Defn
emptyFunction :: Defn
emptyFunction = FunctionData -> Defn
FunctionDefn FunctionData
emptyFunctionData
funFlag :: FunctionFlag -> Lens' Bool Defn
funFlag :: FunctionFlag -> Lens' Bool Defn
funFlag FunctionFlag
flag Bool -> f Bool
f def :: Defn
def@Function{ funFlags :: Defn -> Set FunctionFlag
funFlags = Set FunctionFlag
flags } =
Bool -> f Bool
f (forall a. Ord a => a -> Set a -> Bool
Set.member FunctionFlag
flag Set FunctionFlag
flags) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&>
\ Bool
b -> Defn
def{ funFlags :: Set FunctionFlag
funFlags = (if Bool
b then forall a. Ord a => a -> Set a -> Set a
Set.insert else forall a. Ord a => a -> Set a -> Set a
Set.delete) FunctionFlag
flag Set FunctionFlag
flags }
funFlag FunctionFlag
_ Bool -> f Bool
f Defn
def = Bool -> f Bool
f Bool
False forall (f :: * -> *) a b. Functor f => f a -> b -> f b
$> Defn
def
funStatic, funInline, funMacro :: Lens' Bool Defn
funStatic :: Lens' Bool Defn
funStatic = FunctionFlag -> Lens' Bool Defn
funFlag FunctionFlag
FunStatic
funInline :: Lens' Bool Defn
funInline = FunctionFlag -> Lens' Bool Defn
funFlag FunctionFlag
FunInline
funMacro :: Lens' Bool Defn
funMacro = FunctionFlag -> Lens' Bool Defn
funFlag FunctionFlag
FunMacro
isMacro :: Defn -> Bool
isMacro :: Defn -> Bool
isMacro = (forall o i. o -> Lens' i o -> i
^. Lens' Bool Defn
funMacro)
isEmptyFunction :: Defn -> Bool
isEmptyFunction :: Defn -> Bool
isEmptyFunction Defn
def =
case Defn
def of
Function { funClauses :: Defn -> [Clause]
funClauses = [] } -> Bool
True
Defn
_ -> Bool
False
isCopatternLHS :: [Clause] -> Bool
isCopatternLHS :: [Clause] -> Bool
isCopatternLHS = forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
List.any (forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
List.any (forall a. Maybe a -> Bool
isJust forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. IsProjP a => a -> Maybe (ProjOrigin, AmbiguousQName)
A.isProjP) forall b c a. (b -> c) -> (a -> b) -> a -> c
. Clause -> [NamedArg DeBruijnPattern]
namedClausePats)
recCon :: Defn -> QName
recCon :: Defn -> QName
recCon Record{ ConHead
recConHead :: ConHead
recConHead :: Defn -> ConHead
recConHead } = ConHead -> QName
conName ConHead
recConHead
recCon Defn
_ = forall a. HasCallStack => a
__IMPOSSIBLE__
defIsRecord :: Defn -> Bool
defIsRecord :: Defn -> Bool
defIsRecord Record{} = Bool
True
defIsRecord Defn
_ = Bool
False
defIsDataOrRecord :: Defn -> Bool
defIsDataOrRecord :: Defn -> Bool
defIsDataOrRecord Record{} = Bool
True
defIsDataOrRecord Datatype{} = Bool
True
defIsDataOrRecord Defn
_ = Bool
False
defConstructors :: Defn -> [QName]
defConstructors :: Defn -> [QName]
defConstructors Datatype{dataCons :: Defn -> [QName]
dataCons = [QName]
cs} = [QName]
cs
defConstructors Record{recConHead :: Defn -> ConHead
recConHead = ConHead
c} = [ConHead -> QName
conName ConHead
c]
defConstructors Defn
_ = forall a. HasCallStack => a
__IMPOSSIBLE__
newtype Fields = Fields [(C.Name, Type)]
deriving Fields
Fields -> Bool
forall a. a -> (a -> Bool) -> Null a
null :: Fields -> Bool
$cnull :: Fields -> Bool
empty :: Fields
$cempty :: Fields
Null
data Simplification = YesSimplification | NoSimplification
deriving (Simplification -> Simplification -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Simplification -> Simplification -> Bool
$c/= :: Simplification -> Simplification -> Bool
== :: Simplification -> Simplification -> Bool
$c== :: Simplification -> Simplification -> Bool
Eq, Int -> Simplification -> ShowS
[Simplification] -> ShowS
Simplification -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Simplification] -> ShowS
$cshowList :: [Simplification] -> ShowS
show :: Simplification -> String
$cshow :: Simplification -> String
showsPrec :: Int -> Simplification -> ShowS
$cshowsPrec :: Int -> Simplification -> ShowS
Show, forall x. Rep Simplification x -> Simplification
forall x. Simplification -> Rep Simplification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Simplification x -> Simplification
$cfrom :: forall x. Simplification -> Rep Simplification x
Generic)
instance Null Simplification where
empty :: Simplification
empty = Simplification
NoSimplification
null :: Simplification -> Bool
null = (forall a. Eq a => a -> a -> Bool
== Simplification
NoSimplification)
instance Semigroup Simplification where
Simplification
YesSimplification <> :: Simplification -> Simplification -> Simplification
<> Simplification
_ = Simplification
YesSimplification
Simplification
NoSimplification <> Simplification
s = Simplification
s
instance Monoid Simplification where
mempty :: Simplification
mempty = Simplification
NoSimplification
mappend :: Simplification -> Simplification -> Simplification
mappend = forall a. Semigroup a => a -> a -> a
(<>)
data Reduced no yes
= NoReduction no
| YesReduction Simplification yes
deriving forall a b. a -> Reduced no b -> Reduced no a
forall a b. (a -> b) -> Reduced no a -> Reduced no b
forall no a b. a -> Reduced no b -> Reduced no a
forall no a b. (a -> b) -> Reduced no a -> Reduced no b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: forall a b. a -> Reduced no b -> Reduced no a
$c<$ :: forall no a b. a -> Reduced no b -> Reduced no a
fmap :: forall a b. (a -> b) -> Reduced no a -> Reduced no b
$cfmap :: forall no a b. (a -> b) -> Reduced no a -> Reduced no b
Functor
redReturn :: a -> ReduceM (Reduced a' a)
redReturn :: forall a a'. a -> ReduceM (Reduced a' a)
redReturn = forall (m :: * -> *) a. Monad m => a -> m a
return forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall no yes. Simplification -> yes -> Reduced no yes
YesReduction Simplification
YesSimplification
redBind :: ReduceM (Reduced a a') -> (a -> b) ->
(a' -> ReduceM (Reduced b b')) -> ReduceM (Reduced b b')
redBind :: forall a a' b b'.
ReduceM (Reduced a a')
-> (a -> b)
-> (a' -> ReduceM (Reduced b b'))
-> ReduceM (Reduced b b')
redBind ReduceM (Reduced a a')
ma a -> b
f a' -> ReduceM (Reduced b b')
k = do
Reduced a a'
r <- ReduceM (Reduced a a')
ma
case Reduced a a'
r of
NoReduction a
x -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ forall no yes. no -> Reduced no yes
NoReduction forall a b. (a -> b) -> a -> b
$ a -> b
f a
x
YesReduction Simplification
_ a'
y -> a' -> ReduceM (Reduced b b')
k a'
y
data IsReduced
= NotReduced
| Reduced (Blocked ())
data MaybeReduced a = MaybeRed
{ forall a. MaybeReduced a -> IsReduced
isReduced :: IsReduced
, forall a. MaybeReduced a -> a
ignoreReduced :: a
}
deriving (forall a b. a -> MaybeReduced b -> MaybeReduced a
forall a b. (a -> b) -> MaybeReduced a -> MaybeReduced b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: forall a b. a -> MaybeReduced b -> MaybeReduced a
$c<$ :: forall a b. a -> MaybeReduced b -> MaybeReduced a
fmap :: forall a b. (a -> b) -> MaybeReduced a -> MaybeReduced b
$cfmap :: forall a b. (a -> b) -> MaybeReduced a -> MaybeReduced b
Functor)
instance IsProjElim e => IsProjElim (MaybeReduced e) where
isProjElim :: MaybeReduced e -> Maybe (ProjOrigin, QName)
isProjElim = forall e. IsProjElim e => e -> Maybe (ProjOrigin, QName)
isProjElim forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. MaybeReduced a -> a
ignoreReduced
type MaybeReducedArgs = [MaybeReduced (Arg Term)]
type MaybeReducedElims = [MaybeReduced Elim]
notReduced :: a -> MaybeReduced a
notReduced :: forall a. a -> MaybeReduced a
notReduced a
x = forall a. IsReduced -> a -> MaybeReduced a
MaybeRed IsReduced
NotReduced a
x
reduced :: Blocked (Arg Term) -> MaybeReduced (Arg Term)
reduced :: Blocked (Arg Term) -> MaybeReduced (Arg Term)
reduced Blocked (Arg Term)
b = forall a. IsReduced -> a -> MaybeReduced a
MaybeRed (Blocked_ -> IsReduced
Reduced forall a b. (a -> b) -> a -> b
$ () forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$ Blocked (Arg Term)
b) forall a b. (a -> b) -> a -> b
$ forall t a. Blocked' t a -> a
ignoreBlocking Blocked (Arg Term)
b
data AllowedReduction
= ProjectionReductions
| InlineReductions
| CopatternReductions
| FunctionReductions
| RecursiveReductions
| LevelReductions
| TypeLevelReductions
| UnconfirmedReductions
| NonTerminatingReductions
deriving (Int -> AllowedReduction -> ShowS
[AllowedReduction] -> ShowS
AllowedReduction -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AllowedReduction] -> ShowS
$cshowList :: [AllowedReduction] -> ShowS
show :: AllowedReduction -> String
$cshow :: AllowedReduction -> String
showsPrec :: Int -> AllowedReduction -> ShowS
$cshowsPrec :: Int -> AllowedReduction -> ShowS
Show, AllowedReduction -> AllowedReduction -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AllowedReduction -> AllowedReduction -> Bool
$c/= :: AllowedReduction -> AllowedReduction -> Bool
== :: AllowedReduction -> AllowedReduction -> Bool
$c== :: AllowedReduction -> AllowedReduction -> Bool
Eq, Eq AllowedReduction
AllowedReduction -> AllowedReduction -> Bool
AllowedReduction -> AllowedReduction -> Ordering
AllowedReduction -> AllowedReduction -> AllowedReduction
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 :: AllowedReduction -> AllowedReduction -> AllowedReduction
$cmin :: AllowedReduction -> AllowedReduction -> AllowedReduction
max :: AllowedReduction -> AllowedReduction -> AllowedReduction
$cmax :: AllowedReduction -> AllowedReduction -> AllowedReduction
>= :: AllowedReduction -> AllowedReduction -> Bool
$c>= :: AllowedReduction -> AllowedReduction -> Bool
> :: AllowedReduction -> AllowedReduction -> Bool
$c> :: AllowedReduction -> AllowedReduction -> Bool
<= :: AllowedReduction -> AllowedReduction -> Bool
$c<= :: AllowedReduction -> AllowedReduction -> Bool
< :: AllowedReduction -> AllowedReduction -> Bool
$c< :: AllowedReduction -> AllowedReduction -> Bool
compare :: AllowedReduction -> AllowedReduction -> Ordering
$ccompare :: AllowedReduction -> AllowedReduction -> Ordering
Ord, Int -> AllowedReduction
AllowedReduction -> Int
AllowedReduction -> [AllowedReduction]
AllowedReduction -> AllowedReduction
AllowedReduction -> AllowedReduction -> [AllowedReduction]
AllowedReduction
-> AllowedReduction -> AllowedReduction -> [AllowedReduction]
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 :: AllowedReduction
-> AllowedReduction -> AllowedReduction -> [AllowedReduction]
$cenumFromThenTo :: AllowedReduction
-> AllowedReduction -> AllowedReduction -> [AllowedReduction]
enumFromTo :: AllowedReduction -> AllowedReduction -> [AllowedReduction]
$cenumFromTo :: AllowedReduction -> AllowedReduction -> [AllowedReduction]
enumFromThen :: AllowedReduction -> AllowedReduction -> [AllowedReduction]
$cenumFromThen :: AllowedReduction -> AllowedReduction -> [AllowedReduction]
enumFrom :: AllowedReduction -> [AllowedReduction]
$cenumFrom :: AllowedReduction -> [AllowedReduction]
fromEnum :: AllowedReduction -> Int
$cfromEnum :: AllowedReduction -> Int
toEnum :: Int -> AllowedReduction
$ctoEnum :: Int -> AllowedReduction
pred :: AllowedReduction -> AllowedReduction
$cpred :: AllowedReduction -> AllowedReduction
succ :: AllowedReduction -> AllowedReduction
$csucc :: AllowedReduction -> AllowedReduction
Enum, AllowedReduction
forall a. a -> a -> Bounded a
maxBound :: AllowedReduction
$cmaxBound :: AllowedReduction
minBound :: AllowedReduction
$cminBound :: AllowedReduction
Bounded, Ord AllowedReduction
(AllowedReduction, AllowedReduction) -> Int
(AllowedReduction, AllowedReduction) -> [AllowedReduction]
(AllowedReduction, AllowedReduction) -> AllowedReduction -> Bool
(AllowedReduction, AllowedReduction) -> AllowedReduction -> Int
forall a.
Ord a
-> ((a, a) -> [a])
-> ((a, a) -> a -> Int)
-> ((a, a) -> a -> Int)
-> ((a, a) -> a -> Bool)
-> ((a, a) -> Int)
-> ((a, a) -> Int)
-> Ix a
unsafeRangeSize :: (AllowedReduction, AllowedReduction) -> Int
$cunsafeRangeSize :: (AllowedReduction, AllowedReduction) -> Int
rangeSize :: (AllowedReduction, AllowedReduction) -> Int
$crangeSize :: (AllowedReduction, AllowedReduction) -> Int
inRange :: (AllowedReduction, AllowedReduction) -> AllowedReduction -> Bool
$cinRange :: (AllowedReduction, AllowedReduction) -> AllowedReduction -> Bool
unsafeIndex :: (AllowedReduction, AllowedReduction) -> AllowedReduction -> Int
$cunsafeIndex :: (AllowedReduction, AllowedReduction) -> AllowedReduction -> Int
index :: (AllowedReduction, AllowedReduction) -> AllowedReduction -> Int
$cindex :: (AllowedReduction, AllowedReduction) -> AllowedReduction -> Int
range :: (AllowedReduction, AllowedReduction) -> [AllowedReduction]
$crange :: (AllowedReduction, AllowedReduction) -> [AllowedReduction]
Ix, forall x. Rep AllowedReduction x -> AllowedReduction
forall x. AllowedReduction -> Rep AllowedReduction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AllowedReduction x -> AllowedReduction
$cfrom :: forall x. AllowedReduction -> Rep AllowedReduction x
Generic)
type AllowedReductions = SmallSet AllowedReduction
allReductions :: AllowedReductions
allReductions :: AllowedReductions
allReductions = forall a. SmallSetElement a => a -> SmallSet a -> SmallSet a
SmallSet.delete AllowedReduction
NonTerminatingReductions AllowedReductions
reallyAllReductions
reallyAllReductions :: AllowedReductions
reallyAllReductions :: AllowedReductions
reallyAllReductions = forall a. SmallSetElement a => SmallSet a
SmallSet.total
data ReduceDefs
= OnlyReduceDefs (Set QName)
| DontReduceDefs (Set QName)
deriving forall x. Rep ReduceDefs x -> ReduceDefs
forall x. ReduceDefs -> Rep ReduceDefs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReduceDefs x -> ReduceDefs
$cfrom :: forall x. ReduceDefs -> Rep ReduceDefs x
Generic
reduceAllDefs :: ReduceDefs
reduceAllDefs :: ReduceDefs
reduceAllDefs = Set QName -> ReduceDefs
DontReduceDefs forall a. Null a => a
empty
locallyReduceDefs :: MonadTCEnv m => ReduceDefs -> m a -> m a
locallyReduceDefs :: forall (m :: * -> *) a. MonadTCEnv m => ReduceDefs -> m a -> m a
locallyReduceDefs = forall (m :: * -> *) a b.
MonadTCEnv m =>
Lens' a TCEnv -> (a -> a) -> m b -> m b
locallyTC Lens' ReduceDefs TCEnv
eReduceDefs forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. a -> b -> a
const
locallyReduceAllDefs :: MonadTCEnv m => m a -> m a
locallyReduceAllDefs :: forall (m :: * -> *) a. MonadTCEnv m => m a -> m a
locallyReduceAllDefs = forall (m :: * -> *) a. MonadTCEnv m => ReduceDefs -> m a -> m a
locallyReduceDefs ReduceDefs
reduceAllDefs
shouldReduceDef :: (MonadTCEnv m) => QName -> m Bool
shouldReduceDef :: forall (m :: * -> *). MonadTCEnv m => QName -> m Bool
shouldReduceDef QName
f = forall (m :: * -> *) a. MonadTCEnv m => (TCEnv -> a) -> m a
asksTC TCEnv -> ReduceDefs
envReduceDefs forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \case
OnlyReduceDefs Set QName
defs -> QName
f forall a. Ord a => a -> Set a -> Bool
`Set.member` Set QName
defs
DontReduceDefs Set QName
defs -> Bool -> Bool
not forall a b. (a -> b) -> a -> b
$ QName
f forall a. Ord a => a -> Set a -> Bool
`Set.member` Set QName
defs
instance Semigroup ReduceDefs where
OnlyReduceDefs Set QName
qs1 <> :: ReduceDefs -> ReduceDefs -> ReduceDefs
<> OnlyReduceDefs Set QName
qs2 = Set QName -> ReduceDefs
OnlyReduceDefs forall a b. (a -> b) -> a -> b
$ forall a. Ord a => Set a -> Set a -> Set a
Set.intersection Set QName
qs1 Set QName
qs2
OnlyReduceDefs Set QName
qs1 <> DontReduceDefs Set QName
qs2 = Set QName -> ReduceDefs
OnlyReduceDefs forall a b. (a -> b) -> a -> b
$ forall a. Ord a => Set a -> Set a -> Set a
Set.difference Set QName
qs1 Set QName
qs2
DontReduceDefs Set QName
qs1 <> OnlyReduceDefs Set QName
qs2 = Set QName -> ReduceDefs
OnlyReduceDefs forall a b. (a -> b) -> a -> b
$ forall a. Ord a => Set a -> Set a -> Set a
Set.difference Set QName
qs2 Set QName
qs1
DontReduceDefs Set QName
qs1 <> DontReduceDefs Set QName
qs2 = Set QName -> ReduceDefs
DontReduceDefs forall a b. (a -> b) -> a -> b
$ forall a. Ord a => Set a -> Set a -> Set a
Set.union Set QName
qs1 Set QName
qs2
instance Monoid ReduceDefs where
mempty :: ReduceDefs
mempty = ReduceDefs
reduceAllDefs
mappend :: ReduceDefs -> ReduceDefs -> ReduceDefs
mappend = forall a. Semigroup a => a -> a -> a
(<>)
locallyReconstructed :: MonadTCEnv m => m a -> m a
locallyReconstructed :: forall (m :: * -> *) a. MonadTCEnv m => m a -> m a
locallyReconstructed = forall (m :: * -> *) a b.
MonadTCEnv m =>
Lens' a TCEnv -> (a -> a) -> m b -> m b
locallyTC Lens' Bool TCEnv
eReconstructed forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. a -> b -> a
const forall a b. (a -> b) -> a -> b
$ Bool
True
isReconstructed :: (MonadTCEnv m) => m Bool
isReconstructed :: forall (m :: * -> *). MonadTCEnv m => m Bool
isReconstructed = forall (m :: * -> *) a. MonadTCEnv m => (TCEnv -> a) -> m a
asksTC TCEnv -> Bool
envReconstructed
data PrimitiveImpl = PrimImpl Type PrimFun
data PrimFun = PrimFun
{ PrimFun -> QName
primFunName :: QName
, PrimFun -> Int
primFunArity :: Arity
, PrimFun
-> [Arg Term] -> Int -> ReduceM (Reduced MaybeReducedArgs Term)
primFunImplementation :: [Arg Term] -> Int -> ReduceM (Reduced MaybeReducedArgs Term)
}
deriving forall x. Rep PrimFun x -> PrimFun
forall x. PrimFun -> Rep PrimFun x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PrimFun x -> PrimFun
$cfrom :: forall x. PrimFun -> Rep PrimFun x
Generic
primFun :: QName -> Arity -> ([Arg Term] -> ReduceM (Reduced MaybeReducedArgs Term)) -> PrimFun
primFun :: QName
-> Int
-> ([Arg Term] -> ReduceM (Reduced MaybeReducedArgs Term))
-> PrimFun
primFun QName
q Int
ar [Arg Term] -> ReduceM (Reduced MaybeReducedArgs Term)
imp = QName
-> Int
-> ([Arg Term] -> Int -> ReduceM (Reduced MaybeReducedArgs Term))
-> PrimFun
PrimFun QName
q Int
ar (\ [Arg Term]
args Int
_ -> [Arg Term] -> ReduceM (Reduced MaybeReducedArgs Term)
imp [Arg Term]
args)
defClauses :: Definition -> [Clause]
defClauses :: Definition -> [Clause]
defClauses Defn{theDef :: Definition -> Defn
theDef = Function{funClauses :: Defn -> [Clause]
funClauses = [Clause]
cs}} = [Clause]
cs
defClauses Defn{theDef :: Definition -> Defn
theDef = Primitive{primClauses :: Defn -> [Clause]
primClauses = [Clause]
cs}} = [Clause]
cs
defClauses Defn{theDef :: Definition -> Defn
theDef = Datatype{dataClause :: Defn -> Maybe Clause
dataClause = Just Clause
c}} = [Clause
c]
defClauses Defn{theDef :: Definition -> Defn
theDef = Record{recClause :: Defn -> Maybe Clause
recClause = Just Clause
c}} = [Clause
c]
defClauses Definition
_ = []
defCompiled :: Definition -> Maybe CompiledClauses
defCompiled :: Definition -> Maybe CompiledClauses
defCompiled Defn{theDef :: Definition -> Defn
theDef = Function {funCompiled :: Defn -> Maybe CompiledClauses
funCompiled = Maybe CompiledClauses
mcc}} = Maybe CompiledClauses
mcc
defCompiled Defn{theDef :: Definition -> Defn
theDef = Primitive{primCompiled :: Defn -> Maybe CompiledClauses
primCompiled = Maybe CompiledClauses
mcc}} = Maybe CompiledClauses
mcc
defCompiled Definition
_ = forall a. Maybe a
Nothing
defParameters :: Definition -> Maybe Nat
defParameters :: Definition -> Maybe Int
defParameters Defn{theDef :: Definition -> Defn
theDef = Datatype{dataPars :: Defn -> Int
dataPars = Int
n}} = forall a. a -> Maybe a
Just Int
n
defParameters Defn{theDef :: Definition -> Defn
theDef = Record {recPars :: Defn -> Int
recPars = Int
n}} = forall a. a -> Maybe a
Just Int
n
defParameters Definition
_ = forall a. Maybe a
Nothing
defInverse :: Definition -> FunctionInverse
defInverse :: Definition -> FunctionInverse
defInverse Defn{theDef :: Definition -> Defn
theDef = Function { funInv :: Defn -> FunctionInverse
funInv = FunctionInverse
inv }} = FunctionInverse
inv
defInverse Defn{theDef :: Definition -> Defn
theDef = Primitive{ primInv :: Defn -> FunctionInverse
primInv = FunctionInverse
inv }} = FunctionInverse
inv
defInverse Definition
_ = forall c. FunctionInverse' c
NotInjective
defCompilerPragmas :: BackendName -> Definition -> [CompilerPragma]
defCompilerPragmas :: String -> Definition -> [CompilerPragma]
defCompilerPragmas String
b = forall a. [a] -> [a]
reverse forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. a -> Maybe a -> a
fromMaybe [] forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall k a. Ord k => k -> Map k a -> Maybe a
Map.lookup String
b forall b c a. (b -> c) -> (a -> b) -> a -> c
. Definition -> CompiledRepresentation
defCompiledRep
defDelayed :: Definition -> Delayed
defDelayed :: Definition -> Delayed
defDelayed Defn{theDef :: Definition -> Defn
theDef = Function{funDelayed :: Defn -> Delayed
funDelayed = Delayed
d}} = Delayed
d
defDelayed Definition
_ = Delayed
NotDelayed
defNonterminating :: Definition -> Bool
defNonterminating :: Definition -> Bool
defNonterminating Defn{theDef :: Definition -> Defn
theDef = Function{funTerminates :: Defn -> Maybe Bool
funTerminates = Just Bool
False}} = Bool
True
defNonterminating Definition
_ = Bool
False
defTerminationUnconfirmed :: Definition -> Bool
defTerminationUnconfirmed :: Definition -> Bool
defTerminationUnconfirmed Defn{theDef :: Definition -> Defn
theDef = Function{funTerminates :: Defn -> Maybe Bool
funTerminates = Just Bool
True}} = Bool
False
defTerminationUnconfirmed Defn{theDef :: Definition -> Defn
theDef = Function{funTerminates :: Defn -> Maybe Bool
funTerminates = Maybe Bool
_ }} = Bool
True
defTerminationUnconfirmed Definition
_ = Bool
False
defAbstract :: Definition -> IsAbstract
defAbstract :: Definition -> IsAbstract
defAbstract Definition
d = case Definition -> Defn
theDef Definition
d of
Axiom{} -> IsAbstract
ConcreteDef
DataOrRecSig{} -> IsAbstract
ConcreteDef
GeneralizableVar{} -> IsAbstract
ConcreteDef
AbstractDefn{} -> IsAbstract
AbstractDef
Function{funAbstr :: Defn -> IsAbstract
funAbstr = IsAbstract
a} -> IsAbstract
a
Datatype{dataAbstr :: Defn -> IsAbstract
dataAbstr = IsAbstract
a} -> IsAbstract
a
Record{recAbstr :: Defn -> IsAbstract
recAbstr = IsAbstract
a} -> IsAbstract
a
Constructor{conAbstr :: Defn -> IsAbstract
conAbstr = IsAbstract
a} -> IsAbstract
a
Primitive{primAbstr :: Defn -> IsAbstract
primAbstr = IsAbstract
a} -> IsAbstract
a
PrimitiveSort{} -> IsAbstract
ConcreteDef
defForced :: Definition -> [IsForced]
defForced :: Definition -> [IsForced]
defForced Definition
d = case Definition -> Defn
theDef Definition
d of
Constructor{conForced :: Defn -> [IsForced]
conForced = [IsForced]
fs} -> [IsForced]
fs
Axiom{} -> []
DataOrRecSig{} -> []
GeneralizableVar{} -> []
AbstractDefn{} -> []
Function{} -> []
Datatype{} -> []
Record{} -> []
Primitive{} -> []
PrimitiveSort{} -> []
type FunctionInverse = FunctionInverse' Clause
type InversionMap c = Map TermHead [c]
data FunctionInverse' c
= NotInjective
| Inverse (InversionMap c)
deriving (Int -> FunctionInverse' c -> ShowS
forall c. Show c => Int -> FunctionInverse' c -> ShowS
forall c. Show c => [FunctionInverse' c] -> ShowS
forall c. Show c => FunctionInverse' c -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FunctionInverse' c] -> ShowS
$cshowList :: forall c. Show c => [FunctionInverse' c] -> ShowS
show :: FunctionInverse' c -> String
$cshow :: forall c. Show c => FunctionInverse' c -> String
showsPrec :: Int -> FunctionInverse' c -> ShowS
$cshowsPrec :: forall c. Show c => Int -> FunctionInverse' c -> ShowS
Show, forall a b. a -> FunctionInverse' b -> FunctionInverse' a
forall a b. (a -> b) -> FunctionInverse' a -> FunctionInverse' b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: forall a b. a -> FunctionInverse' b -> FunctionInverse' a
$c<$ :: forall a b. a -> FunctionInverse' b -> FunctionInverse' a
fmap :: forall a b. (a -> b) -> FunctionInverse' a -> FunctionInverse' b
$cfmap :: forall a b. (a -> b) -> FunctionInverse' a -> FunctionInverse' b
Functor, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall c x. Rep (FunctionInverse' c) x -> FunctionInverse' c
forall c x. FunctionInverse' c -> Rep (FunctionInverse' c) x
$cto :: forall c x. Rep (FunctionInverse' c) x -> FunctionInverse' c
$cfrom :: forall c x. FunctionInverse' c -> Rep (FunctionInverse' c) x
Generic)
data TermHead = SortHead
| PiHead
| ConsHead QName
| VarHead Nat
| UnknownHead
deriving (TermHead -> TermHead -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TermHead -> TermHead -> Bool
$c/= :: TermHead -> TermHead -> Bool
== :: TermHead -> TermHead -> Bool
$c== :: TermHead -> TermHead -> Bool
Eq, Eq TermHead
TermHead -> TermHead -> Bool
TermHead -> TermHead -> Ordering
TermHead -> TermHead -> TermHead
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 :: TermHead -> TermHead -> TermHead
$cmin :: TermHead -> TermHead -> TermHead
max :: TermHead -> TermHead -> TermHead
$cmax :: TermHead -> TermHead -> TermHead
>= :: TermHead -> TermHead -> Bool
$c>= :: TermHead -> TermHead -> Bool
> :: TermHead -> TermHead -> Bool
$c> :: TermHead -> TermHead -> Bool
<= :: TermHead -> TermHead -> Bool
$c<= :: TermHead -> TermHead -> Bool
< :: TermHead -> TermHead -> Bool
$c< :: TermHead -> TermHead -> Bool
compare :: TermHead -> TermHead -> Ordering
$ccompare :: TermHead -> TermHead -> Ordering
Ord, Int -> TermHead -> ShowS
[TermHead] -> ShowS
TermHead -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TermHead] -> ShowS
$cshowList :: [TermHead] -> ShowS
show :: TermHead -> String
$cshow :: TermHead -> String
showsPrec :: Int -> TermHead -> ShowS
$cshowsPrec :: Int -> TermHead -> ShowS
Show, forall x. Rep TermHead x -> TermHead
forall x. TermHead -> Rep TermHead x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TermHead x -> TermHead
$cfrom :: forall x. TermHead -> Rep TermHead x
Generic)
instance Pretty TermHead where
pretty :: TermHead -> Doc
pretty = \ case
TermHead
SortHead -> Doc
"SortHead"
TermHead
PiHead -> Doc
"PiHead"
ConsHead QName
q -> Doc
"ConsHead" Doc -> Doc -> Doc
<+> forall a. Pretty a => a -> Doc
pretty QName
q
VarHead Int
i -> String -> Doc
text (String
"VarHead " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show Int
i)
TermHead
UnknownHead -> Doc
"UnknownHead"
newtype MutualId = MutId Int32
deriving (MutualId -> MutualId -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MutualId -> MutualId -> Bool
$c/= :: MutualId -> MutualId -> Bool
== :: MutualId -> MutualId -> Bool
$c== :: MutualId -> MutualId -> Bool
Eq, Eq MutualId
MutualId -> MutualId -> Bool
MutualId -> MutualId -> Ordering
MutualId -> MutualId -> MutualId
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 :: MutualId -> MutualId -> MutualId
$cmin :: MutualId -> MutualId -> MutualId
max :: MutualId -> MutualId -> MutualId
$cmax :: MutualId -> MutualId -> MutualId
>= :: MutualId -> MutualId -> Bool
$c>= :: MutualId -> MutualId -> Bool
> :: MutualId -> MutualId -> Bool
$c> :: MutualId -> MutualId -> Bool
<= :: MutualId -> MutualId -> Bool
$c<= :: MutualId -> MutualId -> Bool
< :: MutualId -> MutualId -> Bool
$c< :: MutualId -> MutualId -> Bool
compare :: MutualId -> MutualId -> Ordering
$ccompare :: MutualId -> MutualId -> Ordering
Ord, Int -> MutualId -> ShowS
[MutualId] -> ShowS
MutualId -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MutualId] -> ShowS
$cshowList :: [MutualId] -> ShowS
show :: MutualId -> String
$cshow :: MutualId -> String
showsPrec :: Int -> MutualId -> ShowS
$cshowsPrec :: Int -> MutualId -> ShowS
Show, Integer -> MutualId
MutualId -> MutualId
MutualId -> MutualId -> MutualId
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
fromInteger :: Integer -> MutualId
$cfromInteger :: Integer -> MutualId
signum :: MutualId -> MutualId
$csignum :: MutualId -> MutualId
abs :: MutualId -> MutualId
$cabs :: MutualId -> MutualId
negate :: MutualId -> MutualId
$cnegate :: MutualId -> MutualId
* :: MutualId -> MutualId -> MutualId
$c* :: MutualId -> MutualId -> MutualId
- :: MutualId -> MutualId -> MutualId
$c- :: MutualId -> MutualId -> MutualId
+ :: MutualId -> MutualId -> MutualId
$c+ :: MutualId -> MutualId -> MutualId
Num, Int -> MutualId
MutualId -> Int
MutualId -> [MutualId]
MutualId -> MutualId
MutualId -> MutualId -> [MutualId]
MutualId -> MutualId -> MutualId -> [MutualId]
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 :: MutualId -> MutualId -> MutualId -> [MutualId]
$cenumFromThenTo :: MutualId -> MutualId -> MutualId -> [MutualId]
enumFromTo :: MutualId -> MutualId -> [MutualId]
$cenumFromTo :: MutualId -> MutualId -> [MutualId]
enumFromThen :: MutualId -> MutualId -> [MutualId]
$cenumFromThen :: MutualId -> MutualId -> [MutualId]
enumFrom :: MutualId -> [MutualId]
$cenumFrom :: MutualId -> [MutualId]
fromEnum :: MutualId -> Int
$cfromEnum :: MutualId -> Int
toEnum :: Int -> MutualId
$ctoEnum :: Int -> MutualId
pred :: MutualId -> MutualId
$cpred :: MutualId -> MutualId
succ :: MutualId -> MutualId
$csucc :: MutualId -> MutualId
Enum, MutualId -> ()
forall a. (a -> ()) -> NFData a
rnf :: MutualId -> ()
$crnf :: MutualId -> ()
NFData)
type Statistics = Map String Integer
data Call
= CheckClause Type A.SpineClause
| CheckLHS A.SpineLHS
| CheckPattern A.Pattern Telescope Type
| CheckPatternLinearityType C.Name
| CheckPatternLinearityValue C.Name
| CheckLetBinding A.LetBinding
| InferExpr A.Expr
| CheckExprCall Comparison A.Expr Type
| CheckDotPattern A.Expr Term
| CheckProjection Range QName Type
| IsTypeCall Comparison A.Expr Sort
| IsType_ A.Expr
| InferVar Name
| InferDef QName
| CheckArguments Range [NamedArg A.Expr] Type (Maybe Type)
| CheckMetaSolution Range MetaId Type Term
| CheckTargetType Range Type Type
| CheckDataDef Range QName [A.LamBinding] [A.Constructor]
| CheckRecDef Range QName [A.LamBinding] [A.Constructor]
| CheckConstructor QName Telescope Sort A.Constructor
| CheckConstructorFitsIn QName Type Sort
| CheckFunDefCall Range QName [A.Clause] Bool
| CheckPragma Range A.Pragma
| CheckPrimitive Range QName A.Expr
| CheckIsEmpty Range Type
| CheckConfluence QName QName
| CheckWithFunctionType Type
| CheckSectionApplication Range ModuleName A.ModuleApplication
| CheckNamedWhere ModuleName
| CheckIApplyConfluence
Range
QName
Term
Term
Term
Type
| ScopeCheckExpr C.Expr
| ScopeCheckDeclaration NiceDeclaration
| ScopeCheckLHS C.QName C.Pattern
| NoHighlighting
| ModuleContents
| SetRange Range
deriving forall x. Rep Call x -> Call
forall x. Call -> Rep Call x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Call x -> Call
$cfrom :: forall x. Call -> Rep Call x
Generic
instance Pretty Call where
pretty :: Call -> Doc
pretty CheckClause{} = Doc
"CheckClause"
pretty CheckLHS{} = Doc
"CheckLHS"
pretty CheckPattern{} = Doc
"CheckPattern"
pretty CheckPatternLinearityType{} = Doc
"CheckPatternLinearityType"
pretty CheckPatternLinearityValue{} = Doc
"CheckPatternLinearityValue"
pretty InferExpr{} = Doc
"InferExpr"
pretty CheckExprCall{} = Doc
"CheckExprCall"
pretty CheckLetBinding{} = Doc
"CheckLetBinding"
pretty CheckProjection{} = Doc
"CheckProjection"
pretty IsTypeCall{} = Doc
"IsTypeCall"
pretty IsType_{} = Doc
"IsType_"
pretty InferVar{} = Doc
"InferVar"
pretty InferDef{} = Doc
"InferDef"
pretty CheckArguments{} = Doc
"CheckArguments"
pretty CheckMetaSolution{} = Doc
"CheckMetaSolution"
pretty CheckTargetType{} = Doc
"CheckTargetType"
pretty CheckDataDef{} = Doc
"CheckDataDef"
pretty CheckRecDef{} = Doc
"CheckRecDef"
pretty CheckConstructor{} = Doc
"CheckConstructor"
pretty CheckConstructorFitsIn{} = Doc
"CheckConstructorFitsIn"
pretty CheckFunDefCall{} = Doc
"CheckFunDefCall"
pretty CheckPragma{} = Doc
"CheckPragma"
pretty CheckPrimitive{} = Doc
"CheckPrimitive"
pretty CheckWithFunctionType{} = Doc
"CheckWithFunctionType"
pretty CheckNamedWhere{} = Doc
"CheckNamedWhere"
pretty ScopeCheckExpr{} = Doc
"ScopeCheckExpr"
pretty ScopeCheckDeclaration{} = Doc
"ScopeCheckDeclaration"
pretty ScopeCheckLHS{} = Doc
"ScopeCheckLHS"
pretty CheckDotPattern{} = Doc
"CheckDotPattern"
pretty SetRange{} = Doc
"SetRange"
pretty CheckSectionApplication{} = Doc
"CheckSectionApplication"
pretty CheckIsEmpty{} = Doc
"CheckIsEmpty"
pretty CheckConfluence{} = Doc
"CheckConfluence"
pretty NoHighlighting{} = Doc
"NoHighlighting"
pretty ModuleContents{} = Doc
"ModuleContents"
pretty CheckIApplyConfluence{} = Doc
"ModuleContents"
instance HasRange Call where
getRange :: Call -> Range
getRange (CheckClause Type
_ SpineClause
c) = forall a. HasRange a => a -> Range
getRange SpineClause
c
getRange (CheckLHS SpineLHS
lhs) = forall a. HasRange a => a -> Range
getRange SpineLHS
lhs
getRange (CheckPattern Pattern
p Telescope
_ Type
_) = forall a. HasRange a => a -> Range
getRange Pattern
p
getRange (CheckPatternLinearityType Name
x) = forall a. HasRange a => a -> Range
getRange Name
x
getRange (CheckPatternLinearityValue Name
x) = forall a. HasRange a => a -> Range
getRange Name
x
getRange (InferExpr Expr
e) = forall a. HasRange a => a -> Range
getRange Expr
e
getRange (CheckExprCall Comparison
_ Expr
e Type
_) = forall a. HasRange a => a -> Range
getRange Expr
e
getRange (CheckLetBinding LetBinding
b) = forall a. HasRange a => a -> Range
getRange LetBinding
b
getRange (CheckProjection Range
r QName
_ Type
_) = Range
r
getRange (IsTypeCall Comparison
cmp Expr
e Sort
s) = forall a. HasRange a => a -> Range
getRange Expr
e
getRange (IsType_ Expr
e) = forall a. HasRange a => a -> Range
getRange Expr
e
getRange (InferVar Name
x) = forall a. HasRange a => a -> Range
getRange Name
x
getRange (InferDef QName
f) = forall a. HasRange a => a -> Range
getRange QName
f
getRange (CheckArguments Range
r [NamedArg Expr]
_ Type
_ Maybe Type
_) = Range
r
getRange (CheckMetaSolution Range
r MetaId
_ Type
_ Term
_) = Range
r
getRange (CheckTargetType Range
r Type
_ Type
_) = Range
r
getRange (CheckDataDef Range
i QName
_ [LamBinding]
_ [Constructor]
_) = forall a. HasRange a => a -> Range
getRange Range
i
getRange (CheckRecDef Range
i QName
_ [LamBinding]
_ [Constructor]
_) = forall a. HasRange a => a -> Range
getRange Range
i
getRange (CheckConstructor QName
_ Telescope
_ Sort
_ Constructor
c) = forall a. HasRange a => a -> Range
getRange Constructor
c
getRange (CheckConstructorFitsIn QName
c Type
_ Sort
_) = forall a. HasRange a => a -> Range
getRange QName
c
getRange (CheckFunDefCall Range
i QName
_ [Clause]
_ Bool
_) = forall a. HasRange a => a -> Range
getRange Range
i
getRange (CheckPragma Range
r Pragma
_) = Range
r
getRange (CheckPrimitive Range
i QName
_ Expr
_) = forall a. HasRange a => a -> Range
getRange Range
i
getRange CheckWithFunctionType{} = forall a. Range' a
noRange
getRange (CheckNamedWhere ModuleName
m) = forall a. HasRange a => a -> Range
getRange ModuleName
m
getRange (ScopeCheckExpr Expr
e) = forall a. HasRange a => a -> Range
getRange Expr
e
getRange (ScopeCheckDeclaration NiceDeclaration
d) = forall a. HasRange a => a -> Range
getRange NiceDeclaration
d
getRange (ScopeCheckLHS QName
_ Pattern
p) = forall a. HasRange a => a -> Range
getRange Pattern
p
getRange (CheckDotPattern Expr
e Term
_) = forall a. HasRange a => a -> Range
getRange Expr
e
getRange (SetRange Range
r) = Range
r
getRange (CheckSectionApplication Range
r ModuleName
_ ModuleApplication
_) = Range
r
getRange (CheckIsEmpty Range
r Type
_) = Range
r
getRange (CheckConfluence QName
rule1 QName
rule2) = forall a. Ord a => a -> a -> a
max (forall a. HasRange a => a -> Range
getRange QName
rule1) (forall a. HasRange a => a -> Range
getRange QName
rule2)
getRange Call
NoHighlighting = forall a. Range' a
noRange
getRange Call
ModuleContents = forall a. Range' a
noRange
getRange (CheckIApplyConfluence Range
e QName
_ Term
_ Term
_ Term
_ Type
_) = forall a. HasRange a => a -> Range
getRange Range
e
type InstanceTable = Map QName (Set QName)
type TempInstanceTable = (InstanceTable , Set QName)
data BuiltinDescriptor
= BuiltinData (TCM Type) [String]
| BuiltinDataCons (TCM Type)
| BuiltinPrim String (Term -> TCM ())
| BuiltinSort String
| BuiltinPostulate Relevance (TCM Type)
| BuiltinUnknown (Maybe (TCM Type)) (Term -> Type -> TCM ())
data BuiltinInfo =
BuiltinInfo { BuiltinInfo -> String
builtinName :: String
, BuiltinInfo -> BuiltinDescriptor
builtinDesc :: BuiltinDescriptor }
type BuiltinThings pf = Map String (Builtin pf)
data Builtin pf
= Builtin Term
| Prim pf
| BuiltinRewriteRelations (Set QName)
deriving (Int -> Builtin pf -> ShowS
forall pf. Show pf => Int -> Builtin pf -> ShowS
forall pf. Show pf => [Builtin pf] -> ShowS
forall pf. Show pf => Builtin pf -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Builtin pf] -> ShowS
$cshowList :: forall pf. Show pf => [Builtin pf] -> ShowS
show :: Builtin pf -> String
$cshow :: forall pf. Show pf => Builtin pf -> String
showsPrec :: Int -> Builtin pf -> ShowS
$cshowsPrec :: forall pf. Show pf => Int -> Builtin pf -> ShowS
Show, forall a b. a -> Builtin b -> Builtin a
forall a b. (a -> b) -> Builtin a -> Builtin b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: forall a b. a -> Builtin b -> Builtin a
$c<$ :: forall a b. a -> Builtin b -> Builtin a
fmap :: forall a b. (a -> b) -> Builtin a -> Builtin b
$cfmap :: forall a b. (a -> b) -> Builtin a -> Builtin b
Functor, forall a. Eq a => a -> Builtin a -> Bool
forall a. Num a => Builtin a -> a
forall a. Ord a => Builtin a -> a
forall m. Monoid m => Builtin m -> m
forall a. Builtin a -> Bool
forall a. Builtin a -> Int
forall a. Builtin a -> [a]
forall a. (a -> a -> a) -> Builtin a -> a
forall m a. Monoid m => (a -> m) -> Builtin a -> m
forall b a. (b -> a -> b) -> b -> Builtin a -> b
forall a b. (a -> b -> b) -> b -> Builtin a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: forall a. Num a => Builtin a -> a
$cproduct :: forall a. Num a => Builtin a -> a
sum :: forall a. Num a => Builtin a -> a
$csum :: forall a. Num a => Builtin a -> a
minimum :: forall a. Ord a => Builtin a -> a
$cminimum :: forall a. Ord a => Builtin a -> a
maximum :: forall a. Ord a => Builtin a -> a
$cmaximum :: forall a. Ord a => Builtin a -> a
elem :: forall a. Eq a => a -> Builtin a -> Bool
$celem :: forall a. Eq a => a -> Builtin a -> Bool
length :: forall a. Builtin a -> Int
$clength :: forall a. Builtin a -> Int
null :: forall a. Builtin a -> Bool
$cnull :: forall a. Builtin a -> Bool
toList :: forall a. Builtin a -> [a]
$ctoList :: forall a. Builtin a -> [a]
foldl1 :: forall a. (a -> a -> a) -> Builtin a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> Builtin a -> a
foldr1 :: forall a. (a -> a -> a) -> Builtin a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> Builtin a -> a
foldl' :: forall b a. (b -> a -> b) -> b -> Builtin a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> Builtin a -> b
foldl :: forall b a. (b -> a -> b) -> b -> Builtin a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> Builtin a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> Builtin a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> Builtin a -> b
foldr :: forall a b. (a -> b -> b) -> b -> Builtin a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> Builtin a -> b
foldMap' :: forall m a. Monoid m => (a -> m) -> Builtin a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> Builtin a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> Builtin a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> Builtin a -> m
fold :: forall m. Monoid m => Builtin m -> m
$cfold :: forall m. Monoid m => Builtin m -> m
Foldable, Functor Builtin
Foldable Builtin
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a. Monad m => Builtin (m a) -> m (Builtin a)
forall (f :: * -> *) a.
Applicative f =>
Builtin (f a) -> f (Builtin a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Builtin a -> m (Builtin b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Builtin a -> f (Builtin b)
sequence :: forall (m :: * -> *) a. Monad m => Builtin (m a) -> m (Builtin a)
$csequence :: forall (m :: * -> *) a. Monad m => Builtin (m a) -> m (Builtin a)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Builtin a -> m (Builtin b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Builtin a -> m (Builtin b)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
Builtin (f a) -> f (Builtin a)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
Builtin (f a) -> f (Builtin a)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Builtin a -> f (Builtin b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Builtin a -> f (Builtin b)
Traversable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall pf x. Rep (Builtin pf) x -> Builtin pf
forall pf x. Builtin pf -> Rep (Builtin pf) x
$cto :: forall pf x. Rep (Builtin pf) x -> Builtin pf
$cfrom :: forall pf x. Builtin pf -> Rep (Builtin pf) x
Generic)
data HighlightingLevel
= None
| NonInteractive
| Interactive
deriving (HighlightingLevel -> HighlightingLevel -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HighlightingLevel -> HighlightingLevel -> Bool
$c/= :: HighlightingLevel -> HighlightingLevel -> Bool
== :: HighlightingLevel -> HighlightingLevel -> Bool
$c== :: HighlightingLevel -> HighlightingLevel -> Bool
Eq, Eq HighlightingLevel
HighlightingLevel -> HighlightingLevel -> Bool
HighlightingLevel -> HighlightingLevel -> Ordering
HighlightingLevel -> HighlightingLevel -> HighlightingLevel
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 :: HighlightingLevel -> HighlightingLevel -> HighlightingLevel
$cmin :: HighlightingLevel -> HighlightingLevel -> HighlightingLevel
max :: HighlightingLevel -> HighlightingLevel -> HighlightingLevel
$cmax :: HighlightingLevel -> HighlightingLevel -> HighlightingLevel
>= :: HighlightingLevel -> HighlightingLevel -> Bool
$c>= :: HighlightingLevel -> HighlightingLevel -> Bool
> :: HighlightingLevel -> HighlightingLevel -> Bool
$c> :: HighlightingLevel -> HighlightingLevel -> Bool
<= :: HighlightingLevel -> HighlightingLevel -> Bool
$c<= :: HighlightingLevel -> HighlightingLevel -> Bool
< :: HighlightingLevel -> HighlightingLevel -> Bool
$c< :: HighlightingLevel -> HighlightingLevel -> Bool
compare :: HighlightingLevel -> HighlightingLevel -> Ordering
$ccompare :: HighlightingLevel -> HighlightingLevel -> Ordering
Ord, Int -> HighlightingLevel -> ShowS
[HighlightingLevel] -> ShowS
HighlightingLevel -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HighlightingLevel] -> ShowS
$cshowList :: [HighlightingLevel] -> ShowS
show :: HighlightingLevel -> String
$cshow :: HighlightingLevel -> String
showsPrec :: Int -> HighlightingLevel -> ShowS
$cshowsPrec :: Int -> HighlightingLevel -> ShowS
Show, ReadPrec [HighlightingLevel]
ReadPrec HighlightingLevel
Int -> ReadS HighlightingLevel
ReadS [HighlightingLevel]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HighlightingLevel]
$creadListPrec :: ReadPrec [HighlightingLevel]
readPrec :: ReadPrec HighlightingLevel
$creadPrec :: ReadPrec HighlightingLevel
readList :: ReadS [HighlightingLevel]
$creadList :: ReadS [HighlightingLevel]
readsPrec :: Int -> ReadS HighlightingLevel
$creadsPrec :: Int -> ReadS HighlightingLevel
Read, forall x. Rep HighlightingLevel x -> HighlightingLevel
forall x. HighlightingLevel -> Rep HighlightingLevel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HighlightingLevel x -> HighlightingLevel
$cfrom :: forall x. HighlightingLevel -> Rep HighlightingLevel x
Generic)
data HighlightingMethod
= Direct
| Indirect
deriving (HighlightingMethod -> HighlightingMethod -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HighlightingMethod -> HighlightingMethod -> Bool
$c/= :: HighlightingMethod -> HighlightingMethod -> Bool
== :: HighlightingMethod -> HighlightingMethod -> Bool
$c== :: HighlightingMethod -> HighlightingMethod -> Bool
Eq, Int -> HighlightingMethod -> ShowS
[HighlightingMethod] -> ShowS
HighlightingMethod -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HighlightingMethod] -> ShowS
$cshowList :: [HighlightingMethod] -> ShowS
show :: HighlightingMethod -> String
$cshow :: HighlightingMethod -> String
showsPrec :: Int -> HighlightingMethod -> ShowS
$cshowsPrec :: Int -> HighlightingMethod -> ShowS
Show, ReadPrec [HighlightingMethod]
ReadPrec HighlightingMethod
Int -> ReadS HighlightingMethod
ReadS [HighlightingMethod]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HighlightingMethod]
$creadListPrec :: ReadPrec [HighlightingMethod]
readPrec :: ReadPrec HighlightingMethod
$creadPrec :: ReadPrec HighlightingMethod
readList :: ReadS [HighlightingMethod]
$creadList :: ReadS [HighlightingMethod]
readsPrec :: Int -> ReadS HighlightingMethod
$creadsPrec :: Int -> ReadS HighlightingMethod
Read, forall x. Rep HighlightingMethod x -> HighlightingMethod
forall x. HighlightingMethod -> Rep HighlightingMethod x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HighlightingMethod x -> HighlightingMethod
$cfrom :: forall x. HighlightingMethod -> Rep HighlightingMethod x
Generic)
ifTopLevelAndHighlightingLevelIsOr ::
MonadTCEnv tcm => HighlightingLevel -> Bool -> tcm () -> tcm ()
ifTopLevelAndHighlightingLevelIsOr :: forall (tcm :: * -> *).
MonadTCEnv tcm =>
HighlightingLevel -> Bool -> tcm () -> tcm ()
ifTopLevelAndHighlightingLevelIsOr HighlightingLevel
l Bool
b tcm ()
m = do
TCEnv
e <- forall (m :: * -> *). MonadTCEnv m => m TCEnv
askTC
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (TCEnv -> HighlightingLevel
envHighlightingLevel TCEnv
e forall a. Ord a => a -> a -> Bool
>= HighlightingLevel
l Bool -> Bool -> Bool
|| Bool
b) forall a b. (a -> b) -> a -> b
$
case (TCEnv -> [TopLevelModuleName]
envImportPath TCEnv
e) of
(TopLevelModuleName
_:TopLevelModuleName
_:[TopLevelModuleName]
_) -> forall (f :: * -> *) a. Applicative f => a -> f a
pure ()
[TopLevelModuleName]
_ -> tcm ()
m
ifTopLevelAndHighlightingLevelIs ::
MonadTCEnv tcm => HighlightingLevel -> tcm () -> tcm ()
ifTopLevelAndHighlightingLevelIs :: forall (tcm :: * -> *).
MonadTCEnv tcm =>
HighlightingLevel -> tcm () -> tcm ()
ifTopLevelAndHighlightingLevelIs HighlightingLevel
l =
forall (tcm :: * -> *).
MonadTCEnv tcm =>
HighlightingLevel -> Bool -> tcm () -> tcm ()
ifTopLevelAndHighlightingLevelIsOr HighlightingLevel
l Bool
False
data TCEnv =
TCEnv { TCEnv -> Context
envContext :: Context
, TCEnv -> LetBindings
envLetBindings :: LetBindings
, TCEnv -> ModuleName
envCurrentModule :: ModuleName
, TCEnv -> Maybe AbsolutePath
envCurrentPath :: Maybe AbsolutePath
, TCEnv -> [(ModuleName, Int)]
envAnonymousModules :: [(ModuleName, Nat)]
, TCEnv -> [TopLevelModuleName]
envImportPath :: [TopLevelModuleName]
, TCEnv -> Maybe MutualId
envMutualBlock :: Maybe MutualId
, TCEnv -> TerminationCheck ()
envTerminationCheck :: TerminationCheck ()
, TCEnv -> CoverageCheck
envCoverageCheck :: CoverageCheck
, TCEnv -> Bool
envMakeCase :: Bool
, TCEnv -> Bool
envSolvingConstraints :: Bool
, TCEnv -> Bool
envCheckingWhere :: Bool
, TCEnv -> Bool
envWorkingOnTypes :: Bool
, TCEnv -> Bool
envAssignMetas :: Bool
, TCEnv -> Set ProblemId
envActiveProblems :: Set ProblemId
, TCEnv -> AbstractMode
envAbstractMode :: AbstractMode
, TCEnv -> Modality
envModality :: Modality
, TCEnv -> Bool
envSplitOnStrict :: Bool
, TCEnv -> Bool
envDisplayFormsEnabled :: Bool
, TCEnv -> Range
envRange :: Range
, TCEnv -> Range
envHighlightingRange :: Range
, TCEnv -> IPClause
envClause :: IPClause
, TCEnv -> Maybe (Closure Call)
envCall :: Maybe (Closure Call)
, TCEnv -> HighlightingLevel
envHighlightingLevel :: HighlightingLevel
, TCEnv -> HighlightingMethod
envHighlightingMethod :: HighlightingMethod
, TCEnv -> ExpandHidden
envExpandLast :: ExpandHidden
, TCEnv -> Maybe QName
envAppDef :: Maybe QName
, TCEnv -> Simplification
envSimplification :: Simplification
, TCEnv -> AllowedReductions
envAllowedReductions :: AllowedReductions
, TCEnv -> ReduceDefs
envReduceDefs :: ReduceDefs
, TCEnv -> Bool
envReconstructed :: Bool
, TCEnv -> Int
envInjectivityDepth :: Int
, TCEnv -> Bool
envCompareBlocked :: Bool
, TCEnv -> Bool
envPrintDomainFreePi :: Bool
, TCEnv -> Bool
envPrintMetasBare :: Bool
, TCEnv -> Bool
envInsideDotPattern :: Bool
, TCEnv -> UnquoteFlags
envUnquoteFlags :: UnquoteFlags
, TCEnv -> Int
envInstanceDepth :: !Int
, TCEnv -> Bool
envIsDebugPrinting :: Bool
, TCEnv -> [QName]
envPrintingPatternLambdas :: [QName]
, TCEnv -> Bool
envCallByNeed :: Bool
, TCEnv -> CheckpointId
envCurrentCheckpoint :: CheckpointId
, TCEnv -> Map CheckpointId Substitution
envCheckpoints :: Map CheckpointId Substitution
, TCEnv -> DoGeneralize
envGeneralizeMetas :: DoGeneralize
, TCEnv -> Map QName GeneralizedValue
envGeneralizedVars :: Map QName GeneralizedValue
, TCEnv -> Maybe String
envActiveBackendName :: Maybe BackendName
, TCEnv -> Bool
envConflComputingOverlap :: Bool
, TCEnv -> Bool
envCurrentlyElaborating :: Bool
, TCEnv -> Maybe Int
envSyntacticEqualityFuel :: !(Strict.Maybe Int)
}
deriving (forall x. Rep TCEnv x -> TCEnv
forall x. TCEnv -> Rep TCEnv x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TCEnv x -> TCEnv
$cfrom :: forall x. TCEnv -> Rep TCEnv x
Generic)
initEnv :: TCEnv
initEnv :: TCEnv
initEnv = TCEnv { envContext :: Context
envContext = []
, envLetBindings :: LetBindings
envLetBindings = forall k a. Map k a
Map.empty
, envCurrentModule :: ModuleName
envCurrentModule = ModuleName
noModuleName
, envCurrentPath :: Maybe AbsolutePath
envCurrentPath = forall a. Maybe a
Nothing
, envAnonymousModules :: [(ModuleName, Int)]
envAnonymousModules = []
, envImportPath :: [TopLevelModuleName]
envImportPath = []
, envMutualBlock :: Maybe MutualId
envMutualBlock = forall a. Maybe a
Nothing
, envTerminationCheck :: TerminationCheck ()
envTerminationCheck = forall m. TerminationCheck m
TerminationCheck
, envCoverageCheck :: CoverageCheck
envCoverageCheck = CoverageCheck
YesCoverageCheck
, envMakeCase :: Bool
envMakeCase = Bool
False
, envSolvingConstraints :: Bool
envSolvingConstraints = Bool
False
, envCheckingWhere :: Bool
envCheckingWhere = Bool
False
, envActiveProblems :: Set ProblemId
envActiveProblems = forall a. Set a
Set.empty
, envWorkingOnTypes :: Bool
envWorkingOnTypes = Bool
False
, envAssignMetas :: Bool
envAssignMetas = Bool
True
, envAbstractMode :: AbstractMode
envAbstractMode = AbstractMode
ConcreteMode
, envModality :: Modality
envModality = Modality
unitModality
, envSplitOnStrict :: Bool
envSplitOnStrict = Bool
False
, envDisplayFormsEnabled :: Bool
envDisplayFormsEnabled = Bool
True
, envRange :: Range
envRange = forall a. Range' a
noRange
, envHighlightingRange :: Range
envHighlightingRange = forall a. Range' a
noRange
, envClause :: IPClause
envClause = IPClause
IPNoClause
, envCall :: Maybe (Closure Call)
envCall = forall a. Maybe a
Nothing
, envHighlightingLevel :: HighlightingLevel
envHighlightingLevel = HighlightingLevel
None
, envHighlightingMethod :: HighlightingMethod
envHighlightingMethod = HighlightingMethod
Indirect
, envExpandLast :: ExpandHidden
envExpandLast = ExpandHidden
ExpandLast
, envAppDef :: Maybe QName
envAppDef = forall a. Maybe a
Nothing
, envSimplification :: Simplification
envSimplification = Simplification
NoSimplification
, envAllowedReductions :: AllowedReductions
envAllowedReductions = AllowedReductions
allReductions
, envReduceDefs :: ReduceDefs
envReduceDefs = ReduceDefs
reduceAllDefs
, envReconstructed :: Bool
envReconstructed = Bool
False
, envInjectivityDepth :: Int
envInjectivityDepth = Int
0
, envCompareBlocked :: Bool
envCompareBlocked = Bool
False
, envPrintDomainFreePi :: Bool
envPrintDomainFreePi = Bool
False
, envPrintMetasBare :: Bool
envPrintMetasBare = Bool
False
, envInsideDotPattern :: Bool
envInsideDotPattern = Bool
False
, envUnquoteFlags :: UnquoteFlags
envUnquoteFlags = UnquoteFlags
defaultUnquoteFlags
, envInstanceDepth :: Int
envInstanceDepth = Int
0
, envIsDebugPrinting :: Bool
envIsDebugPrinting = Bool
False
, envPrintingPatternLambdas :: [QName]
envPrintingPatternLambdas = []
, envCallByNeed :: Bool
envCallByNeed = Bool
True
, envCurrentCheckpoint :: CheckpointId
envCurrentCheckpoint = CheckpointId
0
, envCheckpoints :: Map CheckpointId Substitution
envCheckpoints = forall k a. k -> a -> Map k a
Map.singleton CheckpointId
0 forall a. Substitution' a
IdS
, envGeneralizeMetas :: DoGeneralize
envGeneralizeMetas = DoGeneralize
NoGeneralize
, envGeneralizedVars :: Map QName GeneralizedValue
envGeneralizedVars = forall k a. Map k a
Map.empty
, envActiveBackendName :: Maybe String
envActiveBackendName = forall a. Maybe a
Nothing
, envConflComputingOverlap :: Bool
envConflComputingOverlap = Bool
False
, envCurrentlyElaborating :: Bool
envCurrentlyElaborating = Bool
False
, envSyntacticEqualityFuel :: Maybe Int
envSyntacticEqualityFuel = forall a. Maybe a
Strict.Nothing
}
class LensTCEnv a where
lensTCEnv :: Lens' TCEnv a
instance LensTCEnv TCEnv where
lensTCEnv :: Lens' TCEnv TCEnv
lensTCEnv = forall a. a -> a
id
instance LensModality TCEnv where
getModality :: TCEnv -> Modality
getModality = forall a. LensCohesion a => Cohesion -> a -> a
setCohesion Cohesion
defaultCohesion forall b c a. (b -> c) -> (a -> b) -> a -> c
. TCEnv -> Modality
envModality
mapModality :: (Modality -> Modality) -> TCEnv -> TCEnv
mapModality Modality -> Modality
f TCEnv
e = TCEnv
e { envModality :: Modality
envModality = forall a. LensCohesion a => Cohesion -> a -> a
setCohesion Cohesion
defaultCohesion forall a b. (a -> b) -> a -> b
$ Modality -> Modality
f forall a b. (a -> b) -> a -> b
$ TCEnv -> Modality
envModality TCEnv
e }
instance LensRelevance TCEnv where
instance LensQuantity TCEnv where
data UnquoteFlags = UnquoteFlags
{ UnquoteFlags -> Bool
_unquoteNormalise :: Bool }
deriving forall x. Rep UnquoteFlags x -> UnquoteFlags
forall x. UnquoteFlags -> Rep UnquoteFlags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UnquoteFlags x -> UnquoteFlags
$cfrom :: forall x. UnquoteFlags -> Rep UnquoteFlags x
Generic
defaultUnquoteFlags :: UnquoteFlags
defaultUnquoteFlags :: UnquoteFlags
defaultUnquoteFlags = UnquoteFlags
{ _unquoteNormalise :: Bool
_unquoteNormalise = Bool
False }
unquoteNormalise :: Lens' Bool UnquoteFlags
unquoteNormalise :: Lens' Bool UnquoteFlags
unquoteNormalise Bool -> f Bool
f UnquoteFlags
e = Bool -> f Bool
f (UnquoteFlags -> Bool
_unquoteNormalise UnquoteFlags
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Bool
x -> UnquoteFlags
e { _unquoteNormalise :: Bool
_unquoteNormalise = Bool
x }
eUnquoteNormalise :: Lens' Bool TCEnv
eUnquoteNormalise :: Lens' Bool TCEnv
eUnquoteNormalise = Lens' UnquoteFlags TCEnv
eUnquoteFlags forall b c a. (b -> c) -> (a -> b) -> a -> c
. Lens' Bool UnquoteFlags
unquoteNormalise
eContext :: Lens' Context TCEnv
eContext :: Lens' Context TCEnv
eContext Context -> f Context
f TCEnv
e = Context -> f Context
f (TCEnv -> Context
envContext TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Context
x -> TCEnv
e { envContext :: Context
envContext = Context
x }
eLetBindings :: Lens' LetBindings TCEnv
eLetBindings :: Lens' LetBindings TCEnv
eLetBindings LetBindings -> f LetBindings
f TCEnv
e = LetBindings -> f LetBindings
f (TCEnv -> LetBindings
envLetBindings TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ LetBindings
x -> TCEnv
e { envLetBindings :: LetBindings
envLetBindings = LetBindings
x }
eCurrentModule :: Lens' ModuleName TCEnv
eCurrentModule :: Lens' ModuleName TCEnv
eCurrentModule ModuleName -> f ModuleName
f TCEnv
e = ModuleName -> f ModuleName
f (TCEnv -> ModuleName
envCurrentModule TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ ModuleName
x -> TCEnv
e { envCurrentModule :: ModuleName
envCurrentModule = ModuleName
x }
eCurrentPath :: Lens' (Maybe AbsolutePath) TCEnv
eCurrentPath :: Lens' (Maybe AbsolutePath) TCEnv
eCurrentPath Maybe AbsolutePath -> f (Maybe AbsolutePath)
f TCEnv
e = Maybe AbsolutePath -> f (Maybe AbsolutePath)
f (TCEnv -> Maybe AbsolutePath
envCurrentPath TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Maybe AbsolutePath
x -> TCEnv
e { envCurrentPath :: Maybe AbsolutePath
envCurrentPath = Maybe AbsolutePath
x }
eAnonymousModules :: Lens' [(ModuleName, Nat)] TCEnv
eAnonymousModules :: Lens' [(ModuleName, Int)] TCEnv
eAnonymousModules [(ModuleName, Int)] -> f [(ModuleName, Int)]
f TCEnv
e = [(ModuleName, Int)] -> f [(ModuleName, Int)]
f (TCEnv -> [(ModuleName, Int)]
envAnonymousModules TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ [(ModuleName, Int)]
x -> TCEnv
e { envAnonymousModules :: [(ModuleName, Int)]
envAnonymousModules = [(ModuleName, Int)]
x }
eImportPath :: Lens' [TopLevelModuleName] TCEnv
eImportPath :: Lens' [TopLevelModuleName] TCEnv
eImportPath [TopLevelModuleName] -> f [TopLevelModuleName]
f TCEnv
e = [TopLevelModuleName] -> f [TopLevelModuleName]
f (TCEnv -> [TopLevelModuleName]
envImportPath TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ [TopLevelModuleName]
x -> TCEnv
e { envImportPath :: [TopLevelModuleName]
envImportPath = [TopLevelModuleName]
x }
eMutualBlock :: Lens' (Maybe MutualId) TCEnv
eMutualBlock :: Lens' (Maybe MutualId) TCEnv
eMutualBlock Maybe MutualId -> f (Maybe MutualId)
f TCEnv
e = Maybe MutualId -> f (Maybe MutualId)
f (TCEnv -> Maybe MutualId
envMutualBlock TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Maybe MutualId
x -> TCEnv
e { envMutualBlock :: Maybe MutualId
envMutualBlock = Maybe MutualId
x }
eTerminationCheck :: Lens' (TerminationCheck ()) TCEnv
eTerminationCheck :: Lens' (TerminationCheck ()) TCEnv
eTerminationCheck TerminationCheck () -> f (TerminationCheck ())
f TCEnv
e = TerminationCheck () -> f (TerminationCheck ())
f (TCEnv -> TerminationCheck ()
envTerminationCheck TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ TerminationCheck ()
x -> TCEnv
e { envTerminationCheck :: TerminationCheck ()
envTerminationCheck = TerminationCheck ()
x }
eCoverageCheck :: Lens' CoverageCheck TCEnv
eCoverageCheck :: Lens' CoverageCheck TCEnv
eCoverageCheck CoverageCheck -> f CoverageCheck
f TCEnv
e = CoverageCheck -> f CoverageCheck
f (TCEnv -> CoverageCheck
envCoverageCheck TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ CoverageCheck
x -> TCEnv
e { envCoverageCheck :: CoverageCheck
envCoverageCheck = CoverageCheck
x }
eMakeCase :: Lens' Bool TCEnv
eMakeCase :: Lens' Bool TCEnv
eMakeCase Bool -> f Bool
f TCEnv
e = Bool -> f Bool
f (TCEnv -> Bool
envMakeCase TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Bool
x -> TCEnv
e { envMakeCase :: Bool
envMakeCase = Bool
x }
eSolvingConstraints :: Lens' Bool TCEnv
eSolvingConstraints :: Lens' Bool TCEnv
eSolvingConstraints Bool -> f Bool
f TCEnv
e = Bool -> f Bool
f (TCEnv -> Bool
envSolvingConstraints TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Bool
x -> TCEnv
e { envSolvingConstraints :: Bool
envSolvingConstraints = Bool
x }
eCheckingWhere :: Lens' Bool TCEnv
eCheckingWhere :: Lens' Bool TCEnv
eCheckingWhere Bool -> f Bool
f TCEnv
e = Bool -> f Bool
f (TCEnv -> Bool
envCheckingWhere TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Bool
x -> TCEnv
e { envCheckingWhere :: Bool
envCheckingWhere = Bool
x }
eWorkingOnTypes :: Lens' Bool TCEnv
eWorkingOnTypes :: Lens' Bool TCEnv
eWorkingOnTypes Bool -> f Bool
f TCEnv
e = Bool -> f Bool
f (TCEnv -> Bool
envWorkingOnTypes TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Bool
x -> TCEnv
e { envWorkingOnTypes :: Bool
envWorkingOnTypes = Bool
x }
eAssignMetas :: Lens' Bool TCEnv
eAssignMetas :: Lens' Bool TCEnv
eAssignMetas Bool -> f Bool
f TCEnv
e = Bool -> f Bool
f (TCEnv -> Bool
envAssignMetas TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Bool
x -> TCEnv
e { envAssignMetas :: Bool
envAssignMetas = Bool
x }
eActiveProblems :: Lens' (Set ProblemId) TCEnv
eActiveProblems :: Lens' (Set ProblemId) TCEnv
eActiveProblems Set ProblemId -> f (Set ProblemId)
f TCEnv
e = Set ProblemId -> f (Set ProblemId)
f (TCEnv -> Set ProblemId
envActiveProblems TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Set ProblemId
x -> TCEnv
e { envActiveProblems :: Set ProblemId
envActiveProblems = Set ProblemId
x }
eAbstractMode :: Lens' AbstractMode TCEnv
eAbstractMode :: Lens' AbstractMode TCEnv
eAbstractMode AbstractMode -> f AbstractMode
f TCEnv
e = AbstractMode -> f AbstractMode
f (TCEnv -> AbstractMode
envAbstractMode TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ AbstractMode
x -> TCEnv
e { envAbstractMode :: AbstractMode
envAbstractMode = AbstractMode
x }
eModality :: Lens' Modality TCEnv
eModality :: Lens' Modality TCEnv
eModality Modality -> f Modality
f TCEnv
e = Modality -> f Modality
f (forall a. LensModality a => a -> Modality
getModality TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Modality
x -> forall a. LensModality a => Modality -> a -> a
setModality Modality
x TCEnv
e
eRelevance :: Lens' Relevance TCEnv
eRelevance :: Lens' Relevance TCEnv
eRelevance = Lens' Modality TCEnv
eModality forall b c a. (b -> c) -> (a -> b) -> a -> c
. Lens' Relevance Modality
lModRelevance
eQuantity :: Lens' Quantity TCEnv
eQuantity :: Lens' Quantity TCEnv
eQuantity = Lens' Modality TCEnv
eModality forall b c a. (b -> c) -> (a -> b) -> a -> c
. Lens' Quantity Modality
lModQuantity
eSplitOnStrict :: Lens' Bool TCEnv
eSplitOnStrict :: Lens' Bool TCEnv
eSplitOnStrict Bool -> f Bool
f TCEnv
e = Bool -> f Bool
f (TCEnv -> Bool
envSplitOnStrict TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Bool
x -> TCEnv
e { envSplitOnStrict :: Bool
envSplitOnStrict = Bool
x }
eDisplayFormsEnabled :: Lens' Bool TCEnv
eDisplayFormsEnabled :: Lens' Bool TCEnv
eDisplayFormsEnabled Bool -> f Bool
f TCEnv
e = Bool -> f Bool
f (TCEnv -> Bool
envDisplayFormsEnabled TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Bool
x -> TCEnv
e { envDisplayFormsEnabled :: Bool
envDisplayFormsEnabled = Bool
x }
eRange :: Lens' Range TCEnv
eRange :: Lens' Range TCEnv
eRange Range -> f Range
f TCEnv
e = Range -> f Range
f (TCEnv -> Range
envRange TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Range
x -> TCEnv
e { envRange :: Range
envRange = Range
x }
eHighlightingRange :: Lens' Range TCEnv
eHighlightingRange :: Lens' Range TCEnv
eHighlightingRange Range -> f Range
f TCEnv
e = Range -> f Range
f (TCEnv -> Range
envHighlightingRange TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Range
x -> TCEnv
e { envHighlightingRange :: Range
envHighlightingRange = Range
x }
eCall :: Lens' (Maybe (Closure Call)) TCEnv
eCall :: Lens' (Maybe (Closure Call)) TCEnv
eCall Maybe (Closure Call) -> f (Maybe (Closure Call))
f TCEnv
e = Maybe (Closure Call) -> f (Maybe (Closure Call))
f (TCEnv -> Maybe (Closure Call)
envCall TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Maybe (Closure Call)
x -> TCEnv
e { envCall :: Maybe (Closure Call)
envCall = Maybe (Closure Call)
x }
eHighlightingLevel :: Lens' HighlightingLevel TCEnv
eHighlightingLevel :: Lens' HighlightingLevel TCEnv
eHighlightingLevel HighlightingLevel -> f HighlightingLevel
f TCEnv
e = HighlightingLevel -> f HighlightingLevel
f (TCEnv -> HighlightingLevel
envHighlightingLevel TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ HighlightingLevel
x -> TCEnv
e { envHighlightingLevel :: HighlightingLevel
envHighlightingLevel = HighlightingLevel
x }
eHighlightingMethod :: Lens' HighlightingMethod TCEnv
eHighlightingMethod :: Lens' HighlightingMethod TCEnv
eHighlightingMethod HighlightingMethod -> f HighlightingMethod
f TCEnv
e = HighlightingMethod -> f HighlightingMethod
f (TCEnv -> HighlightingMethod
envHighlightingMethod TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ HighlightingMethod
x -> TCEnv
e { envHighlightingMethod :: HighlightingMethod
envHighlightingMethod = HighlightingMethod
x }
eExpandLast :: Lens' ExpandHidden TCEnv
eExpandLast :: Lens' ExpandHidden TCEnv
eExpandLast ExpandHidden -> f ExpandHidden
f TCEnv
e = ExpandHidden -> f ExpandHidden
f (TCEnv -> ExpandHidden
envExpandLast TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ ExpandHidden
x -> TCEnv
e { envExpandLast :: ExpandHidden
envExpandLast = ExpandHidden
x }
eAppDef :: Lens' (Maybe QName) TCEnv
eAppDef :: Lens' (Maybe QName) TCEnv
eAppDef Maybe QName -> f (Maybe QName)
f TCEnv
e = Maybe QName -> f (Maybe QName)
f (TCEnv -> Maybe QName
envAppDef TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Maybe QName
x -> TCEnv
e { envAppDef :: Maybe QName
envAppDef = Maybe QName
x }
eSimplification :: Lens' Simplification TCEnv
eSimplification :: Lens' Simplification TCEnv
eSimplification Simplification -> f Simplification
f TCEnv
e = Simplification -> f Simplification
f (TCEnv -> Simplification
envSimplification TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Simplification
x -> TCEnv
e { envSimplification :: Simplification
envSimplification = Simplification
x }
eAllowedReductions :: Lens' AllowedReductions TCEnv
eAllowedReductions :: Lens' AllowedReductions TCEnv
eAllowedReductions AllowedReductions -> f AllowedReductions
f TCEnv
e = AllowedReductions -> f AllowedReductions
f (TCEnv -> AllowedReductions
envAllowedReductions TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ AllowedReductions
x -> TCEnv
e { envAllowedReductions :: AllowedReductions
envAllowedReductions = AllowedReductions
x }
eReduceDefs :: Lens' ReduceDefs TCEnv
eReduceDefs :: Lens' ReduceDefs TCEnv
eReduceDefs ReduceDefs -> f ReduceDefs
f TCEnv
e = ReduceDefs -> f ReduceDefs
f (TCEnv -> ReduceDefs
envReduceDefs TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ ReduceDefs
x -> TCEnv
e { envReduceDefs :: ReduceDefs
envReduceDefs = ReduceDefs
x }
eReconstructed :: Lens' Bool TCEnv
eReconstructed :: Lens' Bool TCEnv
eReconstructed Bool -> f Bool
f TCEnv
e = Bool -> f Bool
f (TCEnv -> Bool
envReconstructed TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Bool
x -> TCEnv
e { envReconstructed :: Bool
envReconstructed = Bool
x }
eInjectivityDepth :: Lens' Int TCEnv
eInjectivityDepth :: Lens' Int TCEnv
eInjectivityDepth Int -> f Int
f TCEnv
e = Int -> f Int
f (TCEnv -> Int
envInjectivityDepth TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Int
x -> TCEnv
e { envInjectivityDepth :: Int
envInjectivityDepth = Int
x }
eCompareBlocked :: Lens' Bool TCEnv
eCompareBlocked :: Lens' Bool TCEnv
eCompareBlocked Bool -> f Bool
f TCEnv
e = Bool -> f Bool
f (TCEnv -> Bool
envCompareBlocked TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Bool
x -> TCEnv
e { envCompareBlocked :: Bool
envCompareBlocked = Bool
x }
ePrintDomainFreePi :: Lens' Bool TCEnv
ePrintDomainFreePi :: Lens' Bool TCEnv
ePrintDomainFreePi Bool -> f Bool
f TCEnv
e = Bool -> f Bool
f (TCEnv -> Bool
envPrintDomainFreePi TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Bool
x -> TCEnv
e { envPrintDomainFreePi :: Bool
envPrintDomainFreePi = Bool
x }
ePrintMetasBare :: Lens' Bool TCEnv
ePrintMetasBare :: Lens' Bool TCEnv
ePrintMetasBare Bool -> f Bool
f TCEnv
e = Bool -> f Bool
f (TCEnv -> Bool
envPrintMetasBare TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Bool
x -> TCEnv
e { envPrintMetasBare :: Bool
envPrintMetasBare = Bool
x }
eInsideDotPattern :: Lens' Bool TCEnv
eInsideDotPattern :: Lens' Bool TCEnv
eInsideDotPattern Bool -> f Bool
f TCEnv
e = Bool -> f Bool
f (TCEnv -> Bool
envInsideDotPattern TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Bool
x -> TCEnv
e { envInsideDotPattern :: Bool
envInsideDotPattern = Bool
x }
eUnquoteFlags :: Lens' UnquoteFlags TCEnv
eUnquoteFlags :: Lens' UnquoteFlags TCEnv
eUnquoteFlags UnquoteFlags -> f UnquoteFlags
f TCEnv
e = UnquoteFlags -> f UnquoteFlags
f (TCEnv -> UnquoteFlags
envUnquoteFlags TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ UnquoteFlags
x -> TCEnv
e { envUnquoteFlags :: UnquoteFlags
envUnquoteFlags = UnquoteFlags
x }
eInstanceDepth :: Lens' Int TCEnv
eInstanceDepth :: Lens' Int TCEnv
eInstanceDepth Int -> f Int
f TCEnv
e = Int -> f Int
f (TCEnv -> Int
envInstanceDepth TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Int
x -> TCEnv
e { envInstanceDepth :: Int
envInstanceDepth = Int
x }
eIsDebugPrinting :: Lens' Bool TCEnv
eIsDebugPrinting :: Lens' Bool TCEnv
eIsDebugPrinting Bool -> f Bool
f TCEnv
e = Bool -> f Bool
f (TCEnv -> Bool
envIsDebugPrinting TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Bool
x -> TCEnv
e { envIsDebugPrinting :: Bool
envIsDebugPrinting = Bool
x }
ePrintingPatternLambdas :: Lens' [QName] TCEnv
ePrintingPatternLambdas :: Lens' [QName] TCEnv
ePrintingPatternLambdas [QName] -> f [QName]
f TCEnv
e = [QName] -> f [QName]
f (TCEnv -> [QName]
envPrintingPatternLambdas TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ [QName]
x -> TCEnv
e { envPrintingPatternLambdas :: [QName]
envPrintingPatternLambdas = [QName]
x }
eCallByNeed :: Lens' Bool TCEnv
eCallByNeed :: Lens' Bool TCEnv
eCallByNeed Bool -> f Bool
f TCEnv
e = Bool -> f Bool
f (TCEnv -> Bool
envCallByNeed TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Bool
x -> TCEnv
e { envCallByNeed :: Bool
envCallByNeed = Bool
x }
eCurrentCheckpoint :: Lens' CheckpointId TCEnv
eCurrentCheckpoint :: Lens' CheckpointId TCEnv
eCurrentCheckpoint CheckpointId -> f CheckpointId
f TCEnv
e = CheckpointId -> f CheckpointId
f (TCEnv -> CheckpointId
envCurrentCheckpoint TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ CheckpointId
x -> TCEnv
e { envCurrentCheckpoint :: CheckpointId
envCurrentCheckpoint = CheckpointId
x }
eCheckpoints :: Lens' (Map CheckpointId Substitution) TCEnv
eCheckpoints :: Lens' (Map CheckpointId Substitution) TCEnv
eCheckpoints Map CheckpointId Substitution -> f (Map CheckpointId Substitution)
f TCEnv
e = Map CheckpointId Substitution -> f (Map CheckpointId Substitution)
f (TCEnv -> Map CheckpointId Substitution
envCheckpoints TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Map CheckpointId Substitution
x -> TCEnv
e { envCheckpoints :: Map CheckpointId Substitution
envCheckpoints = Map CheckpointId Substitution
x }
eGeneralizeMetas :: Lens' DoGeneralize TCEnv
eGeneralizeMetas :: Lens' DoGeneralize TCEnv
eGeneralizeMetas DoGeneralize -> f DoGeneralize
f TCEnv
e = DoGeneralize -> f DoGeneralize
f (TCEnv -> DoGeneralize
envGeneralizeMetas TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ DoGeneralize
x -> TCEnv
e { envGeneralizeMetas :: DoGeneralize
envGeneralizeMetas = DoGeneralize
x }
eGeneralizedVars :: Lens' (Map QName GeneralizedValue) TCEnv
eGeneralizedVars :: Lens' (Map QName GeneralizedValue) TCEnv
eGeneralizedVars Map QName GeneralizedValue -> f (Map QName GeneralizedValue)
f TCEnv
e = Map QName GeneralizedValue -> f (Map QName GeneralizedValue)
f (TCEnv -> Map QName GeneralizedValue
envGeneralizedVars TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Map QName GeneralizedValue
x -> TCEnv
e { envGeneralizedVars :: Map QName GeneralizedValue
envGeneralizedVars = Map QName GeneralizedValue
x }
eActiveBackendName :: Lens' (Maybe BackendName) TCEnv
eActiveBackendName :: Lens' (Maybe String) TCEnv
eActiveBackendName Maybe String -> f (Maybe String)
f TCEnv
e = Maybe String -> f (Maybe String)
f (TCEnv -> Maybe String
envActiveBackendName TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Maybe String
x -> TCEnv
e { envActiveBackendName :: Maybe String
envActiveBackendName = Maybe String
x }
eConflComputingOverlap :: Lens' Bool TCEnv
eConflComputingOverlap :: Lens' Bool TCEnv
eConflComputingOverlap Bool -> f Bool
f TCEnv
e = Bool -> f Bool
f (TCEnv -> Bool
envConflComputingOverlap TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Bool
x -> TCEnv
e { envConflComputingOverlap :: Bool
envConflComputingOverlap = Bool
x }
eCurrentlyElaborating :: Lens' Bool TCEnv
eCurrentlyElaborating :: Lens' Bool TCEnv
eCurrentlyElaborating Bool -> f Bool
f TCEnv
e = Bool -> f Bool
f (TCEnv -> Bool
envCurrentlyElaborating TCEnv
e) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ Bool
x -> TCEnv
e { envCurrentlyElaborating :: Bool
envCurrentlyElaborating = Bool
x }
type Context = [ContextEntry]
type ContextEntry = Dom (Name, Type)
type LetBindings = Map Name (Open (Term, Dom Type))
data AbstractMode
= AbstractMode
| ConcreteMode
| IgnoreAbstractMode
deriving (Int -> AbstractMode -> ShowS
[AbstractMode] -> ShowS
AbstractMode -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AbstractMode] -> ShowS
$cshowList :: [AbstractMode] -> ShowS
show :: AbstractMode -> String
$cshow :: AbstractMode -> String
showsPrec :: Int -> AbstractMode -> ShowS
$cshowsPrec :: Int -> AbstractMode -> ShowS
Show, AbstractMode -> AbstractMode -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AbstractMode -> AbstractMode -> Bool
$c/= :: AbstractMode -> AbstractMode -> Bool
== :: AbstractMode -> AbstractMode -> Bool
$c== :: AbstractMode -> AbstractMode -> Bool
Eq, forall x. Rep AbstractMode x -> AbstractMode
forall x. AbstractMode -> Rep AbstractMode x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AbstractMode x -> AbstractMode
$cfrom :: forall x. AbstractMode -> Rep AbstractMode x
Generic)
aDefToMode :: IsAbstract -> AbstractMode
aDefToMode :: IsAbstract -> AbstractMode
aDefToMode IsAbstract
AbstractDef = AbstractMode
AbstractMode
aDefToMode IsAbstract
ConcreteDef = AbstractMode
ConcreteMode
aModeToDef :: AbstractMode -> Maybe IsAbstract
aModeToDef :: AbstractMode -> Maybe IsAbstract
aModeToDef AbstractMode
AbstractMode = forall a. a -> Maybe a
Just IsAbstract
AbstractDef
aModeToDef AbstractMode
ConcreteMode = forall a. a -> Maybe a
Just IsAbstract
ConcreteDef
aModeToDef AbstractMode
_ = forall a. Maybe a
Nothing
data ExpandHidden
= ExpandLast
| DontExpandLast
| ReallyDontExpandLast
deriving (ExpandHidden -> ExpandHidden -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExpandHidden -> ExpandHidden -> Bool
$c/= :: ExpandHidden -> ExpandHidden -> Bool
== :: ExpandHidden -> ExpandHidden -> Bool
$c== :: ExpandHidden -> ExpandHidden -> Bool
Eq, forall x. Rep ExpandHidden x -> ExpandHidden
forall x. ExpandHidden -> Rep ExpandHidden x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExpandHidden x -> ExpandHidden
$cfrom :: forall x. ExpandHidden -> Rep ExpandHidden x
Generic)
isDontExpandLast :: ExpandHidden -> Bool
isDontExpandLast :: ExpandHidden -> Bool
isDontExpandLast ExpandHidden
ExpandLast = Bool
False
isDontExpandLast ExpandHidden
DontExpandLast = Bool
True
isDontExpandLast ExpandHidden
ReallyDontExpandLast = Bool
True
data CandidateKind
= LocalCandidate
| GlobalCandidate QName
deriving (Int -> CandidateKind -> ShowS
[CandidateKind] -> ShowS
CandidateKind -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CandidateKind] -> ShowS
$cshowList :: [CandidateKind] -> ShowS
show :: CandidateKind -> String
$cshow :: CandidateKind -> String
showsPrec :: Int -> CandidateKind -> ShowS
$cshowsPrec :: Int -> CandidateKind -> ShowS
Show, forall x. Rep CandidateKind x -> CandidateKind
forall x. CandidateKind -> Rep CandidateKind x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CandidateKind x -> CandidateKind
$cfrom :: forall x. CandidateKind -> Rep CandidateKind x
Generic)
data Candidate = Candidate { Candidate -> CandidateKind
candidateKind :: CandidateKind
, Candidate -> Term
candidateTerm :: Term
, Candidate -> Type
candidateType :: Type
, Candidate -> Bool
candidateOverlappable :: Bool
}
deriving (Int -> Candidate -> ShowS
[Candidate] -> ShowS
Candidate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Candidate] -> ShowS
$cshowList :: [Candidate] -> ShowS
show :: Candidate -> String
$cshow :: Candidate -> String
showsPrec :: Int -> Candidate -> ShowS
$cshowsPrec :: Int -> Candidate -> ShowS
Show, forall x. Rep Candidate x -> Candidate
forall x. Candidate -> Rep Candidate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Candidate x -> Candidate
$cfrom :: forall x. Candidate -> Rep Candidate x
Generic)
instance Free Candidate where
freeVars' :: forall a c. IsVarSet a c => Candidate -> FreeM a c
freeVars' (Candidate CandidateKind
_ Term
t Type
u Bool
_) = forall t a c. (Free t, IsVarSet a c) => t -> FreeM a c
freeVars' (Term
t, Type
u)
data ArgsCheckState a = ACState
{ forall a. ArgsCheckState a -> [Maybe Range]
acRanges :: [Maybe Range]
, forall a. ArgsCheckState a -> [Elim]
acElims :: Elims
, forall a. ArgsCheckState a -> [Maybe (Abs Constraint)]
acConstraints :: [Maybe (Abs Constraint)]
, forall a. ArgsCheckState a -> Type
acType :: Type
, forall a. ArgsCheckState a -> a
acData :: a
}
deriving (Int -> ArgsCheckState a -> ShowS
forall a. Show a => Int -> ArgsCheckState a -> ShowS
forall a. Show a => [ArgsCheckState a] -> ShowS
forall a. Show a => ArgsCheckState a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ArgsCheckState a] -> ShowS
$cshowList :: forall a. Show a => [ArgsCheckState a] -> ShowS
show :: ArgsCheckState a -> String
$cshow :: forall a. Show a => ArgsCheckState a -> String
showsPrec :: Int -> ArgsCheckState a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> ArgsCheckState a -> ShowS
Show)
data Warning
= NicifierIssue DeclarationWarning
| TerminationIssue [TerminationError]
| UnreachableClauses QName [Range]
| CoverageIssue QName [(Telescope, [NamedArg DeBruijnPattern])]
| CoverageNoExactSplit QName [Clause]
| NotStrictlyPositive QName (Seq OccursWhere)
| UnsolvedMetaVariables [Range]
| UnsolvedInteractionMetas [Range]
| UnsolvedConstraints Constraints
| CantGeneralizeOverSorts [MetaId]
| AbsurdPatternRequiresNoRHS [NamedArg DeBruijnPattern]
| OldBuiltin String String
| EmptyRewritePragma
| EmptyWhere
| IllformedAsClause String
| ClashesViaRenaming NameOrModule [C.Name]
| UselessPatternDeclarationForRecord String
| UselessPublic
| UselessHiding [C.ImportedName]
| UselessInline QName
| WrongInstanceDeclaration
| InstanceWithExplicitArg QName
| InstanceNoOutputTypeName Doc
| InstanceArgWithExplicitArg Doc
| InversionDepthReached QName
| NoGuardednessFlag QName
| GenericWarning Doc
| GenericNonFatalError Doc
| GenericUseless Range Doc
| SafeFlagPostulate C.Name
| SafeFlagPragma [String]
| SafeFlagNonTerminating
| SafeFlagTerminating
| SafeFlagWithoutKFlagPrimEraseEquality
| WithoutKFlagPrimEraseEquality
| SafeFlagNoPositivityCheck
| SafeFlagPolarity
| SafeFlagNoUniverseCheck
| SafeFlagNoCoverageCheck
| SafeFlagInjective
| SafeFlagEta
| ParseWarning ParseWarning
| LibraryWarning LibWarning
| DeprecationWarning String String String
| UserWarning Text
| DuplicateUsing (List1 C.ImportedName)
| FixityInRenamingModule (List1 Range)
| ModuleDoesntExport C.QName [C.Name] [C.Name] [C.ImportedName]
| InfectiveImport Doc
| CoInfectiveImport Doc
| RewriteNonConfluent Term Term Term Doc
| RewriteMaybeNonConfluent Term Term [Doc]
| RewriteAmbiguousRules Term Term Term
| RewriteMissingRule Term Term Term
| PragmaCompileErased BackendName QName
| NotInScopeW [C.QName]
| UnsupportedIndexedMatch Doc
| AsPatternShadowsConstructorOrPatternSynonym Bool
| RecordFieldWarning RecordFieldWarning
deriving (Int -> Warning -> ShowS
[Warning] -> ShowS
Warning -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Warning] -> ShowS
$cshowList :: [Warning] -> ShowS
show :: Warning -> String
$cshow :: Warning -> String
showsPrec :: Int -> Warning -> ShowS
$cshowsPrec :: Int -> Warning -> ShowS
Show, forall x. Rep Warning x -> Warning
forall x. Warning -> Rep Warning x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Warning x -> Warning
$cfrom :: forall x. Warning -> Rep Warning x
Generic)
data RecordFieldWarning
= DuplicateFieldsWarning [(C.Name, Range)]
| TooManyFieldsWarning QName [C.Name] [(C.Name, Range)]
deriving (Int -> RecordFieldWarning -> ShowS
[RecordFieldWarning] -> ShowS
RecordFieldWarning -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RecordFieldWarning] -> ShowS
$cshowList :: [RecordFieldWarning] -> ShowS
show :: RecordFieldWarning -> String
$cshow :: RecordFieldWarning -> String
showsPrec :: Int -> RecordFieldWarning -> ShowS
$cshowsPrec :: Int -> RecordFieldWarning -> ShowS
Show, forall x. Rep RecordFieldWarning x -> RecordFieldWarning
forall x. RecordFieldWarning -> Rep RecordFieldWarning x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RecordFieldWarning x -> RecordFieldWarning
$cfrom :: forall x. RecordFieldWarning -> Rep RecordFieldWarning x
Generic)
recordFieldWarningToError :: RecordFieldWarning -> TypeError
recordFieldWarningToError :: RecordFieldWarning -> TypeError
recordFieldWarningToError = \case
DuplicateFieldsWarning [(Name, Range)]
xrs -> [Name] -> TypeError
DuplicateFields forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> a
fst [(Name, Range)]
xrs
TooManyFieldsWarning QName
q [Name]
ys [(Name, Range)]
xrs -> QName -> [Name] -> [Name] -> TypeError
TooManyFields QName
q [Name]
ys forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> a
fst [(Name, Range)]
xrs
warningName :: Warning -> WarningName
warningName :: Warning -> WarningName
warningName = \case
NicifierIssue DeclarationWarning
dw -> DeclarationWarning -> WarningName
declarationWarningName DeclarationWarning
dw
ParseWarning ParseWarning
pw -> ParseWarning -> WarningName
parseWarningName ParseWarning
pw
LibraryWarning LibWarning
lw -> LibWarning -> WarningName
libraryWarningName LibWarning
lw
AsPatternShadowsConstructorOrPatternSynonym{} -> WarningName
AsPatternShadowsConstructorOrPatternSynonym_
AbsurdPatternRequiresNoRHS{} -> WarningName
AbsurdPatternRequiresNoRHS_
CantGeneralizeOverSorts{} -> WarningName
CantGeneralizeOverSorts_
CoverageIssue{} -> WarningName
CoverageIssue_
CoverageNoExactSplit{} -> WarningName
CoverageNoExactSplit_
DeprecationWarning{} -> WarningName
DeprecationWarning_
Warning
EmptyRewritePragma -> WarningName
EmptyRewritePragma_
Warning
EmptyWhere -> WarningName
EmptyWhere_
IllformedAsClause{} -> WarningName
IllformedAsClause_
WrongInstanceDeclaration{} -> WarningName
WrongInstanceDeclaration_
InstanceWithExplicitArg{} -> WarningName
InstanceWithExplicitArg_
InstanceNoOutputTypeName{} -> WarningName
InstanceNoOutputTypeName_
InstanceArgWithExplicitArg{} -> WarningName
InstanceArgWithExplicitArg_
DuplicateUsing{} -> WarningName
DuplicateUsing_
FixityInRenamingModule{} -> WarningName
FixityInRenamingModule_
GenericNonFatalError{} -> WarningName
GenericNonFatalError_
GenericUseless{} -> WarningName
GenericUseless_
GenericWarning{} -> WarningName
GenericWarning_
InversionDepthReached{} -> WarningName
InversionDepthReached_
ModuleDoesntExport{} -> WarningName
ModuleDoesntExport_
NoGuardednessFlag{} -> WarningName
NoGuardednessFlag_
NotInScopeW{} -> WarningName
NotInScope_
NotStrictlyPositive{} -> WarningName
NotStrictlyPositive_
UnsupportedIndexedMatch{} -> WarningName
UnsupportedIndexedMatch_
OldBuiltin{} -> WarningName
OldBuiltin_
Warning
SafeFlagNoPositivityCheck -> WarningName
SafeFlagNoPositivityCheck_
Warning
SafeFlagNonTerminating -> WarningName
SafeFlagNonTerminating_
Warning
SafeFlagNoUniverseCheck -> WarningName
SafeFlagNoUniverseCheck_
Warning
SafeFlagPolarity -> WarningName
SafeFlagPolarity_
SafeFlagPostulate{} -> WarningName
SafeFlagPostulate_
SafeFlagPragma{} -> WarningName
SafeFlagPragma_
Warning
SafeFlagEta -> WarningName
SafeFlagEta_
Warning
SafeFlagInjective -> WarningName
SafeFlagInjective_
Warning
SafeFlagNoCoverageCheck -> WarningName
SafeFlagNoCoverageCheck_
Warning
SafeFlagWithoutKFlagPrimEraseEquality -> WarningName
SafeFlagWithoutKFlagPrimEraseEquality_
Warning
WithoutKFlagPrimEraseEquality -> WarningName
WithoutKFlagPrimEraseEquality_
Warning
SafeFlagTerminating -> WarningName
SafeFlagTerminating_
TerminationIssue{} -> WarningName
TerminationIssue_
UnreachableClauses{} -> WarningName
UnreachableClauses_
UnsolvedInteractionMetas{} -> WarningName
UnsolvedInteractionMetas_
UnsolvedConstraints{} -> WarningName
UnsolvedConstraints_
UnsolvedMetaVariables{} -> WarningName
UnsolvedMetaVariables_
UselessHiding{} -> WarningName
UselessHiding_
UselessInline{} -> WarningName
UselessInline_
UselessPublic{} -> WarningName
UselessPublic_
UselessPatternDeclarationForRecord{} -> WarningName
UselessPatternDeclarationForRecord_
ClashesViaRenaming{} -> WarningName
ClashesViaRenaming_
UserWarning{} -> WarningName
UserWarning_
InfectiveImport{} -> WarningName
InfectiveImport_
CoInfectiveImport{} -> WarningName
CoInfectiveImport_
RewriteNonConfluent{} -> WarningName
RewriteNonConfluent_
RewriteMaybeNonConfluent{} -> WarningName
RewriteMaybeNonConfluent_
RewriteAmbiguousRules{} -> WarningName
RewriteAmbiguousRules_
RewriteMissingRule{} -> WarningName
RewriteMissingRule_
PragmaCompileErased{} -> WarningName
PragmaCompileErased_
RecordFieldWarning RecordFieldWarning
w -> case RecordFieldWarning
w of
DuplicateFieldsWarning{} -> WarningName
DuplicateFieldsWarning_
TooManyFieldsWarning{} -> WarningName
TooManyFieldsWarning_
data TCWarning
= TCWarning
{ TCWarning -> CallStack
tcWarningLocation :: CallStack
, TCWarning -> Range
tcWarningRange :: Range
, TCWarning -> Warning
tcWarning :: Warning
, TCWarning -> Doc
tcWarningPrintedWarning :: Doc
, TCWarning -> Bool
tcWarningCached :: Bool
}
deriving (Int -> TCWarning -> ShowS
[TCWarning] -> ShowS
TCWarning -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TCWarning] -> ShowS
$cshowList :: [TCWarning] -> ShowS
show :: TCWarning -> String
$cshow :: TCWarning -> String
showsPrec :: Int -> TCWarning -> ShowS
$cshowsPrec :: Int -> TCWarning -> ShowS
Show, forall x. Rep TCWarning x -> TCWarning
forall x. TCWarning -> Rep TCWarning x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TCWarning x -> TCWarning
$cfrom :: forall x. TCWarning -> Rep TCWarning x
Generic)
tcWarningOrigin :: TCWarning -> SrcFile
tcWarningOrigin :: TCWarning -> Maybe RangeFile
tcWarningOrigin = Range -> Maybe RangeFile
rangeFile forall b c a. (b -> c) -> (a -> b) -> a -> c
. TCWarning -> Range
tcWarningRange
instance HasRange TCWarning where
getRange :: TCWarning -> Range
getRange = TCWarning -> Range
tcWarningRange
instance Eq TCWarning where
== :: TCWarning -> TCWarning -> Bool
(==) = forall a. Eq a => a -> a -> Bool
(==) forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
`on` TCWarning -> Doc
tcWarningPrintedWarning
data CallInfo = CallInfo
{ CallInfo -> QName
callInfoTarget :: QName
, CallInfo -> Closure Term
callInfoCall :: Closure Term
} deriving (Int -> CallInfo -> ShowS
[CallInfo] -> ShowS
CallInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CallInfo] -> ShowS
$cshowList :: [CallInfo] -> ShowS
show :: CallInfo -> String
$cshow :: CallInfo -> String
showsPrec :: Int -> CallInfo -> ShowS
$cshowsPrec :: Int -> CallInfo -> ShowS
Show, forall x. Rep CallInfo x -> CallInfo
forall x. CallInfo -> Rep CallInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CallInfo x -> CallInfo
$cfrom :: forall x. CallInfo -> Rep CallInfo x
Generic)
instance HasRange CallInfo where
getRange :: CallInfo -> Range
getRange = forall a. HasRange a => a -> Range
getRange forall b c a. (b -> c) -> (a -> b) -> a -> c
. CallInfo -> QName
callInfoTarget
instance Pretty CallInfo where pretty :: CallInfo -> Doc
pretty = forall a. Pretty a => a -> Doc
pretty forall b c a. (b -> c) -> (a -> b) -> a -> c
. CallInfo -> QName
callInfoTarget
data TerminationError = TerminationError
{ TerminationError -> [QName]
termErrFunctions :: [QName]
, TerminationError -> [CallInfo]
termErrCalls :: [CallInfo]
} deriving (Int -> TerminationError -> ShowS
[TerminationError] -> ShowS
TerminationError -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TerminationError] -> ShowS
$cshowList :: [TerminationError] -> ShowS
show :: TerminationError -> String
$cshow :: TerminationError -> String
showsPrec :: Int -> TerminationError -> ShowS
$cshowsPrec :: Int -> TerminationError -> ShowS
Show, forall x. Rep TerminationError x -> TerminationError
forall x. TerminationError -> Rep TerminationError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TerminationError x -> TerminationError
$cfrom :: forall x. TerminationError -> Rep TerminationError x
Generic)
data SplitError
= NotADatatype (Closure Type)
| BlockedType Blocker (Closure Type)
| ErasedDatatype Bool (Closure Type)
| CoinductiveDatatype (Closure Type)
| UnificationStuck
{ SplitError -> Maybe Blocker
cantSplitBlocker :: Maybe Blocker
, SplitError -> QName
cantSplitConName :: QName
, SplitError -> Telescope
cantSplitTel :: Telescope
, SplitError -> [Arg Term]
cantSplitConIdx :: Args
, SplitError -> [Arg Term]
cantSplitGivenIdx :: Args
, SplitError -> [UnificationFailure]
cantSplitFailures :: [UnificationFailure]
}
| CosplitCatchall
| CosplitNoTarget
| CosplitNoRecordType (Closure Type)
| CannotCreateMissingClause QName (Telescope,[NamedArg DeBruijnPattern]) Doc (Closure (Abs Type))
| GenericSplitError String
deriving (Int -> SplitError -> ShowS
[SplitError] -> ShowS
SplitError -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SplitError] -> ShowS
$cshowList :: [SplitError] -> ShowS
show :: SplitError -> String
$cshow :: SplitError -> String
showsPrec :: Int -> SplitError -> ShowS
$cshowsPrec :: Int -> SplitError -> ShowS
Show, forall x. Rep SplitError x -> SplitError
forall x. SplitError -> Rep SplitError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SplitError x -> SplitError
$cfrom :: forall x. SplitError -> Rep SplitError x
Generic)
data NegativeUnification
= UnifyConflict Telescope Term Term
| UnifyCycle Telescope Int Term
deriving (Int -> NegativeUnification -> ShowS
[NegativeUnification] -> ShowS
NegativeUnification -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NegativeUnification] -> ShowS
$cshowList :: [NegativeUnification] -> ShowS
show :: NegativeUnification -> String
$cshow :: NegativeUnification -> String
showsPrec :: Int -> NegativeUnification -> ShowS
$cshowsPrec :: Int -> NegativeUnification -> ShowS
Show, forall x. Rep NegativeUnification x -> NegativeUnification
forall x. NegativeUnification -> Rep NegativeUnification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NegativeUnification x -> NegativeUnification
$cfrom :: forall x. NegativeUnification -> Rep NegativeUnification x
Generic)
data UnificationFailure
= UnifyIndicesNotVars Telescope Type Term Term Args
| UnifyRecursiveEq Telescope Type Int Term
| UnifyReflexiveEq Telescope Type Term
| UnifyUnusableModality Telescope Type Int Term Modality
deriving (Int -> UnificationFailure -> ShowS
[UnificationFailure] -> ShowS
UnificationFailure -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UnificationFailure] -> ShowS
$cshowList :: [UnificationFailure] -> ShowS
show :: UnificationFailure -> String
$cshow :: UnificationFailure -> String
showsPrec :: Int -> UnificationFailure -> ShowS
$cshowsPrec :: Int -> UnificationFailure -> ShowS
Show, forall x. Rep UnificationFailure x -> UnificationFailure
forall x. UnificationFailure -> Rep UnificationFailure x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UnificationFailure x -> UnificationFailure
$cfrom :: forall x. UnificationFailure -> Rep UnificationFailure x
Generic)
data UnquoteError
= BadVisibility String (Arg I.Term)
| ConInsteadOfDef QName String String
| DefInsteadOfCon QName String String
| NonCanonical String I.Term
| BlockedOnMeta TCState Blocker
| UnquotePanic String
deriving (Int -> UnquoteError -> ShowS
[UnquoteError] -> ShowS
UnquoteError -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UnquoteError] -> ShowS
$cshowList :: [UnquoteError] -> ShowS
show :: UnquoteError -> String
$cshow :: UnquoteError -> String
showsPrec :: Int -> UnquoteError -> ShowS
$cshowsPrec :: Int -> UnquoteError -> ShowS
Show, forall x. Rep UnquoteError x -> UnquoteError
forall x. UnquoteError -> Rep UnquoteError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UnquoteError x -> UnquoteError
$cfrom :: forall x. UnquoteError -> Rep UnquoteError x
Generic)
data TypeError
= InternalError String
| NotImplemented String
| NotSupported String
| CompilationError String
| PropMustBeSingleton
| DataMustEndInSort Term
| ShouldEndInApplicationOfTheDatatype Type
| ShouldBeAppliedToTheDatatypeParameters Term Term
| ShouldBeApplicationOf Type QName
| ConstructorPatternInWrongDatatype QName QName
| CantResolveOverloadedConstructorsTargetingSameDatatype QName (List1 QName)
| DoesNotConstructAnElementOf QName Type
| WrongHidingInLHS
| WrongHidingInLambda Type
| WrongHidingInApplication Type
| WrongNamedArgument (NamedArg A.Expr) [NamedName]
| WrongIrrelevanceInLambda
| WrongQuantityInLambda
| WrongCohesionInLambda
| QuantityMismatch Quantity Quantity
| HidingMismatch Hiding Hiding
| RelevanceMismatch Relevance Relevance
| UninstantiatedDotPattern A.Expr
| ForcedConstructorNotInstantiated A.Pattern
| IllformedProjectionPattern A.Pattern
| CannotEliminateWithPattern (Maybe Blocker) (NamedArg A.Pattern) Type
| WrongNumberOfConstructorArguments QName Nat Nat
| ShouldBeEmpty Type [DeBruijnPattern]
| ShouldBeASort Type
| ShouldBePi Type
| ShouldBePath Type
| ShouldBeRecordType Type
| ShouldBeRecordPattern DeBruijnPattern
| NotAProjectionPattern (NamedArg A.Pattern)
| NotAProperTerm
| InvalidTypeSort Sort
| InvalidType Term
| FunctionTypeInSizeUniv Term
| SplitOnIrrelevant (Dom Type)
| SplitOnUnusableCohesion (Dom Type)
| SplitOnNonVariable Term Type
| SplitOnNonEtaRecord QName
| DefinitionIsIrrelevant QName
| DefinitionIsErased QName
| VariableIsIrrelevant Name
| VariableIsErased Name
| VariableIsOfUnusableCohesion Name Cohesion
| UnequalLevel Comparison Level Level
| UnequalTerms Comparison Term Term CompareAs
| UnequalTypes Comparison Type Type
| UnequalRelevance Comparison Term Term
| UnequalQuantity Comparison Term Term
| UnequalCohesion Comparison Term Term
| UnequalFiniteness Comparison Term Term
| UnequalHiding Term Term
| UnequalSorts Sort Sort
| UnequalBecauseOfUniverseConflict Comparison Term Term
| NotLeqSort Sort Sort
| MetaCannotDependOn MetaId Nat
| MetaOccursInItself MetaId
| MetaIrrelevantSolution MetaId Term
| MetaErasedSolution MetaId Term
| GenericError String
| GenericDocError Doc
| SortOfSplitVarError (Maybe Blocker) Doc
| BuiltinMustBeConstructor String A.Expr
| NoSuchBuiltinName String
| DuplicateBuiltinBinding String Term Term
| NoBindingForBuiltin String
| NoSuchPrimitiveFunction String
| DuplicatePrimitiveBinding String QName QName
| WrongModalityForPrimitive String ArgInfo ArgInfo
| ShadowedModule C.Name [A.ModuleName]
| BuiltinInParameterisedModule String
| IllegalLetInTelescope C.TypedBinding
| IllegalPatternInTelescope C.Binder
| NoRHSRequiresAbsurdPattern [NamedArg A.Pattern]
| TooManyFields QName [C.Name] [C.Name]
| DuplicateFields [C.Name]
| DuplicateConstructors [C.Name]
| WithOnFreeVariable A.Expr Term
| UnexpectedWithPatterns [A.Pattern]
| WithClausePatternMismatch A.Pattern (NamedArg DeBruijnPattern)
| FieldOutsideRecord
| ModuleArityMismatch A.ModuleName Telescope [NamedArg A.Expr]
| GeneralizeCyclicDependency
| GeneralizeUnsolvedMeta
| SplitError SplitError
| ImpossibleConstructor QName NegativeUnification
| TooManyPolarities QName Int
| LocalVsImportedModuleClash ModuleName
| SolvedButOpenHoles
| CyclicModuleDependency [TopLevelModuleName]
| FileNotFound TopLevelModuleName [AbsolutePath]
| OverlappingProjects AbsolutePath TopLevelModuleName TopLevelModuleName
| AmbiguousTopLevelModuleName TopLevelModuleName [AbsolutePath]
| ModuleNameUnexpected TopLevelModuleName TopLevelModuleName
| ModuleNameDoesntMatchFileName TopLevelModuleName [AbsolutePath]
| ClashingFileNamesFor ModuleName [AbsolutePath]
| ModuleDefinedInOtherFile TopLevelModuleName AbsolutePath AbsolutePath
| BothWithAndRHS
| AbstractConstructorNotInScope A.QName
| NotInScope [C.QName]
| NoSuchModule C.QName
| AmbiguousName C.QName AmbiguousNameReason
| AmbiguousModule C.QName (List1 A.ModuleName)
| ClashingDefinition C.QName A.QName (Maybe NiceDeclaration)
| ClashingModule A.ModuleName A.ModuleName
| ClashingImport C.Name A.QName
| ClashingModuleImport C.Name A.ModuleName
| PatternShadowsConstructor C.Name A.QName
| DuplicateImports C.QName [C.ImportedName]
| InvalidPattern C.Pattern
| RepeatedVariablesInPattern [C.Name]
| GeneralizeNotSupportedHere A.QName
| MultipleFixityDecls [(C.Name, [Fixity'])]
| MultiplePolarityPragmas [C.Name]
| NotAModuleExpr C.Expr
| NotAnExpression C.Expr
| NotAValidLetBinding NiceDeclaration
| NotValidBeforeField NiceDeclaration
| NothingAppliedToHiddenArg C.Expr
| NothingAppliedToInstanceArg C.Expr
| BadArgumentsToPatternSynonym A.AmbiguousQName
| TooFewArgumentsToPatternSynonym A.AmbiguousQName
| CannotResolveAmbiguousPatternSynonym (List1 (A.QName, A.PatternSynDefn))
| UnusedVariableInPatternSynonym
| NoParseForApplication (List2 C.Expr)
| AmbiguousParseForApplication (List2 C.Expr) (List1 C.Expr)
| NoParseForLHS LHSOrPatSyn [C.Pattern] C.Pattern
| AmbiguousParseForLHS LHSOrPatSyn C.Pattern [C.Pattern]
| OperatorInformation [NotationSection] TypeError
| InstanceNoCandidate Type [(Term, TCErr)]
| UnquoteFailed UnquoteError
| DeBruijnIndexOutOfScope Nat Telescope [Name]
| NeedOptionCopatterns
| NeedOptionRewriting
| NeedOptionProp
| NeedOptionTwoLevel
| NonFatalErrors [TCWarning]
| InstanceSearchDepthExhausted Term Type Int
| TriedToCopyConstrainedPrim QName
deriving (Int -> TypeError -> ShowS
[TypeError] -> ShowS
TypeError -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TypeError] -> ShowS
$cshowList :: [TypeError] -> ShowS
show :: TypeError -> String
$cshow :: TypeError -> String
showsPrec :: Int -> TypeError -> ShowS
$cshowsPrec :: Int -> TypeError -> ShowS
Show, forall x. Rep TypeError x -> TypeError
forall x. TypeError -> Rep TypeError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TypeError x -> TypeError
$cfrom :: forall x. TypeError -> Rep TypeError x
Generic)
data LHSOrPatSyn = IsLHS | IsPatSyn
deriving (LHSOrPatSyn -> LHSOrPatSyn -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LHSOrPatSyn -> LHSOrPatSyn -> Bool
$c/= :: LHSOrPatSyn -> LHSOrPatSyn -> Bool
== :: LHSOrPatSyn -> LHSOrPatSyn -> Bool
$c== :: LHSOrPatSyn -> LHSOrPatSyn -> Bool
Eq, Int -> LHSOrPatSyn -> ShowS
[LHSOrPatSyn] -> ShowS
LHSOrPatSyn -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LHSOrPatSyn] -> ShowS
$cshowList :: [LHSOrPatSyn] -> ShowS
show :: LHSOrPatSyn -> String
$cshow :: LHSOrPatSyn -> String
showsPrec :: Int -> LHSOrPatSyn -> ShowS
$cshowsPrec :: Int -> LHSOrPatSyn -> ShowS
Show, forall x. Rep LHSOrPatSyn x -> LHSOrPatSyn
forall x. LHSOrPatSyn -> Rep LHSOrPatSyn x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LHSOrPatSyn x -> LHSOrPatSyn
$cfrom :: forall x. LHSOrPatSyn -> Rep LHSOrPatSyn x
Generic)
data TCErr
= TypeError
{ TCErr -> CallStack
tcErrLocation :: CallStack
, TCErr -> TCState
tcErrState :: TCState
, TCErr -> Closure TypeError
tcErrClosErr :: Closure TypeError
}
| Exception Range Doc
| IOException TCState Range E.IOException
| PatternErr Blocker
instance Show TCErr where
show :: TCErr -> String
show (TypeError CallStack
_ TCState
_ Closure TypeError
e) = forall a. Pretty a => a -> String
prettyShow (TCEnv -> Range
envRange forall a b. (a -> b) -> a -> b
$ forall a. Closure a -> TCEnv
clEnv Closure TypeError
e) forall a. [a] -> [a] -> [a]
++ String
": " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show (forall a. Closure a -> a
clValue Closure TypeError
e)
show (Exception Range
r Doc
d) = forall a. Pretty a => a -> String
prettyShow Range
r forall a. [a] -> [a] -> [a]
++ String
": " forall a. [a] -> [a] -> [a]
++ Doc -> String
render Doc
d
show (IOException TCState
_ Range
r IOException
e) = forall a. Pretty a => a -> String
prettyShow Range
r forall a. [a] -> [a] -> [a]
++ String
": " forall a. [a] -> [a] -> [a]
++
forall e. Exception e => e -> String
E.displayException IOException
e
show PatternErr{} = String
"Pattern violation (you shouldn't see this)"
instance HasRange TCErr where
getRange :: TCErr -> Range
getRange (TypeError CallStack
_ TCState
_ Closure TypeError
cl) = TCEnv -> Range
envRange forall a b. (a -> b) -> a -> b
$ forall a. Closure a -> TCEnv
clEnv Closure TypeError
cl
getRange (Exception Range
r Doc
_) = Range
r
getRange (IOException TCState
s Range
r IOException
_) = Range
r
getRange PatternErr{} = forall a. Range' a
noRange
instance E.Exception TCErr
instance MonadIO m => HasOptions (TCMT m) where
pragmaOptions :: TCMT m PragmaOptions
pragmaOptions = forall (m :: * -> *) a. ReadTCState m => Lens' a TCState -> m a
useTC Lens' PragmaOptions TCState
stPragmaOptions
commandLineOptions :: TCMT m CommandLineOptions
commandLineOptions = do
PragmaOptions
p <- forall (m :: * -> *) a. ReadTCState m => Lens' a TCState -> m a
useTC Lens' PragmaOptions TCState
stPragmaOptions
CommandLineOptions
cl <- PersistentTCState -> CommandLineOptions
stPersistentOptions forall b c a. (b -> c) -> (a -> b) -> a -> c
. TCState -> PersistentTCState
stPersistentState forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall (m :: * -> *). MonadTCState m => m TCState
getTC
forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ CommandLineOptions
cl { optPragmaOptions :: PragmaOptions
optPragmaOptions = PragmaOptions
p }
sizedTypesOption :: HasOptions m => m Bool
sizedTypesOption :: forall (m :: * -> *). HasOptions m => m Bool
sizedTypesOption = forall (b :: Bool). KnownBool b => WithDefault b -> Bool
collapseDefault forall b c a. (b -> c) -> (a -> b) -> a -> c
. PragmaOptions -> WithDefault 'False
optSizedTypes forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall (m :: * -> *). HasOptions m => m PragmaOptions
pragmaOptions
guardednessOption :: HasOptions m => m Bool
guardednessOption :: forall (m :: * -> *). HasOptions m => m Bool
guardednessOption = forall (b :: Bool). KnownBool b => WithDefault b -> Bool
collapseDefault forall b c a. (b -> c) -> (a -> b) -> a -> c
. PragmaOptions -> WithDefault 'False
optGuardedness forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall (m :: * -> *). HasOptions m => m PragmaOptions
pragmaOptions
withoutKOption :: HasOptions m => m Bool
withoutKOption :: forall (m :: * -> *). HasOptions m => m Bool
withoutKOption = forall (b :: Bool). KnownBool b => WithDefault b -> Bool
collapseDefault forall b c a. (b -> c) -> (a -> b) -> a -> c
. PragmaOptions -> WithDefault 'False
optWithoutK forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall (m :: * -> *). HasOptions m => m PragmaOptions
pragmaOptions
cubicalCompatibleOption :: HasOptions m => m Bool
cubicalCompatibleOption :: forall (m :: * -> *). HasOptions m => m Bool
cubicalCompatibleOption = forall (b :: Bool). KnownBool b => WithDefault b -> Bool
collapseDefault forall b c a. (b -> c) -> (a -> b) -> a -> c
. PragmaOptions -> WithDefault 'False
optCubicalCompatible forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall (m :: * -> *). HasOptions m => m PragmaOptions
pragmaOptions
enableCaching :: HasOptions m => m Bool
enableCaching :: forall (m :: * -> *). HasOptions m => m Bool
enableCaching = PragmaOptions -> Bool
optCaching forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall (m :: * -> *). HasOptions m => m PragmaOptions
pragmaOptions
data ReduceEnv = ReduceEnv
{ ReduceEnv -> TCEnv
redEnv :: TCEnv
, ReduceEnv -> TCState
redSt :: TCState
, ReduceEnv -> Maybe (MetaId -> ReduceM Bool)
redPred :: Maybe (MetaId -> ReduceM Bool)
}
mapRedEnv :: (TCEnv -> TCEnv) -> ReduceEnv -> ReduceEnv
mapRedEnv :: (TCEnv -> TCEnv) -> ReduceEnv -> ReduceEnv
mapRedEnv TCEnv -> TCEnv
f ReduceEnv
s = ReduceEnv
s { redEnv :: TCEnv
redEnv = TCEnv -> TCEnv
f (ReduceEnv -> TCEnv
redEnv ReduceEnv
s) }
mapRedSt :: (TCState -> TCState) -> ReduceEnv -> ReduceEnv
mapRedSt :: (TCState -> TCState) -> ReduceEnv -> ReduceEnv
mapRedSt TCState -> TCState
f ReduceEnv
s = ReduceEnv
s { redSt :: TCState
redSt = TCState -> TCState
f (ReduceEnv -> TCState
redSt ReduceEnv
s) }
mapRedEnvSt :: (TCEnv -> TCEnv) -> (TCState -> TCState) -> ReduceEnv
-> ReduceEnv
mapRedEnvSt :: (TCEnv -> TCEnv) -> (TCState -> TCState) -> ReduceEnv -> ReduceEnv
mapRedEnvSt TCEnv -> TCEnv
f TCState -> TCState
g (ReduceEnv TCEnv
e TCState
s Maybe (MetaId -> ReduceM Bool)
p) = TCEnv -> TCState -> Maybe (MetaId -> ReduceM Bool) -> ReduceEnv
ReduceEnv (TCEnv -> TCEnv
f TCEnv
e) (TCState -> TCState
g TCState
s) Maybe (MetaId -> ReduceM Bool)
p
reduceEnv :: Lens' TCEnv ReduceEnv
reduceEnv :: Lens' TCEnv ReduceEnv
reduceEnv TCEnv -> f TCEnv
f ReduceEnv
s = TCEnv -> f TCEnv
f (ReduceEnv -> TCEnv
redEnv ReduceEnv
s) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ TCEnv
e -> ReduceEnv
s { redEnv :: TCEnv
redEnv = TCEnv
e }
reduceSt :: Lens' TCState ReduceEnv
reduceSt :: Lens' TCState ReduceEnv
reduceSt TCState -> f TCState
f ReduceEnv
s = TCState -> f TCState
f (ReduceEnv -> TCState
redSt ReduceEnv
s) forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \ TCState
e -> ReduceEnv
s { redSt :: TCState
redSt = TCState
e }
newtype ReduceM a = ReduceM { forall a. ReduceM a -> ReduceEnv -> a
unReduceM :: ReduceEnv -> a }
onReduceEnv :: (ReduceEnv -> ReduceEnv) -> ReduceM a -> ReduceM a
onReduceEnv :: forall a. (ReduceEnv -> ReduceEnv) -> ReduceM a -> ReduceM a
onReduceEnv ReduceEnv -> ReduceEnv
f (ReduceM ReduceEnv -> a
m) = forall a. (ReduceEnv -> a) -> ReduceM a
ReduceM (ReduceEnv -> a
m forall b c a. (b -> c) -> (a -> b) -> a -> c
. ReduceEnv -> ReduceEnv
f)
fmapReduce :: (a -> b) -> ReduceM a -> ReduceM b
fmapReduce :: forall a b. (a -> b) -> ReduceM a -> ReduceM b
fmapReduce a -> b
f (ReduceM ReduceEnv -> a
m) = forall a. (ReduceEnv -> a) -> ReduceM a
ReduceM forall a b. (a -> b) -> a -> b
$ \ ReduceEnv
e -> a -> b
f forall a b. (a -> b) -> a -> b
$! ReduceEnv -> a
m ReduceEnv
e
{-# INLINE fmapReduce #-}
apReduce :: ReduceM (a -> b) -> ReduceM a -> ReduceM b
apReduce :: forall a b. ReduceM (a -> b) -> ReduceM a -> ReduceM b
apReduce (ReduceM ReduceEnv -> a -> b
f) (ReduceM ReduceEnv -> a
x) = forall a. (ReduceEnv -> a) -> ReduceM a
ReduceM forall a b. (a -> b) -> a -> b
$ \ ReduceEnv
e ->
let g :: a -> b
g = ReduceEnv -> a -> b
f ReduceEnv
e
a :: a
a = ReduceEnv -> a
x ReduceEnv
e
in a -> b
g forall a b. a -> b -> b
`pseq` a
a forall a b. a -> b -> b
`pseq` a -> b
g a
a
{-# INLINE apReduce #-}
thenReduce :: ReduceM a -> ReduceM b -> ReduceM b
thenReduce :: forall a b. ReduceM a -> ReduceM b -> ReduceM b
thenReduce (ReduceM ReduceEnv -> a
x) (ReduceM ReduceEnv -> b
y) = forall a. (ReduceEnv -> a) -> ReduceM a
ReduceM forall a b. (a -> b) -> a -> b
$ \ ReduceEnv
e -> ReduceEnv -> a
x ReduceEnv
e forall a b. a -> b -> b
`pseq` ReduceEnv -> b
y ReduceEnv
e
{-# INLINE thenReduce #-}
beforeReduce :: ReduceM a -> ReduceM b -> ReduceM a
beforeReduce :: forall a b. ReduceM a -> ReduceM b -> ReduceM a
beforeReduce (ReduceM ReduceEnv -> a
x) (ReduceM ReduceEnv -> b
y) = forall a. (ReduceEnv -> a) -> ReduceM a
ReduceM forall a b. (a -> b) -> a -> b
$ \ ReduceEnv
e ->
let a :: a
a = ReduceEnv -> a
x ReduceEnv
e
in a
a forall a b. a -> b -> b
`pseq` ReduceEnv -> b
y ReduceEnv
e forall a b. a -> b -> b
`pseq` a
a
{-# INLINE beforeReduce #-}
bindReduce :: ReduceM a -> (a -> ReduceM b) -> ReduceM b
bindReduce :: forall a b. ReduceM a -> (a -> ReduceM b) -> ReduceM b
bindReduce (ReduceM ReduceEnv -> a
m) a -> ReduceM b
f = forall a. (ReduceEnv -> a) -> ReduceM a
ReduceM forall a b. (a -> b) -> a -> b
$ \ ReduceEnv
e -> forall a. ReduceM a -> ReduceEnv -> a
unReduceM (a -> ReduceM b
f forall a b. (a -> b) -> a -> b
$! ReduceEnv -> a
m ReduceEnv
e) ReduceEnv
e
{-# INLINE bindReduce #-}
instance Functor ReduceM where
fmap :: forall a b. (a -> b) -> ReduceM a -> ReduceM b
fmap = forall a b. (a -> b) -> ReduceM a -> ReduceM b
fmapReduce
instance Applicative ReduceM where
pure :: forall a. a -> ReduceM a
pure a
x = forall a. (ReduceEnv -> a) -> ReduceM a
ReduceM (forall a b. a -> b -> a
const a
x)
<*> :: forall a b. ReduceM (a -> b) -> ReduceM a -> ReduceM b
(<*>) = forall a b. ReduceM (a -> b) -> ReduceM a -> ReduceM b
apReduce
*> :: forall a b. ReduceM a -> ReduceM b -> ReduceM b
(*>) = forall a b. ReduceM a -> ReduceM b -> ReduceM b
thenReduce
<* :: forall a b. ReduceM a -> ReduceM b -> ReduceM a
(<*) = forall a b. ReduceM a -> ReduceM b -> ReduceM a
beforeReduce
instance Monad ReduceM where
return :: forall a. a -> ReduceM a
return = forall (f :: * -> *) a. Applicative f => a -> f a
pure
>>= :: forall a b. ReduceM a -> (a -> ReduceM b) -> ReduceM b
(>>=) = forall a b. ReduceM a -> (a -> ReduceM b) -> ReduceM b
bindReduce
>> :: forall a b. ReduceM a -> ReduceM b -> ReduceM b
(>>) = forall (f :: * -> *) a b. Applicative f => f a -> f b -> f b
(*>)
#if __GLASGOW_HASKELL__ < 808
fail = Fail.fail
#endif
instance Fail.MonadFail ReduceM where
fail :: forall a. String -> ReduceM a
fail = forall a. HasCallStack => String -> a
error
instance ReadTCState ReduceM where
getTCState :: ReduceM TCState
getTCState = forall a. (ReduceEnv -> a) -> ReduceM a
ReduceM ReduceEnv -> TCState
redSt
locallyTCState :: forall a b. Lens' a TCState -> (a -> a) -> ReduceM b -> ReduceM b
locallyTCState Lens' a TCState
l a -> a
f = forall a. (ReduceEnv -> ReduceEnv) -> ReduceM a -> ReduceM a
onReduceEnv forall a b. (a -> b) -> a -> b
$ (TCState -> TCState) -> ReduceEnv -> ReduceEnv
mapRedSt forall a b. (a -> b) -> a -> b
$ forall i o. Lens' i o -> LensMap i o
over Lens' a TCState
l a -> a
f
runReduceM :: ReduceM a -> TCM a
runReduceM :: forall a. ReduceM a -> TCM a
runReduceM ReduceM a
m = forall (m :: * -> *) a. (IORef TCState -> TCEnv -> m a) -> TCMT m a
TCM forall a b. (a -> b) -> a -> b
$ \ IORef TCState
r TCEnv
e -> do
TCState
s <- forall a. IORef a -> IO a
readIORef IORef TCState
r
forall a. a -> IO a
E.evaluate forall a b. (a -> b) -> a -> b
$ forall a. ReduceM a -> ReduceEnv -> a
unReduceM ReduceM a
m forall a b. (a -> b) -> a -> b
$ TCEnv -> TCState -> Maybe (MetaId -> ReduceM Bool) -> ReduceEnv
ReduceEnv TCEnv
e TCState
s forall a. Maybe a
Nothing
runReduceF :: (a -> ReduceM b) -> TCM (a -> b)
runReduceF :: forall a b. (a -> ReduceM b) -> TCM (a -> b)
runReduceF a -> ReduceM b
f = do
TCEnv
e <- forall (m :: * -> *). MonadTCEnv m => m TCEnv
askTC
TCState
s <- forall (m :: * -> *). MonadTCState m => m TCState
getTC
forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ \a
x -> forall a. ReduceM a -> ReduceEnv -> a
unReduceM (a -> ReduceM b
f a
x) (TCEnv -> TCState -> Maybe (MetaId -> ReduceM Bool) -> ReduceEnv
ReduceEnv TCEnv
e TCState
s forall a. Maybe a
Nothing)
instance MonadTCEnv ReduceM where
askTC :: ReduceM TCEnv
askTC = forall a. (ReduceEnv -> a) -> ReduceM a
ReduceM ReduceEnv -> TCEnv
redEnv
localTC :: forall a. (TCEnv -> TCEnv) -> ReduceM a -> ReduceM a
localTC = forall a. (ReduceEnv -> ReduceEnv) -> ReduceM a -> ReduceM a
onReduceEnv forall b c a. (b -> c) -> (a -> b) -> a -> c
. (TCEnv -> TCEnv) -> ReduceEnv -> ReduceEnv
mapRedEnv
useR :: (ReadTCState m) => Lens' a TCState -> m a
useR :: forall (m :: * -> *) a. ReadTCState m => Lens' a TCState -> m a
useR Lens' a TCState
l = do
!a
x <- (forall o i. o -> Lens' i o -> i
^.Lens' a TCState
l) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall (m :: * -> *). ReadTCState m => m TCState
getTCState
forall (m :: * -> *) a. Monad m => a -> m a
return a
x
askR :: ReduceM ReduceEnv
askR :: ReduceM ReduceEnv
askR = forall a. (ReduceEnv -> a) -> ReduceM a
ReduceM forall r (m :: * -> *). MonadReader r m => m r
ask
localR :: (ReduceEnv -> ReduceEnv) -> ReduceM a -> ReduceM a
localR :: forall a. (ReduceEnv -> ReduceEnv) -> ReduceM a -> ReduceM a
localR ReduceEnv -> ReduceEnv
f = forall a. (ReduceEnv -> a) -> ReduceM a
ReduceM forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall r (m :: * -> *) a. MonadReader r m => (r -> r) -> m a -> m a
local ReduceEnv -> ReduceEnv
f forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. ReduceM a -> ReduceEnv -> a
unReduceM
instance HasOptions ReduceM where
pragmaOptions :: ReduceM PragmaOptions
pragmaOptions = forall (m :: * -> *) a. ReadTCState m => Lens' a TCState -> m a
useR Lens' PragmaOptions TCState
stPragmaOptions
commandLineOptions :: ReduceM CommandLineOptions
commandLineOptions = do
PragmaOptions
p <- forall (m :: * -> *) a. ReadTCState m => Lens' a TCState -> m a
useR Lens' PragmaOptions TCState
stPragmaOptions
CommandLineOptions
cl <- PersistentTCState -> CommandLineOptions
stPersistentOptions forall b c a. (b -> c) -> (a -> b) -> a -> c
. TCState -> PersistentTCState
stPersistentState forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall (m :: * -> *). ReadTCState m => m TCState
getTCState
forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ CommandLineOptions
cl{ optPragmaOptions :: PragmaOptions
optPragmaOptions = PragmaOptions
p }
class ( Applicative m
, MonadTCEnv m
, ReadTCState m
, HasOptions m
) => MonadReduce m where
liftReduce :: ReduceM a -> m a
default liftReduce :: (MonadTrans t, MonadReduce n, t n ~ m) => ReduceM a -> m a
liftReduce = forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a. MonadReduce m => ReduceM a -> m a
liftReduce
instance MonadReduce ReduceM where
liftReduce :: forall a. ReduceM a -> ReduceM a
liftReduce = forall a. a -> a
id
instance MonadReduce m => MonadReduce (ChangeT m)
instance MonadReduce m => MonadReduce (ExceptT err m)
instance MonadReduce m => MonadReduce (IdentityT m)
instance MonadReduce m => MonadReduce (ListT m)
instance MonadReduce m => MonadReduce (MaybeT m)
instance MonadReduce m => MonadReduce (ReaderT r m)
instance MonadReduce m => MonadReduce (StateT w m)
instance (Monoid w, MonadReduce m) => MonadReduce (WriterT w m)
instance MonadReduce m => MonadReduce (BlockT m)
class Monad m => MonadTCEnv m where
askTC :: m TCEnv
localTC :: (TCEnv -> TCEnv) -> m a -> m a
default askTC :: (MonadTrans t, MonadTCEnv n, t n ~ m) => m TCEnv
askTC = forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall (m :: * -> *). MonadTCEnv m => m TCEnv
askTC
default localTC
:: (MonadTransControl t, MonadTCEnv n, t n ~ m)
=> (TCEnv -> TCEnv) -> m a -> m a
localTC = forall (t :: (* -> *) -> * -> *) (m :: * -> *) a b.
(MonadTransControl t, Monad (t m), Monad m) =>
(m (StT t a) -> m (StT t b)) -> t m a -> t m b
liftThrough forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a.
MonadTCEnv m =>
(TCEnv -> TCEnv) -> m a -> m a
localTC
instance MonadTCEnv m => MonadTCEnv (ChangeT m)
instance MonadTCEnv m => MonadTCEnv (ExceptT err m)
instance MonadTCEnv m => MonadTCEnv (IdentityT m)
instance MonadTCEnv m => MonadTCEnv (MaybeT m)
instance MonadTCEnv m => MonadTCEnv (ReaderT r m)
instance MonadTCEnv m => MonadTCEnv (StateT s m)
instance (Monoid w, MonadTCEnv m) => MonadTCEnv (WriterT w m)
instance MonadTCEnv m => MonadTCEnv (ListT m) where
localTC :: forall a. (TCEnv -> TCEnv) -> ListT m a -> ListT m a
localTC = forall (m :: * -> *) a (n :: * -> *) b.
(m (Maybe (a, ListT m a)) -> n (Maybe (b, ListT n b)))
-> ListT m a -> ListT n b
mapListT forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a.
MonadTCEnv m =>
(TCEnv -> TCEnv) -> m a -> m a
localTC
asksTC :: MonadTCEnv m => (TCEnv -> a) -> m a
asksTC :: forall (m :: * -> *) a. MonadTCEnv m => (TCEnv -> a) -> m a
asksTC TCEnv -> a
f = TCEnv -> a
f forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall (m :: * -> *). MonadTCEnv m => m TCEnv
askTC
viewTC :: MonadTCEnv m => Lens' a TCEnv -> m a
viewTC :: forall (m :: * -> *) a. MonadTCEnv m => Lens' a TCEnv -> m a
viewTC Lens' a TCEnv
l = forall (m :: * -> *) a. MonadTCEnv m => (TCEnv -> a) -> m a
asksTC (forall o i. o -> Lens' i o -> i
^. Lens' a TCEnv
l)
locallyTC :: MonadTCEnv m => Lens' a TCEnv -> (a -> a) -> m b -> m b
locallyTC :: forall (m :: * -> *) a b.
MonadTCEnv m =>
Lens' a TCEnv -> (a -> a) -> m b -> m b
locallyTC Lens' a TCEnv
l = forall (m :: * -> *) a.
MonadTCEnv m =>
(TCEnv -> TCEnv) -> m a -> m a
localTC forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall i o. Lens' i o -> LensMap i o
over Lens' a TCEnv
l
class Monad m => MonadTCState m where
getTC :: m TCState
putTC :: TCState -> m ()
modifyTC :: (TCState -> TCState) -> m ()
default getTC :: (MonadTrans t, MonadTCState n, t n ~ m) => m TCState
getTC = forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall (m :: * -> *). MonadTCState m => m TCState
getTC
default putTC :: (MonadTrans t, MonadTCState n, t n ~ m) => TCState -> m ()
putTC = forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *). MonadTCState m => TCState -> m ()
putTC
default modifyTC :: (MonadTrans t, MonadTCState n, t n ~ m) => (TCState -> TCState) -> m ()
modifyTC = forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *).
MonadTCState m =>
(TCState -> TCState) -> m ()
modifyTC
instance MonadTCState m => MonadTCState (MaybeT m)
instance MonadTCState m => MonadTCState (ListT m)
instance MonadTCState m => MonadTCState (ExceptT err m)
instance MonadTCState m => MonadTCState (ReaderT r m)
instance MonadTCState m => MonadTCState (StateT s m)
instance MonadTCState m => MonadTCState (ChangeT m)
instance MonadTCState m => MonadTCState (IdentityT m)
instance (Monoid w, MonadTCState m) => MonadTCState (WriterT w m)
getsTC :: ReadTCState m => (TCState -> a) -> m a
getsTC :: forall (m :: * -> *) a. ReadTCState m => (TCState -> a) -> m a
getsTC TCState -> a
f = TCState -> a
f forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall (m :: * -> *). ReadTCState m => m TCState
getTCState
modifyTC' :: MonadTCState m => (TCState -> TCState) -> m ()
modifyTC' :: forall (m :: * -> *).
MonadTCState m =>
(TCState -> TCState) -> m ()
modifyTC' TCState -> TCState
f = do
TCState
s' <- forall (m :: * -> *). MonadTCState m => m TCState
getTC
forall (m :: * -> *). MonadTCState m => TCState -> m ()
putTC forall a b. (a -> b) -> a -> b
$! TCState -> TCState
f TCState
s'
useTC :: ReadTCState m => Lens' a TCState -> m a
useTC :: forall (m :: * -> *) a. ReadTCState m => Lens' a TCState -> m a
useTC Lens' a TCState
l = do
!a
x <- forall (m :: * -> *) a. ReadTCState m => (TCState -> a) -> m a
getsTC (forall o i. o -> Lens' i o -> i
^. Lens' a TCState
l)
forall (m :: * -> *) a. Monad m => a -> m a
return a
x
infix 4 `setTCLens`
setTCLens :: MonadTCState m => Lens' a TCState -> a -> m ()
setTCLens :: forall (m :: * -> *) a.
MonadTCState m =>
Lens' a TCState -> a -> m ()
setTCLens Lens' a TCState
l = forall (m :: * -> *).
MonadTCState m =>
(TCState -> TCState) -> m ()
modifyTC forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall i o. Lens' i o -> LensSet i o
set Lens' a TCState
l
setTCLens' :: MonadTCState m => Lens' a TCState -> a -> m ()
setTCLens' :: forall (m :: * -> *) a.
MonadTCState m =>
Lens' a TCState -> a -> m ()
setTCLens' Lens' a TCState
l = forall (m :: * -> *).
MonadTCState m =>
(TCState -> TCState) -> m ()
modifyTC' forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall i o. Lens' i o -> LensSet i o
set Lens' a TCState
l
modifyTCLens :: MonadTCState m => Lens' a TCState -> (a -> a) -> m ()
modifyTCLens :: forall (m :: * -> *) a.
MonadTCState m =>
Lens' a TCState -> (a -> a) -> m ()
modifyTCLens Lens' a TCState
l = forall (m :: * -> *).
MonadTCState m =>
(TCState -> TCState) -> m ()
modifyTC forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall i o. Lens' i o -> LensMap i o
over Lens' a TCState
l
modifyTCLens' :: MonadTCState m => Lens' a TCState -> (a -> a) -> m ()
modifyTCLens' :: forall (m :: * -> *) a.
MonadTCState m =>
Lens' a TCState -> (a -> a) -> m ()
modifyTCLens' Lens' a TCState
l = forall (m :: * -> *).
MonadTCState m =>
(TCState -> TCState) -> m ()
modifyTC' forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall i o. Lens' i o -> LensMap i o
over Lens' a TCState
l
modifyTCLensM :: MonadTCState m => Lens' a TCState -> (a -> m a) -> m ()
modifyTCLensM :: forall (m :: * -> *) a.
MonadTCState m =>
Lens' a TCState -> (a -> m a) -> m ()
modifyTCLensM Lens' a TCState
l a -> m a
f = forall (m :: * -> *). MonadTCState m => TCState -> m ()
putTC forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Lens' a TCState
l a -> m a
f forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< forall (m :: * -> *). MonadTCState m => m TCState
getTC
stateTCLens :: MonadTCState m => Lens' a TCState -> (a -> (r , a)) -> m r
stateTCLens :: forall (m :: * -> *) a r.
MonadTCState m =>
Lens' a TCState -> (a -> (r, a)) -> m r
stateTCLens Lens' a TCState
l a -> (r, a)
f = forall (m :: * -> *) a r.
MonadTCState m =>
Lens' a TCState -> (a -> m (r, a)) -> m r
stateTCLensM Lens' a TCState
l forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. Monad m => a -> m a
return forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> (r, a)
f
stateTCLensM :: MonadTCState m => Lens' a TCState -> (a -> m (r , a)) -> m r
stateTCLensM :: forall (m :: * -> *) a r.
MonadTCState m =>
Lens' a TCState -> (a -> m (r, a)) -> m r
stateTCLensM Lens' a TCState
l a -> m (r, a)
f = do
TCState
s <- forall (m :: * -> *). MonadTCState m => m TCState
getTC
(r
result , a
x) <- a -> m (r, a)
f forall a b. (a -> b) -> a -> b
$ TCState
s forall o i. o -> Lens' i o -> i
^. Lens' a TCState
l
forall (m :: * -> *). MonadTCState m => TCState -> m ()
putTC forall a b. (a -> b) -> a -> b
$ forall i o. Lens' i o -> LensSet i o
set Lens' a TCState
l a
x TCState
s
forall (m :: * -> *) a. Monad m => a -> m a
return r
result
class Monad m => MonadBlock m where
patternViolation :: Blocker -> m a
default patternViolation :: (MonadTrans t, MonadBlock n, m ~ t n) => Blocker -> m a
patternViolation = forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a. MonadBlock m => Blocker -> m a
patternViolation
catchPatternErr :: (Blocker -> m a) -> m a -> m a
newtype BlockT m a = BlockT { forall (m :: * -> *) a. BlockT m a -> ExceptT Blocker m a
unBlockT :: ExceptT Blocker m a }
deriving ( forall a b. a -> BlockT m b -> BlockT m a
forall a b. (a -> b) -> BlockT m a -> BlockT m b
forall (m :: * -> *) a b.
Functor m =>
a -> BlockT m b -> BlockT m a
forall (m :: * -> *) a b.
Functor m =>
(a -> b) -> BlockT m a -> BlockT m b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: forall a b. a -> BlockT m b -> BlockT m a
$c<$ :: forall (m :: * -> *) a b.
Functor m =>
a -> BlockT m b -> BlockT m a
fmap :: forall a b. (a -> b) -> BlockT m a -> BlockT m b
$cfmap :: forall (m :: * -> *) a b.
Functor m =>
(a -> b) -> BlockT m a -> BlockT m b
Functor, forall a. a -> BlockT m a
forall a b. BlockT m a -> BlockT m b -> BlockT m a
forall a b. BlockT m a -> BlockT m b -> BlockT m b
forall a b. BlockT m (a -> b) -> BlockT m a -> BlockT m b
forall a b c.
(a -> b -> c) -> BlockT m a -> BlockT m b -> BlockT m c
forall {m :: * -> *}. Monad m => Functor (BlockT m)
forall (m :: * -> *) a. Monad m => a -> BlockT m a
forall (m :: * -> *) a b.
Monad m =>
BlockT m a -> BlockT m b -> BlockT m a
forall (m :: * -> *) a b.
Monad m =>
BlockT m a -> BlockT m b -> BlockT m b
forall (m :: * -> *) a b.
Monad m =>
BlockT m (a -> b) -> BlockT m a -> BlockT m b
forall (m :: * -> *) a b c.
Monad m =>
(a -> b -> c) -> BlockT m a -> BlockT m b -> BlockT m c
forall (f :: * -> *).
Functor f
-> (forall a. a -> f a)
-> (forall a b. f (a -> b) -> f a -> f b)
-> (forall a b c. (a -> b -> c) -> f a -> f b -> f c)
-> (forall a b. f a -> f b -> f b)
-> (forall a b. f a -> f b -> f a)
-> Applicative f
<* :: forall a b. BlockT m a -> BlockT m b -> BlockT m a
$c<* :: forall (m :: * -> *) a b.
Monad m =>
BlockT m a -> BlockT m b -> BlockT m a
*> :: forall a b. BlockT m a -> BlockT m b -> BlockT m b
$c*> :: forall (m :: * -> *) a b.
Monad m =>
BlockT m a -> BlockT m b -> BlockT m b
liftA2 :: forall a b c.
(a -> b -> c) -> BlockT m a -> BlockT m b -> BlockT m c
$cliftA2 :: forall (m :: * -> *) a b c.
Monad m =>
(a -> b -> c) -> BlockT m a -> BlockT m b -> BlockT m c
<*> :: forall a b. BlockT m (a -> b) -> BlockT m a -> BlockT m b
$c<*> :: forall (m :: * -> *) a b.
Monad m =>
BlockT m (a -> b) -> BlockT m a -> BlockT m b
pure :: forall a. a -> BlockT m a
$cpure :: forall (m :: * -> *) a. Monad m => a -> BlockT m a
Applicative, forall a. a -> BlockT m a
forall a b. BlockT m a -> BlockT m b -> BlockT m b
forall a b. BlockT m a -> (a -> BlockT m b) -> BlockT m b
forall (m :: * -> *). Monad m => Applicative (BlockT m)
forall (m :: * -> *) a. Monad m => a -> BlockT m a
forall (m :: * -> *) a b.
Monad m =>
BlockT m a -> BlockT m b -> BlockT m b
forall (m :: * -> *) a b.
Monad m =>
BlockT m a -> (a -> BlockT m b) -> BlockT m b
forall (m :: * -> *).
Applicative m
-> (forall a b. m a -> (a -> m b) -> m b)
-> (forall a b. m a -> m b -> m b)
-> (forall a. a -> m a)
-> Monad m
return :: forall a. a -> BlockT m a
$creturn :: forall (m :: * -> *) a. Monad m => a -> BlockT m a
>> :: forall a b. BlockT m a -> BlockT m b -> BlockT m b
$c>> :: forall (m :: * -> *) a b.
Monad m =>
BlockT m a -> BlockT m b -> BlockT m b
>>= :: forall a b. BlockT m a -> (a -> BlockT m b) -> BlockT m b
$c>>= :: forall (m :: * -> *) a b.
Monad m =>
BlockT m a -> (a -> BlockT m b) -> BlockT m b
Monad, forall (m :: * -> *) a. Monad m => m a -> BlockT m a
forall (t :: (* -> *) -> * -> *).
(forall (m :: * -> *) a. Monad m => m a -> t m a) -> MonadTrans t
lift :: forall (m :: * -> *) a. Monad m => m a -> BlockT m a
$clift :: forall (m :: * -> *) a. Monad m => m a -> BlockT m a
MonadTrans
, forall a. IO a -> BlockT m a
forall (m :: * -> *).
Monad m -> (forall a. IO a -> m a) -> MonadIO m
forall {m :: * -> *}. MonadIO m => Monad (BlockT m)
forall (m :: * -> *) a. MonadIO m => IO a -> BlockT m a
liftIO :: forall a. IO a -> BlockT m a
$cliftIO :: forall (m :: * -> *) a. MonadIO m => IO a -> BlockT m a
MonadIO, forall a. String -> BlockT m a
forall (m :: * -> *).
Monad m -> (forall a. String -> m a) -> MonadFail m
forall {m :: * -> *}. MonadFail m => Monad (BlockT m)
forall (m :: * -> *) a. MonadFail m => String -> BlockT m a
fail :: forall a. String -> BlockT m a
$cfail :: forall (m :: * -> *) a. MonadFail m => String -> BlockT m a
Fail.MonadFail
, BlockT m TCState
forall a. (TCState -> TCState) -> BlockT m a -> BlockT m a
forall a b. Lens' a TCState -> (a -> a) -> BlockT m b -> BlockT m b
forall (m :: * -> *).
Monad m
-> m TCState
-> (forall a b. Lens' a TCState -> (a -> a) -> m b -> m b)
-> (forall a. (TCState -> TCState) -> m a -> m a)
-> ReadTCState m
forall {m :: * -> *}. ReadTCState m => Monad (BlockT m)
forall (m :: * -> *). ReadTCState m => BlockT m TCState
forall (m :: * -> *) a.
ReadTCState m =>
(TCState -> TCState) -> BlockT m a -> BlockT m a
forall (m :: * -> *) a b.
ReadTCState m =>
Lens' a TCState -> (a -> a) -> BlockT m b -> BlockT m b
withTCState :: forall a. (TCState -> TCState) -> BlockT m a -> BlockT m a
$cwithTCState :: forall (m :: * -> *) a.
ReadTCState m =>
(TCState -> TCState) -> BlockT m a -> BlockT m a
locallyTCState :: forall a b. Lens' a TCState -> (a -> a) -> BlockT m b -> BlockT m b
$clocallyTCState :: forall (m :: * -> *) a b.
ReadTCState m =>
Lens' a TCState -> (a -> a) -> BlockT m b -> BlockT m b
getTCState :: BlockT m TCState
$cgetTCState :: forall (m :: * -> *). ReadTCState m => BlockT m TCState
ReadTCState, BlockT m PragmaOptions
BlockT m CommandLineOptions
forall (m :: * -> *).
Functor m
-> Applicative m
-> Monad m
-> m PragmaOptions
-> m CommandLineOptions
-> HasOptions m
forall {m :: * -> *}. HasOptions m => Monad (BlockT m)
forall {m :: * -> *}. HasOptions m => Functor (BlockT m)
forall {m :: * -> *}. HasOptions m => Applicative (BlockT m)
forall (m :: * -> *). HasOptions m => BlockT m PragmaOptions
forall (m :: * -> *). HasOptions m => BlockT m CommandLineOptions
commandLineOptions :: BlockT m CommandLineOptions
$ccommandLineOptions :: forall (m :: * -> *). HasOptions m => BlockT m CommandLineOptions
pragmaOptions :: BlockT m PragmaOptions
$cpragmaOptions :: forall (m :: * -> *). HasOptions m => BlockT m PragmaOptions
HasOptions
, BlockT m TCEnv
forall a. (TCEnv -> TCEnv) -> BlockT m a -> BlockT m a
forall (m :: * -> *).
Monad m
-> m TCEnv
-> (forall a. (TCEnv -> TCEnv) -> m a -> m a)
-> MonadTCEnv m
forall {m :: * -> *}. MonadTCEnv m => Monad (BlockT m)
forall (m :: * -> *). MonadTCEnv m => BlockT m TCEnv
forall (m :: * -> *) a.
MonadTCEnv m =>
(TCEnv -> TCEnv) -> BlockT m a -> BlockT m a
localTC :: forall a. (TCEnv -> TCEnv) -> BlockT m a -> BlockT m a
$clocalTC :: forall (m :: * -> *) a.
MonadTCEnv m =>
(TCEnv -> TCEnv) -> BlockT m a -> BlockT m a
askTC :: BlockT m TCEnv
$caskTC :: forall (m :: * -> *). MonadTCEnv m => BlockT m TCEnv
MonadTCEnv, BlockT m TCState
TCState -> BlockT m ()
(TCState -> TCState) -> BlockT m ()
forall (m :: * -> *).
Monad m
-> m TCState
-> (TCState -> m ())
-> ((TCState -> TCState) -> m ())
-> MonadTCState m
forall {m :: * -> *}. MonadTCState m => Monad (BlockT m)
forall (m :: * -> *). MonadTCState m => BlockT m TCState
forall (m :: * -> *). MonadTCState m => TCState -> BlockT m ()
forall (m :: * -> *).
MonadTCState m =>
(TCState -> TCState) -> BlockT m ()
modifyTC :: (TCState -> TCState) -> BlockT m ()
$cmodifyTC :: forall (m :: * -> *).
MonadTCState m =>
(TCState -> TCState) -> BlockT m ()
putTC :: TCState -> BlockT m ()
$cputTC :: forall (m :: * -> *). MonadTCState m => TCState -> BlockT m ()
getTC :: BlockT m TCState
$cgetTC :: forall (m :: * -> *). MonadTCState m => BlockT m TCState
MonadTCState, forall a. TCM a -> BlockT m a
forall (tcm :: * -> *).
Applicative tcm
-> MonadIO tcm
-> MonadTCEnv tcm
-> MonadTCState tcm
-> HasOptions tcm
-> (forall a. TCM a -> tcm a)
-> MonadTCM tcm
forall {m :: * -> *}. MonadTCM m => Applicative (BlockT m)
forall {m :: * -> *}. MonadTCM m => MonadIO (BlockT m)
forall {m :: * -> *}. MonadTCM m => HasOptions (BlockT m)
forall {m :: * -> *}. MonadTCM m => MonadTCState (BlockT m)
forall {m :: * -> *}. MonadTCM m => MonadTCEnv (BlockT m)
forall (m :: * -> *) a. MonadTCM m => TCM a -> BlockT m a
liftTCM :: forall a. TCM a -> BlockT m a
$cliftTCM :: forall (m :: * -> *) a. MonadTCM m => TCM a -> BlockT m a
MonadTCM
)
instance Monad m => MonadBlock (BlockT m) where
patternViolation :: forall a. Blocker -> BlockT m a
patternViolation = forall (m :: * -> *) a. ExceptT Blocker m a -> BlockT m a
BlockT forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall e (m :: * -> *) a. MonadError e m => e -> m a
throwError
catchPatternErr :: forall a. (Blocker -> BlockT m a) -> BlockT m a -> BlockT m a
catchPatternErr Blocker -> BlockT m a
h BlockT m a
f = forall (m :: * -> *) a. ExceptT Blocker m a -> BlockT m a
BlockT forall a b. (a -> b) -> a -> b
$ forall e (m :: * -> *) a.
MonadError e m =>
m a -> (e -> m a) -> m a
catchError (forall (m :: * -> *) a. BlockT m a -> ExceptT Blocker m a
unBlockT BlockT m a
f) (forall (m :: * -> *) a. BlockT m a -> ExceptT Blocker m a
unBlockT forall b c a. (b -> c) -> (a -> b) -> a -> c
. Blocker -> BlockT m a
h)
instance Monad m => MonadBlock (ExceptT TCErr m) where
patternViolation :: forall a. Blocker -> ExceptT TCErr m a
patternViolation = forall e (m :: * -> *) a. MonadError e m => e -> m a
throwError forall b c a. (b -> c) -> (a -> b) -> a -> c
. Blocker -> TCErr
PatternErr
catchPatternErr :: forall a.
(Blocker -> ExceptT TCErr m a)
-> ExceptT TCErr m a -> ExceptT TCErr m a
catchPatternErr Blocker -> ExceptT TCErr m a
h ExceptT TCErr m a
f = forall e (m :: * -> *) a.
MonadError e m =>
m a -> (e -> m a) -> m a
catchError ExceptT TCErr m a
f forall a b. (a -> b) -> a -> b
$ \case
PatternErr Blocker
b -> Blocker -> ExceptT TCErr m a
h Blocker
b
TCErr
err -> forall e (m :: * -> *) a. MonadError e m => e -> m a
throwError TCErr
err
runBlocked :: Monad m => BlockT m a -> m (Either Blocker a)
runBlocked :: forall (m :: * -> *) a.
Monad m =>
BlockT m a -> m (Either Blocker a)
runBlocked = forall e (m :: * -> *) a. ExceptT e m a -> m (Either e a)
runExceptT forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a. BlockT m a -> ExceptT Blocker m a
unBlockT
instance MonadBlock m => MonadBlock (MaybeT m) where
catchPatternErr :: forall a. (Blocker -> MaybeT m a) -> MaybeT m a -> MaybeT m a
catchPatternErr Blocker -> MaybeT m a
h MaybeT m a
m = forall (m :: * -> *) a. m (Maybe a) -> MaybeT m a
MaybeT forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a.
MonadBlock m =>
(Blocker -> m a) -> m a -> m a
catchPatternErr (forall (m :: * -> *) a. MaybeT m a -> m (Maybe a)
runMaybeT forall b c a. (b -> c) -> (a -> b) -> a -> c
. Blocker -> MaybeT m a
h) forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MaybeT m a -> m (Maybe a)
runMaybeT MaybeT m a
m
instance MonadBlock m => MonadBlock (ReaderT e m) where
catchPatternErr :: forall a.
(Blocker -> ReaderT e m a) -> ReaderT e m a -> ReaderT e m a
catchPatternErr Blocker -> ReaderT e m a
h ReaderT e m a
m = forall r (m :: * -> *) a. (r -> m a) -> ReaderT r m a
ReaderT forall a b. (a -> b) -> a -> b
$ \ e
e ->
let run :: ReaderT e m a -> m a
run = forall a b c. (a -> b -> c) -> b -> a -> c
flip forall r (m :: * -> *) a. ReaderT r m a -> r -> m a
runReaderT e
e in forall (m :: * -> *) a.
MonadBlock m =>
(Blocker -> m a) -> m a -> m a
catchPatternErr (ReaderT e m a -> m a
run forall b c a. (b -> c) -> (a -> b) -> a -> c
. Blocker -> ReaderT e m a
h) (ReaderT e m a -> m a
run ReaderT e m a
m)
newtype TCMT m a = TCM { forall (m :: * -> *) a. TCMT m a -> IORef TCState -> TCEnv -> m a
unTCM :: IORef TCState -> TCEnv -> m a }
type TCM = TCMT IO
{-# SPECIALIZE INLINE mapTCMT :: (forall a. IO a -> IO a) -> TCM a -> TCM a #-}
mapTCMT :: (forall a. m a -> n a) -> TCMT m a -> TCMT n a
mapTCMT :: forall (m :: * -> *) (n :: * -> *) a.
(forall a. m a -> n a) -> TCMT m a -> TCMT n a
mapTCMT forall a. m a -> n a
f (TCM IORef TCState -> TCEnv -> m a
m) = forall (m :: * -> *) a. (IORef TCState -> TCEnv -> m a) -> TCMT m a
TCM forall a b. (a -> b) -> a -> b
$ \ IORef TCState
s TCEnv
e -> forall a. m a -> n a
f (IORef TCState -> TCEnv -> m a
m IORef TCState
s TCEnv
e)
pureTCM :: MonadIO m => (TCState -> TCEnv -> a) -> TCMT m a
pureTCM :: forall (m :: * -> *) a.
MonadIO m =>
(TCState -> TCEnv -> a) -> TCMT m a
pureTCM TCState -> TCEnv -> a
f = forall (m :: * -> *) a. (IORef TCState -> TCEnv -> m a) -> TCMT m a
TCM forall a b. (a -> b) -> a -> b
$ \ IORef TCState
r TCEnv
e -> do
TCState
s <- forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a. IORef a -> IO a
readIORef IORef TCState
r
forall (m :: * -> *) a. Monad m => a -> m a
return (TCState -> TCEnv -> a
f TCState
s TCEnv
e)
returnTCMT :: Applicative m => a -> TCMT m a
returnTCMT :: forall (m :: * -> *) a. Applicative m => a -> TCMT m a
returnTCMT = \a
x -> forall (m :: * -> *) a. (IORef TCState -> TCEnv -> m a) -> TCMT m a
TCM forall a b. (a -> b) -> a -> b
$ \IORef TCState
_ TCEnv
_ -> forall (f :: * -> *) a. Applicative f => a -> f a
pure a
x
{-# INLINE returnTCMT #-}
bindTCMT :: Monad m => TCMT m a -> (a -> TCMT m b) -> TCMT m b
bindTCMT :: forall (m :: * -> *) a b.
Monad m =>
TCMT m a -> (a -> TCMT m b) -> TCMT m b
bindTCMT = \(TCM IORef TCState -> TCEnv -> m a
m) a -> TCMT m b
k -> forall (m :: * -> *) a. (IORef TCState -> TCEnv -> m a) -> TCMT m a
TCM forall a b. (a -> b) -> a -> b
$ \IORef TCState
r TCEnv
e -> IORef TCState -> TCEnv -> m a
m IORef TCState
r TCEnv
e forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \a
x -> forall (m :: * -> *) a. TCMT m a -> IORef TCState -> TCEnv -> m a
unTCM (a -> TCMT m b
k a
x) IORef TCState
r TCEnv
e
{-# INLINE bindTCMT #-}
thenTCMT :: Applicative m => TCMT m a -> TCMT m b -> TCMT m b
thenTCMT :: forall (m :: * -> *) a b.
Applicative m =>
TCMT m a -> TCMT m b -> TCMT m b
thenTCMT = \(TCM IORef TCState -> TCEnv -> m a
m1) (TCM IORef TCState -> TCEnv -> m b
m2) -> forall (m :: * -> *) a. (IORef TCState -> TCEnv -> m a) -> TCMT m a
TCM forall a b. (a -> b) -> a -> b
$ \IORef TCState
r TCEnv
e -> IORef TCState -> TCEnv -> m a
m1 IORef TCState
r TCEnv
e forall (f :: * -> *) a b. Applicative f => f a -> f b -> f b
*> IORef TCState -> TCEnv -> m b
m2 IORef TCState
r TCEnv
e
{-# INLINE thenTCMT #-}
instance Functor m => Functor (TCMT m) where
fmap :: forall a b. (a -> b) -> TCMT m a -> TCMT m b
fmap = forall (m :: * -> *) a b.
Functor m =>
(a -> b) -> TCMT m a -> TCMT m b
fmapTCMT
fmapTCMT :: Functor m => (a -> b) -> TCMT m a -> TCMT m b
fmapTCMT :: forall (m :: * -> *) a b.
Functor m =>
(a -> b) -> TCMT m a -> TCMT m b
fmapTCMT = \a -> b
f (TCM IORef TCState -> TCEnv -> m a
m) -> forall (m :: * -> *) a. (IORef TCState -> TCEnv -> m a) -> TCMT m a
TCM forall a b. (a -> b) -> a -> b
$ \IORef TCState
r TCEnv
e -> forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
f (IORef TCState -> TCEnv -> m a
m IORef TCState
r TCEnv
e)
{-# INLINE fmapTCMT #-}
instance Applicative m => Applicative (TCMT m) where
pure :: forall a. a -> TCMT m a
pure = forall (m :: * -> *) a. Applicative m => a -> TCMT m a
returnTCMT
<*> :: forall a b. TCMT m (a -> b) -> TCMT m a -> TCMT m b
(<*>) = forall (m :: * -> *) a b.
Applicative m =>
TCMT m (a -> b) -> TCMT m a -> TCMT m b
apTCMT
apTCMT :: Applicative m => TCMT m (a -> b) -> TCMT m a -> TCMT m b
apTCMT :: forall (m :: * -> *) a b.
Applicative m =>
TCMT m (a -> b) -> TCMT m a -> TCMT m b
apTCMT = \(TCM IORef TCState -> TCEnv -> m (a -> b)
mf) (TCM IORef TCState -> TCEnv -> m a
m) -> forall (m :: * -> *) a. (IORef TCState -> TCEnv -> m a) -> TCMT m a
TCM forall a b. (a -> b) -> a -> b
$ \IORef TCState
r TCEnv
e -> IORef TCState -> TCEnv -> m (a -> b)
mf IORef TCState
r TCEnv
e forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> IORef TCState -> TCEnv -> m a
m IORef TCState
r TCEnv
e
{-# INLINE apTCMT #-}
instance MonadTrans TCMT where
lift :: forall (m :: * -> *) a. Monad m => m a -> TCMT m a
lift m a
m = forall (m :: * -> *) a. (IORef TCState -> TCEnv -> m a) -> TCMT m a
TCM forall a b. (a -> b) -> a -> b
$ \IORef TCState
_ TCEnv
_ -> m a
m
#if __GLASGOW_HASKELL__ < 808
instance MonadIO m => Monad (TCMT m) where
#else
instance Monad m => Monad (TCMT m) where
#endif
return :: forall a. a -> TCMT m a
return = forall (f :: * -> *) a. Applicative f => a -> f a
pure
>>= :: forall a b. TCMT m a -> (a -> TCMT m b) -> TCMT m b
(>>=) = forall (m :: * -> *) a b.
Monad m =>
TCMT m a -> (a -> TCMT m b) -> TCMT m b
bindTCMT
>> :: forall a b. TCMT m a -> TCMT m b -> TCMT m b
(>>) = forall (f :: * -> *) a b. Applicative f => f a -> f b -> f b
(*>)
#if __GLASGOW_HASKELL__ < 808
fail = Fail.fail
#endif
instance MonadIO m => Fail.MonadFail (TCMT m) where
fail :: forall a. String -> TCMT m a
fail = forall (tcm :: * -> *) a.
(HasCallStack, MonadTCM tcm) =>
String -> tcm a
internalError
instance MonadIO m => MonadIO (TCMT m) where
liftIO :: forall a. IO a -> TCMT m a
liftIO IO a
m = forall (m :: * -> *) a. (IORef TCState -> TCEnv -> m a) -> TCMT m a
TCM forall a b. (a -> b) -> a -> b
$ \ IORef TCState
s TCEnv
env -> do
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall {a}. IORef TCState -> Range -> IO a -> IO a
wrap IORef TCState
s (TCEnv -> Range
envRange TCEnv
env) forall a b. (a -> b) -> a -> b
$ do
a
x <- IO a
m
a
x seq :: forall a b. a -> b -> b
`seq` forall (m :: * -> *) a. Monad m => a -> m a
return a
x
where
wrap :: IORef TCState -> Range -> IO a -> IO a
wrap IORef TCState
s Range
r IO a
m = forall e a. Exception e => IO a -> (e -> IO a) -> IO a
E.catch IO a
m forall a b. (a -> b) -> a -> b
$ \ IOException
err -> do
TCState
s <- forall a. IORef a -> IO a
readIORef IORef TCState
s
forall e a. Exception e => e -> IO a
E.throwIO forall a b. (a -> b) -> a -> b
$ TCState -> Range -> IOException -> TCErr
IOException TCState
s Range
r IOException
err
instance ( MonadFix m
#if __GLASGOW_HASKELL__ < 808
, MonadIO m
#endif
) => MonadFix (TCMT m) where
mfix :: forall a. (a -> TCMT m a) -> TCMT m a
mfix a -> TCMT m a
f = forall (m :: * -> *) a. (IORef TCState -> TCEnv -> m a) -> TCMT m a
TCM forall a b. (a -> b) -> a -> b
$ \IORef TCState
s TCEnv
env -> mdo
a
x <- forall (m :: * -> *) a. TCMT m a -> IORef TCState -> TCEnv -> m a
unTCM (a -> TCMT m a
f a
x) IORef TCState
s TCEnv
env
forall (m :: * -> *) a. Monad m => a -> m a
return a
x
instance MonadIO m => MonadTCEnv (TCMT m) where
askTC :: TCMT m TCEnv
askTC = forall (m :: * -> *) a. (IORef TCState -> TCEnv -> m a) -> TCMT m a
TCM forall a b. (a -> b) -> a -> b
$ \ IORef TCState
_ TCEnv
e -> forall (m :: * -> *) a. Monad m => a -> m a
return TCEnv
e
localTC :: forall a. (TCEnv -> TCEnv) -> TCMT m a -> TCMT m a
localTC TCEnv -> TCEnv
f (TCM IORef TCState -> TCEnv -> m a
m) = forall (m :: * -> *) a. (IORef TCState -> TCEnv -> m a) -> TCMT m a
TCM forall a b. (a -> b) -> a -> b
$ \ IORef TCState
s TCEnv
e -> IORef TCState -> TCEnv -> m a
m IORef TCState
s (TCEnv -> TCEnv
f TCEnv
e)
instance MonadIO m => MonadTCState (TCMT m) where
getTC :: TCMT m TCState
getTC = forall (m :: * -> *) a. (IORef TCState -> TCEnv -> m a) -> TCMT m a
TCM forall a b. (a -> b) -> a -> b
$ \ IORef TCState
r TCEnv
_e -> forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (forall a. IORef a -> IO a
readIORef IORef TCState
r)
putTC :: TCState -> TCMT m ()
putTC TCState
s = forall (m :: * -> *) a. (IORef TCState -> TCEnv -> m a) -> TCMT m a
TCM forall a b. (a -> b) -> a -> b
$ \ IORef TCState
r TCEnv
_e -> forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (forall a. IORef a -> a -> IO ()
writeIORef IORef TCState
r TCState
s)
modifyTC :: (TCState -> TCState) -> TCMT m ()
modifyTC TCState -> TCState
f = forall (m :: * -> *). MonadTCState m => TCState -> m ()
putTC forall b c a. (b -> c) -> (a -> b) -> a -> c
. TCState -> TCState
f forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< forall (m :: * -> *). MonadTCState m => m TCState
getTC
instance MonadIO m => ReadTCState (TCMT m) where
getTCState :: TCMT m TCState
getTCState = forall (m :: * -> *). MonadTCState m => m TCState
getTC
locallyTCState :: forall a b. Lens' a TCState -> (a -> a) -> TCMT m b -> TCMT m b
locallyTCState Lens' a TCState
l a -> a
f = forall (m :: * -> *) a b.
Monad m =>
m a -> (a -> m ()) -> m b -> m b
bracket_ (forall (m :: * -> *) a. ReadTCState m => Lens' a TCState -> m a
useTC Lens' a TCState
l forall (f :: * -> *) a b. Applicative f => f a -> f b -> f a
<* forall (m :: * -> *) a.
MonadTCState m =>
Lens' a TCState -> (a -> a) -> m ()
modifyTCLens Lens' a TCState
l a -> a
f) (forall (m :: * -> *) a.
MonadTCState m =>
Lens' a TCState -> a -> m ()
setTCLens Lens' a TCState
l)
instance MonadBlock TCM where
patternViolation :: forall a. Blocker -> TCM a
patternViolation Blocker
b = forall e (m :: * -> *) a. MonadError e m => e -> m a
throwError (Blocker -> TCErr
PatternErr Blocker
b)
catchPatternErr :: forall a. (Blocker -> TCM a) -> TCM a -> TCM a
catchPatternErr Blocker -> TCM a
handle TCM a
v =
forall a. TCM a -> (TCErr -> TCM a) -> TCM a
catchError_ TCM a
v forall a b. (a -> b) -> a -> b
$ \TCErr
err ->
case TCErr
err of
PatternErr Blocker
u -> Blocker -> TCM a
handle Blocker
u
TCErr
_ -> forall e (m :: * -> *) a. MonadError e m => e -> m a
throwError TCErr
err
instance MonadError TCErr TCM where
throwError :: forall a. TCErr -> TCM a
throwError = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall e a. Exception e => e -> IO a
E.throwIO
catchError :: forall a. TCM a -> (TCErr -> TCM a) -> TCM a
catchError TCM a
m TCErr -> TCM a
h = forall (m :: * -> *) a. (IORef TCState -> TCEnv -> m a) -> TCMT m a
TCM forall a b. (a -> b) -> a -> b
$ \ IORef TCState
r TCEnv
e -> do
TCState
oldState <- forall a. IORef a -> IO a
readIORef IORef TCState
r
forall (m :: * -> *) a. TCMT m a -> IORef TCState -> TCEnv -> m a
unTCM TCM a
m IORef TCState
r TCEnv
e forall e a. Exception e => IO a -> (e -> IO a) -> IO a
`E.catch` \TCErr
err -> do
case TCErr
err of
PatternErr{} -> forall (m :: * -> *) a. Monad m => a -> m a
return ()
TCErr
_ ->
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
TCState
newState <- forall a. IORef a -> IO a
readIORef IORef TCState
r
forall a. IORef a -> a -> IO ()
writeIORef IORef TCState
r forall a b. (a -> b) -> a -> b
$ TCState
oldState { stPersistentState :: PersistentTCState
stPersistentState = TCState -> PersistentTCState
stPersistentState TCState
newState }
forall (m :: * -> *) a. TCMT m a -> IORef TCState -> TCEnv -> m a
unTCM (TCErr -> TCM a
h TCErr
err) IORef TCState
r TCEnv
e
instance CatchImpossible TCM where
catchImpossibleJust :: forall b a.
(Impossible -> Maybe b) -> TCM a -> (b -> TCM a) -> TCM a
catchImpossibleJust Impossible -> Maybe b
f TCM a
m b -> TCM a
h = forall (m :: * -> *) a. (IORef TCState -> TCEnv -> m a) -> TCMT m a
TCM forall a b. (a -> b) -> a -> b
$ \ IORef TCState
r TCEnv
e -> do
TCState
s <- forall a. IORef a -> IO a
readIORef IORef TCState
r
forall (m :: * -> *) b a.
CatchImpossible m =>
(Impossible -> Maybe b) -> m a -> (b -> m a) -> m a
catchImpossibleJust Impossible -> Maybe b
f (forall (m :: * -> *) a. TCMT m a -> IORef TCState -> TCEnv -> m a
unTCM TCM a
m IORef TCState
r TCEnv
e) forall a b. (a -> b) -> a -> b
$ \ b
err -> do
forall a. IORef a -> a -> IO ()
writeIORef IORef TCState
r TCState
s
forall (m :: * -> *) a. TCMT m a -> IORef TCState -> TCEnv -> m a
unTCM (b -> TCM a
h b
err) IORef TCState
r TCEnv
e
instance MonadIO m => MonadReduce (TCMT m) where
liftReduce :: forall a. ReduceM a -> TCMT m a
liftReduce = forall (tcm :: * -> *) a. MonadTCM tcm => TCM a -> tcm a
liftTCM forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. ReduceM a -> TCM a
runReduceM
instance (IsString a, MonadIO m) => IsString (TCMT m a) where
fromString :: String -> TCMT m a
fromString String
s = forall (m :: * -> *) a. Monad m => a -> m a
return (forall a. IsString a => String -> a
fromString String
s)
instance {-# OVERLAPPABLE #-} (MonadIO m, Semigroup a) => Semigroup (TCMT m a) where
<> :: TCMT m a -> TCMT m a -> TCMT m a
(<>) = forall (f :: * -> *) a b c.
Applicative f =>
(a -> b -> c) -> f a -> f b -> f c
liftA2 forall a. Semigroup a => a -> a -> a
(<>)
instance {-# OVERLAPPABLE #-} (MonadIO m, Semigroup a, Monoid a) => Monoid (TCMT m a) where
mempty :: TCMT m a
mempty = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Monoid a => a
mempty
mappend :: TCMT m a -> TCMT m a -> TCMT m a
mappend = forall a. Semigroup a => a -> a -> a
(<>)
mconcat :: [TCMT m a] -> TCMT m a
mconcat = forall a. Monoid a => [a] -> a
mconcat forall (m :: * -> *) b c a.
Functor m =>
(b -> c) -> (a -> m b) -> a -> m c
<.> forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
sequence
instance {-# OVERLAPPABLE #-} (MonadIO m, Null a) => Null (TCMT m a) where
empty :: TCMT m a
empty = forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Null a => a
empty
null :: TCMT m a -> Bool
null = forall a. HasCallStack => a
__IMPOSSIBLE__
catchError_ :: TCM a -> (TCErr -> TCM a) -> TCM a
catchError_ :: forall a. TCM a -> (TCErr -> TCM a) -> TCM a
catchError_ TCM a
m TCErr -> TCM a
h = forall (m :: * -> *) a. (IORef TCState -> TCEnv -> m a) -> TCMT m a
TCM forall a b. (a -> b) -> a -> b
$ \IORef TCState
r TCEnv
e ->
forall (m :: * -> *) a. TCMT m a -> IORef TCState -> TCEnv -> m a
unTCM TCM a
m IORef TCState
r TCEnv
e
forall e a. Exception e => IO a -> (e -> IO a) -> IO a
`E.catch` \TCErr
err -> forall (m :: * -> *) a. TCMT m a -> IORef TCState -> TCEnv -> m a
unTCM (TCErr -> TCM a
h TCErr
err) IORef TCState
r TCEnv
e
finally_ :: TCM a -> TCM b -> TCM a
finally_ :: forall a b. TCM a -> TCM b -> TCM a
finally_ TCM a
m TCM b
f = do
a
x <- TCM a
m forall a. TCM a -> (TCErr -> TCM a) -> TCM a
`catchError_` \ TCErr
err -> TCM b
f forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> forall e (m :: * -> *) a. MonadError e m => e -> m a
throwError TCErr
err
b
_ <- TCM b
f
forall (m :: * -> *) a. Monad m => a -> m a
return a
x
class ( Applicative tcm, MonadIO tcm
, MonadTCEnv tcm
, MonadTCState tcm
, HasOptions tcm
) => MonadTCM tcm where
liftTCM :: TCM a -> tcm a
default liftTCM :: (MonadTCM m, MonadTrans t, tcm ~ t m) => TCM a -> tcm a
liftTCM = forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (tcm :: * -> *) a. MonadTCM tcm => TCM a -> tcm a
liftTCM
{-# RULES "liftTCM/id" liftTCM = id #-}
instance MonadIO m => MonadTCM (TCMT m) where
liftTCM :: forall a. TCM a -> TCMT m a
liftTCM = forall (m :: * -> *) (n :: * -> *) a.
(forall a. m a -> n a) -> TCMT m a -> TCMT n a
mapTCMT forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO
instance MonadTCM tcm => MonadTCM (ChangeT tcm)
instance MonadTCM tcm => MonadTCM (ExceptT err tcm)
instance MonadTCM tcm => MonadTCM (IdentityT tcm)
instance MonadTCM tcm => MonadTCM (ListT tcm)
instance MonadTCM tcm => MonadTCM (MaybeT tcm)
instance MonadTCM tcm => MonadTCM (ReaderT r tcm)
instance MonadTCM tcm => MonadTCM (StateT s tcm)
instance (Monoid w, MonadTCM tcm) => MonadTCM (WriterT w tcm)
instance MonadBench TCM where
type BenchPhase TCM = Phase
getBenchmark :: TCM (Benchmark (BenchPhase TCM))
getBenchmark = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *). MonadBench m => m (Benchmark (BenchPhase m))
getBenchmark
putBenchmark :: Benchmark (BenchPhase TCM) -> TCM ()
putBenchmark = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *).
MonadBench m =>
Benchmark (BenchPhase m) -> m ()
putBenchmark
finally :: forall a b. TCM a -> TCM b -> TCM a
finally = forall a b. TCM a -> TCM b -> TCM a
finally_
instance Null (TCM Doc) where
empty :: TCM Doc
empty = forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Null a => a
empty
null :: TCM Doc -> Bool
null = forall a. HasCallStack => a
__IMPOSSIBLE__
internalError :: (HasCallStack, MonadTCM tcm) => String -> tcm a
internalError :: forall (tcm :: * -> *) a.
(HasCallStack, MonadTCM tcm) =>
String -> tcm a
internalError String
s = forall b. HasCallStack => (CallStack -> b) -> b
withCallerCallStack forall a b. (a -> b) -> a -> b
$ \ CallStack
loc ->
forall (tcm :: * -> *) a. MonadTCM tcm => TCM a -> tcm a
liftTCM forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a.
MonadTCError m =>
CallStack -> TypeError -> m a
typeError' CallStack
loc forall a b. (a -> b) -> a -> b
$ String -> TypeError
InternalError String
s
type MonadTCError m = (MonadTCEnv m, ReadTCState m, MonadError TCErr m)
locatedTypeError :: MonadTCError m => (a -> TypeError) -> (HasCallStack => a -> m b)
locatedTypeError :: forall (m :: * -> *) a b.
MonadTCError m =>
(a -> TypeError) -> HasCallStack => a -> m b
locatedTypeError a -> TypeError
f a
e = forall b. HasCallStack => (CallStack -> b) -> b
withCallerCallStack (forall a b c. (a -> b -> c) -> b -> a -> c
flip forall (m :: * -> *) a.
MonadTCError m =>
CallStack -> TypeError -> m a
typeError' (a -> TypeError
f a
e))
genericError :: (HasCallStack, MonadTCError m) => String -> m a
genericError :: forall (m :: * -> *) a.
(HasCallStack, MonadTCError m) =>
String -> m a
genericError = forall (m :: * -> *) a b.
MonadTCError m =>
(a -> TypeError) -> HasCallStack => a -> m b
locatedTypeError String -> TypeError
GenericError
{-# SPECIALIZE genericDocError :: Doc -> TCM a #-}
genericDocError :: (HasCallStack, MonadTCError m) => Doc -> m a
genericDocError :: forall (m :: * -> *) a.
(HasCallStack, MonadTCError m) =>
Doc -> m a
genericDocError = forall (m :: * -> *) a b.
MonadTCError m =>
(a -> TypeError) -> HasCallStack => a -> m b
locatedTypeError Doc -> TypeError
GenericDocError
{-# SPECIALIZE typeError' :: CallStack -> TypeError -> TCM a #-}
typeError' :: MonadTCError m => CallStack -> TypeError -> m a
typeError' :: forall (m :: * -> *) a.
MonadTCError m =>
CallStack -> TypeError -> m a
typeError' CallStack
loc TypeError
err = forall e (m :: * -> *) a. MonadError e m => e -> m a
throwError forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< forall (m :: * -> *).
(MonadTCEnv m, ReadTCState m) =>
CallStack -> TypeError -> m TCErr
typeError'_ CallStack
loc TypeError
err
{-# SPECIALIZE typeError :: HasCallStack => TypeError -> TCM a #-}
typeError :: (HasCallStack, MonadTCError m) => TypeError -> m a
typeError :: forall (m :: * -> *) a.
(HasCallStack, MonadTCError m) =>
TypeError -> m a
typeError TypeError
err = forall b. HasCallStack => (CallStack -> b) -> b
withCallerCallStack forall a b. (a -> b) -> a -> b
$ \CallStack
loc -> forall e (m :: * -> *) a. MonadError e m => e -> m a
throwError forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< forall (m :: * -> *).
(MonadTCEnv m, ReadTCState m) =>
CallStack -> TypeError -> m TCErr
typeError'_ CallStack
loc TypeError
err
{-# SPECIALIZE typeError'_ :: CallStack -> TypeError -> TCM TCErr #-}
typeError'_ :: (MonadTCEnv m, ReadTCState m) => CallStack -> TypeError -> m TCErr
typeError'_ :: forall (m :: * -> *).
(MonadTCEnv m, ReadTCState m) =>
CallStack -> TypeError -> m TCErr
typeError'_ CallStack
loc TypeError
err = CallStack -> TCState -> Closure TypeError -> TCErr
TypeError CallStack
loc forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall (m :: * -> *). ReadTCState m => m TCState
getTCState forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> forall (m :: * -> *) a.
(MonadTCEnv m, ReadTCState m) =>
a -> m (Closure a)
buildClosure TypeError
err
{-# SPECIALIZE typeError_ :: HasCallStack => TypeError -> TCM TCErr #-}
typeError_ :: (HasCallStack, MonadTCEnv m, ReadTCState m) => TypeError -> m TCErr
typeError_ :: forall (m :: * -> *).
(HasCallStack, MonadTCEnv m, ReadTCState m) =>
TypeError -> m TCErr
typeError_ = forall b. HasCallStack => (CallStack -> b) -> b
withCallerCallStack forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b c. (a -> b -> c) -> b -> a -> c
flip forall (m :: * -> *).
(MonadTCEnv m, ReadTCState m) =>
CallStack -> TypeError -> m TCErr
typeError'_
{-# SPECIALIZE runTCM :: TCEnv -> TCState -> TCM a -> IO (a, TCState) #-}
runTCM :: MonadIO m => TCEnv -> TCState -> TCMT m a -> m (a, TCState)
runTCM :: forall (m :: * -> *) a.
MonadIO m =>
TCEnv -> TCState -> TCMT m a -> m (a, TCState)
runTCM TCEnv
e TCState
s TCMT m a
m = do
IORef TCState
r <- forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a. a -> IO (IORef a)
newIORef TCState
s
a
a <- forall (m :: * -> *) a. TCMT m a -> IORef TCState -> TCEnv -> m a
unTCM TCMT m a
m IORef TCState
r TCEnv
e
TCState
s <- forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a. IORef a -> IO a
readIORef IORef TCState
r
forall (m :: * -> *) a. Monad m => a -> m a
return (a
a, TCState
s)
runTCMTop :: TCM a -> IO (Either TCErr a)
runTCMTop :: forall a. TCM a -> IO (Either TCErr a)
runTCMTop TCM a
m = (forall a b. b -> Either a b
Right forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall (m :: * -> *) a. MonadIO m => TCMT m a -> m a
runTCMTop' TCM a
m) forall e a. Exception e => IO a -> (e -> IO a) -> IO a
`E.catch` (forall (m :: * -> *) a. Monad m => a -> m a
return forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. a -> Either a b
Left)
runTCMTop' :: MonadIO m => TCMT m a -> m a
runTCMTop' :: forall (m :: * -> *) a. MonadIO m => TCMT m a -> m a
runTCMTop' TCMT m a
m = do
IORef TCState
r <- forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a. a -> IO (IORef a)
newIORef TCState
initState
forall (m :: * -> *) a. TCMT m a -> IORef TCState -> TCEnv -> m a
unTCM TCMT m a
m IORef TCState
r TCEnv
initEnv
runSafeTCM :: TCM a -> TCState -> IO (a, TCState)
runSafeTCM :: forall a. TCM a -> TCState -> IO (a, TCState)
runSafeTCM TCM a
m TCState
st =
forall (m :: * -> *) a.
MonadIO m =>
TCEnv -> TCState -> TCMT m a -> m (a, TCState)
runTCM TCEnv
initEnv TCState
st TCM a
m forall e a. Exception e => IO a -> (e -> IO a) -> IO a
`E.catch` \(TCErr
e :: TCErr) -> case TCErr
e of
IOException TCState
_ Range
_ IOException
err -> forall e a. Exception e => e -> IO a
E.throwIO IOException
err
TCErr
_ -> forall a. HasCallStack => a
__IMPOSSIBLE__
forkTCM :: TCM a -> TCM ()
forkTCM :: forall a. TCM a -> TCM ()
forkTCM TCM a
m = do
TCState
s <- forall (m :: * -> *). MonadTCState m => m TCState
getTC
TCEnv
e <- forall (m :: * -> *). MonadTCEnv m => m TCEnv
askTC
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *) a. Functor f => f a -> f ()
void forall a b. (a -> b) -> a -> b
$ IO () -> IO ThreadId
C.forkIO forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *) a. Functor f => f a -> f ()
void forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a.
MonadIO m =>
TCEnv -> TCState -> TCMT m a -> m (a, TCState)
runTCM TCEnv
e TCState
s TCM a
m
patternInTeleName :: String
patternInTeleName :: String
patternInTeleName = String
".patternInTele"
extendedLambdaName :: String
extendedLambdaName :: String
extendedLambdaName = String
".extendedlambda"
isExtendedLambdaName :: A.QName -> Bool
isExtendedLambdaName :: QName -> Bool
isExtendedLambdaName = (String
extendedLambdaName forall a. Eq a => [a] -> [a] -> Bool
`List.isPrefixOf`) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Pretty a => a -> String
prettyShow forall b c a. (b -> c) -> (a -> b) -> a -> c
. Name -> Name
nameConcrete forall b c a. (b -> c) -> (a -> b) -> a -> c
. QName -> Name
qnameName
absurdLambdaName :: String
absurdLambdaName :: String
absurdLambdaName = String
".absurdlambda"
isAbsurdLambdaName :: QName -> Bool
isAbsurdLambdaName :: QName -> Bool
isAbsurdLambdaName = (String
absurdLambdaName forall a. Eq a => a -> a -> Bool
==) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Pretty a => a -> String
prettyShow forall b c a. (b -> c) -> (a -> b) -> a -> c
. QName -> Name
qnameName
generalizedFieldName :: String
generalizedFieldName :: String
generalizedFieldName = String
".generalizedField-"
getGeneralizedFieldName :: A.QName -> Maybe String
getGeneralizedFieldName :: QName -> Maybe String
getGeneralizedFieldName QName
q
| String
generalizedFieldName forall a. Eq a => [a] -> [a] -> Bool
`List.isPrefixOf` String
strName = forall a. a -> Maybe a
Just (forall a. Int -> [a] -> [a]
drop (forall (t :: * -> *) a. Foldable t => t a -> Int
length String
generalizedFieldName) String
strName)
| Bool
otherwise = forall a. Maybe a
Nothing
where strName :: String
strName = forall a. Pretty a => a -> String
prettyShow forall a b. (a -> b) -> a -> b
$ Name -> Name
nameConcrete forall a b. (a -> b) -> a -> b
$ QName -> Name
qnameName QName
q
instance KillRange Signature where
killRange :: KillRangeT Signature
killRange (Sig Sections
secs Definitions
defs RewriteRuleMap
rews) = forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 Sections -> Definitions -> RewriteRuleMap -> Signature
Sig Sections
secs Definitions
defs RewriteRuleMap
rews
instance KillRange Sections where
killRange :: KillRangeT Sections
killRange = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a. KillRange a => KillRangeT a
killRange
instance KillRange Definitions where
killRange :: KillRangeT Definitions
killRange = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a. KillRange a => KillRangeT a
killRange
instance KillRange RewriteRuleMap where
killRange :: KillRangeT RewriteRuleMap
killRange = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a. KillRange a => KillRangeT a
killRange
instance KillRange Section where
killRange :: KillRangeT Section
killRange (Section Telescope
tel) = forall a b. KillRange a => (a -> b) -> a -> b
killRange1 Telescope -> Section
Section Telescope
tel
instance KillRange Definition where
killRange :: Definition -> Definition
killRange (Defn ArgInfo
ai QName
name Type
t [Polarity]
pols [Occurrence]
occs NumGeneralizableArgs
gens [Maybe Name]
gpars [LocalDisplayForm]
displ MutualId
mut CompiledRepresentation
compiled Maybe QName
inst Bool
copy Set QName
ma Bool
nc Bool
inj Bool
copat Blocked_
blk Language
lang Defn
def) =
forall a b c d e f g h i j k l m n o p q r s t.
(KillRange a, KillRange b, KillRange c, KillRange d, KillRange e,
KillRange f, KillRange g, KillRange h, KillRange i, KillRange j,
KillRange k, KillRange l, KillRange m, KillRange n, KillRange o,
KillRange p, KillRange q, KillRange r, KillRange s) =>
(a
-> b
-> c
-> d
-> e
-> f
-> g
-> h
-> i
-> j
-> k
-> l
-> m
-> n
-> o
-> p
-> q
-> r
-> s
-> t)
-> a
-> b
-> c
-> d
-> e
-> f
-> g
-> h
-> i
-> j
-> k
-> l
-> m
-> n
-> o
-> p
-> q
-> r
-> s
-> t
killRange19 ArgInfo
-> QName
-> Type
-> [Polarity]
-> [Occurrence]
-> NumGeneralizableArgs
-> [Maybe Name]
-> [LocalDisplayForm]
-> MutualId
-> CompiledRepresentation
-> Maybe QName
-> Bool
-> Set QName
-> Bool
-> Bool
-> Bool
-> Blocked_
-> Language
-> Defn
-> Definition
Defn ArgInfo
ai QName
name Type
t [Polarity]
pols [Occurrence]
occs NumGeneralizableArgs
gens [Maybe Name]
gpars [LocalDisplayForm]
displ MutualId
mut CompiledRepresentation
compiled Maybe QName
inst Bool
copy Set QName
ma Bool
nc Bool
inj Bool
copat Blocked_
blk Language
lang Defn
def
instance KillRange NumGeneralizableArgs where
killRange :: KillRangeT NumGeneralizableArgs
killRange = forall a. a -> a
id
instance KillRange NLPat where
killRange :: KillRangeT NLPat
killRange (PVar Int
x [Arg Int]
y) = forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 Int -> [Arg Int] -> NLPat
PVar Int
x [Arg Int]
y
killRange (PDef QName
x PElims
y) = forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 QName -> PElims -> NLPat
PDef QName
x PElims
y
killRange (PLam ArgInfo
x Abs NLPat
y) = forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 ArgInfo -> Abs NLPat -> NLPat
PLam ArgInfo
x Abs NLPat
y
killRange (PPi Dom NLPType
x Abs NLPType
y) = forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 Dom NLPType -> Abs NLPType -> NLPat
PPi Dom NLPType
x Abs NLPType
y
killRange (PSort NLPSort
x) = forall a b. KillRange a => (a -> b) -> a -> b
killRange1 NLPSort -> NLPat
PSort NLPSort
x
killRange (PBoundVar Int
x PElims
y) = forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 Int -> PElims -> NLPat
PBoundVar Int
x PElims
y
killRange (PTerm Term
x) = forall a b. KillRange a => (a -> b) -> a -> b
killRange1 Term -> NLPat
PTerm Term
x
instance KillRange NLPType where
killRange :: KillRangeT NLPType
killRange (NLPType NLPSort
s NLPat
a) = forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 NLPSort -> NLPat -> NLPType
NLPType NLPSort
s NLPat
a
instance KillRange NLPSort where
killRange :: KillRangeT NLPSort
killRange (PType NLPat
l) = forall a b. KillRange a => (a -> b) -> a -> b
killRange1 NLPat -> NLPSort
PType NLPat
l
killRange (PProp NLPat
l) = forall a b. KillRange a => (a -> b) -> a -> b
killRange1 NLPat -> NLPSort
PProp NLPat
l
killRange (PSSet NLPat
l) = forall a b. KillRange a => (a -> b) -> a -> b
killRange1 NLPat -> NLPSort
PSSet NLPat
l
killRange s :: NLPSort
s@(PInf IsFibrant
f Integer
n) = NLPSort
s
killRange NLPSort
PSizeUniv = NLPSort
PSizeUniv
killRange NLPSort
PLockUniv = NLPSort
PLockUniv
killRange NLPSort
PIntervalUniv = NLPSort
PIntervalUniv
instance KillRange RewriteRule where
killRange :: KillRangeT RewriteRule
killRange (RewriteRule QName
q Telescope
gamma QName
f PElims
es Term
rhs Type
t Bool
c) =
forall a b c d e f g.
(KillRange a, KillRange b, KillRange c, KillRange d, KillRange e,
KillRange f) =>
(a -> b -> c -> d -> e -> f -> g)
-> a -> b -> c -> d -> e -> f -> g
killRange6 QName
-> Telescope
-> QName
-> PElims
-> Term
-> Type
-> Bool
-> RewriteRule
RewriteRule QName
q Telescope
gamma QName
f PElims
es Term
rhs Type
t Bool
c
instance KillRange CompiledRepresentation where
killRange :: KillRangeT CompiledRepresentation
killRange = forall a. a -> a
id
instance KillRange EtaEquality where
killRange :: KillRangeT EtaEquality
killRange = forall a. a -> a
id
instance KillRange System where
killRange :: System -> System
killRange (System Telescope
tel [(Face, Term)]
sys) = Telescope -> [(Face, Term)] -> System
System (forall a. KillRange a => KillRangeT a
killRange Telescope
tel) (forall a. KillRange a => KillRangeT a
killRange [(Face, Term)]
sys)
instance KillRange ExtLamInfo where
killRange :: ExtLamInfo -> ExtLamInfo
killRange (ExtLamInfo ModuleName
m Bool
b Maybe System
sys) = forall a b c d.
(KillRange a, KillRange b, KillRange c) =>
(a -> b -> c -> d) -> a -> b -> c -> d
killRange3 ModuleName -> Bool -> Maybe System -> ExtLamInfo
ExtLamInfo ModuleName
m Bool
b Maybe System
sys
instance KillRange FunctionFlag where
killRange :: FunctionFlag -> FunctionFlag
killRange = forall a. a -> a
id
instance KillRange CompKit where
killRange :: CompKit -> CompKit
killRange = forall a. a -> a
id
instance KillRange ProjectionLikenessMissing where
killRange :: ProjectionLikenessMissing -> ProjectionLikenessMissing
killRange = forall a. a -> a
id
instance KillRange Defn where
killRange :: KillRangeT Defn
killRange Defn
def =
case Defn
def of
Axiom Bool
a -> Bool -> Defn
Axiom Bool
a
DataOrRecSig Int
n -> Int -> Defn
DataOrRecSig Int
n
Defn
GeneralizableVar -> Defn
GeneralizableVar
AbstractDefn{} -> forall a. HasCallStack => a
__IMPOSSIBLE__
Function [Clause]
cls Maybe CompiledClauses
comp Maybe SplitTree
ct Maybe Compiled
tt [Clause]
covering FunctionInverse
inv Maybe [QName]
mut IsAbstract
isAbs Delayed
delayed Either ProjectionLikenessMissing Projection
proj Set FunctionFlag
flags Maybe Bool
term Maybe ExtLamInfo
extlam Maybe QName
with Maybe QName
iskan ->
forall a b c d e f g h i j k l m n o.
(KillRange a, KillRange b, KillRange c, KillRange d, KillRange e,
KillRange f, KillRange g, KillRange h, KillRange i, KillRange j,
KillRange k, KillRange l, KillRange m, KillRange n) =>
(a
-> b
-> c
-> d
-> e
-> f
-> g
-> h
-> i
-> j
-> k
-> l
-> m
-> n
-> o)
-> a
-> b
-> c
-> d
-> e
-> f
-> g
-> h
-> i
-> j
-> k
-> l
-> m
-> n
-> o
killRange14 [Clause]
-> Maybe CompiledClauses
-> Maybe SplitTree
-> Maybe Compiled
-> [Clause]
-> FunctionInverse
-> Maybe [QName]
-> IsAbstract
-> Delayed
-> Either ProjectionLikenessMissing Projection
-> Set FunctionFlag
-> Maybe Bool
-> Maybe ExtLamInfo
-> Maybe QName
-> Maybe QName
-> Defn
Function [Clause]
cls Maybe CompiledClauses
comp Maybe SplitTree
ct Maybe Compiled
tt [Clause]
covering FunctionInverse
inv Maybe [QName]
mut IsAbstract
isAbs Delayed
delayed Either ProjectionLikenessMissing Projection
proj Set FunctionFlag
flags Maybe Bool
term Maybe ExtLamInfo
extlam Maybe QName
with Maybe QName
iskan
Datatype Int
a Int
b Maybe Clause
c [QName]
d Sort
e Maybe [QName]
f IsAbstract
g [QName]
h Maybe QName
i Maybe QName
j -> forall a b c d e f g h i j k.
(KillRange a, KillRange b, KillRange c, KillRange d, KillRange e,
KillRange f, KillRange g, KillRange h, KillRange i, KillRange j) =>
(a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k)
-> a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k
killRange10 Int
-> Int
-> Maybe Clause
-> [QName]
-> Sort
-> Maybe [QName]
-> IsAbstract
-> [QName]
-> Maybe QName
-> Maybe QName
-> Defn
Datatype Int
a Int
b Maybe Clause
c [QName]
d Sort
e Maybe [QName]
f IsAbstract
g [QName]
h Maybe QName
i Maybe QName
j
Record Int
a Maybe Clause
b ConHead
c Bool
d [Dom QName]
e Telescope
f Maybe [QName]
g EtaEquality
h PatternOrCopattern
i Maybe Induction
j Maybe Bool
k IsAbstract
l CompKit
m -> forall a b c d e f g h i j k l m n.
(KillRange a, KillRange b, KillRange c, KillRange d, KillRange e,
KillRange f, KillRange g, KillRange h, KillRange i, KillRange j,
KillRange k, KillRange l, KillRange m) =>
(a
-> b -> c -> d -> e -> f -> g -> h -> i -> j -> k -> l -> m -> n)
-> a
-> b
-> c
-> d
-> e
-> f
-> g
-> h
-> i
-> j
-> k
-> l
-> m
-> n
killRange13 Int
-> Maybe Clause
-> ConHead
-> Bool
-> [Dom QName]
-> Telescope
-> Maybe [QName]
-> EtaEquality
-> PatternOrCopattern
-> Maybe Induction
-> Maybe Bool
-> IsAbstract
-> CompKit
-> Defn
Record Int
a Maybe Clause
b ConHead
c Bool
d [Dom QName]
e Telescope
f Maybe [QName]
g EtaEquality
h PatternOrCopattern
i Maybe Induction
j Maybe Bool
k IsAbstract
l CompKit
m
Constructor Int
a Int
b ConHead
c QName
d IsAbstract
e Induction
f CompKit
g Maybe [QName]
h [IsForced]
i Maybe [Bool]
j-> forall a b c d e f g h i j k.
(KillRange a, KillRange b, KillRange c, KillRange d, KillRange e,
KillRange f, KillRange g, KillRange h, KillRange i, KillRange j) =>
(a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k)
-> a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k
killRange10 Int
-> Int
-> ConHead
-> QName
-> IsAbstract
-> Induction
-> CompKit
-> Maybe [QName]
-> [IsForced]
-> Maybe [Bool]
-> Defn
Constructor Int
a Int
b ConHead
c QName
d IsAbstract
e Induction
f CompKit
g Maybe [QName]
h [IsForced]
i Maybe [Bool]
j
Primitive IsAbstract
a String
b [Clause]
c FunctionInverse
d Maybe CompiledClauses
e -> forall a b c d e f.
(KillRange a, KillRange b, KillRange c, KillRange d,
KillRange e) =>
(a -> b -> c -> d -> e -> f) -> a -> b -> c -> d -> e -> f
killRange5 IsAbstract
-> String
-> [Clause]
-> FunctionInverse
-> Maybe CompiledClauses
-> Defn
Primitive IsAbstract
a String
b [Clause]
c FunctionInverse
d Maybe CompiledClauses
e
PrimitiveSort String
a Sort
b -> forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 String -> Sort -> Defn
PrimitiveSort String
a Sort
b
instance KillRange MutualId where
killRange :: MutualId -> MutualId
killRange = forall a. a -> a
id
instance KillRange c => KillRange (FunctionInverse' c) where
killRange :: KillRangeT (FunctionInverse' c)
killRange FunctionInverse' c
NotInjective = forall c. FunctionInverse' c
NotInjective
killRange (Inverse InversionMap c
m) = forall c. InversionMap c -> FunctionInverse' c
Inverse forall a b. (a -> b) -> a -> b
$ forall k v. (KillRange k, KillRange v) => KillRangeT (Map k v)
killRangeMap InversionMap c
m
instance KillRange TermHead where
killRange :: TermHead -> TermHead
killRange TermHead
SortHead = TermHead
SortHead
killRange TermHead
PiHead = TermHead
PiHead
killRange (ConsHead QName
q) = QName -> TermHead
ConsHead forall a b. (a -> b) -> a -> b
$ forall a. KillRange a => KillRangeT a
killRange QName
q
killRange h :: TermHead
h@VarHead{} = TermHead
h
killRange TermHead
UnknownHead = TermHead
UnknownHead
instance KillRange Projection where
killRange :: KillRangeT Projection
killRange (Projection Maybe QName
a QName
b Arg QName
c Int
d ProjLams
e) = forall a b c d e f.
(KillRange a, KillRange b, KillRange c, KillRange d,
KillRange e) =>
(a -> b -> c -> d -> e -> f) -> a -> b -> c -> d -> e -> f
killRange5 Maybe QName -> QName -> Arg QName -> Int -> ProjLams -> Projection
Projection Maybe QName
a QName
b Arg QName
c Int
d ProjLams
e
instance KillRange ProjLams where
killRange :: KillRangeT ProjLams
killRange = forall a. a -> a
id
instance KillRange a => KillRange (Open a) where
killRange :: KillRangeT (Open a)
killRange = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a. KillRange a => KillRangeT a
killRange
instance KillRange DisplayForm where
killRange :: KillRangeT DisplayForm
killRange (Display Int
n [Elim]
es DisplayTerm
dt) = forall a b c d.
(KillRange a, KillRange b, KillRange c) =>
(a -> b -> c -> d) -> a -> b -> c -> d
killRange3 Int -> [Elim] -> DisplayTerm -> DisplayForm
Display Int
n [Elim]
es DisplayTerm
dt
instance KillRange Polarity where
killRange :: KillRangeT Polarity
killRange = forall a. a -> a
id
instance KillRange IsForced where
killRange :: KillRangeT IsForced
killRange = forall a. a -> a
id
instance KillRange DoGeneralize where
killRange :: DoGeneralize -> DoGeneralize
killRange = forall a. a -> a
id
instance KillRange DisplayTerm where
killRange :: KillRangeT DisplayTerm
killRange DisplayTerm
dt =
case DisplayTerm
dt of
DWithApp DisplayTerm
dt [DisplayTerm]
dts [Elim]
es -> forall a b c d.
(KillRange a, KillRange b, KillRange c) =>
(a -> b -> c -> d) -> a -> b -> c -> d
killRange3 DisplayTerm -> [DisplayTerm] -> [Elim] -> DisplayTerm
DWithApp DisplayTerm
dt [DisplayTerm]
dts [Elim]
es
DCon ConHead
q ConInfo
ci [Arg DisplayTerm]
dts -> forall a b c d.
(KillRange a, KillRange b, KillRange c) =>
(a -> b -> c -> d) -> a -> b -> c -> d
killRange3 ConHead -> ConInfo -> [Arg DisplayTerm] -> DisplayTerm
DCon ConHead
q ConInfo
ci [Arg DisplayTerm]
dts
DDef QName
q [Elim' DisplayTerm]
dts -> forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 QName -> [Elim' DisplayTerm] -> DisplayTerm
DDef QName
q [Elim' DisplayTerm]
dts
DDot Term
v -> forall a b. KillRange a => (a -> b) -> a -> b
killRange1 Term -> DisplayTerm
DDot Term
v
DTerm Term
v -> forall a b. KillRange a => (a -> b) -> a -> b
killRange1 Term -> DisplayTerm
DTerm Term
v
instance KillRange a => KillRange (Closure a) where
killRange :: KillRangeT (Closure a)
killRange = forall a. a -> a
id
instance NFData NumGeneralizableArgs where
rnf :: NumGeneralizableArgs -> ()
rnf NumGeneralizableArgs
NoGeneralizableArgs = ()
rnf (SomeGeneralizableArgs Int
_) = ()
instance NFData TCErr where
rnf :: TCErr -> ()
rnf (TypeError CallStack
a TCState
b Closure TypeError
c) = forall a. NFData a => a -> ()
rnf CallStack
a seq :: forall a b. a -> b -> b
`seq` forall a. NFData a => a -> ()
rnf TCState
b seq :: forall a b. a -> b -> b
`seq` forall a. NFData a => a -> ()
rnf Closure TypeError
c
rnf (Exception Range
a Doc
b) = forall a. NFData a => a -> ()
rnf Range
a seq :: forall a b. a -> b -> b
`seq` forall a. NFData a => a -> ()
rnf Doc
b
rnf (IOException TCState
a Range
b IOException
c) = forall a. NFData a => a -> ()
rnf TCState
a seq :: forall a b. a -> b -> b
`seq` forall a. NFData a => a -> ()
rnf Range
b seq :: forall a b. a -> b -> b
`seq` forall a. NFData a => a -> ()
rnf (IOException
c forall a. Eq a => a -> a -> Bool
== IOException
c)
rnf (PatternErr Blocker
a) = forall a. NFData a => a -> ()
rnf Blocker
a
instance NFData PreScopeState
instance NFData PostScopeState
instance NFData TCState
instance NFData DisambiguatedName
instance NFData MutualBlock
instance NFData (BiMap RawTopLevelModuleName ModuleNameHash)
instance NFData PersistentTCState
instance NFData LoadedFileCache
instance NFData TypeCheckAction
instance NFData ModuleCheckMode
instance NFData ModuleInfo
instance NFData ForeignCode
instance NFData Interface
instance NFData a => NFData (Closure a)
instance NFData ProblemConstraint
instance NFData WhyCheckModality
instance NFData Constraint
instance NFData Signature
instance NFData Comparison
instance NFData CompareAs
instance NFData a => NFData (Open a)
instance NFData a => NFData (Judgement a)
instance NFData DoGeneralize
instance NFData GeneralizedValue
instance NFData MetaVariable
instance NFData Listener
instance NFData MetaInstantiation
instance NFData Instantiation
instance NFData RemoteMetaVariable
instance NFData Frozen
instance NFData PrincipalArgTypeMetas
instance NFData TypeCheckingProblem
instance NFData RunMetaOccursCheck
instance NFData MetaInfo
instance NFData InteractionPoint
instance NFData InteractionPoints
instance NFData Overapplied
instance NFData t => NFData (IPBoundary' t)
instance NFData IPClause
instance NFData DisplayForm
instance NFData DisplayTerm
instance NFData NLPat
instance NFData NLPType
instance NFData NLPSort
instance NFData RewriteRule
instance NFData Definition
instance NFData Polarity
instance NFData IsForced
instance NFData Projection
instance NFData ProjLams
instance NFData CompilerPragma
instance NFData System
instance NFData ExtLamInfo
instance NFData EtaEquality
instance NFData FunctionFlag
instance NFData CompKit
instance NFData AxiomData
instance NFData DataOrRecSigData
instance NFData ProjectionLikenessMissing
instance NFData FunctionData
instance NFData DatatypeData
instance NFData RecordData
instance NFData ConstructorData
instance NFData PrimitiveData
instance NFData PrimitiveSortData
instance NFData Defn
instance NFData Simplification
instance NFData AllowedReduction
instance NFData ReduceDefs
instance NFData PrimFun
instance NFData c => NFData (FunctionInverse' c)
instance NFData TermHead
instance NFData Call
instance NFData pf => NFData (Builtin pf)
instance NFData HighlightingLevel
instance NFData HighlightingMethod
instance NFData TCEnv
instance NFData UnquoteFlags
instance NFData AbstractMode
instance NFData ExpandHidden
instance NFData CandidateKind
instance NFData Candidate
instance NFData Warning
instance NFData RecordFieldWarning
instance NFData TCWarning
instance NFData CallInfo
instance NFData TerminationError
instance NFData SplitError
instance NFData NegativeUnification
instance NFData UnificationFailure
instance NFData UnquoteError
instance NFData TypeError
instance NFData LHSOrPatSyn