packages feed

Agda 2.4.2.3 → 2.4.2.4

raw patch · 178 files changed

+14549/−10927 lines, 178 filesdep −ghc-primdep −old-timedep ~Agdadep ~arraydep ~basePVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependencies removed: ghc-prim, old-time

Dependency ranges changed: Agda, array, base, base-orphans, binary, bytestring, containers, deepseq, directory, filepath, hashable, hashtables, haskeline, process, template-haskell, text, time, transformers-compat, unordered-containers, xhtml

API changes (from Hackage documentation)

- Agda.Interaction.BasicOps: instance Agda.Syntax.Translation.AbstractToConcrete.ToConcrete Agda.Syntax.Common.InteractionId Agda.Syntax.Concrete.Expr
- Agda.Interaction.BasicOps: instance Agda.Syntax.Translation.AbstractToConcrete.ToConcrete Agda.TypeChecking.Monad.Base.NamedMeta Agda.Syntax.Concrete.Expr
- Agda.Interaction.Imports: safeReadInterface :: FilePath -> TCM (Maybe Interface)
- Agda.Interaction.Monad: instance Control.Monad.Error.Class.MonadError Agda.TypeChecking.Monad.Base.TCErr Agda.Interaction.Monad.IM
- Agda.Syntax.Abstract: ImplicitP :: PatInfo -> Pattern' e
- Agda.Syntax.Abstract: instance Agda.Syntax.Position.KillRange x => Agda.Syntax.Position.KillRange (Agda.Syntax.Fixity.ThingWithFixity x)
- Agda.Syntax.Abstract.Copatterns: instance GHC.Classes.Eq (Agda.Syntax.Abstract.LHSCore' e)
- Agda.Syntax.Abstract.Copatterns: instance GHC.Classes.Eq (Agda.Syntax.Abstract.Pattern' e)
- Agda.Syntax.Abstract.Copatterns: instance GHC.Classes.Eq Agda.Syntax.Abstract.LHS
- Agda.Syntax.Abstract.Copatterns: instance GHC.Classes.Eq Agda.Syntax.Abstract.Name.AmbiguousQName
- Agda.Syntax.Abstract.Views: instance Agda.Syntax.Abstract.Views.ExprLike (Agda.Syntax.Abstract.Pattern' a)
- Agda.Syntax.Concrete: patternHead :: Pattern -> Maybe Name
- Agda.Syntax.Concrete.Operators: instance Agda.Syntax.Concrete.Operators.Parser.IsExpr Agda.Syntax.Concrete.Expr
- Agda.Syntax.Concrete.Operators: instance Agda.Syntax.Concrete.Operators.Parser.IsExpr Agda.Syntax.Concrete.Pattern
- Agda.Syntax.Info: PatSource :: Range -> (Precedence -> Pattern) -> PatInfo
- Agda.Syntax.Info: [patImplicit] :: ConPatInfo -> Bool
- Agda.Syntax.Info: data PatInfo
- Agda.Syntax.Internal: argName :: Type -> String
- Agda.Syntax.Internal: instance Agda.Syntax.Position.KillRange Agda.Syntax.Internal.Type
- Agda.Syntax.Internal: instance Agda.Syntax.Position.KillRange Agda.Utils.Permutation.Permutation
- Agda.Syntax.Internal: prop :: Type
- Agda.Syntax.Internal.Pattern: instance Agda.Syntax.Abstract.IsProjP Agda.Syntax.Internal.Pattern
- Agda.Syntax.Translation.InternalToAbstract: instance Agda.Syntax.Common.Underscore Agda.Syntax.Abstract.Expr
- Agda.Termination.CallGraph: instance GHC.Base.Monoid cinfo => Agda.Termination.CallMatrix.CallComb (Agda.Termination.CallGraph.Call cinfo)
- Agda.Termination.Order: instance (GHC.Classes.Ord i, Agda.Utils.PartialOrd.PartialOrd a) => Agda.Utils.PartialOrd.PartialOrd (Agda.Termination.SparseMatrix.Matrix i a)
- Agda.Termination.Semiring: instance Agda.Termination.Semiring.SemiRing GHC.Integer.Type.Integer
- Agda.Termination.Semiring: instance Agda.Termination.Semiring.SemiRing GHC.Types.Int
- Agda.Termination.Semiring: instance GHC.Base.Monoid GHC.Integer.Type.Integer
- Agda.Termination.Semiring: instance GHC.Base.Monoid GHC.Types.Int
- Agda.TypeChecking.CompiledClause: emptyBranches :: Case CompiledClauses
- Agda.TypeChecking.CompiledClause.Match: unfoldCorecursion :: Term -> ReduceM (Blocked Term)
- Agda.TypeChecking.CompiledClause.Match: unfoldCorecursionE :: Elim -> ReduceM (Blocked Elim)
- Agda.TypeChecking.Free: allVars :: FreeVars -> VarSet
- Agda.TypeChecking.Free: class Free a
- Agda.TypeChecking.Free: freeInIgnoringSortAnn :: Free a => Nat -> a -> Bool
- Agda.TypeChecking.Free: freeVarsIgnore :: Free a => IgnoreSorts -> a -> FreeVars
- Agda.TypeChecking.Free: instance (Agda.TypeChecking.Free.Free a, Agda.TypeChecking.Free.Free b) => Agda.TypeChecking.Free.Free (a, b)
- Agda.TypeChecking.Free: instance Agda.TypeChecking.Free.Free Agda.Syntax.Internal.Clause
- Agda.TypeChecking.Free: instance Agda.TypeChecking.Free.Free Agda.Syntax.Internal.ClauseBody
- Agda.TypeChecking.Free: instance Agda.TypeChecking.Free.Free Agda.Syntax.Internal.Level
- Agda.TypeChecking.Free: instance Agda.TypeChecking.Free.Free Agda.Syntax.Internal.LevelAtom
- Agda.TypeChecking.Free: instance Agda.TypeChecking.Free.Free Agda.Syntax.Internal.PlusLevel
- Agda.TypeChecking.Free: instance Agda.TypeChecking.Free.Free Agda.Syntax.Internal.Sort
- Agda.TypeChecking.Free: instance Agda.TypeChecking.Free.Free Agda.Syntax.Internal.Term
- Agda.TypeChecking.Free: instance Agda.TypeChecking.Free.Free Agda.Syntax.Internal.Type
- Agda.TypeChecking.Free: instance Agda.TypeChecking.Free.Free a => Agda.TypeChecking.Free.Free (Agda.Syntax.Internal.Abs a)
- Agda.TypeChecking.Free: instance Agda.TypeChecking.Free.Free a => Agda.TypeChecking.Free.Free (Agda.Syntax.Internal.Arg a)
- Agda.TypeChecking.Free: instance Agda.TypeChecking.Free.Free a => Agda.TypeChecking.Free.Free (Agda.Syntax.Internal.Dom a)
- Agda.TypeChecking.Free: instance Agda.TypeChecking.Free.Free a => Agda.TypeChecking.Free.Free (Agda.Syntax.Internal.Elim' a)
- Agda.TypeChecking.Free: instance Agda.TypeChecking.Free.Free a => Agda.TypeChecking.Free.Free (Agda.Syntax.Internal.Tele a)
- Agda.TypeChecking.Free: instance Agda.TypeChecking.Free.Free a => Agda.TypeChecking.Free.Free (GHC.Base.Maybe a)
- Agda.TypeChecking.Free: instance Agda.TypeChecking.Free.Free a => Agda.TypeChecking.Free.Free [a]
- Agda.TypeChecking.Free: instance GHC.Base.Monoid Agda.TypeChecking.Free.FreeT
- Agda.TypeChecking.Free: instance GHC.Classes.Eq Agda.TypeChecking.Free.IgnoreSorts
- Agda.TypeChecking.Free: instance GHC.Show.Show Agda.TypeChecking.Free.IgnoreSorts
- Agda.TypeChecking.Free: relevantVars :: FreeVars -> VarSet
- Agda.TypeChecking.Free: rigidVars :: FreeVars -> VarSet
- Agda.TypeChecking.Irrelevance: composeRelevance :: Relevance -> Relevance -> Relevance
- Agda.TypeChecking.Irrelevance: ignoreForced :: Relevance -> Relevance
- Agda.TypeChecking.Irrelevance: inverseComposeRelevance :: Relevance -> Relevance -> Relevance
- Agda.TypeChecking.Irrelevance: irrToNonStrict :: Relevance -> Relevance
- Agda.TypeChecking.Irrelevance: irrelevantOrUnused :: Relevance -> Bool
- Agda.TypeChecking.Irrelevance: nonStrictToIrr :: Relevance -> Relevance
- Agda.TypeChecking.Irrelevance: unusableRelevance :: Relevance -> Bool
- Agda.TypeChecking.MetaVars: instance Agda.Utils.Except.Error Agda.TypeChecking.MetaVars.InvertExcept
- Agda.TypeChecking.MetaVars: instance Agda.Utils.Except.Error Agda.TypeChecking.MetaVars.ProjVarExc
- Agda.TypeChecking.MetaVars.Occurs: instance GHC.Base.Monoid (Agda.TypeChecking.Monad.Base.TCM Data.Monoid.Any)
- Agda.TypeChecking.Monad.Base: GuardPos :: Occurrence
- Agda.TypeChecking.Monad.Base: JustNeg :: Occurrence
- Agda.TypeChecking.Monad.Base: JustPos :: Occurrence
- Agda.TypeChecking.Monad.Base: Mixed :: Occurrence
- Agda.TypeChecking.Monad.Base: StrictPos :: Occurrence
- Agda.TypeChecking.Monad.Base: Unused :: Occurrence
- Agda.TypeChecking.Monad.Base: [defRewriteRules] :: Definition -> RewriteRules
- Agda.TypeChecking.Monad.Base: data Occurrence
- Agda.TypeChecking.Monad.Base: instance Agda.Utils.Except.Error Agda.TypeChecking.Monad.Base.TypeError
- Agda.TypeChecking.Monad.Base: instance Control.DeepSeq.NFData Agda.TypeChecking.Monad.Base.Occurrence
- Agda.TypeChecking.Monad.Base: instance GHC.Classes.Eq Agda.TypeChecking.Monad.Base.Occurrence
- Agda.TypeChecking.Monad.Base: instance GHC.Classes.Ord Agda.TypeChecking.Monad.Base.Occurrence
- Agda.TypeChecking.Monad.Base: instance GHC.Show.Show Agda.TypeChecking.Monad.Base.Occurrence
- Agda.TypeChecking.Monad.Base.Benchmark: Benchmark :: !(Maybe Account) -> !(Trie Phase CPUTime) -> Benchmark
- Agda.TypeChecking.Monad.Base.Benchmark: BinaryEncode :: Phase
- Agda.TypeChecking.Monad.Base.Benchmark: Compare :: Phase
- Agda.TypeChecking.Monad.Base.Benchmark: Compress :: Phase
- Agda.TypeChecking.Monad.Base.Benchmark: Coverage :: Phase
- Agda.TypeChecking.Monad.Base.Benchmark: Deserialization :: Phase
- Agda.TypeChecking.Monad.Base.Benchmark: Graph :: Phase
- Agda.TypeChecking.Monad.Base.Benchmark: Highlighting :: Phase
- Agda.TypeChecking.Monad.Base.Benchmark: Import :: Phase
- Agda.TypeChecking.Monad.Base.Benchmark: Injectivity :: Phase
- Agda.TypeChecking.Monad.Base.Benchmark: Level :: Phase
- Agda.TypeChecking.Monad.Base.Benchmark: ModuleName :: Phase
- Agda.TypeChecking.Monad.Base.Benchmark: Operators :: Phase
- Agda.TypeChecking.Monad.Base.Benchmark: Parsing :: Phase
- Agda.TypeChecking.Monad.Base.Benchmark: Positivity :: Phase
- Agda.TypeChecking.Monad.Base.Benchmark: ProjectionLikeness :: Phase
- Agda.TypeChecking.Monad.Base.Benchmark: RecCheck :: Phase
- Agda.TypeChecking.Monad.Base.Benchmark: Reduce :: Phase
- Agda.TypeChecking.Monad.Base.Benchmark: Scoping :: Phase
- Agda.TypeChecking.Monad.Base.Benchmark: Serialization :: Phase
- Agda.TypeChecking.Monad.Base.Benchmark: Sort :: Phase
- Agda.TypeChecking.Monad.Base.Benchmark: Termination :: Phase
- Agda.TypeChecking.Monad.Base.Benchmark: Typing :: Phase
- Agda.TypeChecking.Monad.Base.Benchmark: With :: Phase
- Agda.TypeChecking.Monad.Base.Benchmark: [currentAccount] :: Benchmark -> !(Maybe Account)
- Agda.TypeChecking.Monad.Base.Benchmark: [timings] :: Benchmark -> !(Trie Phase CPUTime)
- Agda.TypeChecking.Monad.Base.Benchmark: addCPUTime :: Account -> CPUTime -> Benchmark -> Benchmark
- Agda.TypeChecking.Monad.Base.Benchmark: data Benchmark
- Agda.TypeChecking.Monad.Base.Benchmark: data Phase
- Agda.TypeChecking.Monad.Base.Benchmark: empty :: Benchmark
- Agda.TypeChecking.Monad.Base.Benchmark: instance GHC.Classes.Eq Agda.TypeChecking.Monad.Base.Benchmark.Phase
- Agda.TypeChecking.Monad.Base.Benchmark: instance GHC.Classes.Ord Agda.TypeChecking.Monad.Base.Benchmark.Phase
- Agda.TypeChecking.Monad.Base.Benchmark: instance GHC.Enum.Bounded Agda.TypeChecking.Monad.Base.Benchmark.Phase
- Agda.TypeChecking.Monad.Base.Benchmark: instance GHC.Enum.Enum Agda.TypeChecking.Monad.Base.Benchmark.Phase
- Agda.TypeChecking.Monad.Base.Benchmark: instance GHC.Show.Show Agda.TypeChecking.Monad.Base.Benchmark.Phase
- Agda.TypeChecking.Monad.Base.Benchmark: modifyCurrentAccount :: (Maybe Account -> Maybe Account) -> Benchmark -> Benchmark
- Agda.TypeChecking.Monad.Base.Benchmark: modifyTimings :: (Trie Phase CPUTime -> Trie Phase CPUTime) -> Benchmark -> Benchmark
- Agda.TypeChecking.Monad.Base.Benchmark: type Account = [Phase]
- Agda.TypeChecking.Monad.Base.KillRange: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.CompiledClause.CompiledClauses
- Agda.TypeChecking.Monad.Base.KillRange: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.CompiledRepresentation
- Agda.TypeChecking.Monad.Base.KillRange: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.Definition
- Agda.TypeChecking.Monad.Base.KillRange: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.Definitions
- Agda.TypeChecking.Monad.Base.KillRange: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.Defn
- Agda.TypeChecking.Monad.Base.KillRange: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.DisplayForm
- Agda.TypeChecking.Monad.Base.KillRange: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.DisplayTerm
- Agda.TypeChecking.Monad.Base.KillRange: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.MutualId
- Agda.TypeChecking.Monad.Base.KillRange: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.NLPat
- Agda.TypeChecking.Monad.Base.KillRange: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.Occurrence
- Agda.TypeChecking.Monad.Base.KillRange: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.Polarity
- Agda.TypeChecking.Monad.Base.KillRange: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.Projection
- Agda.TypeChecking.Monad.Base.KillRange: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.RewriteRule
- Agda.TypeChecking.Monad.Base.KillRange: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.Section
- Agda.TypeChecking.Monad.Base.KillRange: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.Sections
- Agda.TypeChecking.Monad.Base.KillRange: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.Signature
- Agda.TypeChecking.Monad.Base.KillRange: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.TermHead
- Agda.TypeChecking.Monad.Base.KillRange: instance Agda.Syntax.Position.KillRange GHC.Base.String
- Agda.TypeChecking.Monad.Base.KillRange: instance Agda.Syntax.Position.KillRange a => Agda.Syntax.Position.KillRange (Agda.TypeChecking.Monad.Base.Open a)
- Agda.TypeChecking.Monad.Base.KillRange: instance Agda.Syntax.Position.KillRange a => Agda.Syntax.Position.KillRange (Agda.Utils.Permutation.Drop a)
- Agda.TypeChecking.Monad.Base.KillRange: instance Agda.Syntax.Position.KillRange c => Agda.Syntax.Position.KillRange (Agda.TypeChecking.CompiledClause.Case c)
- Agda.TypeChecking.Monad.Base.KillRange: instance Agda.Syntax.Position.KillRange c => Agda.Syntax.Position.KillRange (Agda.TypeChecking.CompiledClause.WithArity c)
- Agda.TypeChecking.Monad.Base.KillRange: instance Agda.Syntax.Position.KillRange c => Agda.Syntax.Position.KillRange (Agda.TypeChecking.Monad.Base.FunctionInverse' c)
- Agda.TypeChecking.Monad.Base.KillRange: killRangeMap :: (KillRange k, KillRange v) => KillRangeT (Map k v)
- Agda.TypeChecking.Monad.Benchmark: benchmarking :: MonadTCM tcm => tcm Bool
- Agda.TypeChecking.Monad.Debug: debug :: MonadIO m => String -> m ()
- Agda.TypeChecking.Monad.Signature: getArgOccurrences :: QName -> TCM [Occurrence]
- Agda.TypeChecking.Monad.Trace: traceCall_ :: MonadTCM tcm => (Maybe () -> Call) -> tcm r -> tcm r
- Agda.TypeChecking.Positivity: WithNode :: n -> a -> WithNode n a
- Agda.TypeChecking.Positivity: data WithNode n a
- Agda.TypeChecking.Positivity: instance (Agda.TypeChecking.Pretty.PrettyTCM n, Agda.TypeChecking.Pretty.PrettyTCM (Agda.TypeChecking.Positivity.WithNode n e)) => Agda.TypeChecking.Pretty.PrettyTCM (Agda.Utils.Graph.AdjacencyMap.Graph n e)
- Agda.TypeChecking.Positivity: instance Agda.TypeChecking.Pretty.PrettyTCM Agda.TypeChecking.Monad.Base.Occurrence
- Agda.TypeChecking.Positivity: instance Agda.TypeChecking.Pretty.PrettyTCM n => Agda.TypeChecking.Pretty.PrettyTCM (Agda.TypeChecking.Positivity.WithNode n Agda.TypeChecking.Monad.Base.Occurrence)
- Agda.TypeChecking.Positivity: instance Agda.TypeChecking.Pretty.PrettyTCM n => Agda.TypeChecking.Pretty.PrettyTCM (Agda.TypeChecking.Positivity.WithNode n Agda.TypeChecking.Positivity.Edge)
- Agda.TypeChecking.Positivity: instance Agda.Utils.SemiRing.SemiRing Agda.TypeChecking.Monad.Base.Occurrence
- Agda.TypeChecking.Pretty: instance Agda.Utils.Null.Null (Agda.TypeChecking.Monad.Base.TCM Agda.TypeChecking.Pretty.Doc)
- Agda.TypeChecking.Records: projectType :: Type -> QName -> TCM (Maybe Type)
- Agda.TypeChecking.Reduce: instance Agda.TypeChecking.Reduce.InstantiateFull Agda.Syntax.Internal.Type
- Agda.TypeChecking.Rewriting: updateRewriteRules :: (RewriteRules -> RewriteRules) -> Definition -> Definition
- Agda.TypeChecking.Rewriting.NonLinMatch: AmbSubst :: IntMap [Term] -> AmbSubst
- Agda.TypeChecking.Rewriting.NonLinMatch: [ambSubst] :: AmbSubst -> IntMap [Term]
- Agda.TypeChecking.Rewriting.NonLinMatch: ambMatch :: AmbMatch a b => a -> b -> NLM ()
- Agda.TypeChecking.Rewriting.NonLinMatch: class AmbMatch a b
- Agda.TypeChecking.Rewriting.NonLinMatch: disambiguateSubstitution :: AmbSubst -> ReduceM (Maybe Substitution)
- Agda.TypeChecking.Rewriting.NonLinMatch: instance (Data.Traversable.Traversable f, Agda.TypeChecking.Rewriting.NonLinMatch.PatternFrom a b) => Agda.TypeChecking.Rewriting.NonLinMatch.PatternFrom (f a) (f b)
- Agda.TypeChecking.Rewriting.NonLinMatch: instance Agda.TypeChecking.Rewriting.NonLinMatch.AmbMatch Agda.TypeChecking.Monad.Base.NLPat Agda.Syntax.Internal.Term
- Agda.TypeChecking.Rewriting.NonLinMatch: instance Agda.TypeChecking.Rewriting.NonLinMatch.AmbMatch a b => Agda.TypeChecking.Rewriting.NonLinMatch.AmbMatch (Agda.Syntax.Internal.Arg a) (Agda.Syntax.Internal.Arg b)
- Agda.TypeChecking.Rewriting.NonLinMatch: instance Agda.TypeChecking.Rewriting.NonLinMatch.AmbMatch a b => Agda.TypeChecking.Rewriting.NonLinMatch.AmbMatch (Agda.Syntax.Internal.Elim' a) (Agda.Syntax.Internal.Elim' b)
- Agda.TypeChecking.Rewriting.NonLinMatch: instance Agda.TypeChecking.Rewriting.NonLinMatch.AmbMatch a b => Agda.TypeChecking.Rewriting.NonLinMatch.AmbMatch [a] [b]
- Agda.TypeChecking.Rewriting.NonLinMatch: instance Agda.TypeChecking.Substitute.Subst Agda.TypeChecking.Rewriting.NonLinMatch.PostponedEquation
- Agda.TypeChecking.Rewriting.NonLinMatch: instance Agda.Utils.Singleton.Singleton (GHC.Types.Int, Agda.Syntax.Internal.Term) Agda.TypeChecking.Rewriting.NonLinMatch.AmbSubst
- Agda.TypeChecking.Rewriting.NonLinMatch: instance GHC.Base.Monoid Agda.TypeChecking.Rewriting.NonLinMatch.AmbSubst
- Agda.TypeChecking.Rewriting.NonLinMatch: newtype AmbSubst
- Agda.TypeChecking.Rewriting.NonLinMatch: tellSubst :: Int -> Term -> NLM ()
- Agda.TypeChecking.Rewriting.NonLinMatch: type NLMOut = (AmbSubst, PostponedEquations)
- Agda.TypeChecking.Rules.LHS.Problem: [focusImplicit] :: Focus -> Bool
- Agda.TypeChecking.Rules.Term: instance Agda.Utils.Except.Error (a, b, c)
- Agda.TypeChecking.Serialise: instance Agda.TypeChecking.Serialise.EmbPrj Agda.Syntax.Internal.Type
- Agda.TypeChecking.Serialise: instance Agda.TypeChecking.Serialise.EmbPrj Agda.TypeChecking.Monad.Base.Occurrence
- Agda.TypeChecking.SizedTypes.Syntax: type Offset = Int
- Agda.TypeChecking.SizedTypes.Tests: instance Test.QuickCheck.Arbitrary.Arbitrary Agda.TypeChecking.SizedTypes.Syntax.Cmp
- Agda.TypeChecking.SizedTypes.Tests: instance Test.QuickCheck.Arbitrary.Arbitrary Agda.TypeChecking.SizedTypes.WarshallSolver.Label
- Agda.TypeChecking.SizedTypes.Tests: instance Test.QuickCheck.Arbitrary.Arbitrary Agda.TypeChecking.SizedTypes.WarshallSolver.Weight
- Agda.TypeChecking.SizedTypes.WarshallSolver: instance Agda.TypeChecking.SizedTypes.Utils.Dioid Agda.TypeChecking.SizedTypes.Syntax.Cmp
- Agda.TypeChecking.SizedTypes.WarshallSolver: instance Agda.TypeChecking.SizedTypes.Utils.MeetSemiLattice Agda.TypeChecking.SizedTypes.Syntax.Offset
- Agda.TypeChecking.SizedTypes.WarshallSolver: instance Agda.TypeChecking.SizedTypes.Utils.Plus GHC.Types.Int GHC.Types.Int GHC.Types.Int
- Agda.TypeChecking.Substitute: instance Agda.TypeChecking.Substitute.Abstract [Agda.TypeChecking.Monad.Base.Occurrence]
- Agda.TypeChecking.Substitute: instance Agda.TypeChecking.Substitute.Apply [Agda.TypeChecking.Monad.Base.Occurrence]
- Agda.TypeChecking.Substitute: instance Agda.TypeChecking.Substitute.Subst Agda.Syntax.Internal.Type
- Agda.Utils.Graph.AdjacencyMap: Graph :: Map n (Map n e) -> Graph n e
- Agda.Utils.Graph.AdjacencyMap: [unGraph] :: Graph n e -> Map n (Map n e)
- Agda.Utils.Graph.AdjacencyMap: acyclic :: Ord n => Graph n e -> Bool
- Agda.Utils.Graph.AdjacencyMap: allPaths :: (SemiRing e, Ord n, Ord c) => (e -> c) -> n -> n -> Graph n e -> [e]
- Agda.Utils.Graph.AdjacencyMap: edgeIn :: (Ord n, Arbitrary n, Arbitrary e) => Graph n e -> Gen (n, n, e)
- Agda.Utils.Graph.AdjacencyMap: edges :: Ord n => Graph n e -> [(n, n, e)]
- Agda.Utils.Graph.AdjacencyMap: edgesFrom :: Ord n => Graph n e -> [n] -> [(n, n, e)]
- Agda.Utils.Graph.AdjacencyMap: empty :: Graph n e
- Agda.Utils.Graph.AdjacencyMap: filterEdges :: Ord n => (e -> Bool) -> Graph n e -> Graph n e
- Agda.Utils.Graph.AdjacencyMap: findPath :: (SemiRing e, Ord n) => (e -> Bool) -> n -> n -> Graph n e -> Maybe e
- Agda.Utils.Graph.AdjacencyMap: fromList :: (SemiRing e, Ord n) => [(n, n, e)] -> Graph n e
- Agda.Utils.Graph.AdjacencyMap: fromNodes :: Ord n => [n] -> Graph n e
- Agda.Utils.Graph.AdjacencyMap: insert :: (SemiRing e, Ord n) => n -> n -> e -> Graph n e -> Graph n e
- Agda.Utils.Graph.AdjacencyMap: instance (GHC.Classes.Eq n, GHC.Classes.Eq e) => GHC.Classes.Eq (Agda.Utils.Graph.AdjacencyMap.Graph n e)
- Agda.Utils.Graph.AdjacencyMap: instance (GHC.Classes.Ord n, Agda.Utils.SemiRing.SemiRing e, Test.QuickCheck.Arbitrary.Arbitrary n, Test.QuickCheck.Arbitrary.Arbitrary e) => Test.QuickCheck.Arbitrary.Arbitrary (Agda.Utils.Graph.AdjacencyMap.Graph n e)
- Agda.Utils.Graph.AdjacencyMap: instance (GHC.Show.Show n, GHC.Show.Show e) => GHC.Show.Show (Agda.Utils.Graph.AdjacencyMap.Graph n e)
- Agda.Utils.Graph.AdjacencyMap: instance Agda.Utils.SemiRing.SemiRing Agda.Utils.Graph.AdjacencyMap.E
- Agda.Utils.Graph.AdjacencyMap: instance GHC.Base.Functor (Agda.Utils.Graph.AdjacencyMap.Graph n)
- Agda.Utils.Graph.AdjacencyMap: instance GHC.Classes.Eq Agda.Utils.Graph.AdjacencyMap.E
- Agda.Utils.Graph.AdjacencyMap: instance GHC.Show.Show Agda.Utils.Graph.AdjacencyMap.E
- Agda.Utils.Graph.AdjacencyMap: instance Test.QuickCheck.Arbitrary.Arbitrary Agda.Utils.Graph.AdjacencyMap.E
- Agda.Utils.Graph.AdjacencyMap: invariant :: Ord n => Graph n e -> Bool
- Agda.Utils.Graph.AdjacencyMap: lookup :: Ord n => n -> n -> Graph n e -> Maybe e
- Agda.Utils.Graph.AdjacencyMap: neighbours :: Ord n => n -> Graph n e -> [(n, e)]
- Agda.Utils.Graph.AdjacencyMap: newtype Graph n e
- Agda.Utils.Graph.AdjacencyMap: nodeIn :: (Ord n, Arbitrary n) => Graph n e -> Gen n
- Agda.Utils.Graph.AdjacencyMap: nodes :: Ord n => Graph n e -> Set n
- Agda.Utils.Graph.AdjacencyMap: removeEdge :: Ord n => n -> n -> Graph n e -> Graph n e
- Agda.Utils.Graph.AdjacencyMap: removeNode :: Ord n => n -> Graph n e -> Graph n e
- Agda.Utils.Graph.AdjacencyMap: sccs :: Ord n => Graph n e -> [[n]]
- Agda.Utils.Graph.AdjacencyMap: sccs' :: Ord n => Graph n e -> [SCC n]
- Agda.Utils.Graph.AdjacencyMap: singleton :: Ord n => n -> n -> e -> Graph n e
- Agda.Utils.Graph.AdjacencyMap: tests :: IO Bool
- Agda.Utils.Graph.AdjacencyMap: transitiveClosure :: (Eq e, SemiRing e, Ord n) => Graph n e -> Graph n e
- Agda.Utils.Graph.AdjacencyMap: transitiveClosure1 :: (Eq e, SemiRing e, Ord n) => Graph n e -> Graph n e
- Agda.Utils.Graph.AdjacencyMap: union :: (SemiRing e, Ord n) => Graph n e -> Graph n e -> Graph n e
- Agda.Utils.Graph.AdjacencyMap: unions :: (SemiRing e, Ord n) => [Graph n e] -> Graph n e
- Agda.Utils.Graph.AdjacencyMap.Unidirectional: edgeIn :: (Ord n, Arbitrary n, Arbitrary e) => Graph n n e -> Gen (Edge n n e)
- Agda.Utils.Graph.AdjacencyMap.Unidirectional: instance Agda.Utils.SemiRing.SemiRing Agda.Utils.Graph.AdjacencyMap.Unidirectional.E
- Agda.Utils.Graph.AdjacencyMap.Unidirectional: instance GHC.Classes.Eq Agda.Utils.Graph.AdjacencyMap.Unidirectional.E
- Agda.Utils.Graph.AdjacencyMap.Unidirectional: instance GHC.Classes.Eq Agda.Utils.Graph.AdjacencyMap.Unidirectional.N
- Agda.Utils.Graph.AdjacencyMap.Unidirectional: instance GHC.Classes.Ord Agda.Utils.Graph.AdjacencyMap.Unidirectional.N
- Agda.Utils.Graph.AdjacencyMap.Unidirectional: instance GHC.Show.Show Agda.Utils.Graph.AdjacencyMap.Unidirectional.E
- Agda.Utils.Graph.AdjacencyMap.Unidirectional: instance GHC.Show.Show Agda.Utils.Graph.AdjacencyMap.Unidirectional.N
- Agda.Utils.Graph.AdjacencyMap.Unidirectional: instance Test.QuickCheck.Arbitrary.Arbitrary Agda.Utils.Graph.AdjacencyMap.Unidirectional.E
- Agda.Utils.Graph.AdjacencyMap.Unidirectional: instance Test.QuickCheck.Arbitrary.Arbitrary Agda.Utils.Graph.AdjacencyMap.Unidirectional.N
- Agda.Utils.Graph.AdjacencyMap.Unidirectional: nodeIn :: (Ord n, Arbitrary n) => Graph n n e -> Gen n
- Agda.Utils.Graph.AdjacencyMap.Unidirectional: tests :: IO Bool
- Agda.Utils.Graph.AdjacencyMap.Unidirectional: transitiveClosure :: (Eq e, SemiRing e, Ord n) => Graph n n e -> Graph n n e
- Agda.Utils.Graph.AdjacencyMap.Unidirectional: transitiveClosure1 :: (Eq e, SemiRing e, Ord n) => Graph n n e -> Graph n n e
- Agda.Utils.ListT.Tests: instance Test.QuickCheck.Arbitrary.Arbitrary a => Test.QuickCheck.Arbitrary.Arbitrary (Agda.Utils.ListT.Tests.List a)
- Agda.Utils.Map.Compat: traverseWithKey :: (Ord k, Applicative t) => (k -> a -> t b) -> Map k a -> t (Map k b)
- Agda.Utils.Monad: instance Agda.Utils.Except.Error ()
- Agda.Utils.PartialOrd: instance Agda.Utils.SemiRing.SemiRing Agda.Utils.PartialOrd.PartialOrdering
- Agda.Utils.Permutation.Tests: instance Test.QuickCheck.Arbitrary.Arbitrary Agda.Utils.Permutation.Permutation
- Agda.Utils.Pretty: instance Agda.Utils.Null.Null Text.PrettyPrint.HughesPJ.Doc
- Agda.Utils.Warshall: Dist :: Nat -> Distance
- Agda.Utils.Warshall: instance Agda.Utils.SemiRing.SemiRing Agda.Utils.Warshall.Distance
- Agda.Utils.Warshall: instance GHC.Classes.Eq Agda.Utils.Warshall.Distance
- Agda.Utils.Warshall: instance GHC.Classes.Ord Agda.Utils.Warshall.Distance
- Agda.Utils.Warshall: instance GHC.Enum.Enum Agda.Utils.Warshall.Distance
- Agda.Utils.Warshall: instance GHC.Num.Num Agda.Utils.Warshall.Distance
- Agda.Utils.Warshall: instance GHC.Real.Integral Agda.Utils.Warshall.Distance
- Agda.Utils.Warshall: instance GHC.Real.Real Agda.Utils.Warshall.Distance
- Agda.Utils.Warshall: instance GHC.Show.Show Agda.Utils.Warshall.Distance
- Agda.Utils.Warshall: newtype Distance
+ Agda.Benchmarking: BinaryEncode :: Phase
+ Agda.Benchmarking: Compare :: Phase
+ Agda.Benchmarking: Compress :: Phase
+ Agda.Benchmarking: Coverage :: Phase
+ Agda.Benchmarking: Deserialization :: Phase
+ Agda.Benchmarking: Free :: Phase
+ Agda.Benchmarking: Graph :: Phase
+ Agda.Benchmarking: Highlighting :: Phase
+ Agda.Benchmarking: Import :: Phase
+ Agda.Benchmarking: Injectivity :: Phase
+ Agda.Benchmarking: InverseScopeLookup :: Phase
+ Agda.Benchmarking: Level :: Phase
+ Agda.Benchmarking: ModuleName :: Phase
+ Agda.Benchmarking: OccursCheck :: Phase
+ Agda.Benchmarking: Operators :: Phase
+ Agda.Benchmarking: Parsing :: Phase
+ Agda.Benchmarking: Positivity :: Phase
+ Agda.Benchmarking: ProjectionLikeness :: Phase
+ Agda.Benchmarking: RecCheck :: Phase
+ Agda.Benchmarking: Reduce :: Phase
+ Agda.Benchmarking: Scoping :: Phase
+ Agda.Benchmarking: Serialization :: Phase
+ Agda.Benchmarking: Sort :: Phase
+ Agda.Benchmarking: Termination :: Phase
+ Agda.Benchmarking: Typing :: Phase
+ Agda.Benchmarking: With :: Phase
+ Agda.Benchmarking: benchmarks :: IORef Benchmark
+ Agda.Benchmarking: billToIO :: Account -> IO a -> IO a
+ Agda.Benchmarking: billToPure :: Account -> a -> a
+ Agda.Benchmarking: data Phase
+ Agda.Benchmarking: instance Agda.Utils.Benchmark.MonadBench Agda.Benchmarking.Phase GHC.Types.IO
+ Agda.Benchmarking: instance Agda.Utils.Pretty.Pretty Agda.Benchmarking.Phase
+ Agda.Benchmarking: instance GHC.Classes.Eq Agda.Benchmarking.Phase
+ Agda.Benchmarking: instance GHC.Classes.Ord Agda.Benchmarking.Phase
+ Agda.Benchmarking: instance GHC.Enum.Bounded Agda.Benchmarking.Phase
+ Agda.Benchmarking: instance GHC.Enum.Enum Agda.Benchmarking.Phase
+ Agda.Benchmarking: instance GHC.Show.Show Agda.Benchmarking.Phase
+ Agda.Benchmarking: type Account = Account Phase
+ Agda.Benchmarking: type Benchmark = Benchmark Phase
+ Agda.Compiler.MAlonzo.Compiler: CCEnv :: Maybe QName -> NameSupply -> CCContext -> Maybe CompiledClauses -> CCEnv
+ Agda.Compiler.MAlonzo.Compiler: [ccCatchAll] :: CCEnv -> Maybe CompiledClauses
+ Agda.Compiler.MAlonzo.Compiler: [ccCxt] :: CCEnv -> CCContext
+ Agda.Compiler.MAlonzo.Compiler: [ccFunName] :: CCEnv -> Maybe QName
+ Agda.Compiler.MAlonzo.Compiler: [ccNameSupply] :: CCEnv -> NameSupply
+ Agda.Compiler.MAlonzo.Compiler: branch :: Pat -> CompiledClauses -> CC Alt
+ Agda.Compiler.MAlonzo.Compiler: casetree :: CompiledClauses -> CC Exp
+ Agda.Compiler.MAlonzo.Compiler: catchAllAlts :: Maybe CompiledClauses -> CC [Alt]
+ Agda.Compiler.MAlonzo.Compiler: closedTerm :: Term -> TCM Exp
+ Agda.Compiler.MAlonzo.Compiler: conAlts :: Int -> Map QName (WithArity CompiledClauses) -> CC [Alt]
+ Agda.Compiler.MAlonzo.Compiler: data CCEnv
+ Agda.Compiler.MAlonzo.Compiler: initCCEnv :: Maybe QName -> CCEnv
+ Agda.Compiler.MAlonzo.Compiler: intros :: Int -> ([Name] -> CC Exp) -> CC Exp
+ Agda.Compiler.MAlonzo.Compiler: lambdas :: Int -> CC Exp -> CC Exp
+ Agda.Compiler.MAlonzo.Compiler: lambdasUpTo :: Int -> CC Exp -> CC Exp
+ Agda.Compiler.MAlonzo.Compiler: litAlts :: Map Literal CompiledClauses -> CC [Alt]
+ Agda.Compiler.MAlonzo.Compiler: lookupIndex :: Int -> CCContext -> Name
+ Agda.Compiler.MAlonzo.Compiler: lookupLevel :: Int -> CCContext -> Name
+ Agda.Compiler.MAlonzo.Compiler: mapContext :: (CCContext -> CCContext) -> CCEnv -> CCEnv
+ Agda.Compiler.MAlonzo.Compiler: mapNameSupply :: (NameSupply -> NameSupply) -> CCEnv -> CCEnv
+ Agda.Compiler.MAlonzo.Compiler: mkLams :: [Name] -> Exp -> Exp
+ Agda.Compiler.MAlonzo.Compiler: mkRecord :: Map QName Exp -> CC Exp
+ Agda.Compiler.MAlonzo.Compiler: recConFromProj :: QName -> TCM ConHead
+ Agda.Compiler.MAlonzo.Compiler: replaceVar :: Int -> Int -> ([Name] -> CC a) -> CC a
+ Agda.Compiler.MAlonzo.Compiler: type CC = ReaderT CCEnv TCM
+ Agda.Compiler.MAlonzo.Compiler: type CCContext = [Name]
+ Agda.Compiler.MAlonzo.Compiler: type NameSupply = [Name]
+ Agda.Compiler.MAlonzo.Compiler: updateCatchAll :: Maybe CompiledClauses -> CC a -> CC a
+ Agda.Interaction.BasicOps: SizeLtSat :: a -> OutputConstraint a b
+ Agda.Interaction.Imports: constructIScope :: Interface -> Interface
+ Agda.Interaction.Imports: removePrivates :: ScopeInfo -> ScopeInfo
+ Agda.Interaction.Options: [optRewriting] :: PragmaOptions -> Bool
+ Agda.Syntax.Abstract: instance Agda.Syntax.Common.Underscore Agda.Syntax.Abstract.Expr
+ Agda.Syntax.Abstract: instance GHC.Classes.Eq (Agda.Syntax.Abstract.LHSCore' e)
+ Agda.Syntax.Abstract: instance GHC.Classes.Eq (Agda.Syntax.Abstract.Pattern' e)
+ Agda.Syntax.Abstract: instance GHC.Classes.Eq Agda.Syntax.Abstract.LHS
+ Agda.Syntax.Abstract.Name: instance Agda.Utils.Pretty.Pretty a => Agda.Utils.Pretty.Pretty (Agda.Syntax.Abstract.Name.QNamed a)
+ Agda.Syntax.Abstract.Name: instance GHC.Classes.Eq Agda.Syntax.Abstract.Name.AmbiguousQName
+ Agda.Syntax.Abstract.Name: instance Test.QuickCheck.Arbitrary.Arbitrary Agda.Syntax.Abstract.Name.Name
+ Agda.Syntax.Abstract.Name: instance Test.QuickCheck.Arbitrary.Arbitrary Agda.Syntax.Abstract.Name.QName
+ Agda.Syntax.Abstract.Name: instance Test.QuickCheck.Arbitrary.CoArbitrary Agda.Syntax.Abstract.Name.Name
+ Agda.Syntax.Abstract.Name: instance Test.QuickCheck.Arbitrary.CoArbitrary Agda.Syntax.Abstract.Name.QName
+ Agda.Syntax.Abstract.Views: instance Agda.Syntax.Abstract.Views.ExprLike a => Agda.Syntax.Abstract.Views.ExprLike (Agda.Syntax.Abstract.Pattern' a)
+ Agda.Syntax.Abstract.Views: recurseExpr :: (ExprLike a, Applicative m) => (Expr -> m Expr -> m Expr) -> a -> m a
+ Agda.Syntax.Common: ConPCon :: ConPOrigin
+ Agda.Syntax.Common: ConPImplicit :: ConPOrigin
+ Agda.Syntax.Common: ConPRec :: ConPOrigin
+ Agda.Syntax.Common: composeRelevance :: Relevance -> Relevance -> Relevance
+ Agda.Syntax.Common: data ConPOrigin
+ Agda.Syntax.Common: ignoreForced :: Relevance -> Relevance
+ Agda.Syntax.Common: instance GHC.Classes.Eq Agda.Syntax.Common.ConPOrigin
+ Agda.Syntax.Common: instance GHC.Classes.Ord Agda.Syntax.Common.ConPOrigin
+ Agda.Syntax.Common: instance GHC.Enum.Bounded Agda.Syntax.Common.ConPOrigin
+ Agda.Syntax.Common: instance GHC.Enum.Enum Agda.Syntax.Common.ConPOrigin
+ Agda.Syntax.Common: instance GHC.Generics.Constructor Agda.Syntax.Common.C1_0NameId
+ Agda.Syntax.Common: instance GHC.Generics.Datatype Agda.Syntax.Common.D1NameId
+ Agda.Syntax.Common: instance GHC.Generics.Generic Agda.Syntax.Common.NameId
+ Agda.Syntax.Common: instance GHC.Show.Show Agda.Syntax.Common.ConPOrigin
+ Agda.Syntax.Common: instance Test.QuickCheck.Arbitrary.Arbitrary Agda.Syntax.Common.NameId
+ Agda.Syntax.Common: instance Test.QuickCheck.Arbitrary.CoArbitrary Agda.Syntax.Common.NameId
+ Agda.Syntax.Common: inverseComposeRelevance :: Relevance -> Relevance -> Relevance
+ Agda.Syntax.Common: irrToNonStrict :: Relevance -> Relevance
+ Agda.Syntax.Common: irrelevantOrUnused :: Relevance -> Bool
+ Agda.Syntax.Common: nonStrictToIrr :: Relevance -> Relevance
+ Agda.Syntax.Common: unusableRelevance :: Relevance -> Bool
+ Agda.Syntax.Concrete: patternQNames :: Pattern -> [QName]
+ Agda.Syntax.Concrete.Name: instance GHC.Generics.Constructor Agda.Syntax.Concrete.Name.C1_0NamePart
+ Agda.Syntax.Concrete.Name: instance GHC.Generics.Constructor Agda.Syntax.Concrete.Name.C1_1NamePart
+ Agda.Syntax.Concrete.Name: instance GHC.Generics.Datatype Agda.Syntax.Concrete.Name.D1NamePart
+ Agda.Syntax.Concrete.Name: instance GHC.Generics.Generic Agda.Syntax.Concrete.Name.NamePart
+ Agda.Syntax.Concrete.Name: instance Test.QuickCheck.Arbitrary.Arbitrary Agda.Syntax.Concrete.Name.Name
+ Agda.Syntax.Concrete.Name: instance Test.QuickCheck.Arbitrary.CoArbitrary Agda.Syntax.Concrete.Name.Name
+ Agda.Syntax.Concrete.Name: instance Test.QuickCheck.Arbitrary.CoArbitrary Agda.Syntax.Concrete.Name.NamePart
+ Agda.Syntax.Concrete.Operators.Parser: instance Agda.Syntax.Concrete.Operators.Parser.IsExpr Agda.Syntax.Concrete.Expr
+ Agda.Syntax.Concrete.Operators.Parser: instance Agda.Syntax.Concrete.Operators.Parser.IsExpr Agda.Syntax.Concrete.Pattern
+ Agda.Syntax.Fixity: instance Agda.Syntax.Position.KillRange x => Agda.Syntax.Position.KillRange (Agda.Syntax.Fixity.ThingWithFixity x)
+ Agda.Syntax.Fixity: noFixity' :: Fixity'
+ Agda.Syntax.Info: [patOrigin] :: ConPatInfo -> ConPOrigin
+ Agda.Syntax.Info: instance Agda.Utils.Null.Null Agda.Syntax.Info.ExprInfo
+ Agda.Syntax.Info: instance Agda.Utils.Null.Null Agda.Syntax.Info.LHSInfo
+ Agda.Syntax.Info: instance Agda.Utils.Null.Null Agda.Syntax.Info.LetInfo
+ Agda.Syntax.Info: instance Agda.Utils.Null.Null Agda.Syntax.Info.PatInfo
+ Agda.Syntax.Info: instance GHC.Classes.Eq Agda.Syntax.Info.PatInfo
+ Agda.Syntax.Info: newtype PatInfo
+ Agda.Syntax.Internal: imapClauseBody :: (Nat -> a -> b) -> ClauseBodyF a -> ClauseBodyF b
+ Agda.Syntax.Internal: instance Agda.Syntax.Abstract.IsProjP Agda.Syntax.Internal.Pattern
+ Agda.Syntax.Internal: instance Agda.Syntax.Internal.SgTel (Agda.Syntax.Internal.Dom Agda.Syntax.Internal.Type)
+ Agda.Syntax.Internal: instance Agda.Syntax.Position.KillRange a => Agda.Syntax.Position.KillRange (Agda.Syntax.Internal.Type' a)
+ Agda.Syntax.Internal: notInScopeName :: ArgName -> ArgName
+ Agda.Syntax.Parser: moduleNameParser :: Parser QName
+ Agda.Syntax.Parser.Parser: instance GHC.Show.Show Agda.Syntax.Parser.Parser.RHSOrTypeSigs
+ Agda.Syntax.Parser.Parser: moduleNameParser :: Parser QName
+ Agda.Syntax.Position: instance Agda.Syntax.Position.KillRange GHC.Base.String
+ Agda.Syntax.Position: killRangeMap :: (KillRange k, KillRange v) => KillRangeT (Map k v)
+ Agda.Syntax.Translation.AbstractToConcrete: instance Agda.Syntax.Translation.AbstractToConcrete.ToConcrete Agda.Syntax.Common.InteractionId Agda.Syntax.Concrete.Expr
+ Agda.Syntax.Translation.AbstractToConcrete: instance Agda.Syntax.Translation.AbstractToConcrete.ToConcrete Agda.TypeChecking.Monad.Base.NamedMeta Agda.Syntax.Concrete.Expr
+ Agda.Termination.Monad: instance Agda.Utils.Benchmark.MonadBench Agda.Benchmarking.Phase Agda.Termination.Monad.TerM
+ Agda.Termination.SparseMatrix: instance (GHC.Classes.Ord i, Agda.Utils.PartialOrd.PartialOrd a) => Agda.Utils.PartialOrd.PartialOrd (Agda.Termination.SparseMatrix.Matrix i a)
+ Agda.TypeChecking.CheckInternal: infer :: Term -> TCM Type
+ Agda.TypeChecking.CompiledClause: [projPatterns] :: Case c -> Bool
+ Agda.TypeChecking.CompiledClause: hasCatchAll :: CompiledClauses -> Bool
+ Agda.TypeChecking.CompiledClause: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.CompiledClause.CompiledClauses
+ Agda.TypeChecking.CompiledClause: instance Agda.Syntax.Position.KillRange c => Agda.Syntax.Position.KillRange (Agda.TypeChecking.CompiledClause.Case c)
+ Agda.TypeChecking.CompiledClause: instance Agda.Syntax.Position.KillRange c => Agda.Syntax.Position.KillRange (Agda.TypeChecking.CompiledClause.WithArity c)
+ Agda.TypeChecking.CompiledClause: instance Agda.Utils.Null.Null (Agda.TypeChecking.CompiledClause.Case m)
+ Agda.TypeChecking.CompiledClause: projCase :: QName -> c -> Case c
+ Agda.TypeChecking.CompiledClause.Compile: properSplit :: Pattern -> Maybe Bool
+ Agda.TypeChecking.Conversion: polFromCmp :: Comparison -> Polarity
+ Agda.TypeChecking.DisplayForm: displayFormArities :: QName -> TCM [Int]
+ Agda.TypeChecking.Free: allFreeVars :: Free' a VarSet => a -> VarSet
+ Agda.TypeChecking.Free: allRelevantVars :: Free' a VarSet => a -> VarSet
+ Agda.TypeChecking.Free: allRelevantVarsIgnoring :: Free' a VarSet => IgnoreSorts -> a -> VarSet
+ Agda.TypeChecking.Free: closed :: Free' a All => a -> Bool
+ Agda.TypeChecking.Free: instance Agda.Utils.Singleton.Singleton Agda.TypeChecking.Free.Lazy.Variable Agda.TypeChecking.Free.FreeVars
+ Agda.TypeChecking.Free: instance GHC.Classes.Eq Agda.TypeChecking.Free.FreeVars
+ Agda.TypeChecking.Free: instance GHC.Show.Show Agda.TypeChecking.Free.FreeVars
+ Agda.TypeChecking.Free: type Free a = Free' a Any
+ Agda.TypeChecking.Free: type FreeV a = Free' a FreeVars
+ Agda.TypeChecking.Free: type FreeVS a = Free' a VarSet
+ Agda.TypeChecking.Free.Lazy: Flexible :: FlexRig
+ Agda.TypeChecking.Free.Lazy: FreeEnv :: !IgnoreSorts -> !Int -> !FlexRig -> !Relevance -> SingleVar c -> FreeEnv c
+ Agda.TypeChecking.Free.Lazy: IgnoreAll :: IgnoreSorts
+ Agda.TypeChecking.Free.Lazy: IgnoreInAnnotations :: IgnoreSorts
+ Agda.TypeChecking.Free.Lazy: IgnoreNot :: IgnoreSorts
+ Agda.TypeChecking.Free.Lazy: StronglyRigid :: FlexRig
+ Agda.TypeChecking.Free.Lazy: Unguarded :: FlexRig
+ Agda.TypeChecking.Free.Lazy: VarOcc :: FlexRig -> Relevance -> VarOcc
+ Agda.TypeChecking.Free.Lazy: WeaklyRigid :: FlexRig
+ Agda.TypeChecking.Free.Lazy: [feBinders] :: FreeEnv c -> !Int
+ Agda.TypeChecking.Free.Lazy: [feFlexRig] :: FreeEnv c -> !FlexRig
+ Agda.TypeChecking.Free.Lazy: [feIgnoreSorts] :: FreeEnv c -> !IgnoreSorts
+ Agda.TypeChecking.Free.Lazy: [feRelevance] :: FreeEnv c -> !Relevance
+ Agda.TypeChecking.Free.Lazy: [feSingleton] :: FreeEnv c -> SingleVar c
+ Agda.TypeChecking.Free.Lazy: [varFlexRig] :: VarOcc -> FlexRig
+ Agda.TypeChecking.Free.Lazy: [varRelevance] :: VarOcc -> Relevance
+ Agda.TypeChecking.Free.Lazy: bind :: FreeM a -> FreeM a
+ Agda.TypeChecking.Free.Lazy: botVarOcc :: VarOcc
+ Agda.TypeChecking.Free.Lazy: class Free' a c
+ Agda.TypeChecking.Free.Lazy: composeFlexRig :: FlexRig -> FlexRig -> FlexRig
+ Agda.TypeChecking.Free.Lazy: data FlexRig
+ Agda.TypeChecking.Free.Lazy: data FreeEnv c
+ Agda.TypeChecking.Free.Lazy: data IgnoreSorts
+ Agda.TypeChecking.Free.Lazy: data VarOcc
+ Agda.TypeChecking.Free.Lazy: freeVars' :: (Free' a c, Monoid c) => a -> FreeM c
+ Agda.TypeChecking.Free.Lazy: go :: FlexRig -> FreeM a -> FreeM a
+ Agda.TypeChecking.Free.Lazy: goRel :: Relevance -> FreeM a -> FreeM a
+ Agda.TypeChecking.Free.Lazy: initFreeEnv :: SingleVar c -> FreeEnv c
+ Agda.TypeChecking.Free.Lazy: instance (Agda.TypeChecking.Free.Lazy.Free' a c, Agda.TypeChecking.Free.Lazy.Free' b c) => Agda.TypeChecking.Free.Lazy.Free' (a, b) c
+ Agda.TypeChecking.Free.Lazy: instance Agda.TypeChecking.Free.Lazy.Free' Agda.Syntax.Internal.Clause c
+ Agda.TypeChecking.Free.Lazy: instance Agda.TypeChecking.Free.Lazy.Free' Agda.Syntax.Internal.ClauseBody c
+ Agda.TypeChecking.Free.Lazy: instance Agda.TypeChecking.Free.Lazy.Free' Agda.Syntax.Internal.Level c
+ Agda.TypeChecking.Free.Lazy: instance Agda.TypeChecking.Free.Lazy.Free' Agda.Syntax.Internal.LevelAtom c
+ Agda.TypeChecking.Free.Lazy: instance Agda.TypeChecking.Free.Lazy.Free' Agda.Syntax.Internal.PlusLevel c
+ Agda.TypeChecking.Free.Lazy: instance Agda.TypeChecking.Free.Lazy.Free' Agda.Syntax.Internal.Sort c
+ Agda.TypeChecking.Free.Lazy: instance Agda.TypeChecking.Free.Lazy.Free' Agda.Syntax.Internal.Term c
+ Agda.TypeChecking.Free.Lazy: instance Agda.TypeChecking.Free.Lazy.Free' Agda.Syntax.Internal.Type c
+ Agda.TypeChecking.Free.Lazy: instance Agda.TypeChecking.Free.Lazy.Free' a c => Agda.TypeChecking.Free.Lazy.Free' (Agda.Syntax.Internal.Abs a) c
+ Agda.TypeChecking.Free.Lazy: instance Agda.TypeChecking.Free.Lazy.Free' a c => Agda.TypeChecking.Free.Lazy.Free' (Agda.Syntax.Internal.Arg a) c
+ Agda.TypeChecking.Free.Lazy: instance Agda.TypeChecking.Free.Lazy.Free' a c => Agda.TypeChecking.Free.Lazy.Free' (Agda.Syntax.Internal.Dom a) c
+ Agda.TypeChecking.Free.Lazy: instance Agda.TypeChecking.Free.Lazy.Free' a c => Agda.TypeChecking.Free.Lazy.Free' (Agda.Syntax.Internal.Elim' a) c
+ Agda.TypeChecking.Free.Lazy: instance Agda.TypeChecking.Free.Lazy.Free' a c => Agda.TypeChecking.Free.Lazy.Free' (Agda.Syntax.Internal.Tele a) c
+ Agda.TypeChecking.Free.Lazy: instance Agda.TypeChecking.Free.Lazy.Free' a c => Agda.TypeChecking.Free.Lazy.Free' (GHC.Base.Maybe a) c
+ Agda.TypeChecking.Free.Lazy: instance Agda.TypeChecking.Free.Lazy.Free' a c => Agda.TypeChecking.Free.Lazy.Free' [a] c
+ Agda.TypeChecking.Free.Lazy: instance GHC.Base.Monoid c => GHC.Base.Monoid (Agda.TypeChecking.Free.Lazy.FreeM c)
+ Agda.TypeChecking.Free.Lazy: instance GHC.Classes.Eq Agda.TypeChecking.Free.Lazy.FlexRig
+ Agda.TypeChecking.Free.Lazy: instance GHC.Classes.Eq Agda.TypeChecking.Free.Lazy.IgnoreSorts
+ Agda.TypeChecking.Free.Lazy: instance GHC.Classes.Eq Agda.TypeChecking.Free.Lazy.VarOcc
+ Agda.TypeChecking.Free.Lazy: instance GHC.Classes.Ord Agda.TypeChecking.Free.Lazy.FlexRig
+ Agda.TypeChecking.Free.Lazy: instance GHC.Enum.Bounded Agda.TypeChecking.Free.Lazy.FlexRig
+ Agda.TypeChecking.Free.Lazy: instance GHC.Enum.Enum Agda.TypeChecking.Free.Lazy.FlexRig
+ Agda.TypeChecking.Free.Lazy: instance GHC.Show.Show Agda.TypeChecking.Free.Lazy.FlexRig
+ Agda.TypeChecking.Free.Lazy: instance GHC.Show.Show Agda.TypeChecking.Free.Lazy.IgnoreSorts
+ Agda.TypeChecking.Free.Lazy: instance GHC.Show.Show Agda.TypeChecking.Free.Lazy.VarOcc
+ Agda.TypeChecking.Free.Lazy: instance Test.QuickCheck.Arbitrary.Arbitrary Agda.TypeChecking.Free.Lazy.FlexRig
+ Agda.TypeChecking.Free.Lazy: instance Test.QuickCheck.Arbitrary.Arbitrary Agda.TypeChecking.Free.Lazy.VarOcc
+ Agda.TypeChecking.Free.Lazy: maxVarOcc :: VarOcc -> VarOcc -> VarOcc
+ Agda.TypeChecking.Free.Lazy: topVarOcc :: VarOcc
+ Agda.TypeChecking.Free.Lazy: type FreeM c = Reader (FreeEnv c) c
+ Agda.TypeChecking.Free.Lazy: type SingleVar c = Variable -> c
+ Agda.TypeChecking.Free.Lazy: type VarMap = IntMap VarOcc
+ Agda.TypeChecking.Free.Lazy: type Variable = (Int, VarOcc)
+ Agda.TypeChecking.Free.Lazy: underConstructor :: ConHead -> FreeM a -> FreeM a
+ Agda.TypeChecking.Free.Lazy: variable :: (Monoid c) => Int -> FreeM c
+ Agda.TypeChecking.Free.Old: FV :: VarSet -> VarSet -> VarSet -> VarSet -> VarSet -> VarSet -> FreeVars
+ Agda.TypeChecking.Free.Old: Flexible :: Occurrence
+ Agda.TypeChecking.Free.Old: IgnoreAll :: IgnoreSorts
+ Agda.TypeChecking.Free.Old: IgnoreInAnnotations :: IgnoreSorts
+ Agda.TypeChecking.Free.Old: IgnoreNot :: IgnoreSorts
+ Agda.TypeChecking.Free.Old: Irrelevantly :: Occurrence
+ Agda.TypeChecking.Free.Old: NoOccurrence :: Occurrence
+ Agda.TypeChecking.Free.Old: StronglyRigid :: Occurrence
+ Agda.TypeChecking.Free.Old: Unguarded :: Occurrence
+ Agda.TypeChecking.Free.Old: Unused :: Occurrence
+ Agda.TypeChecking.Free.Old: WeaklyRigid :: Occurrence
+ Agda.TypeChecking.Free.Old: [flexibleVars] :: FreeVars -> VarSet
+ Agda.TypeChecking.Free.Old: [irrelevantVars] :: FreeVars -> VarSet
+ Agda.TypeChecking.Free.Old: [stronglyRigidVars] :: FreeVars -> VarSet
+ Agda.TypeChecking.Free.Old: [unguardedVars] :: FreeVars -> VarSet
+ Agda.TypeChecking.Free.Old: [unusedVars] :: FreeVars -> VarSet
+ Agda.TypeChecking.Free.Old: [weaklyRigidVars] :: FreeVars -> VarSet
+ Agda.TypeChecking.Free.Old: allVars :: FreeVars -> VarSet
+ Agda.TypeChecking.Free.Old: class Free a
+ Agda.TypeChecking.Free.Old: data FreeVars
+ Agda.TypeChecking.Free.Old: data IgnoreSorts
+ Agda.TypeChecking.Free.Old: data Occurrence
+ Agda.TypeChecking.Free.Old: freeIn :: Free a => Nat -> a -> Bool
+ Agda.TypeChecking.Free.Old: freeInIgnoringSortAnn :: Free a => Nat -> a -> Bool
+ Agda.TypeChecking.Free.Old: freeInIgnoringSorts :: Free a => Nat -> a -> Bool
+ Agda.TypeChecking.Free.Old: freeVars :: Free a => a -> FreeVars
+ Agda.TypeChecking.Free.Old: freeVarsIgnore :: Free a => IgnoreSorts -> a -> FreeVars
+ Agda.TypeChecking.Free.Old: instance (Agda.TypeChecking.Free.Old.Free a, Agda.TypeChecking.Free.Old.Free b) => Agda.TypeChecking.Free.Old.Free (a, b)
+ Agda.TypeChecking.Free.Old: instance Agda.TypeChecking.Free.Old.Free Agda.Syntax.Internal.Clause
+ Agda.TypeChecking.Free.Old: instance Agda.TypeChecking.Free.Old.Free Agda.Syntax.Internal.ClauseBody
+ Agda.TypeChecking.Free.Old: instance Agda.TypeChecking.Free.Old.Free Agda.Syntax.Internal.Level
+ Agda.TypeChecking.Free.Old: instance Agda.TypeChecking.Free.Old.Free Agda.Syntax.Internal.LevelAtom
+ Agda.TypeChecking.Free.Old: instance Agda.TypeChecking.Free.Old.Free Agda.Syntax.Internal.PlusLevel
+ Agda.TypeChecking.Free.Old: instance Agda.TypeChecking.Free.Old.Free Agda.Syntax.Internal.Sort
+ Agda.TypeChecking.Free.Old: instance Agda.TypeChecking.Free.Old.Free Agda.Syntax.Internal.Term
+ Agda.TypeChecking.Free.Old: instance Agda.TypeChecking.Free.Old.Free Agda.Syntax.Internal.Type
+ Agda.TypeChecking.Free.Old: instance Agda.TypeChecking.Free.Old.Free a => Agda.TypeChecking.Free.Old.Free (Agda.Syntax.Internal.Abs a)
+ Agda.TypeChecking.Free.Old: instance Agda.TypeChecking.Free.Old.Free a => Agda.TypeChecking.Free.Old.Free (Agda.Syntax.Internal.Arg a)
+ Agda.TypeChecking.Free.Old: instance Agda.TypeChecking.Free.Old.Free a => Agda.TypeChecking.Free.Old.Free (Agda.Syntax.Internal.Dom a)
+ Agda.TypeChecking.Free.Old: instance Agda.TypeChecking.Free.Old.Free a => Agda.TypeChecking.Free.Old.Free (Agda.Syntax.Internal.Elim' a)
+ Agda.TypeChecking.Free.Old: instance Agda.TypeChecking.Free.Old.Free a => Agda.TypeChecking.Free.Old.Free (Agda.Syntax.Internal.Tele a)
+ Agda.TypeChecking.Free.Old: instance Agda.TypeChecking.Free.Old.Free a => Agda.TypeChecking.Free.Old.Free (GHC.Base.Maybe a)
+ Agda.TypeChecking.Free.Old: instance Agda.TypeChecking.Free.Old.Free a => Agda.TypeChecking.Free.Old.Free [a]
+ Agda.TypeChecking.Free.Old: instance GHC.Base.Monoid Agda.TypeChecking.Free.Old.FreeT
+ Agda.TypeChecking.Free.Old: instance GHC.Base.Monoid Agda.TypeChecking.Free.Old.FreeVars
+ Agda.TypeChecking.Free.Old: instance GHC.Classes.Eq Agda.TypeChecking.Free.Old.FreeVars
+ Agda.TypeChecking.Free.Old: instance GHC.Classes.Eq Agda.TypeChecking.Free.Old.IgnoreSorts
+ Agda.TypeChecking.Free.Old: instance GHC.Classes.Eq Agda.TypeChecking.Free.Old.Occurrence
+ Agda.TypeChecking.Free.Old: instance GHC.Show.Show Agda.TypeChecking.Free.Old.FreeVars
+ Agda.TypeChecking.Free.Old: instance GHC.Show.Show Agda.TypeChecking.Free.Old.IgnoreSorts
+ Agda.TypeChecking.Free.Old: instance GHC.Show.Show Agda.TypeChecking.Free.Old.Occurrence
+ Agda.TypeChecking.Free.Old: isBinderUsed :: Free a => Abs a -> Bool
+ Agda.TypeChecking.Free.Old: occurrence :: Nat -> FreeVars -> Occurrence
+ Agda.TypeChecking.Free.Old: relevantIn :: Free a => Nat -> a -> Bool
+ Agda.TypeChecking.Free.Old: relevantInIgnoringSortAnn :: Free a => Nat -> a -> Bool
+ Agda.TypeChecking.Free.Old: relevantVars :: FreeVars -> VarSet
+ Agda.TypeChecking.Free.Old: rigidVars :: FreeVars -> VarSet
+ Agda.TypeChecking.Free.Tests: tests :: IO Bool
+ Agda.TypeChecking.Monad.Base: CheckSizeLtSat :: Type -> Constraint
+ Agda.TypeChecking.Monad.Base: NeedOptionRewriting :: TypeError
+ Agda.TypeChecking.Monad.Base: PBoundVar :: {-# UNPACK #-} !Int -> PElims -> NLPat
+ Agda.TypeChecking.Monad.Base: PLam :: ArgInfo -> (Abs NLPat) -> NLPat
+ Agda.TypeChecking.Monad.Base: PPi :: (Dom (Type' NLPat)) -> (Abs (Type' NLPat)) -> NLPat
+ Agda.TypeChecking.Monad.Base: [sigRewriteRules] :: Signature -> RewriteRuleMap
+ Agda.TypeChecking.Monad.Base: finally_ :: TCM a -> TCM b -> TCM a
+ Agda.TypeChecking.Monad.Base: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.CompiledRepresentation
+ Agda.TypeChecking.Monad.Base: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.Definition
+ Agda.TypeChecking.Monad.Base: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.Definitions
+ Agda.TypeChecking.Monad.Base: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.Defn
+ Agda.TypeChecking.Monad.Base: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.DisplayForm
+ Agda.TypeChecking.Monad.Base: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.DisplayTerm
+ Agda.TypeChecking.Monad.Base: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.MutualId
+ Agda.TypeChecking.Monad.Base: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.NLPat
+ Agda.TypeChecking.Monad.Base: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.Polarity
+ Agda.TypeChecking.Monad.Base: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.Projection
+ Agda.TypeChecking.Monad.Base: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.RewriteRule
+ Agda.TypeChecking.Monad.Base: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.RewriteRuleMap
+ Agda.TypeChecking.Monad.Base: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.Section
+ Agda.TypeChecking.Monad.Base: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.Sections
+ Agda.TypeChecking.Monad.Base: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.Signature
+ Agda.TypeChecking.Monad.Base: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Monad.Base.TermHead
+ Agda.TypeChecking.Monad.Base: instance Agda.Syntax.Position.KillRange a => Agda.Syntax.Position.KillRange (Agda.TypeChecking.Monad.Base.Open a)
+ Agda.TypeChecking.Monad.Base: instance Agda.Syntax.Position.KillRange c => Agda.Syntax.Position.KillRange (Agda.TypeChecking.Monad.Base.FunctionInverse' c)
+ Agda.TypeChecking.Monad.Base: instance Agda.Utils.Benchmark.MonadBench Agda.Benchmarking.Phase Agda.TypeChecking.Monad.Base.TCM
+ Agda.TypeChecking.Monad.Base: instance Agda.Utils.Null.Null (Agda.TypeChecking.Monad.Base.TCM Text.PrettyPrint.HughesPJ.Doc)
+ Agda.TypeChecking.Monad.Base: instance Agda.Utils.Pretty.Pretty Agda.TypeChecking.Monad.Base.Call
+ Agda.TypeChecking.Monad.Base: instance Agda.Utils.Pretty.Pretty Agda.TypeChecking.Monad.Base.Interface
+ Agda.TypeChecking.Monad.Base: instance Control.Monad.Error.Class.MonadError Agda.TypeChecking.Monad.Base.TCErr Agda.TypeChecking.Monad.Base.IM
+ Agda.TypeChecking.Monad.Base: instance GHC.Base.Monoid (Agda.TypeChecking.Monad.Base.TCM Data.Monoid.Any)
+ Agda.TypeChecking.Monad.Base: isEmptyFunction :: Defn -> Bool
+ Agda.TypeChecking.Monad.Base: runIM :: IM a -> TCM a
+ Agda.TypeChecking.Monad.Base: type IM = TCMT (InputT IO)
+ Agda.TypeChecking.Monad.Base: type RewriteRuleMap = HashMap QName RewriteRules
+ Agda.TypeChecking.Monad.Benchmark: class (Ord a, Functor m, MonadIO m) => MonadBench a m | m -> a where getsBenchmark f = f <$> getBenchmark putBenchmark b = modifyBenchmark $ const b modifyBenchmark f = do { b <- getBenchmark; putBenchmark $! f b }
+ Agda.TypeChecking.Monad.Benchmark: updateBenchmarkingStatus :: TCM ()
+ Agda.TypeChecking.Monad.Builtin: coinductionKit' :: TCM CoinductionKit
+ Agda.TypeChecking.Monad.Context: instance Agda.TypeChecking.Monad.Context.AddContext (Agda.Syntax.Internal.Dom Agda.Syntax.Internal.Type)
+ Agda.TypeChecking.Monad.MetaVars: withFreezeMetas :: TCM a -> TCM a
+ Agda.TypeChecking.Monad.Signature: defPars :: Definition -> Int
+ Agda.TypeChecking.Monad.Signature: defaultGetRewriteRulesFor :: (Monad m) => m TCState -> QName -> m RewriteRules
+ Agda.TypeChecking.Monad.Signature: droppedPars :: Definition -> Int
+ Agda.TypeChecking.Monad.Signature: getRewriteRulesFor :: HasConstInfo m => QName -> m RewriteRules
+ Agda.TypeChecking.Monad.Signature: inConcreteOrAbstractMode :: QName -> TCM a -> TCM a
+ Agda.TypeChecking.Monad.Signature: modifyArgOccurrences :: QName -> ([Occurrence] -> [Occurrence]) -> TCM ()
+ Agda.TypeChecking.Monad.Signature: usesCopatterns :: QName -> TCM Bool
+ Agda.TypeChecking.Monad.SizedTypes: instance GHC.Show.Show Agda.TypeChecking.Monad.SizedTypes.DeepSizeView
+ Agda.TypeChecking.Monad.State: addRewriteRulesFor :: QName -> RewriteRules -> Signature -> Signature
+ Agda.TypeChecking.Monad.State: mapRewriteRules :: (RewriteRuleMap -> RewriteRuleMap) -> Signature -> Signature
+ Agda.TypeChecking.Positivity: instance Agda.TypeChecking.Pretty.PrettyTCM n => Agda.TypeChecking.Pretty.PrettyTCM (Agda.TypeChecking.Pretty.WithNode n Agda.TypeChecking.Positivity.Edge)
+ Agda.TypeChecking.Positivity: instance Agda.Utils.Null.Null Agda.TypeChecking.Positivity.Edge
+ Agda.TypeChecking.Positivity: instance Agda.Utils.SemiRing.StarSemiRing Agda.TypeChecking.Positivity.Edge
+ Agda.TypeChecking.Positivity: instance GHC.Classes.Eq Agda.TypeChecking.Positivity.Edge
+ Agda.TypeChecking.Positivity: instance GHC.Classes.Ord Agda.TypeChecking.Positivity.Edge
+ Agda.TypeChecking.Positivity: instance GHC.Classes.Ord Agda.TypeChecking.Positivity.OccursWhere
+ Agda.TypeChecking.Positivity: instance Test.QuickCheck.Arbitrary.Arbitrary Agda.TypeChecking.Positivity.Edge
+ Agda.TypeChecking.Positivity: instance Test.QuickCheck.Arbitrary.Arbitrary Agda.TypeChecking.Positivity.OccursWhere
+ Agda.TypeChecking.Positivity: instance Test.QuickCheck.Arbitrary.CoArbitrary Agda.TypeChecking.Positivity.Edge
+ Agda.TypeChecking.Positivity: instance Test.QuickCheck.Arbitrary.CoArbitrary Agda.TypeChecking.Positivity.OccursWhere
+ Agda.TypeChecking.Positivity: type Graph n e = Graph n n e
+ Agda.TypeChecking.Positivity.Occurrence: GuardPos :: Occurrence
+ Agda.TypeChecking.Positivity.Occurrence: JustNeg :: Occurrence
+ Agda.TypeChecking.Positivity.Occurrence: JustPos :: Occurrence
+ Agda.TypeChecking.Positivity.Occurrence: Mixed :: Occurrence
+ Agda.TypeChecking.Positivity.Occurrence: StrictPos :: Occurrence
+ Agda.TypeChecking.Positivity.Occurrence: Unused :: Occurrence
+ Agda.TypeChecking.Positivity.Occurrence: data Occurrence
+ Agda.TypeChecking.Positivity.Occurrence: instance Agda.Syntax.Position.KillRange Agda.TypeChecking.Positivity.Occurrence.Occurrence
+ Agda.TypeChecking.Positivity.Occurrence: instance Agda.Utils.Null.Null Agda.TypeChecking.Positivity.Occurrence.Occurrence
+ Agda.TypeChecking.Positivity.Occurrence: instance Agda.Utils.SemiRing.SemiRing Agda.TypeChecking.Positivity.Occurrence.Occurrence
+ Agda.TypeChecking.Positivity.Occurrence: instance Agda.Utils.SemiRing.StarSemiRing Agda.TypeChecking.Positivity.Occurrence.Occurrence
+ Agda.TypeChecking.Positivity.Occurrence: instance Control.DeepSeq.NFData Agda.TypeChecking.Positivity.Occurrence.Occurrence
+ Agda.TypeChecking.Positivity.Occurrence: instance GHC.Classes.Eq Agda.TypeChecking.Positivity.Occurrence.Occurrence
+ Agda.TypeChecking.Positivity.Occurrence: instance GHC.Classes.Ord Agda.TypeChecking.Positivity.Occurrence.Occurrence
+ Agda.TypeChecking.Positivity.Occurrence: instance GHC.Enum.Bounded Agda.TypeChecking.Positivity.Occurrence.Occurrence
+ Agda.TypeChecking.Positivity.Occurrence: instance GHC.Enum.Enum Agda.TypeChecking.Positivity.Occurrence.Occurrence
+ Agda.TypeChecking.Positivity.Occurrence: instance GHC.Show.Show Agda.TypeChecking.Positivity.Occurrence.Occurrence
+ Agda.TypeChecking.Positivity.Occurrence: instance Test.QuickCheck.Arbitrary.Arbitrary Agda.TypeChecking.Positivity.Occurrence.Occurrence
+ Agda.TypeChecking.Positivity.Occurrence: instance Test.QuickCheck.Arbitrary.CoArbitrary Agda.TypeChecking.Positivity.Occurrence.Occurrence
+ Agda.TypeChecking.Positivity.Occurrence: prop_Occurrence_distributive :: Occurrence -> Occurrence -> Occurrence -> Bool
+ Agda.TypeChecking.Positivity.Occurrence: prop_Occurrence_oplus_associative :: Occurrence -> Occurrence -> Occurrence -> Bool
+ Agda.TypeChecking.Positivity.Occurrence: prop_Occurrence_oplus_commutative :: Occurrence -> Occurrence -> Bool
+ Agda.TypeChecking.Positivity.Occurrence: prop_Occurrence_oplus_ozero :: Occurrence -> Bool
+ Agda.TypeChecking.Positivity.Occurrence: prop_Occurrence_ostar :: Occurrence -> Bool
+ Agda.TypeChecking.Positivity.Occurrence: prop_Occurrence_otimes_associative :: Occurrence -> Occurrence -> Occurrence -> Bool
+ Agda.TypeChecking.Positivity.Occurrence: prop_Occurrence_otimes_oone :: Occurrence -> Bool
+ Agda.TypeChecking.Positivity.Occurrence: prop_Occurrence_otimes_ozero :: Occurrence -> Bool
+ Agda.TypeChecking.Positivity.Occurrence: tests :: IO Bool
+ Agda.TypeChecking.Positivity.Tests: prop_oplus_Occurrence_Edge :: Edge -> Edge -> Bool
+ Agda.TypeChecking.Positivity.Tests: tests :: IO Bool
+ Agda.TypeChecking.Pretty: WithNode :: n -> a -> WithNode n a
+ Agda.TypeChecking.Pretty: data WithNode n a
+ Agda.TypeChecking.Pretty: instance (Agda.TypeChecking.Pretty.PrettyTCM n, Agda.TypeChecking.Pretty.PrettyTCM (Agda.TypeChecking.Pretty.WithNode n e)) => Agda.TypeChecking.Pretty.PrettyTCM (Agda.Utils.Graph.AdjacencyMap.Unidirectional.Graph n n e)
+ Agda.TypeChecking.Pretty: instance Agda.TypeChecking.Pretty.PrettyTCM (Agda.Syntax.Internal.Type' Agda.TypeChecking.Monad.Base.NLPat)
+ Agda.TypeChecking.Pretty: instance Agda.TypeChecking.Pretty.PrettyTCM Agda.TypeChecking.Monad.Base.Polarity
+ Agda.TypeChecking.Pretty: instance Agda.TypeChecking.Pretty.PrettyTCM Agda.TypeChecking.Positivity.Occurrence.Occurrence
+ Agda.TypeChecking.Pretty: instance Agda.TypeChecking.Pretty.PrettyTCM n => Agda.TypeChecking.Pretty.PrettyTCM (Agda.TypeChecking.Pretty.WithNode n Agda.TypeChecking.Positivity.Occurrence.Occurrence)
+ Agda.TypeChecking.Pretty: raisePatVars :: Int -> NLPat -> NLPat
+ Agda.TypeChecking.RecordPatterns: instance Agda.TypeChecking.Pretty.PrettyTCM (Agda.TypeChecking.RecordPatterns.Kind -> Agda.Syntax.Common.Nat)
+ Agda.TypeChecking.RecordPatterns: instance Agda.TypeChecking.Pretty.PrettyTCM Agda.TypeChecking.RecordPatterns.Change
+ Agda.TypeChecking.RecordPatterns: instance Agda.Utils.Pretty.Pretty (Agda.TypeChecking.RecordPatterns.Kind -> Agda.Syntax.Common.Nat)
+ Agda.TypeChecking.Records: expandRecordVar :: Int -> Telescope -> TCM (Maybe (Telescope, Substitution, Substitution, Telescope))
+ Agda.TypeChecking.Records: expandRecordVarsRecursively :: [Int] -> Telescope -> TCM (Telescope, Substitution, Substitution)
+ Agda.TypeChecking.Records: getOriginalProjection :: QName -> TCM QName
+ Agda.TypeChecking.Records: projectTyped :: Term -> Type -> QName -> TCM (Maybe (Term, Type))
+ Agda.TypeChecking.Reduce: instance Agda.TypeChecking.Reduce.InstantiateFull a => Agda.TypeChecking.Reduce.InstantiateFull (Agda.Syntax.Internal.Type' a)
+ Agda.TypeChecking.Reduce: rewriteAfter :: (Term -> ReduceM (Blocked Term)) -> Term -> ReduceM (Blocked Term)
+ Agda.TypeChecking.Reduce: unfoldCorecursion :: Term -> ReduceM (Blocked Term)
+ Agda.TypeChecking.Reduce: unfoldCorecursionE :: Elim -> ReduceM (Blocked Elim)
+ Agda.TypeChecking.Rewriting: requireOptionRewriting :: TCM ()
+ Agda.TypeChecking.Rewriting.NonLinMatch: [eqFreeVars] :: PostponedEquation -> Int
+ Agda.TypeChecking.Rewriting.NonLinMatch: class Match a b
+ Agda.TypeChecking.Rewriting.NonLinMatch: instance (Agda.TypeChecking.Rewriting.NonLinMatch.Match a b, Agda.TypeChecking.Substitute.Subst b, Agda.TypeChecking.Free.Free b, Agda.TypeChecking.Pretty.PrettyTCM a, Agda.TypeChecking.Pretty.PrettyTCM b) => Agda.TypeChecking.Rewriting.NonLinMatch.Match (Agda.Syntax.Internal.Abs a) (Agda.Syntax.Internal.Abs b)
+ Agda.TypeChecking.Rewriting.NonLinMatch: instance Agda.TypeChecking.Rewriting.NonLinMatch.Match Agda.TypeChecking.Monad.Base.NLPat Agda.Syntax.Internal.Term
+ Agda.TypeChecking.Rewriting.NonLinMatch: instance Agda.TypeChecking.Rewriting.NonLinMatch.Match a b => Agda.TypeChecking.Rewriting.NonLinMatch.Match (Agda.Syntax.Internal.Arg a) (Agda.Syntax.Internal.Arg b)
+ Agda.TypeChecking.Rewriting.NonLinMatch: instance Agda.TypeChecking.Rewriting.NonLinMatch.Match a b => Agda.TypeChecking.Rewriting.NonLinMatch.Match (Agda.Syntax.Internal.Dom a) (Agda.Syntax.Internal.Dom b)
+ Agda.TypeChecking.Rewriting.NonLinMatch: instance Agda.TypeChecking.Rewriting.NonLinMatch.Match a b => Agda.TypeChecking.Rewriting.NonLinMatch.Match (Agda.Syntax.Internal.Elim' a) (Agda.Syntax.Internal.Elim' b)
+ Agda.TypeChecking.Rewriting.NonLinMatch: instance Agda.TypeChecking.Rewriting.NonLinMatch.Match a b => Agda.TypeChecking.Rewriting.NonLinMatch.Match (Agda.Syntax.Internal.Type' a) (Agda.Syntax.Internal.Type' b)
+ Agda.TypeChecking.Rewriting.NonLinMatch: instance Agda.TypeChecking.Rewriting.NonLinMatch.Match a b => Agda.TypeChecking.Rewriting.NonLinMatch.Match [a] [b]
+ Agda.TypeChecking.Rewriting.NonLinMatch: instance Agda.TypeChecking.Rewriting.NonLinMatch.PatternFrom a b => Agda.TypeChecking.Rewriting.NonLinMatch.PatternFrom (Agda.Syntax.Internal.Abs a) (Agda.Syntax.Internal.Abs b)
+ Agda.TypeChecking.Rewriting.NonLinMatch: instance Agda.TypeChecking.Rewriting.NonLinMatch.PatternFrom a b => Agda.TypeChecking.Rewriting.NonLinMatch.PatternFrom (Agda.Syntax.Internal.Arg a) (Agda.Syntax.Internal.Arg b)
+ Agda.TypeChecking.Rewriting.NonLinMatch: instance Agda.TypeChecking.Rewriting.NonLinMatch.PatternFrom a b => Agda.TypeChecking.Rewriting.NonLinMatch.PatternFrom (Agda.Syntax.Internal.Dom a) (Agda.Syntax.Internal.Dom b)
+ Agda.TypeChecking.Rewriting.NonLinMatch: instance Agda.TypeChecking.Rewriting.NonLinMatch.PatternFrom a b => Agda.TypeChecking.Rewriting.NonLinMatch.PatternFrom (Agda.Syntax.Internal.Elim' a) (Agda.Syntax.Internal.Elim' b)
+ Agda.TypeChecking.Rewriting.NonLinMatch: instance Agda.TypeChecking.Rewriting.NonLinMatch.PatternFrom a b => Agda.TypeChecking.Rewriting.NonLinMatch.PatternFrom (Agda.Syntax.Internal.Type' a) (Agda.Syntax.Internal.Type' b)
+ Agda.TypeChecking.Rewriting.NonLinMatch: instance Agda.TypeChecking.Rewriting.NonLinMatch.PatternFrom a b => Agda.TypeChecking.Rewriting.NonLinMatch.PatternFrom [a] [b]
+ Agda.TypeChecking.Rewriting.NonLinMatch: match :: Match a b => Int -> a -> b -> NLM ()
+ Agda.TypeChecking.Rewriting.NonLinMatch: matchingBlocked :: Blocked_ -> NLM ()
+ Agda.TypeChecking.Rewriting.NonLinMatch: tellSub :: Int -> Term -> NLM ()
+ Agda.TypeChecking.Rewriting.NonLinMatch: type NLMState = (Sub, PostponedEquations)
+ Agda.TypeChecking.Rewriting.NonLinMatch: type Sub = IntMap Term
+ Agda.TypeChecking.Rules.Decl: class ShowHead a
+ Agda.TypeChecking.Rules.Decl: debugPrintDecl :: Declaration -> TCM ()
+ Agda.TypeChecking.Rules.Decl: instance Agda.TypeChecking.Rules.Decl.ShowHead Agda.Syntax.Abstract.Declaration
+ Agda.TypeChecking.Rules.Decl: showHead :: ShowHead a => a -> String
+ Agda.TypeChecking.Rules.LHS: class IsFlexiblePattern a where isFlexiblePattern p = isJust <$> runMaybeT (maybeFlexiblePattern p)
+ Agda.TypeChecking.Rules.LHS: instance Agda.TypeChecking.Rules.LHS.IsFlexiblePattern (Agda.Syntax.Internal.Pattern' a)
+ Agda.TypeChecking.Rules.LHS: instance Agda.TypeChecking.Rules.LHS.IsFlexiblePattern Agda.Syntax.Abstract.Pattern
+ Agda.TypeChecking.Rules.LHS: instance Agda.TypeChecking.Rules.LHS.IsFlexiblePattern a => Agda.TypeChecking.Rules.LHS.IsFlexiblePattern (Agda.Syntax.Common.Arg c a)
+ Agda.TypeChecking.Rules.LHS: instance Agda.TypeChecking.Rules.LHS.IsFlexiblePattern a => Agda.TypeChecking.Rules.LHS.IsFlexiblePattern (Agda.Syntax.Common.Named name a)
+ Agda.TypeChecking.Rules.LHS: instance Agda.TypeChecking.Rules.LHS.IsFlexiblePattern a => Agda.TypeChecking.Rules.LHS.IsFlexiblePattern [a]
+ Agda.TypeChecking.Rules.LHS: isFlexiblePattern :: IsFlexiblePattern a => a -> TCM Bool
+ Agda.TypeChecking.Rules.LHS: maybeFlexiblePattern :: IsFlexiblePattern a => a -> MaybeT TCM FlexibleVarKind
+ Agda.TypeChecking.Rules.LHS.Implicit: insertImplicitSizeLtPatterns :: Type -> TCM [NamedArg Pattern]
+ Agda.TypeChecking.Rules.LHS.Problem: [focusPatOrigin] :: Focus -> ConPOrigin
+ Agda.TypeChecking.Rules.Term: inferExpr' :: ExpandHidden -> Expr -> TCM (Term, Type)
+ Agda.TypeChecking.Serialise: instance Agda.TypeChecking.Serialise.EmbPrj Agda.Syntax.Common.ConPOrigin
+ Agda.TypeChecking.Serialise: instance Agda.TypeChecking.Serialise.EmbPrj Agda.Syntax.Info.ConPatInfo
+ Agda.TypeChecking.Serialise: instance Agda.TypeChecking.Serialise.EmbPrj Agda.TypeChecking.Positivity.Occurrence.Occurrence
+ Agda.TypeChecking.Serialise: instance Agda.TypeChecking.Serialise.EmbPrj a => Agda.TypeChecking.Serialise.EmbPrj (Agda.Syntax.Internal.Type' a)
+ Agda.TypeChecking.SizedTypes: checkSizeLtSat :: Type -> TCM ()
+ Agda.TypeChecking.SizedTypes: checkSizeNeverZero :: Term -> TCM Bool
+ Agda.TypeChecking.SizedTypes: checkSizeVarNeverZero :: Int -> TCM Bool
+ Agda.TypeChecking.SizedTypes.Syntax: O :: Int -> Offset
+ Agda.TypeChecking.SizedTypes.Syntax: instance Agda.TypeChecking.SizedTypes.Utils.Dioid Agda.TypeChecking.SizedTypes.Syntax.Cmp
+ Agda.TypeChecking.SizedTypes.Syntax: instance Agda.TypeChecking.SizedTypes.Utils.MeetSemiLattice Agda.TypeChecking.SizedTypes.Syntax.Offset
+ Agda.TypeChecking.SizedTypes.Syntax: instance Agda.TypeChecking.SizedTypes.Utils.Plus Agda.TypeChecking.SizedTypes.Syntax.Offset Agda.TypeChecking.SizedTypes.Syntax.Offset Agda.TypeChecking.SizedTypes.Syntax.Offset
+ Agda.TypeChecking.SizedTypes.Syntax: instance GHC.Classes.Eq Agda.TypeChecking.SizedTypes.Syntax.Offset
+ Agda.TypeChecking.SizedTypes.Syntax: instance GHC.Classes.Ord Agda.TypeChecking.SizedTypes.Syntax.Offset
+ Agda.TypeChecking.SizedTypes.Syntax: instance GHC.Enum.Enum Agda.TypeChecking.SizedTypes.Syntax.Offset
+ Agda.TypeChecking.SizedTypes.Syntax: instance GHC.Num.Num Agda.TypeChecking.SizedTypes.Syntax.Offset
+ Agda.TypeChecking.SizedTypes.Syntax: instance GHC.Show.Show Agda.TypeChecking.SizedTypes.Syntax.Offset
+ Agda.TypeChecking.SizedTypes.Syntax: instance Test.QuickCheck.Arbitrary.Arbitrary Agda.TypeChecking.SizedTypes.Syntax.Cmp
+ Agda.TypeChecking.SizedTypes.Syntax: instance Test.QuickCheck.Arbitrary.Arbitrary Agda.TypeChecking.SizedTypes.Syntax.Offset
+ Agda.TypeChecking.SizedTypes.Syntax: newtype Offset
+ Agda.TypeChecking.SizedTypes.Utils: instance Agda.TypeChecking.SizedTypes.Utils.Plus GHC.Types.Int GHC.Types.Int GHC.Types.Int
+ Agda.TypeChecking.SizedTypes.WarshallSolver: instance Agda.TypeChecking.SizedTypes.WarshallSolver.Negative Agda.TypeChecking.SizedTypes.Syntax.Offset
+ Agda.TypeChecking.SizedTypes.WarshallSolver: instance Test.QuickCheck.Arbitrary.Arbitrary Agda.TypeChecking.SizedTypes.WarshallSolver.Label
+ Agda.TypeChecking.SizedTypes.WarshallSolver: instance Test.QuickCheck.Arbitrary.Arbitrary Agda.TypeChecking.SizedTypes.WarshallSolver.Weight
+ Agda.TypeChecking.Substitute: instance Agda.TypeChecking.Substitute.Abstract [Agda.TypeChecking.Positivity.Occurrence.Occurrence]
+ Agda.TypeChecking.Substitute: instance Agda.TypeChecking.Substitute.Apply [Agda.TypeChecking.Positivity.Occurrence.Occurrence]
+ Agda.TypeChecking.Substitute: instance Agda.TypeChecking.Substitute.Subst Agda.TypeChecking.Monad.Base.NLPat
+ Agda.TypeChecking.Substitute: instance Agda.TypeChecking.Substitute.Subst GHC.Base.String
+ Agda.TypeChecking.Substitute: instance Agda.TypeChecking.Substitute.Subst a => Agda.TypeChecking.Substitute.Subst (Agda.Syntax.Internal.Type' a)
+ Agda.TypeChecking.Telescope: ifNotPi :: MonadTCM tcm => Term -> (Term -> tcm a) -> (Dom Type -> Abs Type -> tcm a) -> tcm a
+ Agda.TypeChecking.Telescope: ifNotPiType :: MonadTCM tcm => Type -> (Type -> tcm a) -> (Dom Type -> Abs Type -> tcm a) -> tcm a
+ Agda.TypeChecking.Telescope: ifPi :: MonadTCM tcm => Term -> (Dom Type -> Abs Type -> tcm a) -> (Term -> tcm a) -> tcm a
+ Agda.TypeChecking.Telescope: ifPiType :: MonadTCM tcm => Type -> (Dom Type -> Abs Type -> tcm a) -> (Type -> tcm a) -> tcm a
+ Agda.Utils.Benchmark: Benchmark :: !Bool -> !(CurrentAccount a) -> !(Timings a) -> Benchmark a
+ Agda.Utils.Benchmark: [benchmarkOn] :: Benchmark a -> !Bool
+ Agda.Utils.Benchmark: [currentAccount] :: Benchmark a -> !(CurrentAccount a)
+ Agda.Utils.Benchmark: [timings] :: Benchmark a -> !(Timings a)
+ Agda.Utils.Benchmark: addCPUTime :: Ord a => Account a -> CPUTime -> Benchmark a -> Benchmark a
+ Agda.Utils.Benchmark: billPureTo :: MonadBench a m => Account a -> c -> m c
+ Agda.Utils.Benchmark: billTo :: MonadBench a m => Account a -> m c -> m c
+ Agda.Utils.Benchmark: class (Ord a, Functor m, MonadIO m) => MonadBench a m | m -> a where getsBenchmark f = f <$> getBenchmark putBenchmark b = modifyBenchmark $ const b modifyBenchmark f = do { b <- getBenchmark; putBenchmark $! f b }
+ Agda.Utils.Benchmark: data Benchmark a
+ Agda.Utils.Benchmark: finally :: MonadBench a m => m b -> m c -> m b
+ Agda.Utils.Benchmark: getBenchmark :: MonadBench a m => m (Benchmark a)
+ Agda.Utils.Benchmark: getsBenchmark :: MonadBench a m => (Benchmark a -> c) -> m c
+ Agda.Utils.Benchmark: instance (GHC.Classes.Ord a, Agda.Utils.Pretty.Pretty a) => Agda.Utils.Pretty.Pretty (Agda.Utils.Benchmark.Benchmark a)
+ Agda.Utils.Benchmark: instance Agda.Utils.Benchmark.MonadBench a m => Agda.Utils.Benchmark.MonadBench a (Control.Monad.Trans.Reader.ReaderT r m)
+ Agda.Utils.Benchmark: instance Agda.Utils.Null.Null (Agda.Utils.Benchmark.Benchmark a)
+ Agda.Utils.Benchmark: mapBenchmarkOn :: (Bool -> Bool) -> Benchmark a -> Benchmark a
+ Agda.Utils.Benchmark: mapCurrentAccount :: (CurrentAccount a -> CurrentAccount a) -> Benchmark a -> Benchmark a
+ Agda.Utils.Benchmark: mapTimings :: (Timings a -> Timings a) -> Benchmark a -> Benchmark a
+ Agda.Utils.Benchmark: modifyBenchmark :: MonadBench a m => (Benchmark a -> Benchmark a) -> m ()
+ Agda.Utils.Benchmark: putBenchmark :: MonadBench a m => Benchmark a -> m ()
+ Agda.Utils.Benchmark: setBenchmarking :: MonadBench a m => Bool -> m ()
+ Agda.Utils.Benchmark: switchBenchmarking :: MonadBench a m => Maybe (Account a) -> m (Maybe (Account a))
+ Agda.Utils.Benchmark: type Account a = [a]
+ Agda.Utils.Benchmark: type CurrentAccount a = Maybe (Account a, CPUTime)
+ Agda.Utils.Benchmark: type Timings a = Trie a CPUTime
+ Agda.Utils.Either: allLeft :: [Either a b] -> Maybe [a]
+ Agda.Utils.Either: maybeLeft :: Either a b -> Maybe a
+ Agda.Utils.Either: maybeRight :: Either a b -> Maybe b
+ Agda.Utils.Either: traverseEither :: Functor f => (a -> f c) -> (b -> f d) -> Either a b -> f (Either c d)
+ Agda.Utils.Except: instance Agda.Utils.Except.Error ()
+ Agda.Utils.Except: instance Agda.Utils.Except.Error (a, b, c)
+ Agda.Utils.Except: mapExceptT :: (m (Either e a) -> n (Either e' b)) -> ExceptT e m a -> ExceptT e' n b
+ Agda.Utils.FileName: instance Data.Hashable.Class.Hashable Agda.Utils.FileName.AbsolutePath
+ Agda.Utils.Function: iterWhile :: (b -> Bool) -> (a -> (b, a)) -> a -> [(b, a)]
+ Agda.Utils.Graph.AdjacencyMap.Unidirectional: DAG :: Graph -> IntMap (SCC n) -> Map n Int -> DAG n
+ Agda.Utils.Graph.AdjacencyMap.Unidirectional: [dagComponentMap] :: DAG n -> IntMap (SCC n)
+ Agda.Utils.Graph.AdjacencyMap.Unidirectional: [dagGraph] :: DAG n -> Graph
+ Agda.Utils.Graph.AdjacencyMap.Unidirectional: [dagNodeMap] :: DAG n -> Map n Int
+ Agda.Utils.Graph.AdjacencyMap.Unidirectional: clean :: (Ord s, Ord t, Null e) => Graph s t e -> Graph s t e
+ Agda.Utils.Graph.AdjacencyMap.Unidirectional: complete :: (Eq e, Null e, SemiRing e, Ord n) => Graph n n e -> Graph n n e
+ Agda.Utils.Graph.AdjacencyMap.Unidirectional: dagInvariant :: Ord n => DAG n -> Bool
+ Agda.Utils.Graph.AdjacencyMap.Unidirectional: data DAG n
+ Agda.Utils.Graph.AdjacencyMap.Unidirectional: discrete :: Null e => Graph s t e -> Bool
+ Agda.Utils.Graph.AdjacencyMap.Unidirectional: gaussJordanFloydWarshallMcNaughtonYamada :: (Ord n, Eq e, StarSemiRing e) => Graph n n e -> Graph n n e
+ Agda.Utils.Graph.AdjacencyMap.Unidirectional: gaussJordanFloydWarshallMcNaughtonYamadaReference :: (Ord n, Eq e, StarSemiRing e) => Graph n n e -> Graph n n e
+ Agda.Utils.Graph.AdjacencyMap.Unidirectional: mapWithEdge :: (Ord s, Ord t) => (Edge s t e -> e') -> Graph s t e -> Graph s t e'
+ Agda.Utils.Graph.AdjacencyMap.Unidirectional: neighboursMap :: (Ord s, Ord t) => s -> Graph s t e -> Map t e
+ Agda.Utils.Graph.AdjacencyMap.Unidirectional: oppositeDAG :: DAG n -> DAG n
+ Agda.Utils.Graph.AdjacencyMap.Unidirectional: reachable :: Ord n => DAG n -> SCC n -> [n]
+ Agda.Utils.Graph.AdjacencyMap.Unidirectional: sccDAG :: Ord n => Graph n n e -> DAG n
+ Agda.Utils.Graph.AdjacencyMap.Unidirectional: sccDAG' :: Ord n => Graph n n e -> [SCC n] -> DAG n
+ Agda.Utils.Graph.AdjacencyMap.Unidirectional.Tests: instance Agda.Utils.SemiRing.SemiRing Agda.Utils.Graph.AdjacencyMap.Unidirectional.Tests.Connected
+ Agda.Utils.Graph.AdjacencyMap.Unidirectional.Tests: instance Agda.Utils.SemiRing.SemiRing Agda.Utils.Graph.AdjacencyMap.Unidirectional.Tests.ExtendedNatural
+ Agda.Utils.Graph.AdjacencyMap.Unidirectional.Tests: instance Agda.Utils.SemiRing.StarSemiRing Agda.Utils.Graph.AdjacencyMap.Unidirectional.Tests.Connected
+ Agda.Utils.Graph.AdjacencyMap.Unidirectional.Tests: instance Agda.Utils.SemiRing.StarSemiRing Agda.Utils.Graph.AdjacencyMap.Unidirectional.Tests.ExtendedNatural
+ Agda.Utils.Graph.AdjacencyMap.Unidirectional.Tests: instance GHC.Classes.Eq Agda.Utils.Graph.AdjacencyMap.Unidirectional.Tests.Connected
+ Agda.Utils.Graph.AdjacencyMap.Unidirectional.Tests: instance GHC.Classes.Eq Agda.Utils.Graph.AdjacencyMap.Unidirectional.Tests.ExtendedNatural
+ Agda.Utils.Graph.AdjacencyMap.Unidirectional.Tests: instance GHC.Classes.Eq Agda.Utils.Graph.AdjacencyMap.Unidirectional.Tests.N
+ Agda.Utils.Graph.AdjacencyMap.Unidirectional.Tests: instance GHC.Classes.Ord Agda.Utils.Graph.AdjacencyMap.Unidirectional.Tests.ExtendedNatural
+ Agda.Utils.Graph.AdjacencyMap.Unidirectional.Tests: instance GHC.Classes.Ord Agda.Utils.Graph.AdjacencyMap.Unidirectional.Tests.N
+ Agda.Utils.Graph.AdjacencyMap.Unidirectional.Tests: instance GHC.Show.Show Agda.Utils.Graph.AdjacencyMap.Unidirectional.Tests.Connected
+ Agda.Utils.Graph.AdjacencyMap.Unidirectional.Tests: instance GHC.Show.Show Agda.Utils.Graph.AdjacencyMap.Unidirectional.Tests.ExtendedNatural
+ Agda.Utils.Graph.AdjacencyMap.Unidirectional.Tests: instance GHC.Show.Show Agda.Utils.Graph.AdjacencyMap.Unidirectional.Tests.N
+ Agda.Utils.Graph.AdjacencyMap.Unidirectional.Tests: instance Test.QuickCheck.Arbitrary.Arbitrary Agda.Utils.Graph.AdjacencyMap.Unidirectional.Tests.N
+ Agda.Utils.Graph.AdjacencyMap.Unidirectional.Tests: tests :: IO Bool
+ Agda.Utils.HashMap: alter :: (Eq k, Hashable k) => (Maybe a -> Maybe a) -> k -> HashMap k a -> HashMap k a
+ Agda.Utils.HashMap: mapMaybe :: (a -> Maybe b) -> HashMap k a -> HashMap k b
+ Agda.Utils.List: prop_updateAt :: Eq a => NonNegative Int -> (a -> a) -> [a] -> Bool
+ Agda.Utils.List: prop_updateHead :: Eq a => (a -> a) -> [a] -> Bool
+ Agda.Utils.List: prop_updateLast :: Eq a => (a -> a) -> [a] -> Bool
+ Agda.Utils.List: spec_updateAt :: Int -> (a -> a) -> [a] -> [a]
+ Agda.Utils.List: spec_updateHead :: (a -> a) -> [a] -> [a]
+ Agda.Utils.List: spec_updateLast :: (a -> a) -> [a] -> [a]
+ Agda.Utils.List: updateAt :: Int -> (a -> a) -> [a] -> [a]
+ Agda.Utils.List: updateHead :: (a -> a) -> [a] -> [a]
+ Agda.Utils.ListT: mapMListT :: (Monad m) => (a -> m b) -> ListT m a -> ListT m b
+ Agda.Utils.ListT: mapMListT_alt :: (Monad m) => (a -> m b) -> ListT m a -> ListT m b
+ Agda.Utils.Maybe: allJustM :: Monad m => [m (Maybe a)] -> m (Maybe [a])
+ Agda.Utils.Maybe: allJustsOrNothings :: [Maybe a] -> Maybe (Maybe [a])
+ Agda.Utils.Maybe: whenNothing :: Monad m => Maybe a -> m () -> m ()
+ Agda.Utils.Maybe: whenNothingM :: Monad m => m (Maybe a) -> m () -> m ()
+ Agda.Utils.Maybe.Strict: instance Agda.Utils.Null.Null (Data.Strict.Maybe.Maybe a)
+ Agda.Utils.Monad: class (Alternative m, Monad m) => MonadPlus (m :: * -> *)
+ Agda.Utils.Monad: forMaybeM :: (Monad m, Functor m) => [a] -> (a -> m (Maybe b)) -> m [b]
+ Agda.Utils.Monad: mplus :: MonadPlus m => m a -> m a -> m a
+ Agda.Utils.Monad: mzero :: MonadPlus m => m a
+ Agda.Utils.Monad: unless :: Applicative f => Bool -> f () -> f ()
+ Agda.Utils.Monad: when :: Applicative f => Bool -> f () -> f ()
+ Agda.Utils.Null: instance Agda.Utils.Null.Null (Data.HashMap.Base.HashMap k a)
+ Agda.Utils.Null: instance Agda.Utils.Null.Null (Data.HashSet.HashSet a)
+ Agda.Utils.Null: instance Agda.Utils.Null.Null Text.PrettyPrint.HughesPJ.Doc
+ Agda.Utils.Permutation: flipP :: Permutation -> Permutation
+ Agda.Utils.Permutation: instance Agda.Syntax.Position.KillRange Agda.Utils.Permutation.Permutation
+ Agda.Utils.Permutation: instance Agda.Syntax.Position.KillRange a => Agda.Syntax.Position.KillRange (Agda.Utils.Permutation.Drop a)
+ Agda.Utils.Permutation: instance Agda.Utils.Permutation.InversePermute (GHC.Types.Int -> a) [GHC.Base.Maybe a]
+ Agda.Utils.Permutation: instance Test.QuickCheck.Arbitrary.Arbitrary Agda.Utils.Permutation.Permutation
+ Agda.Utils.SemiRing: class SemiRing a => StarSemiRing a
+ Agda.Utils.SemiRing: instance Agda.Utils.SemiRing.StarSemiRing a => Agda.Utils.SemiRing.StarSemiRing (GHC.Base.Maybe a)
+ Agda.Utils.SemiRing: oone :: SemiRing a => a
+ Agda.Utils.SemiRing: ostar :: StarSemiRing a => a -> a
+ Agda.Utils.SemiRing: ozero :: SemiRing a => a
+ Agda.Utils.Size: instance Agda.Utils.Size.Sized (Data.HashMap.Base.HashMap k a)
+ Agda.Utils.Size: instance Agda.Utils.Size.Sized (Data.HashSet.HashSet a)
+ Agda.Utils.Time: getCPUTime :: MonadIO m => m CPUTime
+ Agda.Utils.Trie: instance Agda.Utils.Null.Null (Agda.Utils.Trie.Trie k v)
+ Agda.Utils.Warshall: type Distance = Weight
- Agda.Compiler.MAlonzo.Compiler: term :: Term -> ReaderT Nat TCM Exp
+ Agda.Compiler.MAlonzo.Compiler: term :: Term -> CC Exp
- Agda.Compiler.MAlonzo.Compiler: term' :: Arg Term -> ReaderT Nat TCM Exp
+ Agda.Compiler.MAlonzo.Compiler: term' :: Arg Term -> CC Exp
- Agda.Interaction.Options: PragmaOptions :: Bool -> Bool -> Verbosity -> Bool -> Bool -> Bool -> Bool -> CutOff -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> PragmaOptions
+ Agda.Interaction.Options: PragmaOptions :: Bool -> Bool -> Verbosity -> Bool -> Bool -> Bool -> Bool -> CutOff -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> PragmaOptions
- Agda.Syntax.Abstract.Views: class ExprLike a where mapExpr f e = runIdentity $ traverseExpr (Identity . f) e
+ Agda.Syntax.Abstract.Views: class ExprLike a where recurseExpr = traverse . recurseExpr foldExpr f = getConst . recurseExpr (\ pre post -> Const $ f pre) traverseExpr f = recurseExpr (\ pre post -> f =<< post) mapExpr f e = runIdentity $ traverseExpr (Identity . f) e
- Agda.Syntax.Info: ConPatInfo :: Bool -> PatInfo -> ConPatInfo
+ Agda.Syntax.Info: ConPatInfo :: ConPOrigin -> PatInfo -> ConPatInfo
- Agda.Syntax.Internal: ConPatternInfo :: Maybe Bool -> Maybe (Arg Type) -> ConPatternInfo
+ Agda.Syntax.Internal: ConPatternInfo :: Maybe ConPOrigin -> Maybe (Arg Type) -> ConPatternInfo
- Agda.Syntax.Internal: [conPRecord] :: ConPatternInfo -> Maybe Bool
+ Agda.Syntax.Internal: [conPRecord] :: ConPatternInfo -> Maybe ConPOrigin
- Agda.Syntax.Scope.Base: inverseScopeLookup :: Either ModuleName QName -> ScopeInfo -> Maybe QName
+ Agda.Syntax.Scope.Base: inverseScopeLookup :: Either ModuleName QName -> ScopeInfo -> [QName]
- Agda.Syntax.Scope.Base: inverseScopeLookup' :: AllowAmbiguousConstructors -> Either ModuleName QName -> ScopeInfo -> Maybe QName
+ Agda.Syntax.Scope.Base: inverseScopeLookup' :: AllowAmbiguousConstructors -> Either ModuleName QName -> ScopeInfo -> [QName]
- Agda.Syntax.Scope.Base: inverseScopeLookupModule :: ModuleName -> ScopeInfo -> Maybe QName
+ Agda.Syntax.Scope.Base: inverseScopeLookupModule :: ModuleName -> ScopeInfo -> [QName]
- Agda.Syntax.Scope.Base: inverseScopeLookupName :: QName -> ScopeInfo -> Maybe QName
+ Agda.Syntax.Scope.Base: inverseScopeLookupName :: QName -> ScopeInfo -> [QName]
- Agda.Syntax.Scope.Base: inverseScopeLookupName' :: AllowAmbiguousConstructors -> QName -> ScopeInfo -> Maybe QName
+ Agda.Syntax.Scope.Base: inverseScopeLookupName' :: AllowAmbiguousConstructors -> QName -> ScopeInfo -> [QName]
- Agda.TypeChecking.CompiledClause: Branches :: Map QName (WithArity c) -> Map Literal c -> Maybe c -> Case c
+ Agda.TypeChecking.CompiledClause: Branches :: Bool -> Map QName (WithArity c) -> Map Literal c -> Maybe c -> Case c
- Agda.TypeChecking.CompiledClause.Compile: nextSplit :: Cls -> Maybe Int
+ Agda.TypeChecking.CompiledClause.Compile: nextSplit :: Cls -> Maybe (Bool, Int)
- Agda.TypeChecking.Coverage: fixTarget :: SplitClause -> TCM (Bool, SplitClause)
+ Agda.TypeChecking.Coverage: fixTarget :: SplitClause -> TCM (Telescope, SplitClause)
- Agda.TypeChecking.Coverage: splitClauseWithAbsurd :: Clause -> Nat -> TCM (Either SplitError (Either SplitClause Covering))
+ Agda.TypeChecking.Coverage: splitClauseWithAbsurd :: SplitClause -> Nat -> TCM (Either SplitError (Either SplitClause Covering))
- Agda.TypeChecking.Free: freeVars :: Free a => a -> FreeVars
+ Agda.TypeChecking.Free: freeVars :: (Monoid c, Singleton Variable c, Free' a c) => a -> c
- Agda.TypeChecking.Free: occurrence :: Nat -> FreeVars -> Occurrence
+ Agda.TypeChecking.Free: occurrence :: FreeV a => Nat -> a -> Occurrence
- Agda.TypeChecking.MetaVars: expandProjectedVars :: (Normalise a, TermLike a, PrettyTCM a, NoProjectedVar a, Subst a, PrettyTCM b, Subst b) => a -> b -> (a -> b -> TCM c) -> TCM c
+ Agda.TypeChecking.MetaVars: expandProjectedVars :: (Normalise a, TermLike a, Show a, PrettyTCM a, NoProjectedVar a, Subst a, PrettyTCM b, Subst b) => a -> b -> (a -> b -> TCM c) -> TCM c
- Agda.TypeChecking.Monad.Base: CheckArguments :: Range -> [NamedArg Expr] -> Type -> Type -> (Maybe (Args, Type)) -> Call
+ Agda.TypeChecking.Monad.Base: CheckArguments :: Range -> [NamedArg Expr] -> Type -> Type -> Call
- Agda.TypeChecking.Monad.Base: CheckClause :: Type -> SpineClause -> (Maybe Clause) -> Call
+ Agda.TypeChecking.Monad.Base: CheckClause :: Type -> SpineClause -> Call
- Agda.TypeChecking.Monad.Base: CheckConstructor :: QName -> Telescope -> Sort -> Constructor -> (Maybe ()) -> Call
+ Agda.TypeChecking.Monad.Base: CheckConstructor :: QName -> Telescope -> Sort -> Constructor -> Call
- Agda.TypeChecking.Monad.Base: CheckDataDef :: Range -> Name -> [LamBinding] -> [Constructor] -> (Maybe ()) -> Call
+ Agda.TypeChecking.Monad.Base: CheckDataDef :: Range -> Name -> [LamBinding] -> [Constructor] -> Call
- Agda.TypeChecking.Monad.Base: CheckDotPattern :: Expr -> Term -> (Maybe Constraints) -> Call
+ Agda.TypeChecking.Monad.Base: CheckDotPattern :: Expr -> Term -> Call
- Agda.TypeChecking.Monad.Base: CheckExprCall :: Expr -> Type -> (Maybe Term) -> Call
+ Agda.TypeChecking.Monad.Base: CheckExprCall :: Expr -> Type -> Call
- Agda.TypeChecking.Monad.Base: CheckFunDef :: Range -> Name -> [Clause] -> (Maybe ()) -> Call
+ Agda.TypeChecking.Monad.Base: CheckFunDef :: Range -> Name -> [Clause] -> Call
- Agda.TypeChecking.Monad.Base: CheckIsEmpty :: Range -> Type -> (Maybe ()) -> Call
+ Agda.TypeChecking.Monad.Base: CheckIsEmpty :: Range -> Type -> Call
- Agda.TypeChecking.Monad.Base: CheckLetBinding :: LetBinding -> (Maybe ()) -> Call
+ Agda.TypeChecking.Monad.Base: CheckLetBinding :: LetBinding -> Call
- Agda.TypeChecking.Monad.Base: CheckPattern :: Pattern -> Telescope -> Type -> (Maybe a) -> Call
+ Agda.TypeChecking.Monad.Base: CheckPattern :: Pattern -> Telescope -> Type -> Call
- Agda.TypeChecking.Monad.Base: CheckPatternShadowing :: SpineClause -> (Maybe ()) -> Call
+ Agda.TypeChecking.Monad.Base: CheckPatternShadowing :: SpineClause -> Call
- Agda.TypeChecking.Monad.Base: CheckPragma :: Range -> Pragma -> (Maybe ()) -> Call
+ Agda.TypeChecking.Monad.Base: CheckPragma :: Range -> Pragma -> Call
- Agda.TypeChecking.Monad.Base: CheckPrimitive :: Range -> Name -> Expr -> (Maybe ()) -> Call
+ Agda.TypeChecking.Monad.Base: CheckPrimitive :: Range -> Name -> Expr -> Call
- Agda.TypeChecking.Monad.Base: CheckRecDef :: Range -> Name -> [LamBinding] -> [Constructor] -> (Maybe ()) -> Call
+ Agda.TypeChecking.Monad.Base: CheckRecDef :: Range -> Name -> [LamBinding] -> [Constructor] -> Call
- Agda.TypeChecking.Monad.Base: CheckSectionApplication :: Range -> ModuleName -> ModuleApplication -> (Maybe ()) -> Call
+ Agda.TypeChecking.Monad.Base: CheckSectionApplication :: Range -> ModuleName -> ModuleApplication -> Call
- Agda.TypeChecking.Monad.Base: CheckWithFunctionType :: Expr -> (Maybe ()) -> Call
+ Agda.TypeChecking.Monad.Base: CheckWithFunctionType :: Expr -> Call
- Agda.TypeChecking.Monad.Base: Defn :: ArgInfo -> QName -> Type -> [Polarity] -> [Occurrence] -> [Open DisplayForm] -> MutualId -> CompiledRepresentation -> RewriteRules -> Maybe QName -> Defn -> Definition
+ Agda.TypeChecking.Monad.Base: Defn :: ArgInfo -> QName -> Type -> [Polarity] -> [Occurrence] -> [Open DisplayForm] -> MutualId -> CompiledRepresentation -> Maybe QName -> Defn -> Definition
- Agda.TypeChecking.Monad.Base: InferDef :: Range -> QName -> (Maybe (Term, Type)) -> Call
+ Agda.TypeChecking.Monad.Base: InferDef :: Range -> QName -> Call
- Agda.TypeChecking.Monad.Base: InferExpr :: Expr -> (Maybe (Term, Type)) -> Call
+ Agda.TypeChecking.Monad.Base: InferExpr :: Expr -> Call
- Agda.TypeChecking.Monad.Base: InferVar :: Name -> (Maybe (Term, Type)) -> Call
+ Agda.TypeChecking.Monad.Base: InferVar :: Name -> Call
- Agda.TypeChecking.Monad.Base: IsTypeCall :: Expr -> Sort -> (Maybe Type) -> Call
+ Agda.TypeChecking.Monad.Base: IsTypeCall :: Expr -> Sort -> Call
- Agda.TypeChecking.Monad.Base: IsType_ :: Expr -> (Maybe Type) -> Call
+ Agda.TypeChecking.Monad.Base: IsType_ :: Expr -> Call
- Agda.TypeChecking.Monad.Base: NoHighlighting :: (Maybe a) -> Call
+ Agda.TypeChecking.Monad.Base: NoHighlighting :: Call
- Agda.TypeChecking.Monad.Base: ScopeCheckDeclaration :: NiceDeclaration -> (Maybe [Declaration]) -> Call
+ Agda.TypeChecking.Monad.Base: ScopeCheckDeclaration :: NiceDeclaration -> Call
- Agda.TypeChecking.Monad.Base: ScopeCheckExpr :: Expr -> (Maybe Expr) -> Call
+ Agda.TypeChecking.Monad.Base: ScopeCheckExpr :: Expr -> Call
- Agda.TypeChecking.Monad.Base: ScopeCheckLHS :: Name -> Pattern -> (Maybe LHS) -> Call
+ Agda.TypeChecking.Monad.Base: ScopeCheckLHS :: Name -> Pattern -> Call
- Agda.TypeChecking.Monad.Base: SetRange :: Range -> (Maybe a) -> Call
+ Agda.TypeChecking.Monad.Base: SetRange :: Range -> Call
- Agda.TypeChecking.Monad.Base: Sig :: Sections -> Definitions -> Signature
+ Agda.TypeChecking.Monad.Base: Sig :: Sections -> Definitions -> RewriteRuleMap -> Signature
- Agda.TypeChecking.Monad.Benchmark: billPureTo :: MonadTCM tcm => Account -> a -> tcm a
+ Agda.TypeChecking.Monad.Benchmark: billPureTo :: MonadBench a m => Account a -> c -> m c
- Agda.TypeChecking.Monad.Benchmark: billTo :: MonadTCM tcm => Account -> tcm a -> tcm a
+ Agda.TypeChecking.Monad.Benchmark: billTo :: MonadBench a m => Account a -> m c -> m c
- Agda.TypeChecking.Monad.Benchmark: getBenchmark :: TCM Benchmark
+ Agda.TypeChecking.Monad.Benchmark: getBenchmark :: MonadBench a m => m (Benchmark a)
- Agda.TypeChecking.Monad.Trace: traceCall :: MonadTCM tcm => (Maybe r -> Call) -> tcm a -> tcm a
+ Agda.TypeChecking.Monad.Trace: traceCall :: MonadTCM tcm => Call -> tcm a -> tcm a
- Agda.TypeChecking.Monad.Trace: traceCallCPS :: MonadTCM tcm => (Maybe r -> Call) -> (r -> tcm a) -> ((r -> tcm a) -> tcm b) -> tcm b
+ Agda.TypeChecking.Monad.Trace: traceCallCPS :: MonadTCM tcm => Call -> (r -> tcm a) -> ((r -> tcm a) -> tcm b) -> tcm b
- Agda.TypeChecking.Monad.Trace: traceCallCPS_ :: MonadTCM tcm => (Maybe () -> Call) -> tcm a -> (tcm a -> tcm b) -> tcm b
+ Agda.TypeChecking.Monad.Trace: traceCallCPS_ :: MonadTCM tcm => Call -> tcm a -> (tcm a -> tcm b) -> tcm b
- Agda.TypeChecking.Monad.Trace: traceCallM :: MonadTCM tcm => tcm (Maybe r -> Call) -> tcm a -> tcm a
+ Agda.TypeChecking.Monad.Trace: traceCallM :: MonadTCM tcm => tcm Call -> tcm a -> tcm a
- Agda.TypeChecking.Polarity: dependentPolarity :: Type -> [Polarity] -> TCM [Polarity]
+ Agda.TypeChecking.Polarity: dependentPolarity :: Type -> [Polarity] -> [Polarity] -> TCM [Polarity]
- Agda.TypeChecking.Positivity: getOccurrences :: (PrettyTCM a, ComputeOccurrences a) => [Maybe Item] -> a -> TCM Occurrences
+ Agda.TypeChecking.Positivity: getOccurrences :: (Show a, PrettyTCM a, ComputeOccurrences a) => [Maybe Item] -> a -> TCM Occurrences
- Agda.TypeChecking.Primitive: mkPrimFun1TCM :: (FromTerm a, ToTerm b) => TCM Type -> (a -> ReduceM b) -> TCM PrimitiveImpl
+ Agda.TypeChecking.Primitive: mkPrimFun1TCM :: (FromTerm a, ToTerm b, TermLike b) => TCM Type -> (a -> ReduceM b) -> TCM PrimitiveImpl
- Agda.TypeChecking.Records: isRecordConstructor :: QName -> TCM (Maybe (QName, Defn))
+ Agda.TypeChecking.Records: isRecordConstructor :: MonadTCM tcm => QName -> tcm (Maybe (QName, Defn))
- Agda.TypeChecking.Rewriting: rewrite :: Term -> ReduceM (Maybe Term)
+ Agda.TypeChecking.Rewriting: rewrite :: Blocked Term -> ReduceM (Either (Blocked Term) Term)
- Agda.TypeChecking.Rewriting: rewriteWith :: Maybe Type -> Term -> RewriteRule -> ReduceM (Maybe Term)
+ Agda.TypeChecking.Rewriting: rewriteWith :: Maybe Type -> Term -> RewriteRule -> ReduceM (Either (Blocked Term) Term)
- Agda.TypeChecking.Rewriting.NonLinMatch: PostponedEquation :: Term -> Term -> PostponedEquation
+ Agda.TypeChecking.Rewriting.NonLinMatch: PostponedEquation :: Int -> Term -> Term -> PostponedEquation
- Agda.TypeChecking.Rewriting.NonLinMatch: makeSubstitution :: IntMap Term -> Substitution
+ Agda.TypeChecking.Rewriting.NonLinMatch: makeSubstitution :: Sub -> Substitution
- Agda.TypeChecking.Rewriting.NonLinMatch: nonLinMatch :: (AmbMatch a b) => a -> b -> ReduceM (Maybe Substitution)
+ Agda.TypeChecking.Rewriting.NonLinMatch: nonLinMatch :: (Match a b) => a -> b -> ReduceM (Either Blocked_ Substitution)
- Agda.TypeChecking.Rewriting.NonLinMatch: patternFrom :: PatternFrom a b => a -> TCM b
+ Agda.TypeChecking.Rewriting.NonLinMatch: patternFrom :: PatternFrom a b => Int -> a -> TCM b
- Agda.TypeChecking.Rewriting.NonLinMatch: runNLM :: NLM () -> ReduceM (Maybe NLMOut)
+ Agda.TypeChecking.Rewriting.NonLinMatch: runNLM :: NLM () -> ReduceM (Either Blocked_ NLMState)
- Agda.TypeChecking.Rewriting.NonLinMatch: tellEq :: Term -> Term -> NLM ()
+ Agda.TypeChecking.Rewriting.NonLinMatch: tellEq :: Int -> Term -> Term -> NLM ()
- Agda.TypeChecking.Rewriting.NonLinMatch: type NLM = MaybeT (WriterT NLMOut ReduceM)
+ Agda.TypeChecking.Rewriting.NonLinMatch: type NLM = ExceptT Blocked_ (StateT NLMState ReduceM)
- Agda.TypeChecking.Rules.LHS: checkLeftHandSide :: (Maybe r -> Call) -> Maybe QName -> [NamedArg Pattern] -> Type -> (LHSResult -> TCM a) -> TCM a
+ Agda.TypeChecking.Rules.LHS: checkLeftHandSide :: Call -> Maybe QName -> [NamedArg Pattern] -> Type -> (LHSResult -> TCM a) -> TCM a
- Agda.TypeChecking.Rules.LHS: noShadowingOfConstructors :: (Maybe r -> Call) -> Problem -> TCM ()
+ Agda.TypeChecking.Rules.LHS: noShadowingOfConstructors :: Call -> Problem -> TCM ()
- Agda.TypeChecking.Rules.LHS.Problem: Focus :: QName -> Bool -> [NamedArg Pattern] -> Range -> OneHolePatterns -> Int -> QName -> [Arg Term] -> [Arg Term] -> Type -> Focus
+ Agda.TypeChecking.Rules.LHS.Problem: Focus :: QName -> ConPOrigin -> [NamedArg Pattern] -> Range -> OneHolePatterns -> Int -> QName -> [Arg Term] -> [Arg Term] -> Type -> Focus
- Agda.TypeChecking.Rules.LHS.Problem: RecordFlex :: FlexibleVarKind
+ Agda.TypeChecking.Rules.LHS.Problem: RecordFlex :: [FlexibleVarKind] -> FlexibleVarKind
- Agda.TypeChecking.Rules.Term: traceCallE :: Error e => (Maybe r -> Call) -> ExceptT e TCM r -> ExceptT e TCM r
+ Agda.TypeChecking.Rules.Term: traceCallE :: Error e => Call -> ExceptT e TCM r -> ExceptT e TCM r
- Agda.TypeChecking.SizedTypes.Tests: prop_ComposeComplete :: Label -> Label -> Int -> Weight -> Property
+ Agda.TypeChecking.SizedTypes.Tests: prop_ComposeComplete :: Label -> Label -> Offset -> Weight -> Property
- Agda.TypeChecking.SizedTypes.WarshallSolver: Offset :: Int -> Weight
+ Agda.TypeChecking.SizedTypes.WarshallSolver: Offset :: Offset -> Weight
- Agda.TypeChecking.Substitute: singletonS :: Term -> Substitution
+ Agda.TypeChecking.Substitute: singletonS :: Int -> Term -> Substitution
- Agda.TypeChecking.Substitute: subst :: Subst t => Term -> t -> t
+ Agda.TypeChecking.Substitute: subst :: Subst t => Int -> Term -> t -> t
- Agda.TypeChecking.Test.Generators: isWellScoped :: Free a => TermConfiguration -> a -> Bool
+ Agda.TypeChecking.Test.Generators: isWellScoped :: FreeVS a => TermConfiguration -> a -> Bool
- Agda.Utils.Permutation: class DoDrop a where dropMore n (Drop m xs) = Drop (m + n) xs unDrop n (Drop m xs) | n <= m = Drop (m - n) xs | otherwise = (throwImpossible (Impossible "src/full/Agda/Utils/Permutation.hs" 222))
+ Agda.Utils.Permutation: class DoDrop a where dropMore n (Drop m xs) = Drop (m + n) xs unDrop n (Drop m xs) | n <= m = Drop (m - n) xs | otherwise = (throwImpossible (Impossible "src/full/Agda/Utils/Permutation.hs" 249))
- Agda.Utils.Trie: empty :: Trie k v
+ Agda.Utils.Trie: empty :: Null a => a

Files

Agda.cabal view
@@ -1,5 +1,5 @@ name:            Agda-version:         2.4.2.3+version:         2.4.2.4 cabal-version:   >= 1.8 build-type:      Custom license:         OtherLicense@@ -32,10 +32,9 @@   Note that the Agda library does not follow the package versioning   policy, because it is not intended to be used by third-party   packages.-tested-with:        GHC == 7.4.2-                    GHC == 7.6.3+tested-with:        GHC == 7.6.3                     GHC == 7.8.4-                    GHC == 7.10.1+                    GHC == 7.10.2 extra-source-files: src/full/undefined.h                     README.md                     CHANGELOG@@ -56,7 +55,7 @@ source-repository this   type:     git   location: https://github.com/agda/agda-  tag:      2.4.2.3+  tag:      2.4.2.4  flag cpphs   default:     True@@ -75,32 +74,29 @@     build-depends:  Win32 >= 2.2 && < 2.4    build-depends:-    array >= 0.4.0.0 && < 0.6-    , base >= 4.5.0.0 && < 4.9-    , binary >= 0.6 && < 0.8+    array >= 0.4.0.1 && < 0.6+    , base >= 4.6.0.1 && < 4.9+    , binary >= 0.7.2.1 && < 0.8     , boxes >= 0.1.3 && < 0.2-    -- NFData ByteString is only available from bytestring >= 0.10-    -- but bytestring-0.10 is not accepted by travis build for GHC <= 7.4-    -- as it breaks the accompanying haskell-platform-    -- even though it builds with older GHCs.-    , bytestring >= 0.9.2.1 && < 0.11-    , containers >= 0.4.2.1 && < 0.6-    , data-hash == 0.2.0.0-    , deepseq >= 1.3.0.0 && < 1.5+    , bytestring >= 0.10.0.2 && < 0.11+    , containers >= 0.5.0.0 && < 0.6+    , data-hash >= 0.2.0.0 && < 0.3+    , deepseq >= 1.3.0.1 && < 1.5+    , directory >= 1.2.0.1 && < 1.3     , edit-distance >= 0.2.1.2 && < 0.3-    , equivalence >= 0.2.5  && < 0.4-    , filepath >= 1.3.0.0 && < 1.5-    , geniplate-mirror >= 0.6.0.6 && < 0.7+    , equivalence >= 0.2.5 && < 0.4+    , filepath >= 1.3.0.1 && < 1.5+    , geniplate-mirror >= 0.6.0.6 && < 0.8     -- hashable 1.2.0.10 makes library-test 10x slower. The issue was     -- fixed in hashable 1.2.1.0.     -- https://github.com/tibbe/hashable/issues/57.-    , hashable >= 1.1.2.3 && < 1.2 || >= 1.2.1.0 && < 1.3+    , hashable >= 1.2.1.0 && < 1.3     -- There is a "serious bug"     -- (https://hackage.haskell.org/package/hashtables-1.2.0.2/changelog)     -- in hashtables 1.2.0.0/1.2.0.1. This bug seems to have made Agda     -- much slower (infinitely slower?) in some cases.-    , hashtables >= 1.0 && < 1.2 || >= 1.2.0.2 && < 1.3-    , haskeline >= 0.7 && < 0.8+    , hashtables >= 1.0.1.8 && < 1.2 || >= 1.2.0.2 && < 1.3+    , haskeline >= 0.7.1.3 && < 0.8     , haskell-src-exts >= 1.16.0.1 && < 1.17     -- mtl-2.1 contains a severe bug.     --@@ -113,31 +109,21 @@     -- pretty 1.1.1.2 and 1.1.1.3 do not follow the package versioning     -- policy.     , pretty >= 1.1.1.0 && < 1.1.1.2 || >= 1.1.2 && < 1.2-    , process >= 1.1.0.1 && < 1.3+    , process >= 1.1.0.2 && < 1.3     , strict >= 0.3.2 && < 0.4-    , template-haskell >= 2.7.0.0 && < 2.11-    , text >= 0.11 && < 1.3+    , template-haskell >= 2.8.0.0 && < 2.11+    , text >= 0.11.3.1 && < 1.3+    , time >= 1.4.0.1 && < 1.6     -- transformers 0.4.0.0 was deprecated.     , transformers >= 0.3 && < 0.4 || >= 0.4.1.0 && < 0.5-    , transformers-compat >= 0.3.3.2 && < 0.5-    , unordered-containers == 0.2.*-    , xhtml == 3000.2.*-    , zlib >= 0.4.0.1 && < 0.7+    , transformers-compat >= 0.3.3.3 && < 0.5+    , unordered-containers >= 0.2.5.0 && < 0.3+    , xhtml >= 3000.2.1 && < 3000.3+    -- zlib >= 0.6.1 is broken. See Issue 1518.+    , zlib >= 0.4.0.1 && < 0.6.1    if impl(ghc < 7.8)-    build-depends: base-orphans >= 0.3.1 && < 0.4--  if impl(ghc < 7.6)-    build-depends:-      directory >= 1.1.0.2 && < 1.2-      -- The package ghc-prim is included in order to get access to-      -- GHC.Generics, which later moved to base.-      , ghc-prim == 0.2.*-      , old-time >= 1.1.0.0 && < 1.2-  else-      build-depends:-        directory >= 1.2.0.0 && < 1.3-        , time >= 1.4 && < 1.6+    build-depends: base-orphans >= 0.3.1 && < 0.5    build-tools:     alex >= 3.1.0 && < 3.2@@ -150,6 +136,7 @@                     Agda.Auto.SearchControl                     Agda.Auto.Syntax                     Agda.Auto.Typecheck+                    Agda.Benchmarking                     Agda.Compiler.CallCompiler                     Agda.Compiler.Epic.AuxAST                     Agda.Compiler.Epic.CaseOpts@@ -272,6 +259,9 @@                     Agda.TypeChecking.EtaContract                     Agda.TypeChecking.Errors                     Agda.TypeChecking.Free+                    Agda.TypeChecking.Free.Lazy+                    Agda.TypeChecking.Free.Old+                    Agda.TypeChecking.Free.Tests                     Agda.TypeChecking.Forcing                     Agda.TypeChecking.Implicit                     Agda.TypeChecking.Injectivity@@ -283,14 +273,11 @@                     Agda.TypeChecking.MetaVars.Mention                     Agda.TypeChecking.MetaVars.Occurs                     Agda.TypeChecking.Monad.Base-                    Agda.TypeChecking.Monad.Base.Benchmark-                    Agda.TypeChecking.Monad.Base.KillRange                     Agda.TypeChecking.Monad.Benchmark                     Agda.TypeChecking.Monad.Builtin                     Agda.TypeChecking.Monad.Closure                     Agda.TypeChecking.Monad.Constraints                     Agda.TypeChecking.Monad.Context-                    Agda.TypeChecking.Monad.Debug                     Agda.TypeChecking.Monad.Env                     Agda.TypeChecking.Monad.Exception                     Agda.TypeChecking.Monad.Imports@@ -310,6 +297,8 @@                     Agda.TypeChecking.Patterns.Match                     Agda.TypeChecking.Polarity                     Agda.TypeChecking.Positivity+                    Agda.TypeChecking.Positivity.Occurrence+                    Agda.TypeChecking.Positivity.Tests                     Agda.TypeChecking.Pretty                     Agda.TypeChecking.Primitive                     Agda.TypeChecking.ProjectionLike@@ -352,6 +341,7 @@                     Agda.TypeChecking.With                     Agda.Utils.AssocList                     Agda.Utils.Bag+                    Agda.Utils.Benchmark                     Agda.Utils.BiMap                     Agda.Utils.Char                     Agda.Utils.Cluster@@ -363,8 +353,8 @@                     Agda.Utils.Functor                     Agda.Utils.Function                     Agda.Utils.Geniplate-                    Agda.Utils.Graph.AdjacencyMap                     Agda.Utils.Graph.AdjacencyMap.Unidirectional+                    Agda.Utils.Graph.AdjacencyMap.Unidirectional.Tests                     Agda.Utils.Hash                     Agda.Utils.HashMap                     Agda.Utils.Impossible@@ -377,7 +367,6 @@                     Agda.Utils.ListT                     Agda.Utils.ListT.Tests                     Agda.Utils.Map-                    Agda.Utils.Map.Compat                     Agda.Utils.Maybe                     Agda.Utils.Maybe.Strict                     Agda.Utils.Monad@@ -405,7 +394,7 @@    other-modules:    Paths_Agda -  if impl(ghc >= 7.4.2)+  if impl(ghc >= 7.6.3)     ghc-options: -w                  -fwarn-deprecated-flags                  -fwarn-dodgy-exports@@ -419,6 +408,8 @@                  -fwarn-missing-methods                  -fwarn-missing-signatures                  -fwarn-monomorphism-restriction+                 -fwarn-orphans+                 -fwarn-pointless-pragmas                  -fwarn-tabs                  -fwarn-overlapping-patterns                  -fwarn-unrecognised-pragmas@@ -426,9 +417,6 @@                  -fwarn-warnings-deprecations                  -fwarn-wrong-do-bind -  if impl(ghc >= 7.6.3)-    ghc-options: -fwarn-pointless-pragmas-   if impl(ghc >= 7.8)     ghc-options: -fwarn-duplicate-constraints                  -fwarn-empty-enumerations@@ -448,10 +436,10 @@   hs-source-dirs: src/main   main-is:        Main.hs   build-depends:-    Agda == 2.4.2.3+    Agda == 2.4.2.4     -- Nothing is used from the following package, except for the     -- prelude.-    , base >= 3 && < 6+    , base >= 4.6.0.1 && < 6   if impl(ghc >= 7)     -- If someone installs Agda with the setuid bit set, then the     -- presence of +RTS may be a security problem (see GHC bug #3910).@@ -465,7 +453,7 @@   main-is:          Main.hs   other-modules:    Paths_Agda   build-depends:-    base >= 4.5.0.0 && < 4.9-    , directory >= 1.1.0.2 && < 1.3-    , filepath >= 1.3.0.0 && < 1.5-    , process >= 1.0.1.0 && < 1.3+    base >= 4.6.0.1 && < 4.9+    , directory >= 1.2.0.1 && < 1.3+    , filepath >= 1.3.0.1 && < 1.5+    , process >= 1.1.0.2 && < 1.3
CHANGELOG view
@@ -1,4 +1,250 @@ ------------------------------------------------------------------------+-- Release notes for Agda version 2.4.2.4+------------------------------------------------------------------------++Important changes since 2.4.2.3:++Installation and infrastructure+===============================++* Added support for GHC 7.10.2.++* Removed support for GHC 7.4.2.++Pragmas and options+===================++* Option --copatterns is now on by default.  To switch off+  parsing of copatterns, use:++    {-# OPTIONS --no-copatterns #-}++* Option --rewriting is now needed to use REWRITE pragmas+  and rewriting during reduction.  Rewriting is not --safe.++  To use rewriting, first specify a relation symbol `R` that will+  later be used to add rewrite rules.  A canonical candidate would be+  propositional equality++    {-# BUILTIN REWRITE _≡_ #-}++  but any symbol `R` of type `Δ → A → A → Set i` for some `A` and+  `i` is accepted.  Then symbols `q` can be added to rewriting+  provided their type is of the form `Γ → R ds l r`.  This will add+  a rewrite rule++    Γ ⊢ l ↦ r : A[ds/Δ]++  to the signature, which fires whenever a term is an instance of `l`.+  For example, if++    plus0 : ∀ x → x + 0 ≡ x++  (ideally, there is a proof for `plus0`, but it could be a+  postulate), then++    {-# REWRITE plus0 #-}++  will prompt Agda to rewrite any well-typed term of the form `t + 0`+  to `t`.++  Some caveats:  Agda accepts and applies rewrite rules naively, it is+  very easy to break consistency and termination of type checking.+  Some examples of rewrite rules that should /not/ be added:++    refl     : ∀ x → x ≡ x             -- Agda loops+    plus-sym : ∀ x y → x + y ≡ y + x   -- Agda loops+    absurd   : true ≡ false            -- Breaks consistency++  Adding only proven equations should at least preserve consistency,+  but this is only a conjecture, so know what you are doing!+  Using rewriting, you are entering into the wilderness, where you are+  on your own!++Language+========++* forall / ∀ now parses like λ, i.e., the following parses now [Issue 1583]:++    ⊤ × ∀ (B : Set) → B → B++* The underscore pattern _ can now also stand for an inaccessible+  pattern (dot pattern). This alleviates the need for writing `._'.+  [Issue 1605]  Instead of++    transVOld : ∀{A : Set} (a b c : A) → a ≡ b → b ≡ c → a ≡ c+    transVOld _ ._ ._ refl refl = refl++  one can now write++    transVNew : ∀{A : Set} (a b c : A) → a ≡ b → b ≡ c → a ≡ c+    transVNew _ _ _ refl refl = refl++  and let Agda decide where to put the dots.  This was always possible+  by using hidden arguments++    transH : ∀{A : Set}{a b c : A} → a ≡ b → b ≡ c → a ≡ c+    transH refl refl = refl++  which is now equivalent to++    transHNew : ∀{A : Set}{a b c : A} → a ≡ b → b ≡ c → a ≡ c+    transHNew {a = _}{b = _}{c = _} refl refl = refl++  Before, underscore _ stood for an unnamed variable that could not be+  instantiated by an inaccessible pattern.  If one no wants to prevent+  Agda from instantiating, one needs to use a variable name other than+  underscore (however, in practice this situation seems unlikely).++Type checking+=============++* Polarity of phantom arguments to data and record types has changed. [Issue 1596]+  Polarity of size arguments is Nonvariant (both monotone and antitone).+  Polarity of other arguments is Covariant (monotone).+  Both were Invariant before (neither monotone nor antitone).++  The following example type-checks now:++    open import Common.Size++    -- List should be monotone in both arguments+    -- (even when `cons' is missing).++    data List (i : Size) (A : Set) : Set where+      [] : List i A++    castLL : ∀{i A} → List i (List i A) → List ∞ (List ∞ A)+    castLL x = x++    -- Stream should be antitone in the first and monotone in the second argument+    -- (even with field `tail' missing).++    record Stream (i : Size) (A : Set) : Set where+      coinductive+      field+        head : A++    castSS : ∀{i A} → Stream ∞ (Stream ∞ A) → Stream i (Stream i A)+    castSS x = x++* SIZELT lambdas must be consistent [Issue 1523, see Abel and Pientka, ICFP 2013].+  When lambda-abstracting over type (Size< size) then size must be+  non-zero, for any valid instantiation of size variables.++  The good:++      data Nat (i : Size) : Set where+        zero : ∀ (j : Size< i) → Nat i+        suc  : ∀ (j : Size< i) → Nat j → Nat i++      {-# TERMINATING #-}+      -- This definition is fine, the termination checker is too strict at the moment.+      fix : ∀ {C : Size → Set}+         → (∀ i → (∀ (j : Size< i) → Nat j -> C j) → Nat i → C i)+         → ∀ i → Nat i → C i+      fix t i (zero j)  = t i (λ (k : Size< i) → fix t k) (zero j)+      fix t i (suc j n) = t i (λ (k : Size< i) → fix t k) (suc j n)++    The λ (k : Size< i) is fine in both cases, as context++      i : Size, j : Size< i++    guarantees that i is non-zero.++  The bad:++      record Stream {i : Size} (A : Set) : Set where+        coinductive+        constructor _∷ˢ_+        field+          head  : A+          tail  : ∀ {j : Size< i} → Stream {j} A+      open Stream public++      _++ˢ_ : ∀ {i A} → List A → Stream {i} A → Stream {i} A+      []        ++ˢ s = s+      (a ∷ as)  ++ˢ s = a ∷ˢ (as ++ˢ s)++    This fails, maybe unjustified, at++      i : Size, s : Stream {i} A+        ⊢+          a ∷ˢ (λ {j : Size< i} → as ++ˢ s)++    Fixed by defining the constructor by copattern matching:++      record Stream {i : Size} (A : Set) : Set where+        coinductive+        field+          head  : A+          tail  : ∀ {j : Size< i} → Stream {j} A+      open Stream public++      _∷ˢ_ : ∀ {i A} → A → Stream {i} A → Stream {↑ i} A+      head  (a ∷ˢ as) = a+      tail  (a ∷ˢ as) = as++      _++ˢ_ : ∀ {i A} → List A → Stream {i} A → Stream {i} A+      []        ++ˢ s = s+      (a ∷ as)  ++ˢ s = a ∷ˢ (as ++ˢ s)++  The ugly:++      fix : ∀ {C : Size → Set}+         → (∀ i → (∀ (j : Size< i) → C j) → C i)+         → ∀ i → C i+      fix t i = t i λ (j : Size< i) → fix t j++   For i=0, there is no such j at runtime, leading to looping+   behavior.++Interaction+===========++* Issue 635 has been fixed.  Case splitting does not spit out implicit+  record patterns any more.++    record Cont : Set₁ where+      constructor _◃_+      field+        Sh  : Set+        Pos : Sh → Set++    open Cont++    data W (C : Cont) : Set where+      sup : (s : Sh C) (k : Pos C s → W C) → W C++    bogus : {C : Cont} → W C → Set+    bogus w = {!w!}++  Case splitting on w yielded, since the fix of issue 473,++    bogus {Sh ◃ Pos} (sup s k) = ?++  Now it gives, as expected,++    bogus (sup s k) = ?++Performance+===========++* As one result of the 21st Agda Implementor's Meeting (AIM XXI),+  serialization of the standard library is 50% faster (time reduced by+  a third), without using additional disk space for the interface+  files.+++Bug fixes+=========++* Issues fixed ( see https://github.com/agda/agda/issues ):+  1546 (copattern matching and with-clauses)+  1560 (positivity checker inefficiency)+  1584 (let pattern with trailing implicit)++------------------------------------------------------------------------ -- Release notes for Agda version 2.4.2.3 ------------------------------------------------------------------------ @@ -247,7 +493,7 @@ Compiler backends ================= -* The Epic backend has been disabled [Issue 1481].+* The Epic backend has been removed [Issue 1481].  Bug fixes =========
LICENSE view
@@ -57,3 +57,35 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.++--------------------------------------------------------------------------------++The file src/full/Agda/Utils/Maybe/Strict.hs (and the following+license text?) uses the following license:++Copyright (c) Roman Leshchinskiy 2006-2007++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions+are met:++1. Redistributions of source code must retain the above copyright+   notice, this list of conditions and the following disclaimer.+2. Redistributions in binary form must reproduce the above copyright+   notice, this list of conditions and the following disclaimer in the+   documentation and/or other materials provided with the distribution.+3. Neither the name of the author nor the names of his contributors+   may be used to endorse or promote products derived from this software+   without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE+ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF+SUCH DAMAGE.
README.md view
@@ -42,11 +42,11 @@  as root to get the correct files installed. -### Note on ghc's CPP language extension+### Note on GHC's CPP language extension  Recent versions of Clang's preprocessor don't work well with Haskell. In order to get some dependencies to build, you may need to set up Cabal-to have ghc use cpphs by default. You can do this by adding+to have GHC use cpphs by default. You can do this by adding      program-default-options       ghc-options: -pgmPcpphs -optP--cpp
dist/build/Agda/Syntax/Parser/Lexer.hs view
@@ -254,6 +254,26 @@ {-# LINE 1 "templates/GenericTemplate.hs" #-} {-# LINE 1 "<built-in>" #-} {-# LINE 1 "<command-line>" #-}+{-# LINE 9 "<command-line>" #-}+{-# LINE 1 "/usr/local/stow/ghc-7.10.2/lib/ghc-7.10.2/include/ghcversion.h" #-}++++++++++++++++++{-# LINE 9 "<command-line>" #-} {-# LINE 1 "templates/GenericTemplate.hs" #-} -- ----------------------------------------------------------------------------- -- ALEX TEMPLATE
dist/build/Agda/Syntax/Parser/Parser.hs view
@@ -17,5604 +17,5642 @@  -} module Agda.Syntax.Parser.Parser (       moduleParser-    , exprParser-    , tokensParser-    , tests-    ) where--import Control.Monad--import Data.Char-import Data.Functor-import Data.List-import Data.Maybe-import qualified Data.Traversable as T--import Agda.Syntax.Position hiding (tests)-import Agda.Syntax.Parser.Monad-import Agda.Syntax.Parser.Lexer-import Agda.Syntax.Parser.Tokens-import Agda.Syntax.Concrete as C-import Agda.Syntax.Concrete.Pretty ()-import Agda.Syntax.Common hiding (Arg, Dom, NamedArg)-import qualified Agda.Syntax.Common as Common-import Agda.Syntax.Fixity-import Agda.Syntax.Notation-import Agda.Syntax.Literal--import Agda.Utils.Hash-import Agda.Utils.List (spanJust)-import Agda.Utils.Monad-import Agda.Utils.QuickCheck-import Agda.Utils.Singleton-import Agda.Utils.TestHelpers-import Agda.Utils.Tuple-import qualified Data.Array as Happy_Data_Array-import qualified GHC.Exts as Happy_GHC_Exts-import Control.Applicative(Applicative(..))-import Control.Monad (ap)---- parser produced by Happy Version 1.19.5--newtype HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74 = HappyAbsSyn HappyAny-#if __GLASGOW_HASKELL__ >= 607-type HappyAny = Happy_GHC_Exts.Any-#else-type HappyAny = forall a . a-#endif-happyIn6 :: ([Token]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn6 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn6 #-}-happyOut6 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([Token])-happyOut6 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut6 #-}-happyIn7 :: ([Token]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn7 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn7 #-}-happyOut7 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([Token])-happyOut7 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut7 #-}-happyIn8 :: (Token) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn8 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn8 #-}-happyOut8 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Token)-happyOut8 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut8 #-}-happyIn9 :: (([Pragma], [Declaration])) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn9 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn9 #-}-happyOut9 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (([Pragma], [Declaration]))-happyOut9 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut9 #-}-happyIn10 :: t10 -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn10 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn10 #-}-happyOut10 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> t10-happyOut10 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut10 #-}-happyIn11 :: t11 -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn11 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn11 #-}-happyOut11 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> t11-happyOut11 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut11 #-}-happyIn12 :: t12 -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn12 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn12 #-}-happyOut12 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> t12-happyOut12 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut12 #-}-happyIn13 :: (()) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn13 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn13 #-}-happyOut13 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (())-happyOut13 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut13 #-}-happyIn14 :: (Integer) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn14 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn14 #-}-happyOut14 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Integer)-happyOut14 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut14 #-}-happyIn15 :: (Name) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn15 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn15 #-}-happyOut15 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Name)-happyOut15 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut15 #-}-happyIn16 :: ([Name]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn16 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn16 #-}-happyOut16 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([Name])-happyOut16 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut16 #-}-happyIn17 :: (Range) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn17 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn17 #-}-happyOut17 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Range)-happyOut17 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut17 #-}-happyIn18 :: (Arg Name) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn18 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn18 #-}-happyOut18 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Arg Name)-happyOut18 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut18 #-}-happyIn19 :: ([Arg Name]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn19 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn19 #-}-happyOut19 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([Arg Name])-happyOut19 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut19 #-}-happyIn20 :: ([Arg Name]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn20 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn20 #-}-happyOut20 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([Arg Name])-happyOut20 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut20 #-}-happyIn21 :: (QName) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn21 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn21 #-}-happyOut21 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (QName)-happyOut21 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut21 #-}-happyIn22 :: (QName) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn22 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn22 #-}-happyOut22 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (QName)-happyOut22 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut22 #-}-happyIn23 :: (Name) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn23 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn23 #-}-happyOut23 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Name)-happyOut23 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut23 #-}-happyIn24 :: ([Name]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn24 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn24 #-}-happyOut24 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([Name])-happyOut24 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut24 #-}-happyIn25 :: ([Name]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn25 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn25 #-}-happyOut25 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([Name])-happyOut25 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut25 #-}-happyIn26 :: (Either [Name] [Expr]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn26 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn26 #-}-happyOut26 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Either [Name] [Expr])-happyOut26 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut26 #-}-happyIn27 :: ([WithHiding Name]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn27 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn27 #-}-happyOut27 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([WithHiding Name])-happyOut27 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut27 #-}-happyIn28 :: ([String]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn28 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn28 #-}-happyOut28 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([String])-happyOut28 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut28 #-}-happyIn29 :: (String) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn29 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn29 #-}-happyOut29 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (String)-happyOut29 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut29 #-}-happyIn30 :: (Name) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn30 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn30 #-}-happyOut30 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Name)-happyOut30 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut30 #-}-happyIn31 :: (QName) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn31 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn31 #-}-happyOut31 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (QName)-happyOut31 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut31 #-}-happyIn32 :: (Expr) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn32 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn32 #-}-happyOut32 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Expr)-happyOut32 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut32 #-}-happyIn33 :: t33 -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn33 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn33 #-}-happyOut33 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> t33-happyOut33 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut33 #-}-happyIn34 :: ([Expr]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn34 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn34 #-}-happyOut34 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([Expr])-happyOut34 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut34 #-}-happyIn35 :: ([Expr]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn35 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn35 #-}-happyOut35 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([Expr])-happyOut35 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut35 #-}-happyIn36 :: t36 -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn36 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn36 #-}-happyOut36 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> t36-happyOut36 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut36 #-}-happyIn37 :: (Expr) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn37 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn37 #-}-happyOut37 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Expr)-happyOut37 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut37 #-}-happyIn38 :: ([Expr]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn38 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn38 #-}-happyOut38 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([Expr])-happyOut38 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut38 #-}-happyIn39 :: t39 -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn39 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn39 #-}-happyOut39 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> t39-happyOut39 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut39 #-}-happyIn40 :: t40 -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn40 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn40 #-}-happyOut40 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> t40-happyOut40 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut40 #-}-happyIn41 :: t41 -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn41 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn41 #-}-happyOut41 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> t41-happyOut41 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut41 #-}-happyIn42 :: ([(Name, Expr)]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn42 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn42 #-}-happyOut42 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([(Name, Expr)])-happyOut42 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut42 #-}-happyIn43 :: ([(Name, Expr)]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn43 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn43 #-}-happyOut43 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([(Name, Expr)])-happyOut43 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut43 #-}-happyIn44 :: ((Name, Expr)) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn44 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn44 #-}-happyOut44 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ((Name, Expr))-happyOut44 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut44 #-}-happyIn45 :: t45 -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn45 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn45 #-}-happyOut45 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> t45-happyOut45 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut45 #-}-happyIn46 :: t46 -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn46 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn46 #-}-happyOut46 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> t46-happyOut46 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut46 #-}-happyIn47 :: ([TypedBindings]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn47 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn47 #-}-happyOut47 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([TypedBindings])-happyOut47 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut47 #-}-happyIn48 :: (TypedBindings) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn48 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn48 #-}-happyOut48 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (TypedBindings)-happyOut48 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut48 #-}-happyIn49 :: (TypedBindings) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn49 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn49 #-}-happyOut49 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (TypedBindings)-happyOut49 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut49 #-}-happyIn50 :: (TypedBindings) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn50 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn50 #-}-happyOut50 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (TypedBindings)-happyOut50 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut50 #-}-happyIn51 :: ([LamBinding]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn51 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn51 #-}-happyOut51 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([LamBinding])-happyOut51 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut51 #-}-happyIn52 :: (Either ([LamBinding], Hiding) [Expr]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn52 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn52 #-}-happyOut52 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Either ([LamBinding], Hiding) [Expr])-happyOut52 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut52 #-}-happyIn53 :: ([Either Hiding LamBinding]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn53 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn53 #-}-happyOut53 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([Either Hiding LamBinding])-happyOut53 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut53 #-}-happyIn54 :: (Either [Either Hiding LamBinding] [Expr]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn54 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn54 #-}-happyOut54 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Either [Either Hiding LamBinding] [Expr])-happyOut54 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut54 #-}-happyIn55 :: ((LHS,RHS,WhereClause)) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn55 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn55 #-}-happyOut55 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ((LHS,RHS,WhereClause))-happyOut55 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut55 #-}-happyIn56 :: ((LHS,RHS,WhereClause)) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn56 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn56 #-}-happyOut56 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ((LHS,RHS,WhereClause))-happyOut56 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut56 #-}-happyIn57 :: ((LHS,RHS,WhereClause)) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn57 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn57 #-}-happyOut57 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ((LHS,RHS,WhereClause))-happyOut57 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut57 #-}-happyIn58 :: ([(LHS,RHS,WhereClause)]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn58 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn58 #-}-happyOut58 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([(LHS,RHS,WhereClause)])-happyOut58 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut58 #-}-happyIn59 :: ([LamBinding]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn59 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn59 #-}-happyOut59 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([LamBinding])-happyOut59 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut59 #-}-happyIn60 :: ([LamBinding]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn60 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn60 #-}-happyOut60 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([LamBinding])-happyOut60 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut60 #-}-happyIn61 :: ([LamBinding]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn61 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn61 #-}-happyOut61 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([LamBinding])-happyOut61 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut61 #-}-happyIn62 :: ([LamBinding]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn62 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn62 #-}-happyOut62 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([LamBinding])-happyOut62 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut62 #-}-happyIn63 :: (Either [LamBinding] [Expr]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn63 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn63 #-}-happyOut63 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Either [LamBinding] [Expr])-happyOut63 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut63 #-}-happyIn64 :: (ImportDirective) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn64 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn64 #-}-happyOut64 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (ImportDirective)-happyOut64 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut64 #-}-happyIn65 :: ([ImportDirective]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn65 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn65 #-}-happyOut65 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([ImportDirective])-happyOut65 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut65 #-}-happyIn66 :: (ImportDirective) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn66 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn66 #-}-happyOut66 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (ImportDirective)-happyOut66 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut66 #-}-happyIn67 :: ((UsingOrHiding , Range)) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn67 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn67 #-}-happyOut67 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ((UsingOrHiding , Range))-happyOut67 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut67 #-}-happyIn68 :: (([Renaming] , Range)) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn68 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn68 #-}-happyOut68 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (([Renaming] , Range))-happyOut68 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut68 #-}-happyIn69 :: ([Renaming]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn69 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn69 #-}-happyOut69 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([Renaming])-happyOut69 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut69 #-}-happyIn70 :: (Renaming) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn70 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn70 #-}-happyOut70 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Renaming)-happyOut70 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut70 #-}-happyIn71 :: (ImportedName) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn71 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn71 #-}-happyOut71 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (ImportedName)-happyOut71 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut71 #-}-happyIn72 :: (ImportedName) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn72 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn72 #-}-happyOut72 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (ImportedName)-happyOut72 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut72 #-}-happyIn73 :: ([ImportedName]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn73 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn73 #-}-happyOut73 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([ImportedName])-happyOut73 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut73 #-}-happyIn74 :: t74 -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn74 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn74 #-}-happyOut74 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> t74-happyOut74 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut74 #-}-happyIn75 :: (LHS) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn75 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn75 #-}-happyOut75 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (LHS)-happyOut75 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut75 #-}-happyIn76 :: ([Pattern]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn76 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn76 #-}-happyOut76 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([Pattern])-happyOut76 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut76 #-}-happyIn77 :: ([Expr]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn77 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn77 #-}-happyOut77 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([Expr])-happyOut77 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut77 #-}-happyIn78 :: ([Expr]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn78 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn78 #-}-happyOut78 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([Expr])-happyOut78 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut78 #-}-happyIn79 :: (WhereClause) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn79 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn79 #-}-happyOut79 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (WhereClause)-happyOut79 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut79 #-}-happyIn80 :: ([Declaration]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn80 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn80 #-}-happyOut80 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([Declaration])-happyOut80 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut80 #-}-happyIn81 :: ([Declaration]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn81 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn81 #-}-happyOut81 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([Declaration])-happyOut81 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut81 #-}-happyIn82 :: ([Arg Declaration]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn82 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn82 #-}-happyOut82 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([Arg Declaration])-happyOut82 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut82 #-}-happyIn83 :: ([Declaration]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn83 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn83 #-}-happyOut83 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([Declaration])-happyOut83 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut83 #-}-happyIn84 :: (RHSOrTypeSigs) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn84 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn84 #-}-happyOut84 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (RHSOrTypeSigs)-happyOut84 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut84 #-}-happyIn85 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn85 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn85 #-}-happyOut85 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Declaration)-happyOut85 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut85 #-}-happyIn86 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn86 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn86 #-}-happyOut86 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Declaration)-happyOut86 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut86 #-}-happyIn87 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn87 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn87 #-}-happyOut87 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Declaration)-happyOut87 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut87 #-}-happyIn88 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn88 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn88 #-}-happyOut88 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Declaration)-happyOut88 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut88 #-}-happyIn89 :: (Name) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn89 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn89 #-}-happyOut89 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Name)-happyOut89 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut89 #-}-happyIn90 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn90 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn90 #-}-happyOut90 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Declaration)-happyOut90 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut90 #-}-happyIn91 :: ([Declaration]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn91 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn91 #-}-happyOut91 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([Declaration])-happyOut91 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut91 #-}-happyIn92 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn92 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn92 #-}-happyOut92 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Declaration)-happyOut92 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut92 #-}-happyIn93 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn93 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn93 #-}-happyOut93 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Declaration)-happyOut93 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut93 #-}-happyIn94 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn94 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn94 #-}-happyOut94 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Declaration)-happyOut94 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut94 #-}-happyIn95 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn95 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn95 #-}-happyOut95 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Declaration)-happyOut95 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut95 #-}-happyIn96 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn96 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn96 #-}-happyOut96 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Declaration)-happyOut96 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut96 #-}-happyIn97 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn97 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn97 #-}-happyOut97 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Declaration)-happyOut97 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut97 #-}-happyIn98 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn98 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn98 #-}-happyOut98 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Declaration)-happyOut98 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut98 #-}-happyIn99 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn99 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn99 #-}-happyOut99 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Declaration)-happyOut99 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut99 #-}-happyIn100 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn100 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn100 #-}-happyOut100 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Declaration)-happyOut100 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut100 #-}-happyIn101 :: ([Arg Name]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn101 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn101 #-}-happyOut101 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([Arg Name])-happyOut101 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut101 #-}-happyIn102 :: ([RString]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn102 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn102 #-}-happyOut102 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([RString])-happyOut102 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut102 #-}-happyIn103 :: ([NamedArg HoleName]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn103 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn103 #-}-happyOut103 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([NamedArg HoleName])-happyOut103 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut103 #-}-happyIn104 :: (NamedArg HoleName) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn104 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn104 #-}-happyOut104 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (NamedArg HoleName)-happyOut104 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut104 #-}-happyIn105 :: (HoleName) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn105 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn105 #-}-happyOut105 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (HoleName)-happyOut105 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut105 #-}-happyIn106 :: (HoleName) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn106 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn106 #-}-happyOut106 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (HoleName)-happyOut106 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut106 #-}-happyIn107 :: (RString) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn107 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn107 #-}-happyOut107 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (RString)-happyOut107 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut107 #-}-happyIn108 :: (Maybe Range) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn108 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn108 #-}-happyOut108 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Maybe Range)-happyOut108 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut108 #-}-happyIn109 :: ([Declaration]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn109 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn109 #-}-happyOut109 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([Declaration])-happyOut109 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut109 #-}-happyIn110 :: ([Expr]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn110 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn110 #-}-happyOut110 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([Expr])-happyOut110 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut110 #-}-happyIn111 :: ([TypedBindings] -> Parser ModuleApplication) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn111 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn111 #-}-happyOut111 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([TypedBindings] -> Parser ModuleApplication)-happyOut111 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut111 #-}-happyIn112 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn112 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn112 #-}-happyOut112 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Declaration)-happyOut112 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut112 #-}-happyIn113 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn113 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn113 #-}-happyOut113 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Declaration)-happyOut113 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut113 #-}-happyIn114 :: (Name) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn114 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn114 #-}-happyOut114 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Name)-happyOut114 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut114 #-}-happyIn115 :: ([Declaration]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn115 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn115 #-}-happyOut115 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([Declaration])-happyOut115 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut115 #-}-happyIn116 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn116 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn116 #-}-happyOut116 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Declaration)-happyOut116 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut116 #-}-happyIn117 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn117 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn117 #-}-happyOut117 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Pragma)-happyOut117 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut117 #-}-happyIn118 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn118 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn118 #-}-happyOut118 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Pragma)-happyOut118 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut118 #-}-happyIn119 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn119 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn119 #-}-happyOut119 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Pragma)-happyOut119 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut119 #-}-happyIn120 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn120 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn120 #-}-happyOut120 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Pragma)-happyOut120 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut120 #-}-happyIn121 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn121 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn121 #-}-happyOut121 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Pragma)-happyOut121 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut121 #-}-happyIn122 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn122 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn122 #-}-happyOut122 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Pragma)-happyOut122 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut122 #-}-happyIn123 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn123 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn123 #-}-happyOut123 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Pragma)-happyOut123 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut123 #-}-happyIn124 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn124 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn124 #-}-happyOut124 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Pragma)-happyOut124 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut124 #-}-happyIn125 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn125 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn125 #-}-happyOut125 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Pragma)-happyOut125 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut125 #-}-happyIn126 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn126 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn126 #-}-happyOut126 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Pragma)-happyOut126 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut126 #-}-happyIn127 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn127 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn127 #-}-happyOut127 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Pragma)-happyOut127 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut127 #-}-happyIn128 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn128 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn128 #-}-happyOut128 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Pragma)-happyOut128 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut128 #-}-happyIn129 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn129 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn129 #-}-happyOut129 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Pragma)-happyOut129 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut129 #-}-happyIn130 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn130 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn130 #-}-happyOut130 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Pragma)-happyOut130 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut130 #-}-happyIn131 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn131 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn131 #-}-happyOut131 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Pragma)-happyOut131 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut131 #-}-happyIn132 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn132 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn132 #-}-happyOut132 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Pragma)-happyOut132 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut132 #-}-happyIn133 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn133 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn133 #-}-happyOut133 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Pragma)-happyOut133 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut133 #-}-happyIn134 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn134 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn134 #-}-happyOut134 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Pragma)-happyOut134 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut134 #-}-happyIn135 :: ([TypeSignature]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn135 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn135 #-}-happyOut135 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([TypeSignature])-happyOut135 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut135 #-}-happyIn136 :: ([TypeSignature]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn136 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn136 #-}-happyOut136 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([TypeSignature])-happyOut136 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut136 #-}-happyIn137 :: ([Arg TypeSignature]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn137 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn137 #-}-happyOut137 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([Arg TypeSignature])-happyOut137 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut137 #-}-happyIn138 :: ([Arg TypeSignature]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn138 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn138 #-}-happyOut138 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([Arg TypeSignature])-happyOut138 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut138 #-}-happyIn139 :: ([Constructor]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn139 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn139 #-}-happyOut139 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([Constructor])-happyOut139 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut139 #-}-happyIn140 :: ((Maybe (Ranged Induction), Maybe Name, [Declaration])) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn140 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn140 #-}-happyOut140 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ((Maybe (Ranged Induction), Maybe Name, [Declaration]))-happyOut140 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut140 #-}-happyIn141 :: (Ranged Induction) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn141 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn141 #-}-happyOut141 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Ranged Induction)-happyOut141 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut141 #-}-happyIn142 :: ([Declaration]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn142 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn142 #-}-happyOut142 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([Declaration])-happyOut142 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut142 #-}-happyIn143 :: ([Declaration]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn143 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn143 #-}-happyOut143 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([Declaration])-happyOut143 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut143 #-}-happyIn144 :: ([Declaration]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn144 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn144 #-}-happyOut144 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([Declaration])-happyOut144 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut144 #-}-happyIn145 :: ([Declaration]) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyIn145 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyIn145 #-}-happyOut145 :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> ([Declaration])-happyOut145 x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOut145 #-}-happyInTok :: (Token) -> (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74)-happyInTok x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyInTok #-}-happyOutTok :: (HappyAbsSyn t10 t11 t12 t33 t36 t39 t40 t41 t45 t46 t74) -> (Token)-happyOutTok x = Happy_GHC_Exts.unsafeCoerce# x-{-# INLINE happyOutTok #-}---happyActOffsets :: HappyAddr-happyActOffsets = HappyA# "\x00\x00\x36\x09\xdb\x05\x00\x00\xd2\x04\xd4\x05\x79\x04\xe0\x05\x00\x00\xce\x05\xdf\x05\x00\x00\x00\x00\x00\x00\x00\x00\x9b\x02\x00\x00\x00\x00\x05\x09\xdb\x08\xd2\x05\x00\x00\xb6\x02\xd1\x05\x56\x0b\x00\x00\x00\x00\xa1\x0f\xb9\x05\xb9\x05\x00\x00\x00\x00\x2e\x0b\x00\x00\x00\x00\xe6\x02\x0b\x0b\x00\x00\x00\x00\x2d\x0b\x65\x06\x25\x06\x6e\x07\x00\x00\x00\x00\x00\x00\xb4\x05\xca\x05\x00\x00\xc8\x05\x1f\x02\xc4\x05\x00\x00\x00\x00\xef\x00\xef\x00\x00\x00\xc0\x05\xc9\x05\xbf\x05\x31\x01\xbe\x05\xfe\x05\xbb\x05\xb1\x05\x0d\x04\x00\x00\x00\x00\x00\x00\x91\x0f\xdb\x08\x00\x00\xba\x05\x00\x00\x0a\x0b\x8e\x0f\x39\x04\xd3\x00\x00\x00\xaa\x08\x6c\x08\xc5\x09\x00\x00\xe3\x0a\x3d\x07\x25\x06\x02\x07\x00\x0a\x00\x0a\x00\x0a\xb6\x05\xe3\x0a\xd1\x06\x25\x06\x96\x06\xfc\x05\xf7\x05\xe2\x0a\x42\x08\xb2\x05\xe2\x0a\x00\x00\x9b\x09\x00\x0a\x00\x0a\xa8\x05\xa0\x05\xee\x05\x74\x05\x00\x00\xb7\x02\x00\x0a\x00\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x42\x08\x00\x0a\x42\x08\xe3\x0a\xe9\x05\xa4\x05\x12\x04\x3c\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9b\x05\x98\x05\x82\x00\xd0\x00\x8d\x05\x8d\x05\xc0\x0a\x86\x05\x88\x02\x88\x02\x88\x02\x84\x05\x84\x05\x84\x05\x84\x05\x8c\x05\x8c\x05\x8c\x05\x89\x05\xd4\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x88\x05\xe4\xff\x81\x05\x80\x05\x7f\x05\x7e\x05\x7d\x05\x7c\x05\x7b\x05\x77\x05\x76\x05\x76\x05\x76\x05\x76\x05\x76\x05\x76\x05\x76\x05\xc6\x05\x98\x0a\x85\x05\xbf\x0a\x7f\x01\x00\x00\x00\x00\x00\x00\x00\x00\xff\x00\x00\x00\x00\x00\xff\x00\xff\x00\x00\x00\xca\x03\x97\x0a\x74\x0a\x74\x0a\x00\x00\x00\x00\x74\x0a\x74\x0a\x00\x00\x75\x0a\x71\x05\x00\x00\x71\x05\x00\x00\x00\x00\x00\x00\x74\x05\x00\x00\x00\x00\xd6\x00\x42\x08\x42\x08\xbd\x05\x00\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x0a\x00\x0a\x00\x0a\x10\x00\x42\x08\x7a\x05\x6d\x05\x00\x00\x79\x05\x6a\x05\x67\x05\x62\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x42\x08\x42\x08\x00\x0a\x66\x05\xef\x00\x68\x05\x62\x05\xef\x00\x65\x05\x30\x01\x61\x05\x00\x00\xe2\x00\x3d\x01\x5f\x05\x5e\x05\x5d\x05\x00\x00\x00\x0a\x00\x0a\x00\x00\x00\x0a\x00\x0a\x4c\x0a\x5c\x05\x4c\x0a\x11\x08\xd3\x07\x60\x09\x00\x00\x00\x00\x5b\x05\x35\x00\x00\x00\xe5\x03\x00\x00\x00\x00\xa9\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa9\x07\x00\x00\x00\x00\x4d\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc6\x00\x62\x01\x66\x00\x62\x01\x00\x0a\x00\x00\x00\x0a\xa9\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x51\x05\x4a\x05\x00\x00\xa9\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa9\x07\x00\x00\x00\x00\x00\x00\x4e\x05\xde\x00\x00\x00\x48\x05\x5a\x05\x00\x00\x3d\x00\x29\x0a\x4d\x0a\x0d\x03\xe5\x05\x29\x0a\x97\x05\x29\x0a\x1d\x00\xb9\x00\x9f\x00\x9a\x00\x00\x0a\x00\x00\xca\x03\x1b\x05\x00\x00\x3d\x00\x34\x01\x5e\x01\xd5\xff\xd5\xff\xf2\xff\x00\x00\x00\x00\x00\x00\x29\x03\x00\x00\x00\x00\x00\x00\x54\x05\xed\xff\xed\xff\x00\x00\x00\x00\x16\x05\xa9\x07\x11\x05\x53\x05\x45\x05\x00\x00\x41\x05\x41\x05\x41\x05\x32\x05\x30\x05\x27\x05\x43\x05\x00\x00\x00\x00\x00\x00\x00\x00\x40\x05\x00\x00\x34\x05\x2d\x05\x22\x05\x22\x05\x1f\x05\x20\x05\x00\x00\x00\x00\x1e\x05\x1c\x05\x00\x00\x00\x00\x00\x00\x00\x00\x19\x05\x18\x05\x00\x00\x10\x05\x17\x05\x15\x05\x12\x05\x00\x00\x00\x00\x00\x00\x00\x00\xa9\x07\x09\x05\x13\x05\x07\x05\x08\x05\x0d\x05\x06\x05\x00\x00\x06\x05\x00\x00\xd5\xff\x05\x05\xfe\x04\x60\x00\x00\x00\xfe\x04\xfe\x04\xfe\x04\xfe\x04\x00\x00\xca\x03\xa9\x07\x00\x00\x48\x00\x02\x05\xa9\x07\x01\x05\xa9\x07\x01\x05\xa9\x07\xff\x04\xe5\x03\x00\x00\xff\x04\x00\x00\x60\x00\x00\x00\x00\x00\x0d\x03\x00\x00\x00\x00\x04\x05\x03\x05\x00\x05\x00\x00\x00\x00\xfb\x04\x00\x00\xea\x04\xa9\x07\x00\x00\x35\x05\x33\x05\x00\x00\x00\x00\x26\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0d\x03\x00\x00\x00\x00\xe7\x04\xe7\x04\x00\x00\x00\x00\xe5\x03\x90\x00\x2d\x00\x2d\x00\x00\x00\x0d\x03\x00\x00\x2a\x0a\x0d\x03\x00\x00\xc8\x04\x00\x00\x00\x00\x0a\x00\xbc\x04\x00\x00\xb7\x04\x00\x00\xcd\x03\x00\x00\x00\x00\xe6\x04\x60\x00\xe5\x04\x60\x00\xca\x03\xca\x03\x00\x00\xde\x04\x00\x00\xe9\x04\xed\xff\x00\x00\x87\x04\xed\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7c\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7a\x04\x00\x00\xd9\x04\x77\x04\xd8\x04\x00\x00\x00\x00\x00\x00\xca\x03\xca\x03\xca\x03\xca\x03\x00\x00\x3d\x00\x3d\x00\x10\x00\xd7\x04\x00\x00\x00\x00\x78\x04\x72\x04\x00\x00\x72\x04\x00\x00\x00\x00\xa5\x05\x00\x00\x00\x00\x7b\x04\x76\x04\x00\x00\x71\x04\x70\x04\x63\x04\x6b\x04\x74\x04\x9f\x04\x00\x00\x00\x00\x0d\x03\x00\x00\x00\x00\x00\x00\x56\x04\x56\x04\x7e\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2d\x00\x60\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2a\x05\x00\x00\x74\x05\x00\x00\x00\x00\x00\x00\x00\x00\x4e\x04\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x3d\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x74\x05\x00\x00\x10\x00\x00\x00\x00\x00"#--happyGotoOffsets :: HappyAddr-happyGotoOffsets = HappyA# "\x31\x04\xa2\x0f\x89\x04\x85\x04\x82\x04\x00\x00\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xae\x08\x86\x0f\x00\x00\x00\x00\xe6\x03\xfa\x03\xa5\x01\x00\x00\x00\x00\xe3\x01\x6f\x04\x6d\x04\x00\x00\x00\x00\x4d\x03\x00\x00\x00\x00\x00\x00\x2a\x04\x00\x00\x00\x00\x70\x01\x0f\x01\xd2\x0b\x0c\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x04\x68\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe9\x03\x06\x02\x00\x00\x00\x00\x00\x00\x1f\x04\x6a\x0f\x00\x00\x00\x00\x00\x00\x4c\x03\x00\x00\x81\x00\x03\x00\x00\x00\x84\x01\x47\x0c\x94\x0b\x00\x00\x2a\x04\xd8\x06\xaf\x0b\xef\x0b\x44\x07\x1f\x0d\x02\x0d\x00\x00\xef\x02\x4e\x0f\x3a\x0d\x32\x0f\x00\x00\x00\x00\xe4\x03\x16\x0f\x00\x00\xc6\x03\x00\x00\x84\x01\xfb\x0c\xde\x0c\x00\x00\x1a\x00\x00\x00\x48\x03\x00\x00\x00\x00\xd7\x0c\xba\x0c\x00\x00\x00\x00\x00\x00\x00\x00\xfa\x0e\x60\x02\xde\x0e\x87\x03\x27\x04\x00\x00\x20\x04\x66\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x65\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xdf\x03\xe7\x03\x06\x02\x1c\x00\x5c\x04\x50\x04\xfa\x00\xd3\x03\x42\x04\x3e\x04\x2c\x04\xa3\x03\x9c\x03\x99\x03\x8d\x03\x0a\x04\x03\x04\xf7\x03\xb7\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x91\x03\x00\x00\xe2\x03\x00\x00\x00\x00\x94\x03\x00\x00\x00\x00\x00\x00\x83\x03\x7a\x03\x78\x03\x70\x03\x58\x03\x49\x03\x45\x03\x3b\x03\xf0\x02\x7e\x02\x00\x00\x7b\x00\x98\x02\x00\x00\x00\x00\x00\x00\x00\x00\x3b\x02\x00\x00\x00\x00\xe4\x01\xbf\x01\x00\x00\x18\x00\x4a\x03\x28\x03\xd5\x02\x00\x00\x00\x00\xd2\x02\xb0\x02\x00\x00\x9d\x00\x2c\x03\x00\x00\x1e\x00\x00\x00\x00\x00\x00\x00\xd0\x02\x00\x00\x00\x00\xea\x02\xc2\x0e\xa6\x0e\xe8\x02\x1b\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05\x02\xf3\x05\xb3\x0c\x96\x0c\x1e\x03\x8a\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x0d\x00\x00\x00\x13\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6e\x0e\x52\x0e\xe8\x01\x00\x00\x11\x03\x00\x00\x00\x00\xec\x02\x00\x00\x00\x00\x00\x00\x00\x00\x10\x03\x02\x03\x00\x00\x00\x00\x00\x00\x00\x00\x8f\x0c\x72\x0c\x00\x00\x6b\x0c\x4e\x0c\x5f\x02\x00\x00\x5c\x02\x84\x01\x76\x0b\x69\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xea\x01\x00\x00\x00\x00\x36\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1a\x0e\x00\x00\x00\x00\x98\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe9\x02\x00\x00\xdf\x02\x70\x06\x00\x00\x30\x06\xfe\x0d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\xe2\x0d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc6\x0d\x00\x00\x00\x00\x00\x00\xa1\x03\x19\x00\x00\x00\xea\x03\x00\x00\x00\x00\xec\x03\x5a\x02\x95\x00\x6c\x04\x3a\x0d\x09\x02\x00\x00\xe7\x01\x00\x00\x00\x00\x00\x00\x00\x00\x29\x0c\x00\x00\xaf\x02\x00\x00\x00\x00\xd5\x03\x00\x00\xdc\x02\x83\x02\x3c\x02\xa0\x00\x00\x00\x00\x00\x00\x00\x41\x02\x00\x00\x00\x00\x00\x00\x00\x00\x74\x03\x6c\x03\x00\x00\x00\x00\x00\x00\xaa\x0d\x96\x02\x79\x02\x00\x00\x00\x00\x95\x02\x86\x02\x84\x02\x00\x00\x4f\x02\x4e\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2a\x02\x26\x02\x00\x00\x15\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0b\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x8e\x0d\x00\x00\x00\x00\xb8\x01\x00\x00\x00\x00\x89\x01\x00\x00\xad\xff\x00\x00\x8f\x01\x00\x00\xcc\x01\xc1\x01\x00\x00\xab\x03\xa7\x03\xa2\x03\x4f\x03\x00\x00\xb8\x00\x72\x0d\x00\x00\x00\x00\x44\x01\x56\x0d\x92\x01\x07\x0a\x8b\x01\xa2\x09\x06\x03\x20\x00\x00\x00\xf7\x02\x00\x00\xab\x01\x00\x00\x00\x00\x8e\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfa\xff\xb0\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x78\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x67\x04\x00\x00\x00\x00\xf1\x02\x8b\x02\x00\x00\x00\x00\xff\xff\x55\x01\x0d\x01\xd7\x00\x00\x00\x62\x04\x00\x00\x3b\x00\x15\x04\x00\x00\x00\x00\x00\x00\x00\x00\xfd\xff\x00\x00\x00\x00\x00\x00\x00\x00\xfc\xff\x00\x00\x00\x00\x00\x00\xa0\x01\x00\x00\x1c\x01\xae\x02\x8d\x02\x00\x00\x32\x01\x00\x00\x00\x00\xd8\x02\x00\x00\x00\x00\xa2\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x13\x01\x00\x00\x0e\x01\x00\x00\x00\x00\x00\x00\x7c\x02\x20\x02\xa2\x00\x2c\x00\x00\x00\xbf\x02\x6c\x02\x1b\x01\xfe\x00\x00\x00\x00\x00\x57\x00\xd4\x00\x00\x00\x85\x00\x00\x00\x00\x00\x3a\x0d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf8\x00\x00\x00\xf1\x00\x00\x00\x00\x00\x00\x00\xdd\x00\x00\x00\xbc\x03\x00\x00\x00\x00\x00\x00\xc2\x00\x84\x00\x51\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xba\x00\x5a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x68\x01\x00\x00\x58\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3e\x00\x4d\x01\x34\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\x01\x00\x00\x0e\x00\x00\x00\x00\x00"#--happyDefActions :: HappyAddr-happyDefActions = HappyA# "\xfa\xff\x00\x00\x00\x00\x00\x00\xfc\xff\x00\x00\xa4\xfe\x7f\xff\x59\xff\x00\x00\x6d\xff\x6c\xff\x6a\xff\x69\xff\x66\xff\x00\x00\x47\xff\x46\xff\x64\xff\x00\x00\x00\x00\x3f\xff\x3d\xff\x00\x00\x00\x00\x55\xff\x54\xff\x00\x00\x00\x00\x00\x00\x53\xff\x52\xff\x00\x00\x51\xff\x50\xff\x00\x00\x00\x00\x56\xff\x57\xff\x00\x00\xa4\xfe\x00\x00\x00\x00\x97\xff\x80\xff\x58\xff\x00\x00\x00\x00\x79\xff\x00\x00\x78\xff\x00\x00\x5a\xff\x4c\xff\x00\x00\x00\x00\x94\xff\x00\x00\x00\x00\x00\x00\x77\xff\x00\x00\x00\x00\x00\x00\x00\x00\xa5\xfe\x4d\xff\x7d\xff\x0f\xff\x23\xff\x00\x00\x5e\xff\x00\x00\x2e\xff\x2b\xff\x24\xff\x00\x00\x00\x00\x7c\xff\xa4\xfe\x00\x00\x00\x00\x4a\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x61\xff\x5d\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14\xff\x00\x00\x00\x00\x15\xff\x10\xff\xa4\xfe\x00\x00\x00\x00\x00\x00\x45\xff\x00\x00\xa4\xfe\x3e\xff\x00\x00\x00\x00\x00\x00\x40\xff\x71\xff\x68\xff\x5c\xff\x00\x00\x00\x00\x00\x00\x00\x00\xeb\xfe\x00\x00\xcc\xfe\x5c\xfe\xe4\xfe\xe3\xfe\xe2\xfe\xe1\xfe\xe0\xfe\xdf\xfe\xe5\xfe\xde\xfe\xdd\xfe\xdc\xfe\xdb\xfe\xda\xfe\xd9\xfe\xd2\xfe\xd4\xfe\xd3\xfe\xd8\xfe\xd7\xfe\xd6\xfe\xa0\xff\xd5\xfe\x96\xfe\x85\xfe\x95\xfe\x94\xfe\x93\xfe\x92\xfe\x90\xfe\x91\xfe\x8f\xfe\x8e\xfe\x8d\xfe\x8a\xfe\x87\xfe\x88\xfe\x89\xfe\x86\xfe\x8c\xfe\x8b\xfe\x5a\xfe\x97\xfe\x00\x00\x00\x00\xa5\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xef\xfe\x00\x00\xfb\xff\xf9\xff\xf8\xff\xf7\xff\xf6\xff\xf5\xff\xf4\xff\xf3\xff\xf2\xff\xf1\xff\xf0\xff\xef\xff\xee\xff\xed\xff\xec\xff\xeb\xff\xea\xff\xe9\xff\xe8\xff\xe7\xff\xe6\xff\xe5\xff\xe4\xff\xe3\xff\xe2\xff\xe1\xff\xe0\xff\xdf\xff\xde\xff\xdd\xff\xdc\xff\xdb\xff\xda\xff\xd9\xff\xd8\xff\xd7\xff\xd6\xff\xd5\xff\xd4\xff\xcc\xff\xcb\xff\xca\xff\xc9\xff\xc8\xff\xc7\xff\xd3\xff\xd2\xff\xd1\xff\xd0\xff\xcf\xff\xce\xff\xcd\xff\xc6\xff\xc5\xff\xc4\xff\xc3\xff\xc2\xff\xc1\xff\xc0\xff\xbf\xff\xbe\xff\xbd\xff\xbc\xff\xbb\xff\xba\xff\xb9\xff\xb8\xff\xb7\xff\xb6\xff\xb5\xff\xb4\xff\xb3\xff\xb2\xff\xb1\xff\xb0\xff\xaf\xff\xae\xff\xad\xff\xac\xff\xab\xff\xaa\xff\xa9\xff\xa8\xff\xa7\xff\xa6\xff\xa5\xff\xa4\xff\xa3\xff\xa2\xff\x76\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xeb\xfe\x00\x00\x00\x00\xb5\xfe\x00\x00\xbb\xfe\xbc\xfe\xbd\xfe\xbe\xfe\x00\x00\x98\xff\x99\xff\x00\x00\x00\x00\xbf\xfe\x00\x00\x11\xff\x11\xff\x11\xff\x7f\xff\x7e\xff\x11\xff\x11\xff\x98\xfe\xa0\xfe\x00\x00\xb9\xfe\x00\x00\xba\xfe\xa1\xff\x9f\xff\xa4\xfe\x9c\xff\x9b\xff\xe9\xfe\x00\x00\x00\x00\xed\xfe\x00\x00\x4b\xff\x6e\xff\x6b\xff\x6f\xff\x78\xff\x64\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x44\xff\x43\xff\x45\xff\x79\xff\x00\x00\x77\xff\x17\xff\x18\xff\x70\xff\x16\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1e\xff\x00\x00\x19\xff\x00\x00\x00\x00\x21\xff\x20\xff\x22\xff\x0e\xff\x00\x00\x00\x00\x0d\xff\x00\x00\x00\x00\x2a\xff\x26\xff\x2b\xff\xa4\xfe\x00\x00\x00\x00\x2f\xff\x67\xff\x25\xff\x00\x00\x33\xff\x00\x00\x36\xff\x4e\xff\x00\x00\x93\xff\x35\xff\x4f\xff\x34\xff\x5b\xff\x00\x00\x31\xff\x30\xff\xa0\xfe\x32\xff\x28\xff\x27\xff\x29\xff\x2d\xff\x2c\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x5f\xff\x00\x00\x00\x00\x3c\xff\x3a\xff\x3b\xff\x39\xff\x37\xff\x38\xff\x60\xff\x62\xff\x63\xff\x0b\xff\x0c\xff\x00\x00\x00\x00\x49\xff\x00\x00\x65\xff\x60\xfe\x9d\xff\x9e\xff\xea\xfe\xf1\xfe\x00\x00\xce\xfe\xcd\xfe\xcf\xfe\x00\x00\x00\x00\x5d\xfe\x95\xff\x00\x00\x70\xfe\x00\x00\x11\xff\xa0\xfe\x04\xff\x00\x00\x11\xff\x00\x00\x11\xff\x00\x00\x00\x00\x00\x00\x00\x00\x45\xff\x91\xff\x8d\xff\x00\x00\x6d\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7a\xff\xc2\xfe\xc1\xfe\xc0\xfe\x00\x00\xb1\xfe\xaf\xfe\xaa\xfe\x00\x00\x00\x00\x00\x00\xa6\xfe\xb4\xfe\x00\x00\x00\x00\xef\xfe\xed\xfe\x00\x00\x72\xff\x76\xff\x76\xff\x76\xff\x00\x00\x00\x00\x76\xff\x00\x00\x73\xff\x76\xfe\x77\xfe\x78\xfe\x00\x00\x73\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x76\xff\x75\xff\x84\xfe\x00\x00\x00\x00\x81\xfe\x74\xfe\x79\xfe\x75\xfe\x00\x00\x00\x00\x74\xff\x76\xff\x00\x00\x00\x00\x00\x00\x7a\xfe\xf0\xfe\xee\xfe\xb8\xfe\x00\x00\x00\x00\xa8\xfe\x00\x00\x00\x00\xa8\xfe\x00\x00\xb0\xfe\x00\x00\x7b\xff\x8f\xff\x00\x00\x00\x00\x00\x00\x92\xff\x00\x00\x00\x00\x00\x00\x00\x00\x6f\xfe\x00\x00\x00\x00\x8e\xff\x7f\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x13\xff\x00\x00\x12\xff\x00\x00\xa2\xfe\x06\xff\x04\xff\x02\xff\x01\xff\x00\x00\x00\x00\x00\x00\x03\xff\x9f\xfe\x00\x00\x72\xfe\x00\x00\x00\x00\x96\xff\x00\x00\x00\x00\x5e\xfe\xe8\xfe\x00\x00\xec\xfe\x41\xff\x42\xff\x48\xff\x1f\xff\x1e\xff\x1d\xff\x1c\xff\x1a\xff\x1b\xff\x09\xff\x0a\xff\x07\xff\x08\xff\x04\xff\xa3\xfe\x5f\xfe\x00\x00\x00\x00\xd1\xfe\x71\xfe\x00\x00\x9a\xff\xf5\xfe\xf5\xfe\x05\xff\x04\xff\x99\xfe\xa0\xfe\x04\xff\x9a\xfe\xc7\xfe\x6b\xfe\xc9\xfe\x00\x00\x00\x00\xc8\xfe\xc4\xfe\xc5\xfe\x00\x00\xd0\xfe\x6e\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x8b\xff\x89\xff\x90\xff\xb7\xfe\xb3\xfe\x00\x00\x00\x00\xad\xfe\x00\x00\x00\x00\xae\xfe\xb6\xfe\x7b\xfe\x7c\xfe\x7e\xfe\x00\x00\x7f\xfe\x80\xfe\x82\xfe\x83\xfe\x7d\xfe\x00\x00\xa8\xfe\x00\x00\x00\x00\x00\x00\xb2\xfe\x8a\xff\x8c\xff\x85\xff\x87\xff\x81\xff\x83\xff\x6a\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x62\xfe\x61\xfe\x00\x00\x00\x00\x6c\xfe\x00\x00\x9c\xfe\x9d\xfe\x00\x00\xa1\xfe\xf7\xfe\xf3\xfe\x00\x00\xf4\xfe\x00\x00\x00\x00\x00\x00\x00\x00\xfb\xfe\x00\x00\x9a\xff\xfd\xfe\x04\xff\xe7\xfe\xe6\xfe\x9b\xfe\x00\x00\x00\x00\x9a\xff\xfe\xfe\xf9\xfe\xff\xfe\xf6\xfe\x00\xff\x00\x00\x00\x00\xcb\xfe\xca\xfe\xc6\xfe\xc3\xfe\x67\xfe\x66\xfe\xa4\xfe\x69\xfe\xa4\xfe\x84\xff\x82\xff\x88\xff\x86\xff\x00\x00\xab\xfe\xa7\xfe\xac\xfe\xa9\xfe\x00\x00\x00\x00\x00\x00\x9e\xfe\xf2\xfe\xfc\xfe\xfa\xfe\xf8\xfe\x63\xfe\x65\xfe\xa4\xfe\x68\xfe\x00\x00\x64\xfe"#--happyCheck :: HappyAddr-happyCheck = HappyA# "\xff\xff\x05\x00\x05\x00\x09\x00\x0a\x00\x09\x00\x09\x00\x0a\x00\x09\x00\x25\x00\x00\x00\x0f\x00\x09\x00\x60\x00\x0f\x00\x10\x00\x00\x00\x09\x00\x65\x00\x05\x00\x11\x00\x40\x00\x09\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x03\x00\x09\x00\x09\x00\x09\x00\x0c\x00\x09\x00\x0e\x00\x09\x00\x0a\x00\x09\x00\x55\x00\x0f\x00\x10\x00\x25\x00\x26\x00\x0f\x00\x10\x00\x24\x00\x25\x00\x26\x00\x47\x00\x09\x00\x44\x00\x02\x00\x0c\x00\x05\x00\x0e\x00\x57\x00\x0f\x00\x00\x00\x24\x00\x25\x00\x26\x00\x45\x00\x55\x00\x05\x00\x09\x00\x4b\x00\x4a\x00\x55\x00\x4b\x00\x4d\x00\x0f\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x51\x00\x21\x00\x22\x00\x23\x00\x55\x00\x43\x00\x51\x00\x66\x00\x67\x00\x4c\x00\x0b\x00\x6a\x00\x6b\x00\x69\x00\x4b\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x80\x00\x05\x00\x41\x00\x82\x00\x4b\x00\x09\x00\x55\x00\x87\x00\x09\x00\x6c\x00\x8a\x00\x0f\x00\x6c\x00\x69\x00\x09\x00\x43\x00\x11\x00\x09\x00\x51\x00\x52\x00\x48\x00\x0f\x00\x11\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x84\x00\x03\x00\x09\x00\x0f\x00\x82\x00\x09\x00\x03\x00\x68\x00\x0f\x00\x2a\x00\x09\x00\x0f\x00\x42\x00\x09\x00\x2f\x00\x09\x00\x0f\x00\x4d\x00\x0c\x00\x4f\x00\x0e\x00\x11\x00\x12\x00\x38\x00\x39\x00\x4f\x00\x21\x00\x22\x00\x23\x00\x21\x00\x22\x00\x23\x00\x03\x00\x45\x00\x21\x00\x22\x00\x23\x00\x09\x00\x4a\x00\x09\x00\x0c\x00\x4d\x00\x0e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x09\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x55\x00\x56\x00\x03\x00\x5f\x00\x4b\x00\x42\x00\x86\x00\x66\x00\x67\x00\x09\x00\x42\x00\x6a\x00\x6b\x00\x07\x00\x0f\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x80\x00\x09\x00\x09\x00\x42\x00\x42\x00\x68\x00\x44\x00\x0f\x00\x68\x00\x09\x00\x8a\x00\x09\x00\x4c\x00\x68\x00\x81\x00\x09\x00\x42\x00\x0f\x00\x85\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x44\x00\x4f\x00\x09\x00\x44\x00\x09\x00\x42\x00\x43\x00\x44\x00\x22\x00\x4a\x00\x0f\x00\x4c\x00\x05\x00\x4e\x00\x44\x00\x41\x00\x15\x00\x55\x00\x56\x00\x0b\x00\x55\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x55\x00\x52\x00\x45\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x4a\x00\x2c\x00\x4d\x00\x4d\x00\x4f\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x44\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x42\x00\x43\x00\x44\x00\x05\x00\x06\x00\x55\x00\x81\x00\x66\x00\x67\x00\x07\x00\x85\x00\x6a\x00\x6b\x00\x07\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x80\x00\x09\x00\x42\x00\x65\x00\x43\x00\x66\x00\x67\x00\x0f\x00\x65\x00\x09\x00\x8a\x00\x8b\x00\x4b\x00\x41\x00\x41\x00\x4f\x00\x4c\x00\x11\x00\x4e\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x4f\x00\x09\x00\x52\x00\x52\x00\x3f\x00\x40\x00\x41\x00\x0f\x00\x3f\x00\x40\x00\x41\x00\x65\x00\x09\x00\x15\x00\x2a\x00\x0c\x00\x0d\x00\x2d\x00\x2e\x00\x2f\x00\x30\x00\x1d\x00\x1e\x00\x1f\x00\x42\x00\x21\x00\x22\x00\x23\x00\x38\x00\x39\x00\x4c\x00\x0b\x00\x4e\x00\x45\x00\x09\x00\x4d\x00\x2c\x00\x4f\x00\x4a\x00\x55\x00\x0f\x00\x4d\x00\x0b\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x22\x00\x09\x00\x4a\x00\x86\x00\x4c\x00\x0b\x00\x4e\x00\x66\x00\x67\x00\x11\x00\x12\x00\x6a\x00\x6b\x00\x55\x00\x09\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x80\x00\x09\x00\x66\x00\x67\x00\x09\x00\x09\x00\x65\x00\x0f\x00\x09\x00\x09\x00\x8a\x00\x09\x00\x11\x00\x11\x00\x12\x00\x0f\x00\x11\x00\x0f\x00\x10\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x81\x00\x2a\x00\x09\x00\x09\x00\x85\x00\x2a\x00\x09\x00\x81\x00\x0f\x00\x0f\x00\x10\x00\x85\x00\x35\x00\x36\x00\x11\x00\x38\x00\x39\x00\x65\x00\x37\x00\x38\x00\x39\x00\x16\x00\x1d\x00\x1e\x00\x1f\x00\x45\x00\x21\x00\x22\x00\x23\x00\x09\x00\x4a\x00\x16\x00\x0c\x00\x4d\x00\x0e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x2a\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x19\x00\x37\x00\x38\x00\x39\x00\x19\x00\x09\x00\x09\x00\x66\x00\x67\x00\x0c\x00\x0d\x00\x6a\x00\x6b\x00\x11\x00\x12\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x80\x00\x09\x00\x43\x00\x09\x00\x16\x00\x09\x00\x17\x00\x0f\x00\x09\x00\x09\x00\x8a\x00\x11\x00\x4d\x00\x11\x00\x4f\x00\x0f\x00\x11\x00\x05\x00\x06\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x2a\x00\x09\x00\x2a\x00\x09\x00\x0c\x00\x2a\x00\x0e\x00\x2f\x00\x09\x00\x0f\x00\x2f\x00\x0c\x00\x0d\x00\x37\x00\x38\x00\x39\x00\x38\x00\x39\x00\x09\x00\x38\x00\x39\x00\x0c\x00\x16\x00\x0e\x00\x16\x00\x45\x00\x20\x00\x21\x00\x22\x00\x23\x00\x4a\x00\x62\x00\x63\x00\x4d\x00\x65\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x16\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x09\x00\x09\x00\x09\x00\x0c\x00\x0c\x00\x0e\x00\x0e\x00\x66\x00\x67\x00\x47\x00\x11\x00\x6a\x00\x6b\x00\x05\x00\x06\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x80\x00\x09\x00\x2a\x00\x09\x00\x46\x00\x55\x00\x09\x00\x0f\x00\x58\x00\x46\x00\x8a\x00\x11\x00\x49\x00\x09\x00\x11\x00\x37\x00\x38\x00\x39\x00\x0b\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x0b\x00\x3f\x00\x40\x00\x0b\x00\x09\x00\x61\x00\x62\x00\x63\x00\x2a\x00\x65\x00\x0f\x00\x2a\x00\x4a\x00\x4a\x00\x4c\x00\x4c\x00\x4e\x00\x4e\x00\x64\x00\x65\x00\x06\x00\x37\x00\x38\x00\x39\x00\x37\x00\x38\x00\x39\x00\x20\x00\x21\x00\x22\x00\x23\x00\x88\x00\x89\x00\x45\x00\x06\x00\x0a\x00\x0b\x00\x0c\x00\x4a\x00\x0e\x00\x0b\x00\x4d\x00\x0b\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x05\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x47\x00\x4a\x00\x09\x00\x4c\x00\x49\x00\x4e\x00\x09\x00\x66\x00\x67\x00\x48\x00\x11\x00\x6a\x00\x6b\x00\x64\x00\x65\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x80\x00\x09\x00\x2a\x00\x09\x00\x19\x00\x09\x00\x09\x00\x0f\x00\x09\x00\x0a\x00\x8a\x00\x11\x00\x0f\x00\x11\x00\x19\x00\x37\x00\x38\x00\x39\x00\x19\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x43\x00\x20\x00\x21\x00\x22\x00\x23\x00\x19\x00\x09\x00\x4a\x00\x2a\x00\x4c\x00\x2a\x00\x4e\x00\x0f\x00\x88\x00\x89\x00\x2f\x00\x13\x00\x14\x00\x55\x00\x88\x00\x89\x00\x37\x00\x38\x00\x39\x00\x38\x00\x39\x00\x1d\x00\x1e\x00\x1f\x00\x19\x00\x21\x00\x22\x00\x23\x00\x45\x00\x88\x00\x89\x00\x09\x00\x19\x00\x4a\x00\x19\x00\x2b\x00\x4d\x00\x0f\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x18\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x16\x00\x21\x00\x22\x00\x23\x00\x09\x00\x0a\x00\x19\x00\x66\x00\x67\x00\x09\x00\x0a\x00\x6a\x00\x6b\x00\x09\x00\x0a\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x80\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x00\x00\x01\x00\x09\x00\x64\x00\x65\x00\x8a\x00\x06\x00\x07\x00\x08\x00\x09\x00\x11\x00\x64\x00\x65\x00\x05\x00\x06\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x09\x00\x21\x00\x22\x00\x2a\x00\x05\x00\x06\x00\x09\x00\x0a\x00\x11\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x19\x00\x36\x00\x46\x00\x38\x00\x39\x00\x09\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3f\x00\x40\x00\x3e\x00\x09\x00\x40\x00\x2a\x00\x29\x00\x2a\x00\x44\x00\x45\x00\x09\x00\x47\x00\x88\x00\x4c\x00\x4a\x00\x4e\x00\x4c\x00\x36\x00\x4e\x00\x38\x00\x39\x00\x51\x00\x55\x00\x53\x00\x88\x00\x55\x00\x56\x00\x88\x00\x58\x00\x00\x00\x01\x00\x09\x00\x88\x00\x89\x00\x88\x00\x06\x00\x07\x00\x08\x00\x09\x00\x11\x00\x00\x00\x01\x00\x09\x00\x08\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x0f\x00\x55\x00\x56\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x08\x00\x21\x00\x22\x00\x2a\x00\x08\x00\x21\x00\x22\x00\x23\x00\x2f\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x42\x00\x43\x00\x83\x00\x38\x00\x39\x00\x09\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x55\x00\x56\x00\x3e\x00\x09\x00\x40\x00\x88\x00\x81\x00\x04\x00\x44\x00\x45\x00\x06\x00\x47\x00\x4e\x00\x48\x00\x4a\x00\x88\x00\x4c\x00\x0b\x00\x4e\x00\x0b\x00\x09\x00\x51\x00\x09\x00\x53\x00\x01\x00\x55\x00\x56\x00\x44\x00\x58\x00\x06\x00\x07\x00\x08\x00\x88\x00\x4a\x00\x02\x00\x4c\x00\x01\x00\x4e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x03\x00\x0f\x00\x55\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x4b\x00\x21\x00\x22\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x55\x00\x0d\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x41\x00\x4b\x00\x3e\x00\x55\x00\x40\x00\x03\x00\x4b\x00\x41\x00\x44\x00\x45\x00\x03\x00\x47\x00\x4b\x00\x50\x00\x4a\x00\x4d\x00\x4c\x00\x55\x00\x4e\x00\x50\x00\x4f\x00\x51\x00\x03\x00\x53\x00\x46\x00\x55\x00\x56\x00\x54\x00\x58\x00\x59\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x01\x00\x55\x00\x55\x00\x55\x00\x46\x00\x06\x00\x07\x00\x08\x00\x55\x00\x4f\x00\x4f\x00\x03\x00\x50\x00\x03\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x43\x00\x55\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x4a\x00\x21\x00\x22\x00\x4a\x00\x4a\x00\x50\x00\x43\x00\x50\x00\x50\x00\x55\x00\x4f\x00\x4d\x00\x43\x00\x04\x00\x4f\x00\x43\x00\x49\x00\x55\x00\x55\x00\x42\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x54\x00\x57\x00\x3e\x00\x54\x00\x40\x00\x54\x00\x54\x00\x54\x00\x44\x00\x45\x00\x54\x00\x47\x00\x54\x00\x54\x00\x4a\x00\x01\x00\x4c\x00\x57\x00\x4e\x00\x57\x00\x06\x00\x07\x00\x08\x00\x53\x00\x57\x00\x55\x00\x56\x00\x54\x00\x58\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x57\x00\x54\x00\x57\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x54\x00\x21\x00\x22\x00\x54\x00\x57\x00\x54\x00\x03\x00\x47\x00\x42\x00\x55\x00\x50\x00\x55\x00\x4f\x00\x46\x00\x46\x00\x46\x00\x46\x00\x46\x00\x01\x00\x46\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x4b\x00\x4f\x00\x3e\x00\x4b\x00\x40\x00\x4f\x00\x4f\x00\x12\x00\x44\x00\x45\x00\x41\x00\x47\x00\x4f\x00\x43\x00\x4a\x00\x55\x00\x4c\x00\x04\x00\x4e\x00\x1e\x00\x1f\x00\x20\x00\x55\x00\x53\x00\x43\x00\x55\x00\x56\x00\x05\x00\x58\x00\x57\x00\x57\x00\x54\x00\x54\x00\x54\x00\x49\x00\x54\x00\x50\x00\x57\x00\x50\x00\x57\x00\x57\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x57\x00\x3b\x00\x55\x00\x55\x00\x3e\x00\x3f\x00\x40\x00\x01\x00\x51\x00\x50\x00\x44\x00\x45\x00\x50\x00\x47\x00\x49\x00\x05\x00\x4a\x00\x02\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x55\x00\x4e\x00\x12\x00\x46\x00\x02\x00\x55\x00\x56\x00\x09\x00\x58\x00\x02\x00\x49\x00\x46\x00\x50\x00\x0f\x00\x1e\x00\x1f\x00\x20\x00\x4b\x00\x09\x00\x15\x00\x4b\x00\x4b\x00\x42\x00\x42\x00\x59\x00\x55\x00\x4f\x00\x1d\x00\x1e\x00\x1f\x00\x4f\x00\x21\x00\x22\x00\x23\x00\x4f\x00\x46\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x2c\x00\x3b\x00\x50\x00\x43\x00\x3e\x00\x3f\x00\x40\x00\x01\x00\x59\x00\x48\x00\x44\x00\x45\x00\x50\x00\x47\x00\x59\x00\xff\xff\x4a\x00\xff\xff\x4c\x00\x4d\x00\x4e\x00\x4f\x00\xff\xff\xff\xff\x12\x00\xff\xff\x09\x00\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\x1e\x00\x1f\x00\x20\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\x31\x00\x32\x00\x33\x00\x3f\x00\x40\x00\x01\x00\xff\xff\xff\xff\x44\x00\x45\x00\xff\xff\x47\x00\x08\x00\xff\xff\x4a\x00\xff\xff\x4c\x00\x4d\x00\x4e\x00\x4f\x00\xff\xff\xff\xff\x12\x00\xff\xff\x09\x00\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\x1e\x00\x1f\x00\x20\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\xff\xff\xff\xff\x01\x00\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\x31\x00\x32\x00\x33\x00\x3f\x00\x40\x00\xff\xff\xff\xff\x12\x00\x44\x00\x45\x00\xff\xff\x47\x00\xff\xff\xff\xff\x4a\x00\x4b\x00\x4c\x00\xff\xff\x4e\x00\x1e\x00\x1f\x00\x20\x00\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\x01\x00\xff\xff\xff\xff\x3f\x00\x40\x00\xff\xff\xff\xff\xff\xff\x44\x00\x45\x00\xff\xff\x47\x00\xff\xff\xff\xff\x4a\x00\x09\x00\x4c\x00\x12\x00\x4e\x00\x4f\x00\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\x15\x00\x58\x00\x1e\x00\x1f\x00\x20\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\xff\xff\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x01\x00\x2c\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\xff\xff\xff\xff\xff\xff\x3f\x00\x40\x00\xff\xff\xff\xff\x12\x00\x44\x00\x45\x00\xff\xff\x47\x00\xff\xff\xff\xff\x4a\x00\x4b\x00\x4c\x00\xff\xff\x4e\x00\x1e\x00\x1f\x00\x20\x00\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\x01\x00\xff\xff\xff\xff\x3f\x00\x40\x00\xff\xff\xff\xff\xff\xff\x44\x00\x45\x00\xff\xff\x47\x00\xff\xff\xff\xff\x4a\x00\x09\x00\x4c\x00\x12\x00\x4e\x00\x4f\x00\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\x15\x00\x58\x00\x1e\x00\x1f\x00\x20\x00\xff\xff\xff\xff\xff\xff\x1d\x00\x1e\x00\x1f\x00\xff\xff\x21\x00\x22\x00\x23\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x00\x2c\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\xff\xff\xff\xff\xff\xff\x3f\x00\x40\x00\xff\xff\xff\xff\x12\x00\x44\x00\x45\x00\xff\xff\x47\x00\xff\xff\xff\xff\x4a\x00\x4b\x00\x4c\x00\xff\xff\x4e\x00\x1e\x00\x1f\x00\x20\x00\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\x01\x00\xff\xff\xff\xff\x3f\x00\x40\x00\xff\xff\xff\xff\xff\xff\x44\x00\x45\x00\xff\xff\x47\x00\xff\xff\xff\xff\x4a\x00\x09\x00\x4c\x00\x12\x00\x4e\x00\x4f\x00\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\x1e\x00\x1f\x00\x20\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x01\x00\xff\xff\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\x12\x00\xff\xff\xff\xff\x3f\x00\x40\x00\xff\xff\xff\xff\xff\xff\x44\x00\x45\x00\xff\xff\x47\x00\x1e\x00\x1f\x00\x4a\x00\xff\xff\x4c\x00\xff\xff\x4e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\xff\xff\xff\xff\xff\xff\x01\x00\x40\x00\xff\xff\xff\xff\xff\xff\x44\x00\x45\x00\x08\x00\x47\x00\xff\xff\xff\xff\x4a\x00\xff\xff\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x12\x00\x09\x00\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\x0f\x00\x58\x00\xff\xff\xff\xff\xff\xff\x1e\x00\x1f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\xff\xff\xff\xff\xff\xff\x01\x00\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\xff\xff\xff\xff\xff\xff\xff\xff\x40\x00\xff\xff\xff\xff\x12\x00\x44\x00\x45\x00\xff\xff\x47\x00\xff\xff\xff\xff\x4a\x00\x4b\x00\x4c\x00\xff\xff\x4e\x00\x1e\x00\x1f\x00\x20\x00\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\xff\xff\x01\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\x12\x00\xff\xff\xff\xff\x3f\x00\x40\x00\xff\xff\xff\xff\xff\xff\x44\x00\x45\x00\xff\xff\x47\x00\x1e\x00\x1f\x00\x4a\x00\xff\xff\x4c\x00\xff\xff\x4e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\xff\xff\xff\xff\xff\xff\x01\x00\x40\x00\xff\xff\xff\xff\xff\xff\x44\x00\x45\x00\x08\x00\x47\x00\xff\xff\xff\xff\x4a\x00\x09\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x12\x00\x0f\x00\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\xff\xff\x1e\x00\x1f\x00\xff\xff\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x00\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\xff\xff\xff\xff\xff\xff\xff\xff\x40\x00\xff\xff\xff\xff\x12\x00\x44\x00\x45\x00\xff\xff\x47\x00\xff\xff\xff\xff\x4a\x00\x4b\x00\x4c\x00\xff\xff\x4e\x00\x1e\x00\x1f\x00\x20\x00\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\xff\xff\x01\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\x12\x00\xff\xff\xff\xff\x3f\x00\x40\x00\xff\xff\xff\xff\xff\xff\x44\x00\x45\x00\xff\xff\x47\x00\x1e\x00\x1f\x00\x4a\x00\xff\xff\x4c\x00\xff\xff\x4e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\xff\xff\x01\x00\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\xff\xff\xff\xff\xff\xff\xff\xff\x40\x00\xff\xff\xff\xff\x12\x00\x44\x00\x45\x00\x46\x00\x47\x00\xff\xff\x49\x00\x4a\x00\xff\xff\x4c\x00\xff\xff\x4e\x00\x1e\x00\x1f\x00\x20\x00\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\xff\xff\x01\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\x12\x00\xff\xff\xff\xff\x3f\x00\x40\x00\xff\xff\xff\xff\xff\xff\x44\x00\x45\x00\xff\xff\x47\x00\x1e\x00\x1f\x00\x4a\x00\xff\xff\x4c\x00\xff\xff\x4e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\x01\x00\xff\xff\xff\xff\xff\xff\x40\x00\xff\xff\xff\xff\x08\x00\x44\x00\x45\x00\xff\xff\x47\x00\xff\xff\xff\xff\x4a\x00\x09\x00\x4c\x00\x12\x00\x4e\x00\x4f\x00\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\x1e\x00\x1f\x00\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x01\x00\xff\xff\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\x12\x00\xff\xff\xff\xff\xff\xff\x40\x00\xff\xff\xff\xff\xff\xff\x44\x00\x45\x00\xff\xff\x47\x00\x1e\x00\x1f\x00\x4a\x00\xff\xff\x4c\x00\xff\xff\x4e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\x01\x00\xff\xff\xff\xff\xff\xff\x40\x00\xff\xff\xff\xff\xff\xff\x44\x00\x45\x00\xff\xff\x47\x00\xff\xff\xff\xff\x4a\x00\x09\x00\x4c\x00\x12\x00\x4e\x00\x4f\x00\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\x1e\x00\x1f\x00\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\xff\xff\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\x12\x00\xff\xff\xff\xff\xff\xff\x40\x00\xff\xff\xff\xff\xff\xff\x44\x00\x45\x00\xff\xff\x47\x00\x1e\x00\x1f\x00\x4a\x00\xff\xff\x4c\x00\xff\xff\x4e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x12\x00\x36\x00\x37\x00\xff\xff\x39\x00\xff\xff\x3b\x00\xff\xff\xff\xff\x3f\x00\x40\x00\x40\x00\x1e\x00\x1f\x00\x44\x00\x44\x00\x45\x00\xff\xff\xff\xff\xff\xff\x4a\x00\x4a\x00\x4c\x00\x4c\x00\x4e\x00\x4e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x55\x00\x55\x00\x56\x00\xff\xff\x58\x00\x36\x00\x37\x00\xff\xff\x39\x00\x12\x00\x3b\x00\xff\xff\xff\xff\x3f\x00\x40\x00\x40\x00\xff\xff\xff\xff\x44\x00\x44\x00\x45\x00\x1e\x00\x1f\x00\xff\xff\x4a\x00\x4a\x00\x4c\x00\x4c\x00\x4e\x00\x4e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x55\x00\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\xff\xff\xff\xff\x12\x00\x36\x00\x37\x00\xff\xff\x39\x00\xff\xff\x3b\x00\xff\xff\xff\xff\x3f\x00\x40\x00\x40\x00\x1e\x00\x1f\x00\x44\x00\x44\x00\x45\x00\xff\xff\xff\xff\xff\xff\x4a\x00\x4a\x00\x4c\x00\x4c\x00\x4e\x00\x4e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x55\x00\x55\x00\x56\x00\xff\xff\x58\x00\x36\x00\x37\x00\xff\xff\x39\x00\x12\x00\x3b\x00\xff\xff\xff\xff\x3f\x00\x40\x00\x40\x00\xff\xff\xff\xff\x44\x00\x44\x00\x45\x00\x1e\x00\x1f\x00\xff\xff\x4a\x00\x4a\x00\x4c\x00\x4c\x00\x4e\x00\x4e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x55\x00\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\xff\xff\xff\xff\x12\x00\x36\x00\x37\x00\xff\xff\x39\x00\xff\xff\x3b\x00\xff\xff\xff\xff\x3f\x00\x40\x00\x40\x00\x1e\x00\x1f\x00\x44\x00\x44\x00\x45\x00\xff\xff\xff\xff\xff\xff\x4a\x00\x4a\x00\x4c\x00\x4c\x00\x4e\x00\x4e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x55\x00\x55\x00\x56\x00\xff\xff\x58\x00\x36\x00\x37\x00\xff\xff\x39\x00\x12\x00\x3b\x00\xff\xff\xff\xff\x3f\x00\x40\x00\x40\x00\xff\xff\xff\xff\x44\x00\x44\x00\x45\x00\x1e\x00\x1f\x00\xff\xff\x4a\x00\x4a\x00\x4c\x00\x4c\x00\x4e\x00\x4e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x55\x00\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\xff\xff\xff\xff\x12\x00\x36\x00\x37\x00\xff\xff\x39\x00\xff\xff\x3b\x00\xff\xff\xff\xff\x3f\x00\x40\x00\x40\x00\x1e\x00\x1f\x00\x44\x00\x44\x00\x45\x00\xff\xff\xff\xff\xff\xff\x4a\x00\x4a\x00\x4c\x00\x4c\x00\x4e\x00\x4e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x55\x00\x55\x00\x56\x00\xff\xff\x58\x00\x36\x00\x37\x00\xff\xff\x39\x00\x12\x00\x3b\x00\xff\xff\xff\xff\x3f\x00\x40\x00\x40\x00\xff\xff\xff\xff\x44\x00\x44\x00\x45\x00\x1e\x00\x1f\x00\xff\xff\x4a\x00\x4a\x00\x4c\x00\x4c\x00\x4e\x00\x4e\x00\xff\xff\xff\xff\x09\x00\xff\xff\x0b\x00\x55\x00\x55\x00\x56\x00\x0f\x00\x58\x00\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\x36\x00\x37\x00\xff\xff\x39\x00\xff\xff\x3b\x00\xff\xff\x1d\x00\x1e\x00\x1f\x00\x40\x00\x21\x00\x22\x00\x23\x00\x44\x00\x45\x00\xff\xff\x09\x00\xff\xff\xff\xff\x4a\x00\x2b\x00\x4c\x00\x0f\x00\x4e\x00\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x09\x00\xff\xff\x0b\x00\xff\xff\xff\xff\xff\xff\x0f\x00\x2b\x00\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\x31\x00\x32\x00\xff\xff\x34\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\xff\xff\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x09\x00\xff\xff\x0b\x00\xff\xff\xff\xff\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\xff\xff\x09\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x0f\x00\xff\xff\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\xff\xff\x09\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x0f\x00\xff\xff\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\xff\xff\x09\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x0f\x00\xff\xff\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1d\x00\x1e\x00\x1f\x00\xff\xff\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x09\x00\xff\xff\x0b\x00\xff\xff\x2b\x00\xff\xff\x0f\x00\x09\x00\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\x1d\x00\x1e\x00\x1f\x00\xff\xff\x21\x00\x22\x00\x23\x00\x1d\x00\x1e\x00\x1f\x00\xff\xff\x21\x00\x22\x00\x23\x00\x2b\x00\xff\xff\x09\x00\xff\xff\xff\xff\xff\xff\xff\xff\x2b\x00\x0f\x00\x09\x00\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\x1d\x00\x1e\x00\x1f\x00\xff\xff\x21\x00\x22\x00\x23\x00\x1d\x00\x1e\x00\x1f\x00\xff\xff\x21\x00\x22\x00\x23\x00\x2b\x00\xff\xff\x09\x00\xff\xff\xff\xff\xff\xff\xff\xff\x2b\x00\x0f\x00\x09\x00\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\x1d\x00\x1e\x00\x1f\x00\xff\xff\x21\x00\x22\x00\x23\x00\x1d\x00\x1e\x00\x1f\x00\xff\xff\x21\x00\x22\x00\x23\x00\x2b\x00\xff\xff\x09\x00\xff\xff\xff\xff\xff\xff\xff\xff\x2b\x00\x0f\x00\x09\x00\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\x1d\x00\x1e\x00\x1f\x00\xff\xff\x21\x00\x22\x00\x23\x00\x1d\x00\x1e\x00\x1f\x00\xff\xff\x21\x00\x22\x00\x23\x00\x2b\x00\xff\xff\x09\x00\xff\xff\xff\xff\xff\xff\xff\xff\x2b\x00\x0f\x00\x09\x00\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\x1d\x00\x1e\x00\x1f\x00\xff\xff\x21\x00\x22\x00\x23\x00\x1d\x00\x1e\x00\x1f\x00\xff\xff\x21\x00\x22\x00\x23\x00\x2b\x00\xff\xff\x09\x00\xff\xff\xff\xff\xff\xff\xff\xff\x2b\x00\x0f\x00\x09\x00\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\x1d\x00\x1e\x00\x1f\x00\xff\xff\x21\x00\x22\x00\x23\x00\x1d\x00\x1e\x00\x1f\x00\xff\xff\x21\x00\x22\x00\x23\x00\x2b\x00\xff\xff\x09\x00\xff\xff\xff\xff\xff\xff\xff\xff\x2b\x00\x0f\x00\xff\xff\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1d\x00\x1e\x00\x1f\x00\xff\xff\x21\x00\x22\x00\x23\x00\x09\x00\xff\xff\x0b\x00\xff\xff\xff\xff\xff\xff\x0f\x00\x2b\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\xff\xff\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x3f\x00\x40\x00\xff\xff\x3f\x00\x40\x00\x44\x00\xff\xff\x46\x00\x44\x00\xff\xff\x46\x00\x4a\x00\xff\xff\x4c\x00\x4a\x00\x4e\x00\x4c\x00\xff\xff\x4e\x00\x3f\x00\x40\x00\xff\xff\x55\x00\xff\xff\x44\x00\x55\x00\xff\xff\xff\xff\xff\xff\xff\xff\x4a\x00\xff\xff\x4c\x00\xff\xff\x4e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x55\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\x30\x00\x31\x00\x32\x00\x33\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"#--happyTable :: HappyAddr-happyTable = HappyA# "\x00\x00\x94\x02\x9d\x02\xbb\x01\xbc\x01\x07\x00\xbb\x01\xbc\x01\x37\x01\xf7\x01\xb1\x01\x08\x00\x43\x00\x76\x02\x38\x01\x61\x02\xb1\x01\x56\x01\x77\x02\xdc\x02\x73\x01\x1a\x02\x56\x01\x79\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x7a\x00\x10\x00\x11\x00\x12\x00\x2c\x02\xcb\x01\x40\x02\x56\x01\xcc\x01\x37\x01\xcd\x01\xbb\x01\xbc\x01\x37\x01\x2c\x00\x38\x01\x39\x01\x47\x02\x59\x01\x38\x01\x61\x02\xaa\x01\x58\x01\x59\x01\x11\x02\xcb\x01\x4f\x00\x56\x01\xcc\x01\xd7\x02\xc6\x02\xf8\x01\xa8\x02\xb1\x01\x57\x01\x58\x01\x59\x01\x7b\x00\xe0\x01\xda\x02\x07\x00\x59\x02\x7c\x00\x2c\x00\xbd\x01\x7d\x00\x08\x00\x7e\x00\x7f\x00\x80\x00\x81\x00\x95\x02\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\xb2\x01\x10\x00\x11\x00\xc0\x01\x2c\x00\x2d\x02\xb2\x01\x3e\x00\x8d\x00\xce\x01\xd2\x02\x8e\x00\x8f\x00\xaf\x02\xbd\x01\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\x55\x02\x45\x01\xbe\x01\x92\x01\x07\x00\x2c\x00\x96\x02\x43\x00\x41\x02\x97\x02\x08\x00\x3a\x01\x62\x02\x43\x00\xae\x01\x44\x00\xd5\x02\xb2\x01\x46\x01\x79\x00\x3e\x01\x76\x01\x79\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x7a\x00\x10\x00\x11\x00\x12\x00\xcf\x01\x26\x02\x07\x00\xae\x02\xbe\x01\x07\x00\x28\x02\xa0\x02\x08\x00\x79\x01\x07\x00\x08\x00\x8e\x01\x43\x00\xe0\x01\xcb\x01\x08\x00\x39\x00\xcc\x01\x3a\x00\xc7\x02\xd4\x01\x16\x02\x7b\x01\x65\x00\x51\x02\x10\x00\x11\x00\xc0\x01\x10\x00\x11\x00\xc0\x01\x2a\x02\x7b\x00\x10\x00\x11\x00\xc0\x01\xcb\x01\x7c\x00\xa3\x02\xcc\x01\x7d\x00\xcd\x01\x7e\x00\x7f\x00\x80\x00\x81\x00\xd6\x02\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x2c\x00\x2d\x00\xb9\x01\xe1\x01\xaf\x02\x27\x02\xbf\x02\x3e\x00\x8d\x00\xa3\x02\x29\x02\x8e\x00\x8f\x00\xb3\x02\xba\x01\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\x07\x00\xb7\x02\x2b\x02\xa4\x02\x3a\x02\xd3\x02\x08\x00\x53\x02\xb9\x02\x54\x01\x07\x00\x6e\x02\xc1\x01\x65\x02\xc0\x02\x8e\x01\x08\x00\xbd\x02\x79\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x7a\x00\x10\x00\x11\x00\x12\x00\x3c\x01\x53\x02\xa3\x02\x4f\x00\x07\x00\xa4\x02\xa5\x02\xa6\x02\x34\x01\x52\x01\x08\x00\x75\x01\xc1\x02\x76\x01\x3c\x01\x45\x01\x3a\x00\x2c\x00\x2d\x00\x90\x02\x2c\x00\x3b\x00\x0a\x00\x0b\x00\x3c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x2c\x00\x46\x01\x7b\x00\x13\x00\x14\x00\x15\x00\x16\x00\x7c\x00\x3d\x00\x39\x00\x7d\x00\x3a\x00\x7e\x00\x7f\x00\x80\x00\x81\x00\x4f\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\xa4\x02\xa8\x02\xa6\x02\xd8\x02\xd9\x02\x2c\x00\x65\x02\x3e\x00\x8d\x00\xa9\x02\xbe\x02\x8e\x00\x8f\x00\xa9\x02\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\x07\x00\x78\xff\xca\x02\x6a\xff\x3e\x00\x3f\x00\x08\x00\xcc\x02\x43\x00\xa4\x00\xa5\x00\x6a\xff\x45\x01\x45\x01\x78\xff\x1f\x02\x44\x00\x20\x02\x79\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x7a\x00\x10\x00\x11\x00\x12\x00\x9d\x01\x07\x00\x46\x01\x46\x01\xd4\x02\xab\x02\xac\x02\x08\x00\xaa\x02\xab\x02\xac\x02\x8d\x02\xcb\x01\x3a\x00\x45\x00\x17\x02\x75\x02\x46\x00\x47\x00\x48\x00\x49\x00\x5d\x01\x0d\x00\x0e\x00\x8e\x01\x10\x00\x11\x00\x50\x01\x4a\x00\x4b\x00\x1d\x02\x92\x02\x1e\x02\x7b\x00\x07\x00\x39\x00\x3d\x00\x3a\x00\x7c\x00\x2c\x00\x08\x00\x7d\x00\x5f\x02\x7e\x00\x7f\x00\x80\x00\x81\x00\xd0\x02\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x69\x00\x43\x00\xdd\x01\x6b\x02\xde\x01\x73\x02\xdf\x01\x3e\x00\x8d\x00\xd4\x01\xd5\x01\x8e\x00\x8f\x00\xe0\x01\x1b\x02\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\x07\x00\x3e\x00\x3f\x00\x43\x00\x43\x00\x78\x02\x08\x00\x43\x00\x07\x00\xd1\x02\x37\x01\x44\x00\xd4\x01\xd6\x01\x08\x00\x44\x00\x38\x01\x90\x01\x79\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x7a\x00\x10\x00\x11\x00\x12\x00\xa5\x01\x0c\x00\x0d\x00\x0e\x00\x7a\x00\x10\x00\x11\x00\x12\x00\x65\x02\x61\x00\x07\x00\x37\x01\x66\x02\xc3\x01\x43\x00\x65\x02\x08\x00\x38\x01\x3c\x01\x69\x02\x62\x00\x63\x00\x44\x00\x64\x00\x65\x00\x7b\x02\x2d\x02\xc5\x01\x65\x00\x82\x02\x73\x00\x0d\x00\x0e\x00\x7b\x00\x10\x00\x11\x00\x50\x01\xcb\x01\x7c\x00\xfa\x01\xcc\x01\x7d\x00\xc8\x02\x7e\x00\x7f\x00\x80\x00\x81\x00\xc3\x01\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\xfc\x01\x2f\x02\xc5\x01\x65\x00\xfd\x01\x43\x00\xcb\x01\x3e\x00\x8d\x00\x17\x02\x18\x02\x8e\x00\x8f\x00\xd4\x01\xd7\x01\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\x07\x00\x6a\xff\x43\x00\x02\x02\x43\x00\x03\x02\x08\x00\x43\x00\x07\x00\xdb\x02\x44\x00\x6a\xff\x44\x00\x6a\xff\x08\x00\x44\x00\xc2\x02\xc3\x02\x79\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x7a\x00\x10\x00\x11\x00\x12\x00\x4d\x01\x0c\x00\x0d\x00\x0e\x00\x7a\x00\x10\x00\x11\x00\x12\x00\xc3\x01\xcb\x01\x79\x01\x07\x00\xcc\x01\x79\x01\xc9\x02\x95\x01\xcb\x01\x08\x00\x96\x01\x17\x02\x1a\x02\x3b\x02\xc5\x01\x65\x00\x7b\x01\x65\x00\xcb\x01\x7b\x01\x65\x00\xcc\x01\x06\x02\x8e\x02\x07\x02\x7b\x00\xe3\x01\x10\x00\x11\x00\x5b\x00\x7c\x00\x14\x02\xda\x01\x7d\x00\xdb\x01\x7e\x00\x7f\x00\x80\x00\x81\x00\x08\x02\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\xcb\x01\xcb\x01\x43\x00\xcc\x01\xcc\x01\x8f\x02\x23\x02\x3e\x00\x8d\x00\x0a\x02\x44\x00\x8e\x00\x8f\x00\xc4\x02\xc5\x02\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\x07\x00\xc3\x01\x43\x00\x0b\x02\x2f\x01\x43\x00\x08\x00\x30\x01\x76\x00\xcf\x02\x44\x00\x77\x00\x1b\x02\x44\x00\xc4\x01\xc5\x01\x65\x00\x4f\x02\x79\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x7a\x00\x10\x00\x11\x00\x12\x00\x51\x02\x24\x00\x6f\x00\xa0\x01\x07\x00\xd8\x01\xd9\x01\xda\x01\xc3\x01\xdb\x01\x08\x00\xc3\x01\x67\x00\x52\x01\x70\x00\x53\x01\x71\x00\x54\x01\x88\x02\x89\x02\x9b\x01\xc6\x01\xc5\x01\x65\x00\xc7\x01\xc5\x01\x65\x00\x74\x00\x10\x00\x11\x00\x5b\x00\x42\x02\xb0\x02\x7b\x00\x9d\x01\x37\x02\x38\x02\x39\x02\x7c\x00\x3a\x02\xa3\x01\x7d\x00\xa8\x01\x7e\x00\x7f\x00\x80\x00\x81\x00\xaf\x01\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\xb3\x01\x58\x00\x43\x00\x59\x00\xb7\x01\x5a\x00\xbf\x01\x3e\x00\x8d\x00\xe4\x01\x44\x00\x8e\x00\x8f\x00\x8b\x02\x89\x02\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\x07\x00\xc3\x01\x43\x00\xe5\x01\x43\x00\x07\x00\x08\x00\xbb\x01\x6f\x02\xba\x01\x44\x00\x08\x00\x44\x00\xe7\x01\xc8\x01\xc5\x01\x65\x00\xe8\x01\x79\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x7a\x00\x10\x00\x11\x00\x12\x00\x16\x02\x5a\x00\x10\x00\x11\x00\x5b\x00\xe9\x01\x07\x00\xdd\x01\xc3\x01\xde\x01\x79\x01\xdf\x01\x08\x00\x42\x02\xb1\x02\x7a\x01\x2f\x00\x5b\x01\xe0\x01\x42\x02\x60\x02\xc9\x01\xc5\x01\x65\x00\x7b\x01\x65\x00\x4f\x01\x0d\x00\x0e\x00\xea\x01\x10\x00\x11\x00\x50\x01\x7b\x00\x42\x02\x63\x02\x07\x00\xeb\x01\x7c\x00\xec\x01\x33\x00\x7d\x00\x08\x00\x7e\x00\x7f\x00\x80\x00\x81\x00\xed\x01\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\xf8\x01\x10\x00\x11\x00\x4b\x01\xbb\x01\x70\x02\xf2\x01\x3e\x00\x8d\x00\xbb\x01\x71\x02\x8e\x00\x8f\x00\xbb\x01\x72\x02\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\x5e\x02\x33\x02\x34\x02\x35\x02\xb1\x01\x18\x00\x43\x00\x0e\x02\x0f\x02\x54\x01\xa7\x00\xa8\x00\xa9\x00\xa4\xfe\x44\x00\x11\x02\x12\x02\x20\x02\x21\x02\xaa\x00\xab\x00\xac\x00\xad\x00\x99\x02\x9a\x02\x9b\x02\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\x1a\x00\x1b\x00\x43\x00\xb6\x00\xb7\x00\x61\x00\x3c\x02\x3d\x02\xbb\x01\x3f\x02\x44\x00\xb2\x02\x32\x02\x33\x02\x34\x02\x35\x02\xf5\x01\x5e\x01\x24\x01\x64\x00\x65\x00\x26\x01\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\xb8\x00\x23\x00\xd1\x01\xd2\x01\xb9\x00\x27\x01\x54\x00\x61\x00\x6d\x00\x16\x00\x26\x00\x27\x00\x28\x01\x28\x00\x29\x01\xd3\x01\x5d\x00\xd4\x01\x5e\x00\x61\x01\x5f\x00\x64\x00\x65\x00\xb2\x01\x2c\x00\xba\x00\x2a\x01\x2c\x00\x2d\x00\x2b\x01\x2e\x00\xb1\x01\x18\x00\x43\x00\x42\x02\x43\x02\x2c\x01\xa7\x00\xa8\x00\xa9\x00\xa4\xfe\x44\x00\x2e\x00\x04\x00\x07\x00\x2d\x01\xaa\x00\xab\x00\xac\x00\xad\x00\x08\x00\x2c\x00\x2d\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\x1a\x00\x1b\x00\x30\x01\xb6\x00\xb7\x00\x79\x01\x31\x01\x10\x00\x11\x00\x52\x00\x81\x01\x9f\x02\x32\x02\x33\x02\x34\x02\x35\x02\x48\x01\x49\x01\x32\x01\x7b\x01\x65\x00\x35\x01\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\xb8\x00\x23\x00\x2c\x00\x2d\x00\xb9\x00\x36\x01\x54\x00\x40\x01\x3e\x01\x41\x01\x26\x00\x27\x00\x43\x01\x28\x00\x46\x01\x49\x01\x5d\x00\x82\x01\x5e\x00\x89\x01\x5f\x00\x8a\x01\x5f\x00\xb2\x01\x60\x00\xba\x00\x18\x00\x2c\x00\x2d\x00\x4f\x00\x2e\x00\xa7\x00\xa8\x00\xa9\x00\x6b\x00\x58\x00\xba\x00\x78\x01\x04\x00\x79\x01\xaa\x00\xab\x00\xac\x00\xad\x00\x05\x00\xae\x02\x2c\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\x1a\x00\x1b\x00\xcf\x02\xb6\x00\xb7\x00\xa2\x02\x32\x02\x33\x02\x34\x02\x35\x02\x54\x02\x32\x02\x33\x02\x34\x02\x35\x02\x31\x02\x32\x02\x33\x02\x34\x02\x35\x02\x2c\x00\xb5\x02\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\xb8\x00\x23\x00\xb6\x02\xb7\x02\xb9\x00\x2c\x00\x54\x00\x9c\x02\xb9\x02\xbc\x02\x26\x00\x27\x00\x9d\x02\x28\x00\xbb\x02\x68\x02\x5d\x00\xcc\x02\x5e\x00\x2c\x00\x5f\x00\x6d\x02\xce\x02\x5b\xfe\x9f\x02\xba\x00\x8b\x02\x2c\x00\x2d\x00\x88\x02\x2e\x00\x5b\xfe\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x00\x01\x01\x01\x02\x01\x03\x01\x04\x01\x05\x01\x06\x01\x07\x01\x08\x01\x09\x01\x0a\x01\x0b\x01\x0c\x01\x0d\x01\x0e\x01\x0f\x01\x10\x01\x11\x01\x12\x01\x13\x01\x18\x00\x2c\x00\xe0\x01\xe0\x01\x8d\x02\xa7\x00\xa8\x00\xa9\x00\xe0\x01\x92\x02\x94\x02\x57\x02\x45\x02\x58\x02\xaa\x00\xab\x00\xac\x00\xad\x00\x99\x02\x5b\x02\x2c\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\x1a\x00\x1b\x00\x5c\x02\xb6\x00\xb7\x00\x5d\x02\x5e\x02\x45\x02\x7a\x02\x68\x02\x6d\x02\x2c\x00\x75\x02\x7b\x02\x7d\x02\xb5\x01\x7e\x02\x0e\x02\x26\x01\xe0\x01\xe0\x01\x23\x02\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\xb8\x00\x23\x00\x80\x02\xfa\x01\xb9\x00\x81\x02\x54\x00\x82\x02\x84\x02\x85\x02\x26\x00\x27\x00\x86\x02\x28\x00\x87\x02\xfc\x01\x5d\x00\x18\x00\x5e\x00\xfa\x01\x5f\x00\xe7\x01\xa7\x00\xa8\x00\xa9\x00\xba\x00\xfa\x01\x2c\x00\x2d\x00\xff\x01\x2e\x00\xaa\x00\xab\x00\xac\x00\xad\x00\x05\x02\x00\x02\x06\x02\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\x1a\x00\x1b\x00\x01\x02\xb6\x00\xb7\x00\x02\x02\xfa\x01\x0a\x02\x2f\x02\x14\x02\x3f\x02\x2c\x00\x45\x02\x2c\x00\x49\x02\x2c\xff\x2d\xff\x29\xff\x27\xff\x28\xff\x18\x00\x9f\x01\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\xb8\x00\x23\x00\xa0\x01\xa2\x01\xb9\x00\xa3\x01\x54\x00\xa5\x01\xaa\x01\x19\x00\x26\x00\x27\x00\xac\x01\x28\x00\xad\x01\xae\x01\x5d\x00\x2c\x00\x5e\x00\xb5\x01\x5f\x00\x1a\x00\x1b\x00\x1c\x00\x2c\x00\xba\x00\xe3\x01\x2c\x00\x2d\x00\x4b\x01\x2e\x00\xe7\x01\xef\x01\xf0\x01\xf1\x01\xf2\x01\x26\x01\xf4\x01\x6d\x00\xe7\x01\x34\x01\xf5\x01\xe7\x01\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\xfa\x01\x23\x00\x2c\x00\x2c\x00\xbd\x02\x24\x00\x25\x00\x18\x00\x43\x01\x40\x01\x26\x00\x27\x00\x6d\x00\x28\x00\x77\x00\x4b\x01\x29\x00\x56\x01\x2a\x00\x39\x00\x2b\x00\x3a\x00\x2c\x00\x5b\x01\x19\x00\x60\x01\x63\x01\x2c\x00\x2d\x00\x07\x00\x2e\x00\x64\x01\x65\x01\x80\x01\x6d\x00\x08\x00\x1a\x00\x1b\x00\x1c\x00\x84\x01\x85\x01\x3a\x00\x86\x01\x87\x01\x88\x01\x8e\x01\xff\xff\x2c\x00\x89\x01\x5d\x01\x0d\x00\x0e\x00\x8c\x01\x10\x00\x11\x00\x50\x01\x8d\x01\x72\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x6a\x01\x23\x00\x6d\x00\x78\x00\x31\x02\x24\x00\x25\x00\x18\x00\xff\xff\x79\x00\x26\x00\x27\x00\x07\x00\x28\x00\xff\xff\x00\x00\x29\x00\x00\x00\x2a\x00\x39\x00\x2b\x00\x3a\x00\x00\x00\x00\x00\x19\x00\x00\x00\x07\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x1a\x00\x1b\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x4a\x02\x0d\x00\x0e\x00\x6c\x01\x10\x00\x11\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x00\x00\x23\x00\x4b\x02\x4c\x02\x4d\x02\x24\x00\x25\x00\x41\x00\x00\x00\x00\x00\x26\x00\x27\x00\x00\x00\x28\x00\x42\x00\x00\x00\x29\x00\x00\x00\x2a\x00\x39\x00\x2b\x00\x3a\x00\x00\x00\x00\x00\x19\x00\x00\x00\x07\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x1a\x00\x1b\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x4a\x02\x0d\x00\x0e\x00\x6c\x01\x10\x00\x11\x00\x12\x00\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x00\x00\x23\x00\x4b\x02\x4c\x02\x4e\x02\x24\x00\x25\x00\x00\x00\x00\x00\x19\x00\x26\x00\x27\x00\x00\x00\x28\x00\x00\x00\x00\x00\x29\x00\x43\x00\x2a\x00\x00\x00\x2b\x00\x1a\x00\x1b\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x00\x00\x23\x00\x18\x00\x00\x00\x00\x00\x24\x00\x25\x00\x00\x00\x00\x00\x00\x00\x26\x00\x27\x00\x00\x00\x28\x00\x00\x00\x00\x00\x29\x00\x07\x00\x2a\x00\x19\x00\x2b\x00\x35\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2d\x00\x3a\x00\x2e\x00\x1a\x00\x1b\x00\x1c\x00\x3b\x00\x0a\x00\x0b\x00\x3c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x00\x00\x00\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x18\x00\x6a\x01\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x00\x00\x23\x00\x00\x00\x00\x00\x00\x00\x24\x00\x25\x00\x00\x00\x00\x00\x19\x00\x26\x00\x27\x00\x00\x00\x28\x00\x00\x00\x00\x00\x29\x00\x43\x00\x2a\x00\x00\x00\x2b\x00\x1a\x00\x1b\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x00\x00\x23\x00\x18\x00\x00\x00\x00\x00\x24\x00\x25\x00\x00\x00\x00\x00\x00\x00\x26\x00\x27\x00\x00\x00\x28\x00\x00\x00\x00\x00\x29\x00\x07\x00\x2a\x00\x19\x00\x2b\x00\x35\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2d\x00\x3a\x00\x2e\x00\x1a\x00\x1b\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x5d\x01\x0d\x00\x0e\x00\x00\x00\x10\x00\x11\x00\x50\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x67\x01\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x00\x00\x23\x00\x00\x00\x00\x00\x00\x00\x24\x00\x25\x00\x00\x00\x00\x00\x19\x00\x26\x00\x27\x00\x00\x00\x28\x00\x00\x00\x00\x00\x29\x00\x43\x00\x2a\x00\x00\x00\x2b\x00\x1a\x00\x1b\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x00\x00\x23\x00\x18\x00\x00\x00\x00\x00\x24\x00\x25\x00\x00\x00\x00\x00\x00\x00\x26\x00\x27\x00\x00\x00\x28\x00\x00\x00\x00\x00\x29\x00\x07\x00\x2a\x00\x19\x00\x2b\x00\x35\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x1a\x00\x1b\x00\x1c\x00\x58\x02\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x18\x00\x00\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x00\x00\x00\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x00\x00\x23\x00\x19\x00\x00\x00\x00\x00\x24\x00\x25\x00\x00\x00\x00\x00\x00\x00\x26\x00\x27\x00\x00\x00\x28\x00\x1a\x00\x1b\x00\x29\x00\x00\x00\x2a\x00\x00\x00\x2b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x00\x00\x23\x00\x00\x00\x00\x00\x00\x00\x41\x00\x54\x00\x00\x00\x00\x00\x00\x00\x26\x00\x27\x00\x42\x00\x28\x00\x00\x00\x00\x00\x5d\x00\x00\x00\x5e\x00\x39\x00\x5f\x00\x3a\x00\x19\x00\x07\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2d\x00\x08\x00\x2e\x00\x00\x00\x00\x00\x00\x00\x1a\x00\x1b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb2\x01\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x7a\x00\x10\x00\x11\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x00\x00\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x54\x00\x00\x00\x00\x00\x19\x00\x26\x00\x27\x00\x00\x00\x28\x00\x00\x00\x00\x00\x5d\x00\x95\x01\x5e\x00\x00\x00\x5f\x00\x1a\x00\x1b\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x00\x00\x23\x00\x19\x00\x00\x00\x00\x00\x24\x00\x25\x00\x00\x00\x00\x00\x00\x00\x26\x00\x27\x00\x00\x00\x28\x00\x1a\x00\x1b\x00\x29\x00\x00\x00\x2a\x00\x00\x00\x2b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x00\x00\x23\x00\x00\x00\x00\x00\x00\x00\x41\x00\x54\x00\x00\x00\x00\x00\x00\x00\x26\x00\x27\x00\x42\x00\x28\x00\x00\x00\x00\x00\x5d\x00\x07\x00\x5e\x00\x39\x00\x5f\x00\x3a\x00\x19\x00\x08\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x00\x00\x1a\x00\x1b\x00\x00\x00\x73\x00\x0d\x00\x0e\x00\x74\x00\x10\x00\x11\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x00\x00\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x54\x00\x00\x00\x00\x00\x19\x00\x26\x00\x27\x00\x00\x00\x28\x00\x00\x00\x00\x00\x5d\x00\x73\x01\x5e\x00\x00\x00\x5f\x00\x1a\x00\x1b\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x00\x00\x23\x00\x19\x00\x00\x00\x00\x00\x24\x00\x25\x00\x00\x00\x00\x00\x00\x00\x26\x00\x27\x00\x00\x00\x28\x00\x1a\x00\x1b\x00\x29\x00\x00\x00\x2a\x00\x00\x00\x2b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x00\x00\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x54\x00\x00\x00\x00\x00\x19\x00\x26\x00\x27\x00\x5d\xff\x28\x00\x00\x00\x5d\xff\x5d\x00\x00\x00\x5e\x00\x00\x00\x5f\x00\x1a\x00\x1b\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x00\x00\x23\x00\x19\x00\x00\x00\x00\x00\x24\x00\x25\x00\x00\x00\x00\x00\x00\x00\x26\x00\x27\x00\x00\x00\x28\x00\x1a\x00\x1b\x00\x29\x00\x00\x00\x2a\x00\x00\x00\x2b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x00\x00\x23\x00\x41\x00\x00\x00\x00\x00\x00\x00\x54\x00\x00\x00\x00\x00\x42\x00\x26\x00\x27\x00\x00\x00\x28\x00\x00\x00\x00\x00\x5d\x00\x07\x00\x5e\x00\x19\x00\x5f\x00\x93\x01\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x1a\x00\x1b\x00\x00\x00\x64\x02\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x18\x00\x00\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x00\x00\x00\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x00\x00\x23\x00\x19\x00\x00\x00\x00\x00\x00\x00\x54\x00\x00\x00\x00\x00\x00\x00\x26\x00\x27\x00\x00\x00\x28\x00\x1a\x00\x1b\x00\x5d\x00\x00\x00\x5e\x00\x00\x00\x5f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x00\x00\x23\x00\x18\x00\x00\x00\x00\x00\x00\x00\x54\x00\x00\x00\x00\x00\x00\x00\x26\x00\x27\x00\x00\x00\x28\x00\x00\x00\x00\x00\x5d\x00\x07\x00\x5e\x00\x19\x00\x5f\x00\x71\x01\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x1a\x00\x1b\x00\x00\x00\x68\x02\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x00\x00\x00\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x00\x00\x00\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x00\x00\x23\x00\x19\x00\x00\x00\x00\x00\x00\x00\x54\x00\x00\x00\x00\x00\x00\x00\x26\x00\x27\x00\x00\x00\x28\x00\x1a\x00\x1b\x00\x5d\x00\x00\x00\x5e\x00\x00\x00\x5f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x19\x00\x1f\x00\x20\x00\x00\x00\x22\x00\x00\x00\x23\x00\x00\x00\x00\x00\x4d\x00\x4e\x00\x54\x00\x1a\x00\x1b\x00\x4f\x00\x26\x00\x27\x00\x00\x00\x00\x00\x00\x00\x67\x00\x5d\x00\x68\x00\xa2\x02\x69\x00\x5f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x1f\x00\x20\x00\x00\x00\x22\x00\x19\x00\x23\x00\x00\x00\x00\x00\x4d\x00\x4e\x00\x54\x00\x00\x00\x00\x00\x4f\x00\x26\x00\x27\x00\x1a\x00\x1b\x00\x00\x00\x7d\x01\x5d\x00\x7e\x01\x5e\x00\x7f\x01\x5f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x19\x00\x1f\x00\x20\x00\x00\x00\x22\x00\x00\x00\x23\x00\x00\x00\x00\x00\x4d\x00\x4e\x00\x54\x00\x1a\x00\x1b\x00\x4f\x00\x26\x00\x27\x00\x00\x00\x00\x00\x00\x00\x67\x00\x5d\x00\x68\x00\xc3\x01\x69\x00\x5f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x1f\x00\x20\x00\x00\x00\x22\x00\x19\x00\x23\x00\x00\x00\x00\x00\x4d\x00\x4e\x00\x54\x00\x00\x00\x00\x00\x4f\x00\x26\x00\x27\x00\x1a\x00\x1b\x00\x00\x00\x67\x00\x5d\x00\x68\x00\x5e\x00\xcb\x01\x5f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x19\x00\x1f\x00\x20\x00\x00\x00\x22\x00\x00\x00\x23\x00\x00\x00\x00\x00\x4d\x00\x4e\x00\x54\x00\x1a\x00\x1b\x00\x4f\x00\x26\x00\x27\x00\x00\x00\x00\x00\x00\x00\x7d\x01\x5d\x00\x7e\x01\x5e\x00\x7f\x01\x6b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x1f\x00\x20\x00\x00\x00\x22\x00\x19\x00\x23\x00\x00\x00\x00\x00\x4d\x00\x4e\x00\x54\x00\x00\x00\x00\x00\x4f\x00\x26\x00\x27\x00\x1a\x00\x1b\x00\x00\x00\x67\x00\x5d\x00\x68\x00\x5e\x00\x69\x00\x5f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x19\x00\x1f\x00\x20\x00\x00\x00\x22\x00\x00\x00\x23\x00\x00\x00\x00\x00\x4d\x00\x4e\x00\x54\x00\x1a\x00\x1b\x00\x4f\x00\x26\x00\x27\x00\x00\x00\x00\x00\x00\x00\x7d\x01\x55\x00\x7e\x01\x56\x00\x7f\x01\x57\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x1f\x00\x20\x00\x00\x00\x22\x00\x19\x00\x23\x00\x00\x00\x00\x00\x4d\x00\x4e\x00\x54\x00\x00\x00\x00\x00\x4f\x00\x26\x00\x27\x00\x1a\x00\x1b\x00\x00\x00\x50\x00\x5d\x00\x51\x00\x5e\x00\x52\x00\x5f\x00\x00\x00\x00\x00\x07\x00\x00\x00\x93\x01\x2c\x00\x2c\x00\x2d\x00\x08\x00\x2e\x00\x00\x00\x00\x00\x5c\x01\x30\x00\x00\x00\x1f\x00\x20\x00\x00\x00\x22\x00\x00\x00\x23\x00\x00\x00\x4f\x01\x0d\x00\x0e\x00\x54\x00\x10\x00\x11\x00\x50\x01\x26\x00\x27\x00\x00\x00\x07\x00\x00\x00\x00\x00\x5d\x00\x37\x00\x5e\x00\x08\x00\x6b\x00\x00\x00\x00\x00\x2f\x00\x5b\x01\x00\x00\x00\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x6b\x01\x0d\x00\x0e\x00\x6c\x01\x10\x00\x11\x00\x12\x00\x07\x00\x00\x00\x35\x00\x00\x00\x00\x00\x00\x00\x08\x00\x33\x00\x00\x00\x00\x00\x2f\x00\x30\x00\x00\x00\x6d\x01\x6e\x01\x00\x00\x6f\x01\x36\x00\x0a\x00\x0b\x00\x32\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x00\x00\x00\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x69\x01\x07\x00\x00\x00\x35\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x2f\x00\x30\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x36\x00\x0a\x00\x0b\x00\x32\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x00\x00\x00\x00\x07\x00\x13\x00\x14\x00\x15\x00\x16\x00\x37\x00\x08\x00\x00\x00\x00\x00\x00\x00\x2f\x00\x30\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x31\x00\x0a\x00\x0b\x00\x32\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x00\x00\x00\x00\x07\x00\x13\x00\x14\x00\x15\x00\x16\x00\x68\x01\x08\x00\x00\x00\x00\x00\x00\x00\x2f\x00\x30\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x31\x00\x0a\x00\x0b\x00\x32\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x00\x00\x00\x00\x24\x02\x13\x00\x14\x00\x15\x00\x16\x00\x33\x00\x08\x00\x00\x00\x00\x00\x00\x00\x2f\x00\x5b\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x4f\x01\x0d\x00\x0e\x00\x00\x00\x10\x00\x11\x00\x50\x01\xaa\x01\x58\x01\x59\x01\x07\x00\x00\x00\x71\x01\x00\x00\x33\x00\x00\x00\x08\x00\x07\x00\x00\x00\x00\x00\x5c\x01\x30\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x97\x01\x30\x00\x00\x00\x4f\x01\x0d\x00\x0e\x00\x00\x00\x10\x00\x11\x00\x50\x01\x4f\x01\x0d\x00\x0e\x00\x00\x00\x10\x00\x11\x00\x50\x01\x37\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x65\x01\x08\x00\x07\x00\x00\x00\x00\x00\x98\x01\x30\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x99\x01\x30\x00\x00\x00\x4f\x01\x0d\x00\x0e\x00\x00\x00\x10\x00\x11\x00\x50\x01\x4f\x01\x0d\x00\x0e\x00\x00\x00\x10\x00\x11\x00\x50\x01\x66\x01\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x68\x01\x08\x00\x07\x00\x00\x00\x00\x00\x9a\x01\x30\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x2f\x00\x30\x00\x00\x00\x4f\x01\x0d\x00\x0e\x00\x00\x00\x10\x00\x11\x00\x50\x01\x4f\x01\x0d\x00\x0e\x00\x00\x00\x10\x00\x11\x00\x50\x01\x69\x01\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x68\x01\x08\x00\x07\x00\x00\x00\x00\x00\x2f\x00\x30\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x2f\x00\x30\x00\x00\x00\x4f\x01\x0d\x00\x0e\x00\x00\x00\x10\x00\x11\x00\x50\x01\x4f\x01\x0d\x00\x0e\x00\x00\x00\x10\x00\x11\x00\x50\x01\x69\x01\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x33\x00\x08\x00\x07\x00\x00\x00\x00\x00\x2f\x00\x30\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x2f\x00\x5b\x01\x00\x00\x4f\x01\x0d\x00\x0e\x00\x00\x00\x10\x00\x11\x00\x50\x01\x4f\x01\x0d\x00\x0e\x00\x00\x00\x10\x00\x11\x00\x50\x01\x37\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x33\x00\x08\x00\x07\x00\x00\x00\x00\x00\x5c\x01\x30\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x2f\x00\x30\x00\x00\x00\x4f\x01\x0d\x00\x0e\x00\x00\x00\x10\x00\x11\x00\x50\x01\x4f\x01\x0d\x00\x0e\x00\x00\x00\x10\x00\x11\x00\x50\x01\x37\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x65\x01\x08\x00\x00\x00\x00\x00\x00\x00\x2f\x00\x30\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x4f\x01\x0d\x00\x0e\x00\x00\x00\x10\x00\x11\x00\x50\x01\x07\x00\x00\x00\x35\x00\x00\x00\x00\x00\x00\x00\x08\x00\x66\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x36\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x00\x00\x07\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x02\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x00\x00\x07\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6d\x02\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x00\x00\x07\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7e\x02\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x00\x00\x07\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x02\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x00\x00\x07\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x45\x02\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x00\x00\x07\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x46\x02\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x00\x00\x07\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x49\x02\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x00\x00\x07\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x8e\x01\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x00\x00\x07\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x8f\x01\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x00\x00\x07\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa6\x01\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x00\x00\x07\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa7\x01\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x00\x00\x07\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xae\x01\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x00\x00\x07\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb5\x01\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x00\x00\x07\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb6\x01\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x00\x00\x07\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x4c\x01\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x00\x00\x07\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x4e\x01\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x00\x00\x07\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x60\x01\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x00\x00\x07\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x31\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x00\x00\x07\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3b\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x00\x00\x07\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x01\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x00\x00\x07\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x72\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x00\x00\x07\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x00\x00\x00\x00\x00\x00\x13\x00\x14\x00\x15\x00\x16\x00\x10\xff\x10\xff\x00\x00\x4d\x00\x4e\x00\x10\xff\x00\x00\x10\xff\x4f\x00\x00\x00\x2a\xff\x10\xff\x00\x00\x10\xff\x7d\x01\x10\xff\x7e\x01\x00\x00\x7f\x01\x4d\x00\x4e\x00\x00\x00\x10\xff\x00\x00\x4f\x00\x2c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x67\x00\x00\x00\x68\x00\x00\x00\x69\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x14\x01\x15\x01\x16\x01\x17\x01\x18\x01\x19\x01\x1a\x01\x1b\x01\x1c\x01\x1d\x01\x1e\x01\x1f\x01\x20\x01\x21\x01\x22\x01\x23\x01\x24\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#--happyReduceArr = Happy_Data_Array.array (3, 421) [-	(3 , happyReduce_3),-	(4 , happyReduce_4),-	(5 , happyReduce_5),-	(6 , happyReduce_6),-	(7 , happyReduce_7),-	(8 , happyReduce_8),-	(9 , happyReduce_9),-	(10 , happyReduce_10),-	(11 , happyReduce_11),-	(12 , happyReduce_12),-	(13 , happyReduce_13),-	(14 , happyReduce_14),-	(15 , happyReduce_15),-	(16 , happyReduce_16),-	(17 , happyReduce_17),-	(18 , happyReduce_18),-	(19 , happyReduce_19),-	(20 , happyReduce_20),-	(21 , happyReduce_21),-	(22 , happyReduce_22),-	(23 , happyReduce_23),-	(24 , happyReduce_24),-	(25 , happyReduce_25),-	(26 , happyReduce_26),-	(27 , happyReduce_27),-	(28 , happyReduce_28),-	(29 , happyReduce_29),-	(30 , happyReduce_30),-	(31 , happyReduce_31),-	(32 , happyReduce_32),-	(33 , happyReduce_33),-	(34 , happyReduce_34),-	(35 , happyReduce_35),-	(36 , happyReduce_36),-	(37 , happyReduce_37),-	(38 , happyReduce_38),-	(39 , happyReduce_39),-	(40 , happyReduce_40),-	(41 , happyReduce_41),-	(42 , happyReduce_42),-	(43 , happyReduce_43),-	(44 , happyReduce_44),-	(45 , happyReduce_45),-	(46 , happyReduce_46),-	(47 , happyReduce_47),-	(48 , happyReduce_48),-	(49 , happyReduce_49),-	(50 , happyReduce_50),-	(51 , happyReduce_51),-	(52 , happyReduce_52),-	(53 , happyReduce_53),-	(54 , happyReduce_54),-	(55 , happyReduce_55),-	(56 , happyReduce_56),-	(57 , happyReduce_57),-	(58 , happyReduce_58),-	(59 , happyReduce_59),-	(60 , happyReduce_60),-	(61 , happyReduce_61),-	(62 , happyReduce_62),-	(63 , happyReduce_63),-	(64 , happyReduce_64),-	(65 , happyReduce_65),-	(66 , happyReduce_66),-	(67 , happyReduce_67),-	(68 , happyReduce_68),-	(69 , happyReduce_69),-	(70 , happyReduce_70),-	(71 , happyReduce_71),-	(72 , happyReduce_72),-	(73 , happyReduce_73),-	(74 , happyReduce_74),-	(75 , happyReduce_75),-	(76 , happyReduce_76),-	(77 , happyReduce_77),-	(78 , happyReduce_78),-	(79 , happyReduce_79),-	(80 , happyReduce_80),-	(81 , happyReduce_81),-	(82 , happyReduce_82),-	(83 , happyReduce_83),-	(84 , happyReduce_84),-	(85 , happyReduce_85),-	(86 , happyReduce_86),-	(87 , happyReduce_87),-	(88 , happyReduce_88),-	(89 , happyReduce_89),-	(90 , happyReduce_90),-	(91 , happyReduce_91),-	(92 , happyReduce_92),-	(93 , happyReduce_93),-	(94 , happyReduce_94),-	(95 , happyReduce_95),-	(96 , happyReduce_96),-	(97 , happyReduce_97),-	(98 , happyReduce_98),-	(99 , happyReduce_99),-	(100 , happyReduce_100),-	(101 , happyReduce_101),-	(102 , happyReduce_102),-	(103 , happyReduce_103),-	(104 , happyReduce_104),-	(105 , happyReduce_105),-	(106 , happyReduce_106),-	(107 , happyReduce_107),-	(108 , happyReduce_108),-	(109 , happyReduce_109),-	(110 , happyReduce_110),-	(111 , happyReduce_111),-	(112 , happyReduce_112),-	(113 , happyReduce_113),-	(114 , happyReduce_114),-	(115 , happyReduce_115),-	(116 , happyReduce_116),-	(117 , happyReduce_117),-	(118 , happyReduce_118),-	(119 , happyReduce_119),-	(120 , happyReduce_120),-	(121 , happyReduce_121),-	(122 , happyReduce_122),-	(123 , happyReduce_123),-	(124 , happyReduce_124),-	(125 , happyReduce_125),-	(126 , happyReduce_126),-	(127 , happyReduce_127),-	(128 , happyReduce_128),-	(129 , happyReduce_129),-	(130 , happyReduce_130),-	(131 , happyReduce_131),-	(132 , happyReduce_132),-	(133 , happyReduce_133),-	(134 , happyReduce_134),-	(135 , happyReduce_135),-	(136 , happyReduce_136),-	(137 , happyReduce_137),-	(138 , happyReduce_138),-	(139 , happyReduce_139),-	(140 , happyReduce_140),-	(141 , happyReduce_141),-	(142 , happyReduce_142),-	(143 , happyReduce_143),-	(144 , happyReduce_144),-	(145 , happyReduce_145),-	(146 , happyReduce_146),-	(147 , happyReduce_147),-	(148 , happyReduce_148),-	(149 , happyReduce_149),-	(150 , happyReduce_150),-	(151 , happyReduce_151),-	(152 , happyReduce_152),-	(153 , happyReduce_153),-	(154 , happyReduce_154),-	(155 , happyReduce_155),-	(156 , happyReduce_156),-	(157 , happyReduce_157),-	(158 , happyReduce_158),-	(159 , happyReduce_159),-	(160 , happyReduce_160),-	(161 , happyReduce_161),-	(162 , happyReduce_162),-	(163 , happyReduce_163),-	(164 , happyReduce_164),-	(165 , happyReduce_165),-	(166 , happyReduce_166),-	(167 , happyReduce_167),-	(168 , happyReduce_168),-	(169 , happyReduce_169),-	(170 , happyReduce_170),-	(171 , happyReduce_171),-	(172 , happyReduce_172),-	(173 , happyReduce_173),-	(174 , happyReduce_174),-	(175 , happyReduce_175),-	(176 , happyReduce_176),-	(177 , happyReduce_177),-	(178 , happyReduce_178),-	(179 , happyReduce_179),-	(180 , happyReduce_180),-	(181 , happyReduce_181),-	(182 , happyReduce_182),-	(183 , happyReduce_183),-	(184 , happyReduce_184),-	(185 , happyReduce_185),-	(186 , happyReduce_186),-	(187 , happyReduce_187),-	(188 , happyReduce_188),-	(189 , happyReduce_189),-	(190 , happyReduce_190),-	(191 , happyReduce_191),-	(192 , happyReduce_192),-	(193 , happyReduce_193),-	(194 , happyReduce_194),-	(195 , happyReduce_195),-	(196 , happyReduce_196),-	(197 , happyReduce_197),-	(198 , happyReduce_198),-	(199 , happyReduce_199),-	(200 , happyReduce_200),-	(201 , happyReduce_201),-	(202 , happyReduce_202),-	(203 , happyReduce_203),-	(204 , happyReduce_204),-	(205 , happyReduce_205),-	(206 , happyReduce_206),-	(207 , happyReduce_207),-	(208 , happyReduce_208),-	(209 , happyReduce_209),-	(210 , happyReduce_210),-	(211 , happyReduce_211),-	(212 , happyReduce_212),-	(213 , happyReduce_213),-	(214 , happyReduce_214),-	(215 , happyReduce_215),-	(216 , happyReduce_216),-	(217 , happyReduce_217),-	(218 , happyReduce_218),-	(219 , happyReduce_219),-	(220 , happyReduce_220),-	(221 , happyReduce_221),-	(222 , happyReduce_222),-	(223 , happyReduce_223),-	(224 , happyReduce_224),-	(225 , happyReduce_225),-	(226 , happyReduce_226),-	(227 , happyReduce_227),-	(228 , happyReduce_228),-	(229 , happyReduce_229),-	(230 , happyReduce_230),-	(231 , happyReduce_231),-	(232 , happyReduce_232),-	(233 , happyReduce_233),-	(234 , happyReduce_234),-	(235 , happyReduce_235),-	(236 , happyReduce_236),-	(237 , happyReduce_237),-	(238 , happyReduce_238),-	(239 , happyReduce_239),-	(240 , happyReduce_240),-	(241 , happyReduce_241),-	(242 , happyReduce_242),-	(243 , happyReduce_243),-	(244 , happyReduce_244),-	(245 , happyReduce_245),-	(246 , happyReduce_246),-	(247 , happyReduce_247),-	(248 , happyReduce_248),-	(249 , happyReduce_249),-	(250 , happyReduce_250),-	(251 , happyReduce_251),-	(252 , happyReduce_252),-	(253 , happyReduce_253),-	(254 , happyReduce_254),-	(255 , happyReduce_255),-	(256 , happyReduce_256),-	(257 , happyReduce_257),-	(258 , happyReduce_258),-	(259 , happyReduce_259),-	(260 , happyReduce_260),-	(261 , happyReduce_261),-	(262 , happyReduce_262),-	(263 , happyReduce_263),-	(264 , happyReduce_264),-	(265 , happyReduce_265),-	(266 , happyReduce_266),-	(267 , happyReduce_267),-	(268 , happyReduce_268),-	(269 , happyReduce_269),-	(270 , happyReduce_270),-	(271 , happyReduce_271),-	(272 , happyReduce_272),-	(273 , happyReduce_273),-	(274 , happyReduce_274),-	(275 , happyReduce_275),-	(276 , happyReduce_276),-	(277 , happyReduce_277),-	(278 , happyReduce_278),-	(279 , happyReduce_279),-	(280 , happyReduce_280),-	(281 , happyReduce_281),-	(282 , happyReduce_282),-	(283 , happyReduce_283),-	(284 , happyReduce_284),-	(285 , happyReduce_285),-	(286 , happyReduce_286),-	(287 , happyReduce_287),-	(288 , happyReduce_288),-	(289 , happyReduce_289),-	(290 , happyReduce_290),-	(291 , happyReduce_291),-	(292 , happyReduce_292),-	(293 , happyReduce_293),-	(294 , happyReduce_294),-	(295 , happyReduce_295),-	(296 , happyReduce_296),-	(297 , happyReduce_297),-	(298 , happyReduce_298),-	(299 , happyReduce_299),-	(300 , happyReduce_300),-	(301 , happyReduce_301),-	(302 , happyReduce_302),-	(303 , happyReduce_303),-	(304 , happyReduce_304),-	(305 , happyReduce_305),-	(306 , happyReduce_306),-	(307 , happyReduce_307),-	(308 , happyReduce_308),-	(309 , happyReduce_309),-	(310 , happyReduce_310),-	(311 , happyReduce_311),-	(312 , happyReduce_312),-	(313 , happyReduce_313),-	(314 , happyReduce_314),-	(315 , happyReduce_315),-	(316 , happyReduce_316),-	(317 , happyReduce_317),-	(318 , happyReduce_318),-	(319 , happyReduce_319),-	(320 , happyReduce_320),-	(321 , happyReduce_321),-	(322 , happyReduce_322),-	(323 , happyReduce_323),-	(324 , happyReduce_324),-	(325 , happyReduce_325),-	(326 , happyReduce_326),-	(327 , happyReduce_327),-	(328 , happyReduce_328),-	(329 , happyReduce_329),-	(330 , happyReduce_330),-	(331 , happyReduce_331),-	(332 , happyReduce_332),-	(333 , happyReduce_333),-	(334 , happyReduce_334),-	(335 , happyReduce_335),-	(336 , happyReduce_336),-	(337 , happyReduce_337),-	(338 , happyReduce_338),-	(339 , happyReduce_339),-	(340 , happyReduce_340),-	(341 , happyReduce_341),-	(342 , happyReduce_342),-	(343 , happyReduce_343),-	(344 , happyReduce_344),-	(345 , happyReduce_345),-	(346 , happyReduce_346),-	(347 , happyReduce_347),-	(348 , happyReduce_348),-	(349 , happyReduce_349),-	(350 , happyReduce_350),-	(351 , happyReduce_351),-	(352 , happyReduce_352),-	(353 , happyReduce_353),-	(354 , happyReduce_354),-	(355 , happyReduce_355),-	(356 , happyReduce_356),-	(357 , happyReduce_357),-	(358 , happyReduce_358),-	(359 , happyReduce_359),-	(360 , happyReduce_360),-	(361 , happyReduce_361),-	(362 , happyReduce_362),-	(363 , happyReduce_363),-	(364 , happyReduce_364),-	(365 , happyReduce_365),-	(366 , happyReduce_366),-	(367 , happyReduce_367),-	(368 , happyReduce_368),-	(369 , happyReduce_369),-	(370 , happyReduce_370),-	(371 , happyReduce_371),-	(372 , happyReduce_372),-	(373 , happyReduce_373),-	(374 , happyReduce_374),-	(375 , happyReduce_375),-	(376 , happyReduce_376),-	(377 , happyReduce_377),-	(378 , happyReduce_378),-	(379 , happyReduce_379),-	(380 , happyReduce_380),-	(381 , happyReduce_381),-	(382 , happyReduce_382),-	(383 , happyReduce_383),-	(384 , happyReduce_384),-	(385 , happyReduce_385),-	(386 , happyReduce_386),-	(387 , happyReduce_387),-	(388 , happyReduce_388),-	(389 , happyReduce_389),-	(390 , happyReduce_390),-	(391 , happyReduce_391),-	(392 , happyReduce_392),-	(393 , happyReduce_393),-	(394 , happyReduce_394),-	(395 , happyReduce_395),-	(396 , happyReduce_396),-	(397 , happyReduce_397),-	(398 , happyReduce_398),-	(399 , happyReduce_399),-	(400 , happyReduce_400),-	(401 , happyReduce_401),-	(402 , happyReduce_402),-	(403 , happyReduce_403),-	(404 , happyReduce_404),-	(405 , happyReduce_405),-	(406 , happyReduce_406),-	(407 , happyReduce_407),-	(408 , happyReduce_408),-	(409 , happyReduce_409),-	(410 , happyReduce_410),-	(411 , happyReduce_411),-	(412 , happyReduce_412),-	(413 , happyReduce_413),-	(414 , happyReduce_414),-	(415 , happyReduce_415),-	(416 , happyReduce_416),-	(417 , happyReduce_417),-	(418 , happyReduce_418),-	(419 , happyReduce_419),-	(420 , happyReduce_420),-	(421 , happyReduce_421)-	]--happy_n_terms = 90 :: Int-happy_n_nonterms = 140 :: Int--happyReduce_3 = happySpecReduce_1  0# happyReduction_3-happyReduction_3 happy_x_1-	 =  case happyOut7 happy_x_1 of { happy_var_1 -> -	happyIn6-		 (reverse happy_var_1-	)}--happyReduce_4 = happySpecReduce_2  1# happyReduction_4-happyReduction_4 happy_x_2-	happy_x_1-	 =  case happyOut7 happy_x_1 of { happy_var_1 -> -	case happyOut8 happy_x_2 of { happy_var_2 -> -	happyIn7-		 (happy_var_2 : happy_var_1-	)}}--happyReduce_5 = happySpecReduce_0  1# happyReduction_5-happyReduction_5  =  happyIn7-		 ([]-	)--happyReduce_6 = happySpecReduce_1  2# happyReduction_6-happyReduction_6 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwLet happy_var_1) -> -	happyIn8-		 (TokKeyword KwLet happy_var_1-	)}--happyReduce_7 = happySpecReduce_1  2# happyReduction_7-happyReduction_7 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwIn happy_var_1) -> -	happyIn8-		 (TokKeyword KwIn happy_var_1-	)}--happyReduce_8 = happySpecReduce_1  2# happyReduction_8-happyReduction_8 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwWhere happy_var_1) -> -	happyIn8-		 (TokKeyword KwWhere happy_var_1-	)}--happyReduce_9 = happySpecReduce_1  2# happyReduction_9-happyReduction_9 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwWith happy_var_1) -> -	happyIn8-		 (TokKeyword KwWith happy_var_1-	)}--happyReduce_10 = happySpecReduce_1  2# happyReduction_10-happyReduction_10 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwRewrite happy_var_1) -> -	happyIn8-		 (TokKeyword KwRewrite happy_var_1-	)}--happyReduce_11 = happySpecReduce_1  2# happyReduction_11-happyReduction_11 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwPostulate happy_var_1) -> -	happyIn8-		 (TokKeyword KwPostulate happy_var_1-	)}--happyReduce_12 = happySpecReduce_1  2# happyReduction_12-happyReduction_12 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwPrimitive happy_var_1) -> -	happyIn8-		 (TokKeyword KwPrimitive happy_var_1-	)}--happyReduce_13 = happySpecReduce_1  2# happyReduction_13-happyReduction_13 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwOpen happy_var_1) -> -	happyIn8-		 (TokKeyword KwOpen happy_var_1-	)}--happyReduce_14 = happySpecReduce_1  2# happyReduction_14-happyReduction_14 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwImport happy_var_1) -> -	happyIn8-		 (TokKeyword KwImport happy_var_1-	)}--happyReduce_15 = happySpecReduce_1  2# happyReduction_15-happyReduction_15 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwUsing happy_var_1) -> -	happyIn8-		 (TokKeyword KwUsing happy_var_1-	)}--happyReduce_16 = happySpecReduce_1  2# happyReduction_16-happyReduction_16 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwHiding happy_var_1) -> -	happyIn8-		 (TokKeyword KwHiding happy_var_1-	)}--happyReduce_17 = happySpecReduce_1  2# happyReduction_17-happyReduction_17 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwRenaming happy_var_1) -> -	happyIn8-		 (TokKeyword KwRenaming happy_var_1-	)}--happyReduce_18 = happySpecReduce_1  2# happyReduction_18-happyReduction_18 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwTo happy_var_1) -> -	happyIn8-		 (TokKeyword KwTo happy_var_1-	)}--happyReduce_19 = happySpecReduce_1  2# happyReduction_19-happyReduction_19 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwPublic happy_var_1) -> -	happyIn8-		 (TokKeyword KwPublic happy_var_1-	)}--happyReduce_20 = happySpecReduce_1  2# happyReduction_20-happyReduction_20 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwModule happy_var_1) -> -	happyIn8-		 (TokKeyword KwModule happy_var_1-	)}--happyReduce_21 = happySpecReduce_1  2# happyReduction_21-happyReduction_21 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwData happy_var_1) -> -	happyIn8-		 (TokKeyword KwData happy_var_1-	)}--happyReduce_22 = happySpecReduce_1  2# happyReduction_22-happyReduction_22 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwCoData happy_var_1) -> -	happyIn8-		 (TokKeyword KwCoData happy_var_1-	)}--happyReduce_23 = happySpecReduce_1  2# happyReduction_23-happyReduction_23 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwRecord happy_var_1) -> -	happyIn8-		 (TokKeyword KwRecord happy_var_1-	)}--happyReduce_24 = happySpecReduce_1  2# happyReduction_24-happyReduction_24 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwConstructor happy_var_1) -> -	happyIn8-		 (TokKeyword KwConstructor happy_var_1-	)}--happyReduce_25 = happySpecReduce_1  2# happyReduction_25-happyReduction_25 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwInductive happy_var_1) -> -	happyIn8-		 (TokKeyword KwInductive happy_var_1-	)}--happyReduce_26 = happySpecReduce_1  2# happyReduction_26-happyReduction_26 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwCoInductive happy_var_1) -> -	happyIn8-		 (TokKeyword KwCoInductive happy_var_1-	)}--happyReduce_27 = happySpecReduce_1  2# happyReduction_27-happyReduction_27 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwField happy_var_1) -> -	happyIn8-		 (TokKeyword KwField happy_var_1-	)}--happyReduce_28 = happySpecReduce_1  2# happyReduction_28-happyReduction_28 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwInfix happy_var_1) -> -	happyIn8-		 (TokKeyword KwInfix happy_var_1-	)}--happyReduce_29 = happySpecReduce_1  2# happyReduction_29-happyReduction_29 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwInfixL happy_var_1) -> -	happyIn8-		 (TokKeyword KwInfixL happy_var_1-	)}--happyReduce_30 = happySpecReduce_1  2# happyReduction_30-happyReduction_30 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwInfixR happy_var_1) -> -	happyIn8-		 (TokKeyword KwInfixR happy_var_1-	)}--happyReduce_31 = happySpecReduce_1  2# happyReduction_31-happyReduction_31 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwMutual happy_var_1) -> -	happyIn8-		 (TokKeyword KwMutual happy_var_1-	)}--happyReduce_32 = happySpecReduce_1  2# happyReduction_32-happyReduction_32 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwAbstract happy_var_1) -> -	happyIn8-		 (TokKeyword KwAbstract happy_var_1-	)}--happyReduce_33 = happySpecReduce_1  2# happyReduction_33-happyReduction_33 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwPrivate happy_var_1) -> -	happyIn8-		 (TokKeyword KwPrivate happy_var_1-	)}--happyReduce_34 = happySpecReduce_1  2# happyReduction_34-happyReduction_34 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwInstance happy_var_1) -> -	happyIn8-		 (TokKeyword KwInstance happy_var_1-	)}--happyReduce_35 = happySpecReduce_1  2# happyReduction_35-happyReduction_35 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwProp happy_var_1) -> -	happyIn8-		 (TokKeyword KwProp happy_var_1-	)}--happyReduce_36 = happySpecReduce_1  2# happyReduction_36-happyReduction_36 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwSet happy_var_1) -> -	happyIn8-		 (TokKeyword KwSet happy_var_1-	)}--happyReduce_37 = happySpecReduce_1  2# happyReduction_37-happyReduction_37 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwForall happy_var_1) -> -	happyIn8-		 (TokKeyword KwForall happy_var_1-	)}--happyReduce_38 = happySpecReduce_1  2# happyReduction_38-happyReduction_38 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwSyntax happy_var_1) -> -	happyIn8-		 (TokKeyword KwSyntax happy_var_1-	)}--happyReduce_39 = happySpecReduce_1  2# happyReduction_39-happyReduction_39 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwPatternSyn happy_var_1) -> -	happyIn8-		 (TokKeyword KwPatternSyn happy_var_1-	)}--happyReduce_40 = happySpecReduce_1  2# happyReduction_40-happyReduction_40 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwOPTIONS happy_var_1) -> -	happyIn8-		 (TokKeyword KwOPTIONS happy_var_1-	)}--happyReduce_41 = happySpecReduce_1  2# happyReduction_41-happyReduction_41 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwBUILTIN happy_var_1) -> -	happyIn8-		 (TokKeyword KwBUILTIN happy_var_1-	)}--happyReduce_42 = happySpecReduce_1  2# happyReduction_42-happyReduction_42 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwREWRITE happy_var_1) -> -	happyIn8-		 (TokKeyword KwREWRITE happy_var_1-	)}--happyReduce_43 = happySpecReduce_1  2# happyReduction_43-happyReduction_43 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwIMPORT happy_var_1) -> -	happyIn8-		 (TokKeyword KwIMPORT happy_var_1-	)}--happyReduce_44 = happySpecReduce_1  2# happyReduction_44-happyReduction_44 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwCOMPILED happy_var_1) -> -	happyIn8-		 (TokKeyword KwCOMPILED happy_var_1-	)}--happyReduce_45 = happySpecReduce_1  2# happyReduction_45-happyReduction_45 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwCOMPILED_EXPORT happy_var_1) -> -	happyIn8-		 (TokKeyword KwCOMPILED_EXPORT happy_var_1-	)}--happyReduce_46 = happySpecReduce_1  2# happyReduction_46-happyReduction_46 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwCOMPILED_DATA happy_var_1) -> -	happyIn8-		 (TokKeyword KwCOMPILED_DATA happy_var_1-	)}--happyReduce_47 = happySpecReduce_1  2# happyReduction_47-happyReduction_47 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwCOMPILED_TYPE happy_var_1) -> -	happyIn8-		 (TokKeyword KwCOMPILED_TYPE happy_var_1-	)}--happyReduce_48 = happySpecReduce_1  2# happyReduction_48-happyReduction_48 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwCOMPILED_EPIC happy_var_1) -> -	happyIn8-		 (TokKeyword KwCOMPILED_EPIC happy_var_1-	)}--happyReduce_49 = happySpecReduce_1  2# happyReduction_49-happyReduction_49 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwCOMPILED_JS happy_var_1) -> -	happyIn8-		 (TokKeyword KwCOMPILED_JS happy_var_1-	)}--happyReduce_50 = happySpecReduce_1  2# happyReduction_50-happyReduction_50 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwSTATIC happy_var_1) -> -	happyIn8-		 (TokKeyword KwSTATIC happy_var_1-	)}--happyReduce_51 = happySpecReduce_1  2# happyReduction_51-happyReduction_51 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwIMPOSSIBLE happy_var_1) -> -	happyIn8-		 (TokKeyword KwIMPOSSIBLE happy_var_1-	)}--happyReduce_52 = happySpecReduce_1  2# happyReduction_52-happyReduction_52 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwETA happy_var_1) -> -	happyIn8-		 (TokKeyword KwETA happy_var_1-	)}--happyReduce_53 = happySpecReduce_1  2# happyReduction_53-happyReduction_53 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwNO_TERMINATION_CHECK happy_var_1) -> -	happyIn8-		 (TokKeyword KwNO_TERMINATION_CHECK happy_var_1-	)}--happyReduce_54 = happySpecReduce_1  2# happyReduction_54-happyReduction_54 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwNON_TERMINATING happy_var_1) -> -	happyIn8-		 (TokKeyword KwNON_TERMINATING happy_var_1-	)}--happyReduce_55 = happySpecReduce_1  2# happyReduction_55-happyReduction_55 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwTERMINATING happy_var_1) -> -	happyIn8-		 (TokKeyword KwTERMINATING happy_var_1-	)}--happyReduce_56 = happySpecReduce_1  2# happyReduction_56-happyReduction_56 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwMEASURE happy_var_1) -> -	happyIn8-		 (TokKeyword KwMEASURE happy_var_1-	)}--happyReduce_57 = happySpecReduce_1  2# happyReduction_57-happyReduction_57 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwQuoteGoal happy_var_1) -> -	happyIn8-		 (TokKeyword KwQuoteGoal happy_var_1-	)}--happyReduce_58 = happySpecReduce_1  2# happyReduction_58-happyReduction_58 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwQuoteContext happy_var_1) -> -	happyIn8-		 (TokKeyword KwQuoteContext happy_var_1-	)}--happyReduce_59 = happySpecReduce_1  2# happyReduction_59-happyReduction_59 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwQuote happy_var_1) -> -	happyIn8-		 (TokKeyword KwQuote happy_var_1-	)}--happyReduce_60 = happySpecReduce_1  2# happyReduction_60-happyReduction_60 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwQuoteTerm happy_var_1) -> -	happyIn8-		 (TokKeyword KwQuoteTerm happy_var_1-	)}--happyReduce_61 = happySpecReduce_1  2# happyReduction_61-happyReduction_61 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwTactic happy_var_1) -> -	happyIn8-		 (TokKeyword KwTactic happy_var_1-	)}--happyReduce_62 = happySpecReduce_1  2# happyReduction_62-happyReduction_62 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwUnquote happy_var_1) -> -	happyIn8-		 (TokKeyword KwUnquote happy_var_1-	)}--happyReduce_63 = happySpecReduce_1  2# happyReduction_63-happyReduction_63 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwUnquoteDecl happy_var_1) -> -	happyIn8-		 (TokKeyword KwUnquoteDecl happy_var_1-	)}--happyReduce_64 = happySpecReduce_1  2# happyReduction_64-happyReduction_64 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSetN happy_var_1) -> -	happyIn8-		 (TokSetN happy_var_1-	)}--happyReduce_65 = happySpecReduce_1  2# happyReduction_65-happyReduction_65 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokTeX happy_var_1) -> -	happyIn8-		 (TokTeX happy_var_1-	)}--happyReduce_66 = happySpecReduce_1  2# happyReduction_66-happyReduction_66 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokComment happy_var_1) -> -	happyIn8-		 (TokComment happy_var_1-	)}--happyReduce_67 = happySpecReduce_1  2# happyReduction_67-happyReduction_67 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymEllipsis happy_var_1) -> -	happyIn8-		 (TokSymbol SymEllipsis happy_var_1-	)}--happyReduce_68 = happySpecReduce_1  2# happyReduction_68-happyReduction_68 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymDotDot happy_var_1) -> -	happyIn8-		 (TokSymbol SymDotDot happy_var_1-	)}--happyReduce_69 = happySpecReduce_1  2# happyReduction_69-happyReduction_69 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymDot happy_var_1) -> -	happyIn8-		 (TokSymbol SymDot happy_var_1-	)}--happyReduce_70 = happySpecReduce_1  2# happyReduction_70-happyReduction_70 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymSemi happy_var_1) -> -	happyIn8-		 (TokSymbol SymSemi happy_var_1-	)}--happyReduce_71 = happySpecReduce_1  2# happyReduction_71-happyReduction_71 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymColon happy_var_1) -> -	happyIn8-		 (TokSymbol SymColon happy_var_1-	)}--happyReduce_72 = happySpecReduce_1  2# happyReduction_72-happyReduction_72 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymEqual happy_var_1) -> -	happyIn8-		 (TokSymbol SymEqual happy_var_1-	)}--happyReduce_73 = happySpecReduce_1  2# happyReduction_73-happyReduction_73 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymUnderscore happy_var_1) -> -	happyIn8-		 (TokSymbol SymUnderscore happy_var_1-	)}--happyReduce_74 = happySpecReduce_1  2# happyReduction_74-happyReduction_74 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymQuestionMark happy_var_1) -> -	happyIn8-		 (TokSymbol SymQuestionMark happy_var_1-	)}--happyReduce_75 = happySpecReduce_1  2# happyReduction_75-happyReduction_75 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymArrow happy_var_1) -> -	happyIn8-		 (TokSymbol SymArrow happy_var_1-	)}--happyReduce_76 = happySpecReduce_1  2# happyReduction_76-happyReduction_76 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymLambda happy_var_1) -> -	happyIn8-		 (TokSymbol SymLambda happy_var_1-	)}--happyReduce_77 = happySpecReduce_1  2# happyReduction_77-happyReduction_77 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymAs happy_var_1) -> -	happyIn8-		 (TokSymbol SymAs happy_var_1-	)}--happyReduce_78 = happySpecReduce_1  2# happyReduction_78-happyReduction_78 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymBar happy_var_1) -> -	happyIn8-		 (TokSymbol SymBar happy_var_1-	)}--happyReduce_79 = happySpecReduce_1  2# happyReduction_79-happyReduction_79 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenParen happy_var_1) -> -	happyIn8-		 (TokSymbol SymOpenParen happy_var_1-	)}--happyReduce_80 = happySpecReduce_1  2# happyReduction_80-happyReduction_80 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymCloseParen happy_var_1) -> -	happyIn8-		 (TokSymbol SymCloseParen happy_var_1-	)}--happyReduce_81 = happySpecReduce_1  2# happyReduction_81-happyReduction_81 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymDoubleOpenBrace happy_var_1) -> -	happyIn8-		 (TokSymbol SymDoubleOpenBrace happy_var_1-	)}--happyReduce_82 = happySpecReduce_1  2# happyReduction_82-happyReduction_82 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymDoubleCloseBrace happy_var_1) -> -	happyIn8-		 (TokSymbol SymDoubleCloseBrace happy_var_1-	)}--happyReduce_83 = happySpecReduce_1  2# happyReduction_83-happyReduction_83 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenBrace happy_var_1) -> -	happyIn8-		 (TokSymbol SymOpenBrace happy_var_1-	)}--happyReduce_84 = happySpecReduce_1  2# happyReduction_84-happyReduction_84 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymCloseBrace happy_var_1) -> -	happyIn8-		 (TokSymbol SymCloseBrace happy_var_1-	)}--happyReduce_85 = happySpecReduce_1  2# happyReduction_85-happyReduction_85 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenVirtualBrace happy_var_1) -> -	happyIn8-		 (TokSymbol SymOpenVirtualBrace happy_var_1-	)}--happyReduce_86 = happySpecReduce_1  2# happyReduction_86-happyReduction_86 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymCloseVirtualBrace happy_var_1) -> -	happyIn8-		 (TokSymbol SymCloseVirtualBrace happy_var_1-	)}--happyReduce_87 = happySpecReduce_1  2# happyReduction_87-happyReduction_87 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymVirtualSemi happy_var_1) -> -	happyIn8-		 (TokSymbol SymVirtualSemi happy_var_1-	)}--happyReduce_88 = happySpecReduce_1  2# happyReduction_88-happyReduction_88 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> -	happyIn8-		 (TokSymbol SymOpenPragma happy_var_1-	)}--happyReduce_89 = happySpecReduce_1  2# happyReduction_89-happyReduction_89 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymClosePragma happy_var_1) -> -	happyIn8-		 (TokSymbol SymClosePragma happy_var_1-	)}--happyReduce_90 = happySpecReduce_1  2# happyReduction_90-happyReduction_90 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokId happy_var_1) -> -	happyIn8-		 (TokId happy_var_1-	)}--happyReduce_91 = happySpecReduce_1  2# happyReduction_91-happyReduction_91 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokQId happy_var_1) -> -	happyIn8-		 (TokQId happy_var_1-	)}--happyReduce_92 = happySpecReduce_1  2# happyReduction_92-happyReduction_92 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokString happy_var_1) -> -	happyIn8-		 (TokString happy_var_1-	)}--happyReduce_93 = happySpecReduce_1  2# happyReduction_93-happyReduction_93 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokLiteral happy_var_1) -> -	happyIn8-		 (TokLiteral happy_var_1-	)}--happyReduce_94 = happySpecReduce_3  3# happyReduction_94-happyReduction_94 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut115 happy_x_2 of { happy_var_2 -> -	happyIn9-		 (takeOptionsPragmas happy_var_2-	)}--happyReduce_95 = happySpecReduce_0  4# happyReduction_95-happyReduction_95  =  happyIn10-		 (()-	)--happyReduce_96 = happySpecReduce_1  4# happyReduction_96-happyReduction_96 happy_x_1-	 =  happyIn10-		 (()-	)--happyReduce_97 = happySpecReduce_1  5# happyReduction_97-happyReduction_97 happy_x_1-	 =  happyIn11-		 (()-	)--happyReduce_98 = happyMonadReduce 1# 5# happyReduction_98-happyReduction_98 (happy_x_1 `HappyStk`-	happyRest) tk-	 = happyThen (( popContext)-	) (\r -> happyReturn (happyIn11 r))--happyReduce_99 = happySpecReduce_1  6# happyReduction_99-happyReduction_99 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymSemi happy_var_1) -> -	happyIn12-		 (happy_var_1-	)}--happyReduce_100 = happySpecReduce_1  6# happyReduction_100-happyReduction_100 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymVirtualSemi happy_var_1) -> -	happyIn12-		 (happy_var_1-	)}--happyReduce_101 = happyMonadReduce 0# 7# happyReduction_101-happyReduction_101 (happyRest) tk-	 = happyThen (( pushLexState imp_dir)-	) (\r -> happyReturn (happyIn13 r))--happyReduce_102 = happyMonadReduce 1# 8# happyReduction_102-happyReduction_102 (happy_x_1 `HappyStk`-	happyRest) tk-	 = happyThen (case happyOutTok happy_x_1 of { (TokLiteral happy_var_1) -> -	( case happy_var_1 of {-                     LitInt _ i -> return i;-                     _          -> fail $ "Expected integer"-                   })}-	) (\r -> happyReturn (happyIn14 r))--happyReduce_103 = happyMonadReduce 1# 8# happyReduction_103-happyReduction_103 (happy_x_1 `HappyStk`-	happyRest) tk-	 = happyThen (case happyOutTok happy_x_1 of { (TokId happy_var_1) -> -	( case happy_var_1 of {-             (_, s) -> case readM s of {-                         Right i  -> return i;-                         Left (err :: String) -> fail $ "Expected integer"-                       }-           })}-	) (\r -> happyReturn (happyIn14 r))--happyReduce_104 = happyMonadReduce 1# 9# happyReduction_104-happyReduction_104 (happy_x_1 `HappyStk`-	happyRest) tk-	 = happyThen (case happyOutTok happy_x_1 of { (TokId happy_var_1) -> -	( mkName happy_var_1)}-	) (\r -> happyReturn (happyIn15 r))--happyReduce_105 = happySpecReduce_2  10# happyReduction_105-happyReduction_105 happy_x_2-	happy_x_1-	 =  case happyOut15 happy_x_1 of { happy_var_1 -> -	case happyOut16 happy_x_2 of { happy_var_2 -> -	happyIn16-		 (happy_var_1 : happy_var_2-	)}}--happyReduce_106 = happySpecReduce_1  10# happyReduction_106-happyReduction_106 happy_x_1-	 =  case happyOut15 happy_x_1 of { happy_var_1 -> -	happyIn16-		 ([happy_var_1]-	)}--happyReduce_107 = happySpecReduce_1  11# happyReduction_107-happyReduction_107 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymDoubleCloseBrace happy_var_1) -> -	happyIn17-		 (getRange happy_var_1-	)}--happyReduce_108 = happyMonadReduce 2# 11# happyReduction_108-happyReduction_108 (happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest) tk-	 = happyThen (case happyOutTok happy_x_1 of { (TokSymbol SymCloseBrace happy_var_1) -> -	case happyOutTok happy_x_2 of { (TokSymbol SymCloseBrace happy_var_2) -> -	(-      if posPos (fromJust (rEnd (getRange happy_var_2))) --         posPos (fromJust (rStart (getRange happy_var_1))) > 2-      then parseErrorAt (fromJust (rStart (getRange happy_var_2)))-         "Expecting '}}', found separated '}'s."-      else return $ getRange (happy_var_1, happy_var_2))}}-	) (\r -> happyReturn (happyIn17 r))--happyReduce_109 = happySpecReduce_2  12# happyReduction_109-happyReduction_109 happy_x_2-	happy_x_1-	 =  case happyOut15 happy_x_2 of { happy_var_2 -> -	happyIn18-		 (setRelevance Irrelevant $ defaultArg happy_var_2-	)}--happyReduce_110 = happySpecReduce_1  12# happyReduction_110-happyReduction_110 happy_x_1-	 =  case happyOut15 happy_x_1 of { happy_var_1 -> -	happyIn18-		 (defaultArg happy_var_1-	)}--happyReduce_111 = happySpecReduce_2  13# happyReduction_111-happyReduction_111 happy_x_2-	happy_x_1-	 =  case happyOut18 happy_x_1 of { happy_var_1 -> -	case happyOut19 happy_x_2 of { happy_var_2 -> -	happyIn19-		 (happy_var_1 : happy_var_2-	)}}--happyReduce_112 = happySpecReduce_1  13# happyReduction_112-happyReduction_112 happy_x_1-	 =  case happyOut18 happy_x_1 of { happy_var_1 -> -	happyIn19-		 ([happy_var_1]-	)}--happyReduce_113 = happySpecReduce_2  14# happyReduction_113-happyReduction_113 happy_x_2-	happy_x_1-	 =  case happyOut18 happy_x_1 of { happy_var_1 -> -	case happyOut20 happy_x_2 of { happy_var_2 -> -	happyIn20-		 (happy_var_1 : happy_var_2-	)}}--happyReduce_114 = happySpecReduce_1  14# happyReduction_114-happyReduction_114 happy_x_1-	 =  case happyOut18 happy_x_1 of { happy_var_1 -> -	happyIn20-		 ([happy_var_1]-	)}--happyReduce_115 = happyReduce 4# 14# happyReduction_115-happyReduction_115 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut19 happy_x_2 of { happy_var_2 -> -	case happyOut20 happy_x_4 of { happy_var_4 -> -	happyIn20-		 (map makeInstance happy_var_2 ++ happy_var_4-	) `HappyStk` happyRest}}--happyReduce_116 = happySpecReduce_3  14# happyReduction_116-happyReduction_116 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut19 happy_x_2 of { happy_var_2 -> -	happyIn20-		 (map makeInstance happy_var_2-	)}--happyReduce_117 = happyReduce 4# 14# happyReduction_117-happyReduction_117 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut19 happy_x_2 of { happy_var_2 -> -	case happyOut20 happy_x_4 of { happy_var_4 -> -	happyIn20-		 (map hide happy_var_2 ++ happy_var_4-	) `HappyStk` happyRest}}--happyReduce_118 = happySpecReduce_3  14# happyReduction_118-happyReduction_118 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut19 happy_x_2 of { happy_var_2 -> -	happyIn20-		 (map hide happy_var_2-	)}--happyReduce_119 = happyReduce 5# 14# happyReduction_119-happyReduction_119 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut16 happy_x_3 of { happy_var_3 -> -	case happyOut20 happy_x_5 of { happy_var_5 -> -	happyIn20-		 (map (hide . setRelevance Irrelevant . defaultArg) happy_var_3 ++ happy_var_5-	) `HappyStk` happyRest}}--happyReduce_120 = happyReduce 4# 14# happyReduction_120-happyReduction_120 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut16 happy_x_3 of { happy_var_3 -> -	happyIn20-		 (map (hide . setRelevance Irrelevant . defaultArg) happy_var_3-	) `HappyStk` happyRest}--happyReduce_121 = happyReduce 5# 14# happyReduction_121-happyReduction_121 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut16 happy_x_3 of { happy_var_3 -> -	case happyOut20 happy_x_5 of { happy_var_5 -> -	happyIn20-		 (map (makeInstance . setRelevance Irrelevant . defaultArg) happy_var_3 ++ happy_var_5-	) `HappyStk` happyRest}}--happyReduce_122 = happyReduce 4# 14# happyReduction_122-happyReduction_122 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut16 happy_x_3 of { happy_var_3 -> -	happyIn20-		 (map (makeInstance . setRelevance Irrelevant . defaultArg) happy_var_3-	) `HappyStk` happyRest}--happyReduce_123 = happyReduce 5# 14# happyReduction_123-happyReduction_123 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut16 happy_x_3 of { happy_var_3 -> -	case happyOut20 happy_x_5 of { happy_var_5 -> -	happyIn20-		 (map (hide . setRelevance NonStrict . defaultArg) happy_var_3 ++ happy_var_5-	) `HappyStk` happyRest}}--happyReduce_124 = happyReduce 4# 14# happyReduction_124-happyReduction_124 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut16 happy_x_3 of { happy_var_3 -> -	happyIn20-		 (map (hide . setRelevance NonStrict . defaultArg) happy_var_3-	) `HappyStk` happyRest}--happyReduce_125 = happyReduce 5# 14# happyReduction_125-happyReduction_125 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut16 happy_x_3 of { happy_var_3 -> -	case happyOut20 happy_x_5 of { happy_var_5 -> -	happyIn20-		 (map (makeInstance . setRelevance NonStrict . defaultArg) happy_var_3 ++ happy_var_5-	) `HappyStk` happyRest}}--happyReduce_126 = happyReduce 4# 14# happyReduction_126-happyReduction_126 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut16 happy_x_3 of { happy_var_3 -> -	happyIn20-		 (map (makeInstance . setRelevance NonStrict . defaultArg) happy_var_3-	) `HappyStk` happyRest}--happyReduce_127 = happyMonadReduce 1# 15# happyReduction_127-happyReduction_127 (happy_x_1 `HappyStk`-	happyRest) tk-	 = happyThen (case happyOutTok happy_x_1 of { (TokQId happy_var_1) -> -	( mkQName happy_var_1)}-	) (\r -> happyReturn (happyIn21 r))--happyReduce_128 = happySpecReduce_1  15# happyReduction_128-happyReduction_128 happy_x_1-	 =  case happyOut15 happy_x_1 of { happy_var_1 -> -	happyIn21-		 (QName happy_var_1-	)}--happyReduce_129 = happySpecReduce_1  16# happyReduction_129-happyReduction_129 happy_x_1-	 =  case happyOut21 happy_x_1 of { happy_var_1 -> -	happyIn22-		 (happy_var_1-	)}--happyReduce_130 = happySpecReduce_1  17# happyReduction_130-happyReduction_130 happy_x_1-	 =  case happyOut15 happy_x_1 of { happy_var_1 -> -	happyIn23-		 (happy_var_1-	)}--happyReduce_131 = happySpecReduce_1  17# happyReduction_131-happyReduction_131 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymUnderscore happy_var_1) -> -	happyIn23-		 (Name (getRange happy_var_1) [Hole]-	)}--happyReduce_132 = happySpecReduce_2  18# happyReduction_132-happyReduction_132 happy_x_2-	happy_x_1-	 =  case happyOut23 happy_x_1 of { happy_var_1 -> -	case happyOut24 happy_x_2 of { happy_var_2 -> -	happyIn24-		 (happy_var_1 : happy_var_2-	)}}--happyReduce_133 = happySpecReduce_1  18# happyReduction_133-happyReduction_133 happy_x_1-	 =  case happyOut23 happy_x_1 of { happy_var_1 -> -	happyIn24-		 ([happy_var_1]-	)}--happyReduce_134 = happySpecReduce_1  19# happyReduction_134-happyReduction_134 happy_x_1-	 =  case happyOut26 happy_x_1 of { happy_var_1 -> -	happyIn25-		 (case happy_var_1 of-      Left ns -> ns-      Right _ -> fail $ "expected sequence of bound identifiers, not absurd pattern"-	)}--happyReduce_135 = happyMonadReduce 1# 20# happyReduction_135-happyReduction_135 (happy_x_1 `HappyStk`-	happyRest) tk-	 = happyThen (case happyOut35 happy_x_1 of { happy_var_1 -> -	(-    let getName :: Expr -> Maybe Name-        getName (Ident (QName x)) = Just x-        getName (Underscore r _)  = Just (Name r [Hole])-        getName _                 = Nothing--        isAbsurd :: Expr -> Bool-        isAbsurd (Absurd _)                  = True-        isAbsurd (HiddenArg _ (Named _ e))   = isAbsurd e-        isAbsurd (InstanceArg _ (Named _ e)) = isAbsurd e-        isAbsurd (Paren _ expr)              = isAbsurd expr-        isAbsurd (RawApp _ exprs)            = any isAbsurd exprs-        isAbsurd _                           = False-    in-    if any isAbsurd happy_var_1 then return $ Right happy_var_1 else-    case mapM getName happy_var_1 of-        Just good -> return $ Left good-        Nothing   -> fail $ "expected sequence of bound identifiers")}-	) (\r -> happyReturn (happyIn26 r))--happyReduce_136 = happyMonadReduce 1# 21# happyReduction_136-happyReduction_136 (happy_x_1 `HappyStk`-	happyRest) tk-	 = happyThen (case happyOut35 happy_x_1 of { happy_var_1 -> -	(-    let -- interpret an expression as name-        getName :: Expr -> Maybe Name-        getName (Ident (QName x)) = Just x-        getName (Underscore r _)  = Just (Name r [Hole])-        getName _                 = Nothing--        getNames :: Expr -> Maybe [Name]-        getNames (RawApp _ es) = mapM getName es-        getNames e             = singleton `fmap` getName e--        -- interpret an expression as name or list of hidden names-        getName1 :: Expr -> Maybe [WithHiding Name]-        getName1 (Ident (QName x)) = Just [WithHiding NotHidden x]-        getName1 (Underscore r _)  = Just [WithHiding NotHidden $ Name r [Hole]]-        getName1 (HiddenArg _ (Named Nothing e))-                                   = map (WithHiding Hidden) `fmap` getNames e-        getName1 _                 = Nothing--    in-    case mapM getName1 happy_var_1 of-        Just good -> return $ concat good-        Nothing   -> fail $ "expected sequence of possibly hidden bound identifiers")}-	) (\r -> happyReturn (happyIn27 r))--happyReduce_137 = happySpecReduce_0  22# happyReduction_137-happyReduction_137  =  happyIn28-		 ([]-	)--happyReduce_138 = happySpecReduce_2  22# happyReduction_138-happyReduction_138 happy_x_2-	happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokString happy_var_1) -> -	case happyOut28 happy_x_2 of { happy_var_2 -> -	happyIn28-		 (snd happy_var_1 : happy_var_2-	)}}--happyReduce_139 = happySpecReduce_1  23# happyReduction_139-happyReduction_139 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokString happy_var_1) -> -	happyIn29-		 (snd happy_var_1-	)}--happyReduce_140 = happyMonadReduce 1# 24# happyReduction_140-happyReduction_140 (happy_x_1 `HappyStk`-	happyRest) tk-	 = happyThen (case happyOutTok happy_x_1 of { (TokString happy_var_1) -> -	( mkName happy_var_1)}-	) (\r -> happyReturn (happyIn30 r))--happyReduce_141 = happyMonadReduce 1# 25# happyReduction_141-happyReduction_141 (happy_x_1 `HappyStk`-	happyRest) tk-	 = happyThen (case happyOutTok happy_x_1 of { (TokString happy_var_1) -> -	( fmap QName (mkName happy_var_1))}-	) (\r -> happyReturn (happyIn31 r))--happyReduce_142 = happySpecReduce_2  26# happyReduction_142-happyReduction_142 happy_x_2-	happy_x_1-	 =  case happyOut45 happy_x_1 of { happy_var_1 -> -	case happyOut32 happy_x_2 of { happy_var_2 -> -	happyIn32-		 (Pi happy_var_1 happy_var_2-	)}}--happyReduce_143 = happySpecReduce_3  26# happyReduction_143-happyReduction_143 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut59 happy_x_2 of { happy_var_2 -> -	case happyOut32 happy_x_3 of { happy_var_3 -> -	happyIn32-		 (forallPi happy_var_2 happy_var_3-	)}}--happyReduce_144 = happySpecReduce_3  26# happyReduction_144-happyReduction_144 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut38 happy_x_1 of { happy_var_1 -> -	case happyOutTok happy_x_2 of { (TokSymbol SymArrow happy_var_2) -> -	case happyOut32 happy_x_3 of { happy_var_3 -> -	happyIn32-		 (Fun (getRange (happy_var_1,happy_var_2,happy_var_3))-                                              (RawApp (getRange happy_var_1) happy_var_1)-                                              happy_var_3-	)}}}--happyReduce_145 = happySpecReduce_3  26# happyReduction_145-happyReduction_145 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut33 happy_x_1 of { happy_var_1 -> -	case happyOutTok happy_x_2 of { (TokSymbol SymEqual happy_var_2) -> -	case happyOut32 happy_x_3 of { happy_var_3 -> -	happyIn32-		 (Equal (getRange (happy_var_1, happy_var_2, happy_var_3)) happy_var_1 happy_var_3-	)}}}--happyReduce_146 = happySpecReduce_1  26# happyReduction_146-happyReduction_146 happy_x_1-	 =  case happyOut33 happy_x_1 of { happy_var_1 -> -	happyIn32-		 (happy_var_1-	)}--happyReduce_147 = happyMonadReduce 1# 27# happyReduction_147-happyReduction_147 (happy_x_1 `HappyStk`-	happyRest) tk-	 = happyThen (case happyOut34 happy_x_1 of { happy_var_1 -> -	( case happy_var_1 of-                      { [e]    -> return e-                      ; e : es -> return $ WithApp (fuseRange e es) e es-                      ; []     -> fail "impossible: empty with expressions"-                      })}-	) (\r -> happyReturn (happyIn33 r))--happyReduce_148 = happySpecReduce_3  28# happyReduction_148-happyReduction_148 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut38 happy_x_1 of { happy_var_1 -> -	case happyOut34 happy_x_3 of { happy_var_3 -> -	happyIn34-		 (RawApp (getRange happy_var_1) happy_var_1 :  happy_var_3-	)}}--happyReduce_149 = happySpecReduce_1  28# happyReduction_149-happyReduction_149 happy_x_1-	 =  case happyOut35 happy_x_1 of { happy_var_1 -> -	happyIn34-		 ([RawApp (getRange happy_var_1) happy_var_1]-	)}--happyReduce_150 = happySpecReduce_1  29# happyReduction_150-happyReduction_150 happy_x_1-	 =  case happyOut36 happy_x_1 of { happy_var_1 -> -	happyIn35-		 ([happy_var_1]-	)}--happyReduce_151 = happySpecReduce_2  29# happyReduction_151-happyReduction_151 happy_x_2-	happy_x_1-	 =  case happyOut41 happy_x_1 of { happy_var_1 -> -	case happyOut35 happy_x_2 of { happy_var_2 -> -	happyIn35-		 (happy_var_1 : happy_var_2-	)}}--happyReduce_152 = happySpecReduce_3  30# happyReduction_152-happyReduction_152 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymLambda happy_var_1) -> -	case happyOut51 happy_x_2 of { happy_var_2 -> -	case happyOut32 happy_x_3 of { happy_var_3 -> -	happyIn36-		 (Lam (getRange (happy_var_1,happy_var_2,happy_var_3)) happy_var_2 happy_var_3-	)}}}--happyReduce_153 = happySpecReduce_1  30# happyReduction_153-happyReduction_153 happy_x_1-	 =  case happyOut37 happy_x_1 of { happy_var_1 -> -	happyIn36-		 (happy_var_1-	)}--happyReduce_154 = happyReduce 4# 30# happyReduction_154-happyReduction_154 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokKeyword KwLet happy_var_1) -> -	case happyOut142 happy_x_2 of { happy_var_2 -> -	case happyOutTok happy_x_3 of { (TokKeyword KwIn happy_var_3) -> -	case happyOut32 happy_x_4 of { happy_var_4 -> -	happyIn36-		 (Let (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4)) happy_var_2 happy_var_4-	) `HappyStk` happyRest}}}}--happyReduce_155 = happySpecReduce_1  30# happyReduction_155-happyReduction_155 happy_x_1-	 =  case happyOut41 happy_x_1 of { happy_var_1 -> -	happyIn36-		 (happy_var_1-	)}--happyReduce_156 = happyReduce 4# 30# happyReduction_156-happyReduction_156 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokKeyword KwQuoteGoal happy_var_1) -> -	case happyOut15 happy_x_2 of { happy_var_2 -> -	case happyOutTok happy_x_3 of { (TokKeyword KwIn happy_var_3) -> -	case happyOut32 happy_x_4 of { happy_var_4 -> -	happyIn36-		 (QuoteGoal (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4)) happy_var_2 happy_var_4-	) `HappyStk` happyRest}}}}--happyReduce_157 = happyReduce 4# 30# happyReduction_157-happyReduction_157 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokKeyword KwQuoteContext happy_var_1) -> -	case happyOut15 happy_x_2 of { happy_var_2 -> -	case happyOutTok happy_x_3 of { (TokKeyword KwIn happy_var_3) -> -	case happyOut32 happy_x_4 of { happy_var_4 -> -	happyIn36-		 (QuoteContext (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4)) happy_var_2 happy_var_4-	) `HappyStk` happyRest}}}}--happyReduce_158 = happySpecReduce_2  30# happyReduction_158-happyReduction_158 happy_x_2-	happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwTactic happy_var_1) -> -	case happyOut38 happy_x_2 of { happy_var_2 -> -	happyIn36-		 (Tactic (getRange (happy_var_1, happy_var_2)) (RawApp (getRange happy_var_2) happy_var_2) []-	)}}--happyReduce_159 = happyReduce 4# 30# happyReduction_159-happyReduction_159 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokKeyword KwTactic happy_var_1) -> -	case happyOut38 happy_x_2 of { happy_var_2 -> -	case happyOutTok happy_x_3 of { (TokSymbol SymBar happy_var_3) -> -	case happyOut34 happy_x_4 of { happy_var_4 -> -	happyIn36-		 (Tactic (getRange (happy_var_1, happy_var_2, happy_var_3, happy_var_4)) (RawApp (getRange happy_var_2) happy_var_2) happy_var_4-	) `HappyStk` happyRest}}}}--happyReduce_160 = happyReduce 4# 31# happyReduction_160-happyReduction_160 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokSymbol SymLambda happy_var_1) -> -	case happyOutTok happy_x_2 of { (TokSymbol SymOpenBrace happy_var_2) -> -	case happyOut58 happy_x_3 of { happy_var_3 -> -	case happyOutTok happy_x_4 of { (TokSymbol SymCloseBrace happy_var_4) -> -	happyIn37-		 (ExtendedLam (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4)) (reverse happy_var_3)-	) `HappyStk` happyRest}}}}--happyReduce_161 = happyMonadReduce 2# 31# happyReduction_161-happyReduction_161 (happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest) tk-	 = happyThen (case happyOutTok happy_x_1 of { (TokSymbol SymLambda happy_var_1) -> -	case happyOut52 happy_x_2 of { happy_var_2 -> -	( case happy_var_2 of-                                       Left (bs, h) -> if null bs then return $ AbsurdLam r h else-                                                       return $ Lam r bs (AbsurdLam r h)-                                                         where r = fuseRange happy_var_1 bs-                                       Right es -> do -- it is of the form @\ { p1 ... () }@-                                                     p <- exprToLHS (RawApp (getRange es) es);-                                                     return $ ExtendedLam (fuseRange happy_var_1 es)-                                                                     [(p [] [], AbsurdRHS, NoWhere)])}}-	) (\r -> happyReturn (happyIn37 r))--happyReduce_162 = happySpecReduce_1  32# happyReduction_162-happyReduction_162 happy_x_1-	 =  case happyOut41 happy_x_1 of { happy_var_1 -> -	happyIn38-		 ([happy_var_1]-	)}--happyReduce_163 = happySpecReduce_2  32# happyReduction_163-happyReduction_163 happy_x_2-	happy_x_1-	 =  case happyOut41 happy_x_1 of { happy_var_1 -> -	case happyOut38 happy_x_2 of { happy_var_2 -> -	happyIn38-		 (happy_var_1 : happy_var_2-	)}}--happyReduce_164 = happySpecReduce_3  33# happyReduction_164-happyReduction_164 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenBrace happy_var_1) -> -	case happyOut32 happy_x_2 of { happy_var_2 -> -	case happyOutTok happy_x_3 of { (TokSymbol SymCloseBrace happy_var_3) -> -	happyIn39-		 (HiddenArg (getRange (happy_var_1,happy_var_2,happy_var_3)) (maybeNamed happy_var_2)-	)}}}--happyReduce_165 = happySpecReduce_2  33# happyReduction_165-happyReduction_165 happy_x_2-	happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenBrace happy_var_1) -> -	case happyOutTok happy_x_2 of { (TokSymbol SymCloseBrace happy_var_2) -> -	happyIn39-		 (let r = fuseRange happy_var_1 happy_var_2 in HiddenArg r $ unnamed $ Absurd r-	)}}--happyReduce_166 = happySpecReduce_1  34# happyReduction_166-happyReduction_166 happy_x_1-	 =  case happyOut21 happy_x_1 of { happy_var_1 -> -	happyIn40-		 (Ident happy_var_1-	)}--happyReduce_167 = happySpecReduce_1  34# happyReduction_167-happyReduction_167 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokLiteral happy_var_1) -> -	happyIn40-		 (Lit happy_var_1-	)}--happyReduce_168 = happySpecReduce_1  34# happyReduction_168-happyReduction_168 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymQuestionMark happy_var_1) -> -	happyIn40-		 (QuestionMark (getRange happy_var_1) Nothing-	)}--happyReduce_169 = happySpecReduce_1  34# happyReduction_169-happyReduction_169 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymUnderscore happy_var_1) -> -	happyIn40-		 (Underscore (getRange happy_var_1) Nothing-	)}--happyReduce_170 = happySpecReduce_1  34# happyReduction_170-happyReduction_170 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwProp happy_var_1) -> -	happyIn40-		 (Prop (getRange happy_var_1)-	)}--happyReduce_171 = happySpecReduce_1  34# happyReduction_171-happyReduction_171 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwSet happy_var_1) -> -	happyIn40-		 (Set (getRange happy_var_1)-	)}--happyReduce_172 = happySpecReduce_1  34# happyReduction_172-happyReduction_172 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwQuote happy_var_1) -> -	happyIn40-		 (Quote (getRange happy_var_1)-	)}--happyReduce_173 = happySpecReduce_1  34# happyReduction_173-happyReduction_173 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwQuoteTerm happy_var_1) -> -	happyIn40-		 (QuoteTerm (getRange happy_var_1)-	)}--happyReduce_174 = happySpecReduce_1  34# happyReduction_174-happyReduction_174 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwUnquote happy_var_1) -> -	happyIn40-		 (Unquote (getRange happy_var_1)-	)}--happyReduce_175 = happySpecReduce_1  34# happyReduction_175-happyReduction_175 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSetN happy_var_1) -> -	happyIn40-		 (SetN (getRange (fst happy_var_1)) (snd happy_var_1)-	)}--happyReduce_176 = happySpecReduce_3  34# happyReduction_176-happyReduction_176 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymDoubleOpenBrace happy_var_1) -> -	case happyOut32 happy_x_2 of { happy_var_2 -> -	case happyOut17 happy_x_3 of { happy_var_3 -> -	happyIn40-		 (InstanceArg (getRange (happy_var_1,happy_var_2,happy_var_3))-                                                          (maybeNamed happy_var_2)-	)}}}--happyReduce_177 = happySpecReduce_3  34# happyReduction_177-happyReduction_177 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenParen happy_var_1) -> -	case happyOut32 happy_x_2 of { happy_var_2 -> -	case happyOutTok happy_x_3 of { (TokSymbol SymCloseParen happy_var_3) -> -	happyIn40-		 (Paren (getRange (happy_var_1,happy_var_2,happy_var_3)) happy_var_2-	)}}}--happyReduce_178 = happySpecReduce_2  34# happyReduction_178-happyReduction_178 happy_x_2-	happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenParen happy_var_1) -> -	case happyOutTok happy_x_2 of { (TokSymbol SymCloseParen happy_var_2) -> -	happyIn40-		 (Absurd (fuseRange happy_var_1 happy_var_2)-	)}}--happyReduce_179 = happySpecReduce_2  34# happyReduction_179-happyReduction_179 happy_x_2-	happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymDoubleOpenBrace happy_var_1) -> -	case happyOut17 happy_x_2 of { happy_var_2 -> -	happyIn40-		 (let r = fuseRange happy_var_1 happy_var_2 in InstanceArg r $ unnamed $ Absurd r-	)}}--happyReduce_180 = happySpecReduce_3  34# happyReduction_180-happyReduction_180 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut15 happy_x_1 of { happy_var_1 -> -	case happyOutTok happy_x_2 of { (TokSymbol SymAs happy_var_2) -> -	case happyOut41 happy_x_3 of { happy_var_3 -> -	happyIn40-		 (As (getRange (happy_var_1,happy_var_2,happy_var_3)) happy_var_1 happy_var_3-	)}}}--happyReduce_181 = happySpecReduce_2  34# happyReduction_181-happyReduction_181 happy_x_2-	happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymDot happy_var_1) -> -	case happyOut41 happy_x_2 of { happy_var_2 -> -	happyIn40-		 (Dot (fuseRange happy_var_1 happy_var_2) happy_var_2-	)}}--happyReduce_182 = happyReduce 4# 34# happyReduction_182-happyReduction_182 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokKeyword KwRecord happy_var_1) -> -	case happyOutTok happy_x_2 of { (TokSymbol SymOpenBrace happy_var_2) -> -	case happyOut42 happy_x_3 of { happy_var_3 -> -	case happyOutTok happy_x_4 of { (TokSymbol SymCloseBrace happy_var_4) -> -	happyIn40-		 (Rec (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4)) happy_var_3-	) `HappyStk` happyRest}}}}--happyReduce_183 = happyReduce 5# 34# happyReduction_183-happyReduction_183 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokKeyword KwRecord happy_var_1) -> -	case happyOut40 happy_x_2 of { happy_var_2 -> -	case happyOutTok happy_x_3 of { (TokSymbol SymOpenBrace happy_var_3) -> -	case happyOut42 happy_x_4 of { happy_var_4 -> -	case happyOutTok happy_x_5 of { (TokSymbol SymCloseBrace happy_var_5) -> -	happyIn40-		 (RecUpdate (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5)) happy_var_2 happy_var_4-	) `HappyStk` happyRest}}}}}--happyReduce_184 = happySpecReduce_1  35# happyReduction_184-happyReduction_184 happy_x_1-	 =  case happyOut39 happy_x_1 of { happy_var_1 -> -	happyIn41-		 (happy_var_1-	)}--happyReduce_185 = happySpecReduce_1  35# happyReduction_185-happyReduction_185 happy_x_1-	 =  case happyOut40 happy_x_1 of { happy_var_1 -> -	happyIn41-		 (happy_var_1-	)}--happyReduce_186 = happySpecReduce_0  36# happyReduction_186-happyReduction_186  =  happyIn42-		 ([]-	)--happyReduce_187 = happySpecReduce_1  36# happyReduction_187-happyReduction_187 happy_x_1-	 =  case happyOut43 happy_x_1 of { happy_var_1 -> -	happyIn42-		 (happy_var_1-	)}--happyReduce_188 = happySpecReduce_1  37# happyReduction_188-happyReduction_188 happy_x_1-	 =  case happyOut44 happy_x_1 of { happy_var_1 -> -	happyIn43-		 ([happy_var_1]-	)}--happyReduce_189 = happySpecReduce_3  37# happyReduction_189-happyReduction_189 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut44 happy_x_1 of { happy_var_1 -> -	case happyOut43 happy_x_3 of { happy_var_3 -> -	happyIn43-		 (happy_var_1 : happy_var_3-	)}}--happyReduce_190 = happySpecReduce_3  38# happyReduction_190-happyReduction_190 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut15 happy_x_1 of { happy_var_1 -> -	case happyOut32 happy_x_3 of { happy_var_3 -> -	happyIn44-		 ((happy_var_1, happy_var_3)-	)}}--happyReduce_191 = happySpecReduce_2  39# happyReduction_191-happyReduction_191 happy_x_2-	happy_x_1-	 =  case happyOut46 happy_x_1 of { happy_var_1 -> -	happyIn45-		 (happy_var_1-	)}--happyReduce_192 = happySpecReduce_1  40# happyReduction_192-happyReduction_192 happy_x_1-	 =  case happyOut47 happy_x_1 of { happy_var_1 -> -	happyIn46-		 ({-TeleBind-} happy_var_1-	)}--happyReduce_193 = happySpecReduce_2  41# happyReduction_193-happyReduction_193 happy_x_2-	happy_x_1-	 =  case happyOut48 happy_x_1 of { happy_var_1 -> -	case happyOut47 happy_x_2 of { happy_var_2 -> -	happyIn47-		 (happy_var_1 : happy_var_2-	)}}--happyReduce_194 = happySpecReduce_1  41# happyReduction_194-happyReduction_194 happy_x_1-	 =  case happyOut48 happy_x_1 of { happy_var_1 -> -	happyIn47-		 ([happy_var_1]-	)}--happyReduce_195 = happyReduce 4# 42# happyReduction_195-happyReduction_195 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_2 of { (TokSymbol SymOpenParen happy_var_2) -> -	case happyOut50 happy_x_3 of { happy_var_3 -> -	case happyOutTok happy_x_4 of { (TokSymbol SymCloseParen happy_var_4) -> -	happyIn48-		 (setRange (getRange (happy_var_2,happy_var_3,happy_var_4)) $-                             setRelevance Irrelevant happy_var_3-	) `HappyStk` happyRest}}}--happyReduce_196 = happyReduce 4# 42# happyReduction_196-happyReduction_196 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_2 of { (TokSymbol SymOpenBrace happy_var_2) -> -	case happyOut49 happy_x_3 of { happy_var_3 -> -	case happyOutTok happy_x_4 of { (TokSymbol SymCloseBrace happy_var_4) -> -	happyIn48-		 (setRange (getRange (happy_var_2,happy_var_3,happy_var_4)) $-                             setHiding Hidden $-                             setRelevance Irrelevant happy_var_3-	) `HappyStk` happyRest}}}--happyReduce_197 = happyReduce 4# 42# happyReduction_197-happyReduction_197 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_2 of { (TokSymbol SymDoubleOpenBrace happy_var_2) -> -	case happyOut49 happy_x_3 of { happy_var_3 -> -	case happyOut17 happy_x_4 of { happy_var_4 -> -	happyIn48-		 (setRange (getRange (happy_var_2,happy_var_3,happy_var_4)) $-                             setHiding Instance $-                             setRelevance Irrelevant happy_var_3-	) `HappyStk` happyRest}}}--happyReduce_198 = happyReduce 4# 42# happyReduction_198-happyReduction_198 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_2 of { (TokSymbol SymOpenParen happy_var_2) -> -	case happyOut50 happy_x_3 of { happy_var_3 -> -	case happyOutTok happy_x_4 of { (TokSymbol SymCloseParen happy_var_4) -> -	happyIn48-		 (setRange (getRange (happy_var_2,happy_var_3,happy_var_4)) $-                             setRelevance NonStrict happy_var_3-	) `HappyStk` happyRest}}}--happyReduce_199 = happyReduce 4# 42# happyReduction_199-happyReduction_199 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_2 of { (TokSymbol SymOpenBrace happy_var_2) -> -	case happyOut49 happy_x_3 of { happy_var_3 -> -	case happyOutTok happy_x_4 of { (TokSymbol SymCloseBrace happy_var_4) -> -	happyIn48-		 (setRange (getRange (happy_var_2,happy_var_3,happy_var_4)) $-                             setHiding Hidden $-                             setRelevance NonStrict happy_var_3-	) `HappyStk` happyRest}}}--happyReduce_200 = happyReduce 4# 42# happyReduction_200-happyReduction_200 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_2 of { (TokSymbol SymDoubleOpenBrace happy_var_2) -> -	case happyOut49 happy_x_3 of { happy_var_3 -> -	case happyOut17 happy_x_4 of { happy_var_4 -> -	happyIn48-		 (setRange (getRange (happy_var_2,happy_var_3,happy_var_4)) $-                             setHiding Instance $-                             setRelevance NonStrict happy_var_3-	) `HappyStk` happyRest}}}--happyReduce_201 = happySpecReduce_3  42# happyReduction_201-happyReduction_201 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenParen happy_var_1) -> -	case happyOut50 happy_x_2 of { happy_var_2 -> -	case happyOutTok happy_x_3 of { (TokSymbol SymCloseParen happy_var_3) -> -	happyIn48-		 (setRange (getRange (happy_var_1,happy_var_2,happy_var_3)) happy_var_2-	)}}}--happyReduce_202 = happySpecReduce_3  42# happyReduction_202-happyReduction_202 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymDoubleOpenBrace happy_var_1) -> -	case happyOut49 happy_x_2 of { happy_var_2 -> -	case happyOut17 happy_x_3 of { happy_var_3 -> -	happyIn48-		 (setRange (getRange (happy_var_1,happy_var_2,happy_var_3)) $-                             setHiding Instance happy_var_2-	)}}}--happyReduce_203 = happySpecReduce_3  42# happyReduction_203-happyReduction_203 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenBrace happy_var_1) -> -	case happyOut49 happy_x_2 of { happy_var_2 -> -	case happyOutTok happy_x_3 of { (TokSymbol SymCloseBrace happy_var_3) -> -	happyIn48-		 (setRange (getRange (happy_var_1,happy_var_2,happy_var_3)) $-                             setHiding Hidden happy_var_2-	)}}}--happyReduce_204 = happySpecReduce_3  42# happyReduction_204-happyReduction_204 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenParen happy_var_1) -> -	case happyOut109 happy_x_2 of { happy_var_2 -> -	case happyOutTok happy_x_3 of { (TokSymbol SymCloseParen happy_var_3) -> -	happyIn48-		 (tLet (getRange (happy_var_1,happy_var_3)) happy_var_2-	)}}}--happyReduce_205 = happyReduce 4# 42# happyReduction_205-happyReduction_205 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenParen happy_var_1) -> -	case happyOut142 happy_x_3 of { happy_var_3 -> -	case happyOutTok happy_x_4 of { (TokSymbol SymCloseParen happy_var_4) -> -	happyIn48-		 (tLet (getRange (happy_var_1,happy_var_4)) happy_var_3-	) `HappyStk` happyRest}}}--happyReduce_206 = happySpecReduce_3  43# happyReduction_206-happyReduction_206 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut25 happy_x_1 of { happy_var_1 -> -	case happyOutTok happy_x_2 of { (TokSymbol SymColon happy_var_2) -> -	case happyOut32 happy_x_3 of { happy_var_3 -> -	happyIn49-		 (let r = getRange (happy_var_1,happy_var_2,happy_var_3) -- the range is approximate only for TypedBindings-    in TypedBindings r $ defaultArg $ TBind r (map (pure . mkBoundName_) happy_var_1) happy_var_3-	)}}}--happyReduce_207 = happySpecReduce_3  44# happyReduction_207-happyReduction_207 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut27 happy_x_1 of { happy_var_1 -> -	case happyOutTok happy_x_2 of { (TokSymbol SymColon happy_var_2) -> -	case happyOut32 happy_x_3 of { happy_var_3 -> -	happyIn50-		 (let r = getRange (happy_var_1,happy_var_2,happy_var_3) -- the range is approximate only for TypedBindings-    in TypedBindings r $ defaultArg $ TBind r (map (fmap mkBoundName_) happy_var_1) happy_var_3-	)}}}--happyReduce_208 = happyMonadReduce 2# 45# happyReduction_208-happyReduction_208 (happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest) tk-	 = happyThen (case happyOut53 happy_x_1 of { happy_var_1 -> -	(-      case reverse happy_var_1 of-        Left _ : _ -> parseError "Absurd lambda cannot have a body."-        _ : _      -> return [ b | Right b <- happy_var_1 ]-        []         -> parsePanic "Empty LamBinds")}-	) (\r -> happyReturn (happyIn51 r))--happyReduce_209 = happyMonadReduce 1# 46# happyReduction_209-happyReduction_209 (happy_x_1 `HappyStk`-	happyRest) tk-	 = happyThen (case happyOut54 happy_x_1 of { happy_var_1 -> -	(-    case happy_var_1 of-      Left lb -> case reverse lb of-                   Right _ : _ -> parseError "Missing body for lambda"-                   Left h  : _ -> return $ Left ([ b | Right b <- init lb], h)-                   _           -> parseError "Unsupported variant of lambda"-      Right es -> return $ Right es)}-	) (\r -> happyReturn (happyIn52 r))--happyReduce_210 = happySpecReduce_2  47# happyReduction_210-happyReduction_210 happy_x_2-	happy_x_1-	 =  case happyOut62 happy_x_1 of { happy_var_1 -> -	case happyOut53 happy_x_2 of { happy_var_2 -> -	happyIn53-		 (map Right happy_var_1 ++ happy_var_2-	)}}--happyReduce_211 = happySpecReduce_2  47# happyReduction_211-happyReduction_211 happy_x_2-	happy_x_1-	 =  case happyOut48 happy_x_1 of { happy_var_1 -> -	case happyOut53 happy_x_2 of { happy_var_2 -> -	happyIn53-		 (Right (DomainFull happy_var_1) : happy_var_2-	)}}--happyReduce_212 = happySpecReduce_1  47# happyReduction_212-happyReduction_212 happy_x_1-	 =  case happyOut62 happy_x_1 of { happy_var_1 -> -	happyIn53-		 (map Right happy_var_1-	)}--happyReduce_213 = happySpecReduce_1  47# happyReduction_213-happyReduction_213 happy_x_1-	 =  case happyOut48 happy_x_1 of { happy_var_1 -> -	happyIn53-		 ([Right $ DomainFull happy_var_1]-	)}--happyReduce_214 = happySpecReduce_2  47# happyReduction_214-happyReduction_214 happy_x_2-	happy_x_1-	 =  happyIn53-		 ([Left NotHidden]-	)--happyReduce_215 = happySpecReduce_2  47# happyReduction_215-happyReduction_215 happy_x_2-	happy_x_1-	 =  happyIn53-		 ([Left Hidden]-	)--happyReduce_216 = happySpecReduce_2  47# happyReduction_216-happyReduction_216 happy_x_2-	happy_x_1-	 =  happyIn53-		 ([Left Instance]-	)--happyReduce_217 = happySpecReduce_2  48# happyReduction_217-happyReduction_217 happy_x_2-	happy_x_1-	 =  case happyOut62 happy_x_1 of { happy_var_1 -> -	case happyOut53 happy_x_2 of { happy_var_2 -> -	happyIn54-		 (Left $ map Right happy_var_1 ++ happy_var_2-	)}}--happyReduce_218 = happySpecReduce_2  48# happyReduction_218-happyReduction_218 happy_x_2-	happy_x_1-	 =  case happyOut48 happy_x_1 of { happy_var_1 -> -	case happyOut53 happy_x_2 of { happy_var_2 -> -	happyIn54-		 (Left $ Right (DomainFull happy_var_1) : happy_var_2-	)}}--happyReduce_219 = happySpecReduce_1  48# happyReduction_219-happyReduction_219 happy_x_1-	 =  case happyOut63 happy_x_1 of { happy_var_1 -> -	happyIn54-		 (case happy_var_1 of-                                    Left lb -> Left $ map Right lb-                                    Right es -> Right es-	)}--happyReduce_220 = happySpecReduce_1  48# happyReduction_220-happyReduction_220 happy_x_1-	 =  case happyOut48 happy_x_1 of { happy_var_1 -> -	happyIn54-		 (Left [Right $ DomainFull happy_var_1]-	)}--happyReduce_221 = happySpecReduce_2  48# happyReduction_221-happyReduction_221 happy_x_2-	happy_x_1-	 =  happyIn54-		 (Left [Left NotHidden]-	)--happyReduce_222 = happySpecReduce_2  48# happyReduction_222-happyReduction_222 happy_x_2-	happy_x_1-	 =  happyIn54-		 (Left [Left Hidden]-	)--happyReduce_223 = happySpecReduce_2  48# happyReduction_223-happyReduction_223 happy_x_2-	happy_x_1-	 =  happyIn54-		 (Left [Left Instance]-	)--happyReduce_224 = happyMonadReduce 3# 49# happyReduction_224-happyReduction_224 (happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest) tk-	 = happyThen (case happyOut38 happy_x_1 of { happy_var_1 -> -	case happyOut32 happy_x_3 of { happy_var_3 -> -	( do-      p <- exprToLHS (RawApp (getRange happy_var_1) happy_var_1) ;-      return (p [] [], RHS happy_var_3, NoWhere))}}-	) (\r -> happyReturn (happyIn55 r))--happyReduce_225 = happyMonadReduce 1# 50# happyReduction_225-happyReduction_225 (happy_x_1 `HappyStk`-	happyRest) tk-	 = happyThen (case happyOut35 happy_x_1 of { happy_var_1 -> -	( do-      p <- exprToLHS (RawApp (getRange happy_var_1) happy_var_1);-      return (p [] [], AbsurdRHS, NoWhere))}-	) (\r -> happyReturn (happyIn56 r))--happyReduce_226 = happySpecReduce_1  51# happyReduction_226-happyReduction_226 happy_x_1-	 =  case happyOut55 happy_x_1 of { happy_var_1 -> -	happyIn57-		 (happy_var_1-	)}--happyReduce_227 = happySpecReduce_1  51# happyReduction_227-happyReduction_227 happy_x_1-	 =  case happyOut56 happy_x_1 of { happy_var_1 -> -	happyIn57-		 (happy_var_1-	)}--happyReduce_228 = happySpecReduce_3  52# happyReduction_228-happyReduction_228 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut58 happy_x_1 of { happy_var_1 -> -	case happyOut57 happy_x_3 of { happy_var_3 -> -	happyIn58-		 (happy_var_3 : happy_var_1-	)}}--happyReduce_229 = happySpecReduce_3  52# happyReduction_229-happyReduction_229 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut56 happy_x_1 of { happy_var_1 -> -	case happyOut57 happy_x_3 of { happy_var_3 -> -	happyIn58-		 ([happy_var_3, happy_var_1]-	)}}--happyReduce_230 = happySpecReduce_1  52# happyReduction_230-happyReduction_230 happy_x_1-	 =  case happyOut55 happy_x_1 of { happy_var_1 -> -	happyIn58-		 ([happy_var_1]-	)}--happyReduce_231 = happySpecReduce_2  53# happyReduction_231-happyReduction_231 happy_x_2-	happy_x_1-	 =  case happyOut60 happy_x_1 of { happy_var_1 -> -	happyIn59-		 (happy_var_1-	)}--happyReduce_232 = happySpecReduce_2  54# happyReduction_232-happyReduction_232 happy_x_2-	happy_x_1-	 =  case happyOut62 happy_x_1 of { happy_var_1 -> -	case happyOut60 happy_x_2 of { happy_var_2 -> -	happyIn60-		 (happy_var_1 ++ happy_var_2-	)}}--happyReduce_233 = happySpecReduce_2  54# happyReduction_233-happyReduction_233 happy_x_2-	happy_x_1-	 =  case happyOut48 happy_x_1 of { happy_var_1 -> -	case happyOut60 happy_x_2 of { happy_var_2 -> -	happyIn60-		 (DomainFull happy_var_1 : happy_var_2-	)}}--happyReduce_234 = happySpecReduce_1  54# happyReduction_234-happyReduction_234 happy_x_1-	 =  case happyOut62 happy_x_1 of { happy_var_1 -> -	happyIn60-		 (happy_var_1-	)}--happyReduce_235 = happySpecReduce_1  54# happyReduction_235-happyReduction_235 happy_x_1-	 =  case happyOut48 happy_x_1 of { happy_var_1 -> -	happyIn60-		 ([DomainFull happy_var_1]-	)}--happyReduce_236 = happySpecReduce_2  55# happyReduction_236-happyReduction_236 happy_x_2-	happy_x_1-	 =  case happyOut62 happy_x_1 of { happy_var_1 -> -	case happyOut61 happy_x_2 of { happy_var_2 -> -	happyIn61-		 (happy_var_1 ++ happy_var_2-	)}}--happyReduce_237 = happySpecReduce_2  55# happyReduction_237-happyReduction_237 happy_x_2-	happy_x_1-	 =  case happyOut48 happy_x_1 of { happy_var_1 -> -	case happyOut61 happy_x_2 of { happy_var_2 -> -	happyIn61-		 (DomainFull happy_var_1 : happy_var_2-	)}}--happyReduce_238 = happySpecReduce_0  55# happyReduction_238-happyReduction_238  =  happyIn61-		 ([]-	)--happyReduce_239 = happySpecReduce_1  56# happyReduction_239-happyReduction_239 happy_x_1-	 =  case happyOut63 happy_x_1 of { happy_var_1 -> -	happyIn62-		 (case happy_var_1 of-                             Left lbs -> lbs-                             Right _ -> fail "expected sequence of bound identifiers, not absurd pattern"-	)}--happyReduce_240 = happySpecReduce_1  57# happyReduction_240-happyReduction_240 happy_x_1-	 =  case happyOut23 happy_x_1 of { happy_var_1 -> -	happyIn63-		 (Left [DomainFree defaultArgInfo $ mkBoundName_ happy_var_1]-	)}--happyReduce_241 = happySpecReduce_2  57# happyReduction_241-happyReduction_241 happy_x_2-	happy_x_1-	 =  case happyOut23 happy_x_2 of { happy_var_2 -> -	happyIn63-		 (Left [DomainFree (setRelevance Irrelevant $ defaultArgInfo) $ mkBoundName_ happy_var_2]-	)}--happyReduce_242 = happySpecReduce_2  57# happyReduction_242-happyReduction_242 happy_x_2-	happy_x_1-	 =  case happyOut23 happy_x_2 of { happy_var_2 -> -	happyIn63-		 (Left [DomainFree (setRelevance NonStrict $ defaultArgInfo) $ mkBoundName_ happy_var_2]-	)}--happyReduce_243 = happySpecReduce_3  57# happyReduction_243-happyReduction_243 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut26 happy_x_2 of { happy_var_2 -> -	happyIn63-		 (either (Left . map (DomainFree (setHiding Hidden $ defaultArgInfo) . mkBoundName_)) Right happy_var_2-	)}--happyReduce_244 = happySpecReduce_3  57# happyReduction_244-happyReduction_244 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut25 happy_x_2 of { happy_var_2 -> -	happyIn63-		 (Left $ map (DomainFree (setHiding Instance $ defaultArgInfo) . mkBoundName_) happy_var_2-	)}--happyReduce_245 = happyReduce 4# 57# happyReduction_245-happyReduction_245 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut25 happy_x_3 of { happy_var_3 -> -	happyIn63-		 (Left $ map (DomainFree (setHiding Hidden $ setRelevance Irrelevant $ defaultArgInfo) . mkBoundName_) happy_var_3-	) `HappyStk` happyRest}--happyReduce_246 = happyReduce 4# 57# happyReduction_246-happyReduction_246 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut25 happy_x_3 of { happy_var_3 -> -	happyIn63-		 (Left $ map (DomainFree (setHiding Instance $ setRelevance Irrelevant $ defaultArgInfo) . mkBoundName_) happy_var_3-	) `HappyStk` happyRest}--happyReduce_247 = happyReduce 4# 57# happyReduction_247-happyReduction_247 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut25 happy_x_3 of { happy_var_3 -> -	happyIn63-		 (Left $ map (DomainFree (setHiding Hidden $ setRelevance NonStrict $ defaultArgInfo) . mkBoundName_) happy_var_3-	) `HappyStk` happyRest}--happyReduce_248 = happyReduce 4# 57# happyReduction_248-happyReduction_248 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut25 happy_x_3 of { happy_var_3 -> -	happyIn63-		 (Left $ map (DomainFree  (setHiding Instance $ setRelevance NonStrict $ defaultArgInfo) . mkBoundName_) happy_var_3-	) `HappyStk` happyRest}--happyReduce_249 = happyMonadReduce 1# 58# happyReduction_249-happyReduction_249 (happy_x_1 `HappyStk`-	happyRest) tk-	 = happyThen (case happyOut65 happy_x_1 of { happy_var_1 -> -	( mergeImportDirectives happy_var_1)}-	) (\r -> happyReturn (happyIn64 r))--happyReduce_250 = happySpecReduce_2  59# happyReduction_250-happyReduction_250 happy_x_2-	happy_x_1-	 =  case happyOut66 happy_x_1 of { happy_var_1 -> -	case happyOut65 happy_x_2 of { happy_var_2 -> -	happyIn65-		 (happy_var_1 : happy_var_2-	)}}--happyReduce_251 = happySpecReduce_0  59# happyReduction_251-happyReduction_251  =  happyIn65-		 ([]-	)--happyReduce_252 = happySpecReduce_1  60# happyReduction_252-happyReduction_252 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwPublic happy_var_1) -> -	happyIn66-		 (defaultImportDir { importDirRange = getRange happy_var_1, publicOpen = True }-	)}--happyReduce_253 = happySpecReduce_1  60# happyReduction_253-happyReduction_253 happy_x_1-	 =  case happyOut67 happy_x_1 of { happy_var_1 -> -	happyIn66-		 (defaultImportDir { importDirRange = snd happy_var_1, usingOrHiding = fst happy_var_1 }-	)}--happyReduce_254 = happySpecReduce_1  60# happyReduction_254-happyReduction_254 happy_x_1-	 =  case happyOut68 happy_x_1 of { happy_var_1 -> -	happyIn66-		 (defaultImportDir { importDirRange = snd happy_var_1, renaming = fst happy_var_1 }-	)}--happyReduce_255 = happyReduce 4# 61# happyReduction_255-happyReduction_255 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokKeyword KwUsing happy_var_1) -> -	case happyOutTok happy_x_2 of { (TokSymbol SymOpenParen happy_var_2) -> -	case happyOut73 happy_x_3 of { happy_var_3 -> -	case happyOutTok happy_x_4 of { (TokSymbol SymCloseParen happy_var_4) -> -	happyIn67-		 ((Using happy_var_3 , getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4))-	) `HappyStk` happyRest}}}}--happyReduce_256 = happyReduce 4# 61# happyReduction_256-happyReduction_256 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokKeyword KwHiding happy_var_1) -> -	case happyOutTok happy_x_2 of { (TokSymbol SymOpenParen happy_var_2) -> -	case happyOut73 happy_x_3 of { happy_var_3 -> -	case happyOutTok happy_x_4 of { (TokSymbol SymCloseParen happy_var_4) -> -	happyIn67-		 ((Hiding happy_var_3 , getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4))-	) `HappyStk` happyRest}}}}--happyReduce_257 = happyReduce 4# 62# happyReduction_257-happyReduction_257 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokKeyword KwRenaming happy_var_1) -> -	case happyOutTok happy_x_2 of { (TokSymbol SymOpenParen happy_var_2) -> -	case happyOut69 happy_x_3 of { happy_var_3 -> -	case happyOutTok happy_x_4 of { (TokSymbol SymCloseParen happy_var_4) -> -	happyIn68-		 ((happy_var_3 , getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4))-	) `HappyStk` happyRest}}}}--happyReduce_258 = happySpecReduce_3  62# happyReduction_258-happyReduction_258 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwRenaming happy_var_1) -> -	case happyOutTok happy_x_2 of { (TokSymbol SymOpenParen happy_var_2) -> -	case happyOutTok happy_x_3 of { (TokSymbol SymCloseParen happy_var_3) -> -	happyIn68-		 (([] , getRange (happy_var_1,happy_var_2,happy_var_3))-	)}}}--happyReduce_259 = happySpecReduce_3  63# happyReduction_259-happyReduction_259 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut70 happy_x_1 of { happy_var_1 -> -	case happyOut69 happy_x_3 of { happy_var_3 -> -	happyIn69-		 (happy_var_1 : happy_var_3-	)}}--happyReduce_260 = happySpecReduce_1  63# happyReduction_260-happyReduction_260 happy_x_1-	 =  case happyOut70 happy_x_1 of { happy_var_1 -> -	happyIn69-		 ([happy_var_1]-	)}--happyReduce_261 = happySpecReduce_3  64# happyReduction_261-happyReduction_261 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut71 happy_x_1 of { happy_var_1 -> -	case happyOutTok happy_x_2 of { (TokKeyword KwTo happy_var_2) -> -	case happyOut15 happy_x_3 of { happy_var_3 -> -	happyIn70-		 (Renaming happy_var_1 happy_var_3 (getRange happy_var_2)-	)}}}--happyReduce_262 = happySpecReduce_2  65# happyReduction_262-happyReduction_262 happy_x_2-	happy_x_1-	 =  case happyOut15 happy_x_2 of { happy_var_2 -> -	happyIn71-		 (ImportedName happy_var_2-	)}--happyReduce_263 = happySpecReduce_3  65# happyReduction_263-happyReduction_263 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut15 happy_x_3 of { happy_var_3 -> -	happyIn71-		 (ImportedModule happy_var_3-	)}--happyReduce_264 = happySpecReduce_1  66# happyReduction_264-happyReduction_264 happy_x_1-	 =  case happyOut15 happy_x_1 of { happy_var_1 -> -	happyIn72-		 (ImportedName happy_var_1-	)}--happyReduce_265 = happySpecReduce_2  66# happyReduction_265-happyReduction_265 happy_x_2-	happy_x_1-	 =  case happyOut15 happy_x_2 of { happy_var_2 -> -	happyIn72-		 (ImportedModule happy_var_2-	)}--happyReduce_266 = happySpecReduce_0  67# happyReduction_266-happyReduction_266  =  happyIn73-		 ([]-	)--happyReduce_267 = happySpecReduce_1  67# happyReduction_267-happyReduction_267 happy_x_1-	 =  case happyOut74 happy_x_1 of { happy_var_1 -> -	happyIn73-		 (happy_var_1-	)}--happyReduce_268 = happySpecReduce_1  68# happyReduction_268-happyReduction_268 happy_x_1-	 =  case happyOut72 happy_x_1 of { happy_var_1 -> -	happyIn74-		 ([happy_var_1]-	)}--happyReduce_269 = happySpecReduce_3  68# happyReduction_269-happyReduction_269 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut72 happy_x_1 of { happy_var_1 -> -	case happyOut74 happy_x_3 of { happy_var_3 -> -	happyIn74-		 (happy_var_1 : happy_var_3-	)}}--happyReduce_270 = happyMonadReduce 3# 69# happyReduction_270-happyReduction_270 (happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest) tk-	 = happyThen (case happyOut33 happy_x_1 of { happy_var_1 -> -	case happyOut78 happy_x_2 of { happy_var_2 -> -	case happyOut77 happy_x_3 of { happy_var_3 -> -	( exprToLHS happy_var_1 >>= \p -> return (p happy_var_2 happy_var_3))}}}-	) (\r -> happyReturn (happyIn75 r))--happyReduce_271 = happyReduce 4# 69# happyReduction_271-happyReduction_271 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokSymbol SymEllipsis happy_var_1) -> -	case happyOut76 happy_x_2 of { happy_var_2 -> -	case happyOut78 happy_x_3 of { happy_var_3 -> -	case happyOut77 happy_x_4 of { happy_var_4 -> -	happyIn75-		 (Ellipsis (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4)) happy_var_2 happy_var_3 happy_var_4-	) `HappyStk` happyRest}}}}--happyReduce_272 = happySpecReduce_0  70# happyReduction_272-happyReduction_272  =  happyIn76-		 ([]-	)--happyReduce_273 = happyMonadReduce 3# 70# happyReduction_273-happyReduction_273 (happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest) tk-	 = happyThen (case happyOut38 happy_x_2 of { happy_var_2 -> -	case happyOut76 happy_x_3 of { happy_var_3 -> -	( exprToPattern (RawApp (getRange happy_var_2) happy_var_2) >>= \p ->-                   return (p : happy_var_3))}}-	) (\r -> happyReturn (happyIn76 r))--happyReduce_274 = happySpecReduce_0  71# happyReduction_274-happyReduction_274  =  happyIn77-		 ([]-	)--happyReduce_275 = happySpecReduce_2  71# happyReduction_275-happyReduction_275 happy_x_2-	happy_x_1-	 =  case happyOut32 happy_x_2 of { happy_var_2 -> -	happyIn77-		 (case happy_var_2 of { WithApp _ e es -> e : es; e -> [e] }-	)}--happyReduce_276 = happySpecReduce_0  72# happyReduction_276-happyReduction_276  =  happyIn78-		 ([]-	)--happyReduce_277 = happySpecReduce_2  72# happyReduction_277-happyReduction_277 happy_x_2-	happy_x_1-	 =  case happyOut33 happy_x_2 of { happy_var_2 -> -	happyIn78-		 (case happy_var_2 of { WithApp _ e es -> e : es; e -> [e] }-	)}--happyReduce_278 = happySpecReduce_0  73# happyReduction_278-happyReduction_278  =  happyIn79-		 (NoWhere-	)--happyReduce_279 = happySpecReduce_2  73# happyReduction_279-happyReduction_279 happy_x_2-	happy_x_1-	 =  case happyOut143 happy_x_2 of { happy_var_2 -> -	happyIn79-		 (AnyWhere happy_var_2-	)}--happyReduce_280 = happyReduce 4# 73# happyReduction_280-happyReduction_280 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut15 happy_x_2 of { happy_var_2 -> -	case happyOut143 happy_x_4 of { happy_var_4 -> -	happyIn79-		 (SomeWhere happy_var_2 happy_var_4-	) `HappyStk` happyRest}}--happyReduce_281 = happyReduce 4# 73# happyReduction_281-happyReduction_281 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut114 happy_x_2 of { happy_var_2 -> -	case happyOut143 happy_x_4 of { happy_var_4 -> -	happyIn79-		 (SomeWhere happy_var_2 happy_var_4-	) `HappyStk` happyRest}}--happyReduce_282 = happySpecReduce_1  74# happyReduction_282-happyReduction_282 happy_x_1-	 =  case happyOut91 happy_x_1 of { happy_var_1 -> -	happyIn80-		 (happy_var_1-	)}--happyReduce_283 = happySpecReduce_1  74# happyReduction_283-happyReduction_283 happy_x_1-	 =  case happyOut83 happy_x_1 of { happy_var_1 -> -	happyIn80-		 (happy_var_1-	)}--happyReduce_284 = happySpecReduce_1  74# happyReduction_284-happyReduction_284 happy_x_1-	 =  case happyOut85 happy_x_1 of { happy_var_1 -> -	happyIn80-		 ([happy_var_1]-	)}--happyReduce_285 = happySpecReduce_1  74# happyReduction_285-happyReduction_285 happy_x_1-	 =  case happyOut86 happy_x_1 of { happy_var_1 -> -	happyIn80-		 ([happy_var_1]-	)}--happyReduce_286 = happySpecReduce_1  74# happyReduction_286-happyReduction_286 happy_x_1-	 =  case happyOut87 happy_x_1 of { happy_var_1 -> -	happyIn80-		 ([happy_var_1]-	)}--happyReduce_287 = happySpecReduce_1  74# happyReduction_287-happyReduction_287 happy_x_1-	 =  case happyOut88 happy_x_1 of { happy_var_1 -> -	happyIn80-		 ([happy_var_1]-	)}--happyReduce_288 = happySpecReduce_1  74# happyReduction_288-happyReduction_288 happy_x_1-	 =  case happyOut90 happy_x_1 of { happy_var_1 -> -	happyIn80-		 ([happy_var_1]-	)}--happyReduce_289 = happySpecReduce_1  74# happyReduction_289-happyReduction_289 happy_x_1-	 =  case happyOut92 happy_x_1 of { happy_var_1 -> -	happyIn80-		 ([happy_var_1]-	)}--happyReduce_290 = happySpecReduce_1  74# happyReduction_290-happyReduction_290 happy_x_1-	 =  case happyOut93 happy_x_1 of { happy_var_1 -> -	happyIn80-		 ([happy_var_1]-	)}--happyReduce_291 = happySpecReduce_1  74# happyReduction_291-happyReduction_291 happy_x_1-	 =  case happyOut94 happy_x_1 of { happy_var_1 -> -	happyIn80-		 ([happy_var_1]-	)}--happyReduce_292 = happySpecReduce_1  74# happyReduction_292-happyReduction_292 happy_x_1-	 =  case happyOut95 happy_x_1 of { happy_var_1 -> -	happyIn80-		 ([happy_var_1]-	)}--happyReduce_293 = happySpecReduce_1  74# happyReduction_293-happyReduction_293 happy_x_1-	 =  case happyOut96 happy_x_1 of { happy_var_1 -> -	happyIn80-		 ([happy_var_1]-	)}--happyReduce_294 = happySpecReduce_1  74# happyReduction_294-happyReduction_294 happy_x_1-	 =  case happyOut97 happy_x_1 of { happy_var_1 -> -	happyIn80-		 ([happy_var_1]-	)}--happyReduce_295 = happySpecReduce_1  74# happyReduction_295-happyReduction_295 happy_x_1-	 =  case happyOut109 happy_x_1 of { happy_var_1 -> -	happyIn80-		 (happy_var_1-	)}--happyReduce_296 = happySpecReduce_1  74# happyReduction_296-happyReduction_296 happy_x_1-	 =  case happyOut112 happy_x_1 of { happy_var_1 -> -	happyIn80-		 ([happy_var_1]-	)}--happyReduce_297 = happySpecReduce_1  74# happyReduction_297-happyReduction_297 happy_x_1-	 =  case happyOut113 happy_x_1 of { happy_var_1 -> -	happyIn80-		 ([happy_var_1]-	)}--happyReduce_298 = happySpecReduce_1  74# happyReduction_298-happyReduction_298 happy_x_1-	 =  case happyOut116 happy_x_1 of { happy_var_1 -> -	happyIn80-		 ([happy_var_1]-	)}--happyReduce_299 = happySpecReduce_1  74# happyReduction_299-happyReduction_299 happy_x_1-	 =  case happyOut99 happy_x_1 of { happy_var_1 -> -	happyIn80-		 ([happy_var_1]-	)}--happyReduce_300 = happySpecReduce_1  74# happyReduction_300-happyReduction_300 happy_x_1-	 =  case happyOut100 happy_x_1 of { happy_var_1 -> -	happyIn80-		 ([happy_var_1]-	)}--happyReduce_301 = happySpecReduce_1  74# happyReduction_301-happyReduction_301 happy_x_1-	 =  case happyOut98 happy_x_1 of { happy_var_1 -> -	happyIn80-		 ([happy_var_1]-	)}--happyReduce_302 = happySpecReduce_3  75# happyReduction_302-happyReduction_302 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut16 happy_x_1 of { happy_var_1 -> -	case happyOut32 happy_x_3 of { happy_var_3 -> -	happyIn81-		 (map (\ x -> TypeSig defaultArgInfo x happy_var_3) happy_var_1-	)}}--happyReduce_303 = happySpecReduce_3  76# happyReduction_303-happyReduction_303 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut20 happy_x_1 of { happy_var_1 -> -	case happyOut32 happy_x_3 of { happy_var_3 -> -	happyIn82-		 (map (fmap (\ x -> TypeSig defaultArgInfo x happy_var_3)) happy_var_1-	)}}--happyReduce_304 = happyMonadReduce 3# 77# happyReduction_304-happyReduction_304 (happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest) tk-	 = happyThen (case happyOut75 happy_x_1 of { happy_var_1 -> -	case happyOut84 happy_x_2 of { happy_var_2 -> -	case happyOut79 happy_x_3 of { happy_var_3 -> -	( funClauseOrTypeSigs happy_var_1 happy_var_2 happy_var_3)}}}-	) (\r -> happyReturn (happyIn83 r))--happyReduce_305 = happySpecReduce_2  78# happyReduction_305-happyReduction_305 happy_x_2-	happy_x_1-	 =  case happyOut32 happy_x_2 of { happy_var_2 -> -	happyIn84-		 (JustRHS (RHS happy_var_2)-	)}--happyReduce_306 = happySpecReduce_2  78# happyReduction_306-happyReduction_306 happy_x_2-	happy_x_1-	 =  case happyOut32 happy_x_2 of { happy_var_2 -> -	happyIn84-		 (TypeSigsRHS happy_var_2-	)}--happyReduce_307 = happySpecReduce_0  78# happyReduction_307-happyReduction_307  =  happyIn84-		 (JustRHS AbsurdRHS-	)--happyReduce_308 = happyReduce 7# 79# happyReduction_308-happyReduction_308 (happy_x_7 `HappyStk`-	happy_x_6 `HappyStk`-	happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokKeyword KwData happy_var_1) -> -	case happyOut15 happy_x_2 of { happy_var_2 -> -	case happyOut61 happy_x_3 of { happy_var_3 -> -	case happyOutTok happy_x_4 of { (TokSymbol SymColon happy_var_4) -> -	case happyOut32 happy_x_5 of { happy_var_5 -> -	case happyOutTok happy_x_6 of { (TokKeyword KwWhere happy_var_6) -> -	case happyOut139 happy_x_7 of { happy_var_7 -> -	happyIn85-		 (Data (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5,happy_var_6,happy_var_7)) Inductive happy_var_2 happy_var_3 (Just happy_var_5) happy_var_7-	) `HappyStk` happyRest}}}}}}}--happyReduce_309 = happyReduce 7# 79# happyReduction_309-happyReduction_309 (happy_x_7 `HappyStk`-	happy_x_6 `HappyStk`-	happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokKeyword KwCoData happy_var_1) -> -	case happyOut15 happy_x_2 of { happy_var_2 -> -	case happyOut61 happy_x_3 of { happy_var_3 -> -	case happyOutTok happy_x_4 of { (TokSymbol SymColon happy_var_4) -> -	case happyOut32 happy_x_5 of { happy_var_5 -> -	case happyOutTok happy_x_6 of { (TokKeyword KwWhere happy_var_6) -> -	case happyOut139 happy_x_7 of { happy_var_7 -> -	happyIn85-		 (Data (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5,happy_var_6,happy_var_7)) CoInductive happy_var_2 happy_var_3 (Just happy_var_5) happy_var_7-	) `HappyStk` happyRest}}}}}}}--happyReduce_310 = happyReduce 5# 79# happyReduction_310-happyReduction_310 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokKeyword KwData happy_var_1) -> -	case happyOut15 happy_x_2 of { happy_var_2 -> -	case happyOut61 happy_x_3 of { happy_var_3 -> -	case happyOutTok happy_x_4 of { (TokKeyword KwWhere happy_var_4) -> -	case happyOut139 happy_x_5 of { happy_var_5 -> -	happyIn85-		 (Data (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5)) Inductive happy_var_2 happy_var_3 Nothing happy_var_5-	) `HappyStk` happyRest}}}}}--happyReduce_311 = happyReduce 5# 79# happyReduction_311-happyReduction_311 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokKeyword KwCoData happy_var_1) -> -	case happyOut15 happy_x_2 of { happy_var_2 -> -	case happyOut61 happy_x_3 of { happy_var_3 -> -	case happyOutTok happy_x_4 of { (TokKeyword KwWhere happy_var_4) -> -	case happyOut139 happy_x_5 of { happy_var_5 -> -	happyIn85-		 (Data (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5)) CoInductive happy_var_2 happy_var_3 Nothing happy_var_5-	) `HappyStk` happyRest}}}}}--happyReduce_312 = happyReduce 5# 80# happyReduction_312-happyReduction_312 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokKeyword KwData happy_var_1) -> -	case happyOut15 happy_x_2 of { happy_var_2 -> -	case happyOut61 happy_x_3 of { happy_var_3 -> -	case happyOutTok happy_x_4 of { (TokSymbol SymColon happy_var_4) -> -	case happyOut32 happy_x_5 of { happy_var_5 -> -	happyIn86-		 (DataSig (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5)) Inductive happy_var_2 happy_var_3 happy_var_5-	) `HappyStk` happyRest}}}}}--happyReduce_313 = happyMonadReduce 7# 81# happyReduction_313-happyReduction_313 (happy_x_7 `HappyStk`-	happy_x_6 `HappyStk`-	happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest) tk-	 = happyThen (case happyOutTok happy_x_1 of { (TokKeyword KwRecord happy_var_1) -> -	case happyOut40 happy_x_2 of { happy_var_2 -> -	case happyOut61 happy_x_3 of { happy_var_3 -> -	case happyOutTok happy_x_4 of { (TokSymbol SymColon happy_var_4) -> -	case happyOut32 happy_x_5 of { happy_var_5 -> -	case happyOutTok happy_x_6 of { (TokKeyword KwWhere happy_var_6) -> -	case happyOut140 happy_x_7 of { happy_var_7 -> -	( exprToName happy_var_2 >>= \ n -> return $ Record (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5,happy_var_6,happy_var_7)) n (fst3 happy_var_7) (snd3 happy_var_7) happy_var_3 (Just happy_var_5) (thd3 happy_var_7))}}}}}}}-	) (\r -> happyReturn (happyIn87 r))--happyReduce_314 = happyMonadReduce 5# 81# happyReduction_314-happyReduction_314 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest) tk-	 = happyThen (case happyOutTok happy_x_1 of { (TokKeyword KwRecord happy_var_1) -> -	case happyOut40 happy_x_2 of { happy_var_2 -> -	case happyOut61 happy_x_3 of { happy_var_3 -> -	case happyOutTok happy_x_4 of { (TokKeyword KwWhere happy_var_4) -> -	case happyOut140 happy_x_5 of { happy_var_5 -> -	( exprToName happy_var_2 >>= \ n -> return $ Record (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5)) n (fst3 happy_var_5) (snd3 happy_var_5) happy_var_3 Nothing (thd3 happy_var_5))}}}}}-	) (\r -> happyReturn (happyIn87 r))--happyReduce_315 = happyMonadReduce 5# 82# happyReduction_315-happyReduction_315 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest) tk-	 = happyThen (case happyOutTok happy_x_1 of { (TokKeyword KwRecord happy_var_1) -> -	case happyOut40 happy_x_2 of { happy_var_2 -> -	case happyOut61 happy_x_3 of { happy_var_3 -> -	case happyOutTok happy_x_4 of { (TokSymbol SymColon happy_var_4) -> -	case happyOut32 happy_x_5 of { happy_var_5 -> -	( exprToName happy_var_2 >>= \ n -> return $ RecordSig (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5)) n happy_var_3 happy_var_5)}}}}}-	) (\r -> happyReturn (happyIn88 r))--happyReduce_316 = happySpecReduce_2  83# happyReduction_316-happyReduction_316 happy_x_2-	happy_x_1-	 =  case happyOut15 happy_x_2 of { happy_var_2 -> -	happyIn89-		 (happy_var_2-	)}--happyReduce_317 = happySpecReduce_3  84# happyReduction_317-happyReduction_317 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwInfix happy_var_1) -> -	case happyOut14 happy_x_2 of { happy_var_2 -> -	case happyOut24 happy_x_3 of { happy_var_3 -> -	happyIn90-		 (Infix (Fixity (getRange (happy_var_1,happy_var_3)) happy_var_2 NonAssoc)   happy_var_3-	)}}}--happyReduce_318 = happySpecReduce_3  84# happyReduction_318-happyReduction_318 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwInfixL happy_var_1) -> -	case happyOut14 happy_x_2 of { happy_var_2 -> -	case happyOut24 happy_x_3 of { happy_var_3 -> -	happyIn90-		 (Infix (Fixity (getRange (happy_var_1,happy_var_3)) happy_var_2 LeftAssoc)  happy_var_3-	)}}}--happyReduce_319 = happySpecReduce_3  84# happyReduction_319-happyReduction_319 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwInfixR happy_var_1) -> -	case happyOut14 happy_x_2 of { happy_var_2 -> -	case happyOut24 happy_x_3 of { happy_var_3 -> -	happyIn90-		 (Infix (Fixity (getRange (happy_var_1,happy_var_3)) happy_var_2 RightAssoc) happy_var_3-	)}}}--happyReduce_320 = happySpecReduce_2  85# happyReduction_320-happyReduction_320 happy_x_2-	happy_x_1-	 =  case happyOut137 happy_x_2 of { happy_var_2 -> -	happyIn91-		 (let toField (Common.Arg info (TypeSig _ x t)) = Field x (Common.Arg info t) in map toField happy_var_2-	)}--happyReduce_321 = happySpecReduce_2  86# happyReduction_321-happyReduction_321 happy_x_2-	happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwMutual happy_var_1) -> -	case happyOut142 happy_x_2 of { happy_var_2 -> -	happyIn92-		 (Mutual (fuseRange happy_var_1 happy_var_2) happy_var_2-	)}}--happyReduce_322 = happySpecReduce_2  87# happyReduction_322-happyReduction_322 happy_x_2-	happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwAbstract happy_var_1) -> -	case happyOut142 happy_x_2 of { happy_var_2 -> -	happyIn93-		 (Abstract (fuseRange happy_var_1 happy_var_2) happy_var_2-	)}}--happyReduce_323 = happySpecReduce_2  88# happyReduction_323-happyReduction_323 happy_x_2-	happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwPrivate happy_var_1) -> -	case happyOut142 happy_x_2 of { happy_var_2 -> -	happyIn94-		 (Private (fuseRange happy_var_1 happy_var_2) happy_var_2-	)}}--happyReduce_324 = happySpecReduce_2  89# happyReduction_324-happyReduction_324 happy_x_2-	happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwInstance happy_var_1) -> -	case happyOut142 happy_x_2 of { happy_var_2 -> -	happyIn95-		 (InstanceB (fuseRange happy_var_1 happy_var_2) happy_var_2-	)}}--happyReduce_325 = happySpecReduce_2  90# happyReduction_325-happyReduction_325 happy_x_2-	happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwPostulate happy_var_1) -> -	case happyOut142 happy_x_2 of { happy_var_2 -> -	happyIn96-		 (Postulate (fuseRange happy_var_1 happy_var_2) happy_var_2-	)}}--happyReduce_326 = happySpecReduce_2  91# happyReduction_326-happyReduction_326 happy_x_2-	happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwPrimitive happy_var_1) -> -	case happyOut135 happy_x_2 of { happy_var_2 -> -	happyIn97-		 (Primitive (fuseRange happy_var_1 happy_var_2) happy_var_2-	)}}--happyReduce_327 = happyReduce 4# 92# happyReduction_327-happyReduction_327 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokKeyword KwUnquoteDecl happy_var_1) -> -	case happyOut15 happy_x_2 of { happy_var_2 -> -	case happyOut32 happy_x_4 of { happy_var_4 -> -	happyIn98-		 (UnquoteDecl (fuseRange happy_var_1 happy_var_4) happy_var_2 happy_var_4-	) `HappyStk` happyRest}}}--happyReduce_328 = happyMonadReduce 5# 93# happyReduction_328-happyReduction_328 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest) tk-	 = happyThen (case happyOut15 happy_x_2 of { happy_var_2 -> -	case happyOut103 happy_x_3 of { happy_var_3 -> -	case happyOut102 happy_x_5 of { happy_var_5 -> -	(-  case happy_var_2 of-    Name _ [_] -> case mkNotation happy_var_3 (map rangedThing happy_var_5) of-      Left err -> parseError $ "Malformed syntax declaration: " ++ err-      Right n -> return $ Syntax happy_var_2 n-    _ -> parseError "Syntax declarations are allowed only for simple names (without holes)")}}}-	) (\r -> happyReturn (happyIn99 r))--happyReduce_329 = happyMonadReduce 5# 94# happyReduction_329-happyReduction_329 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest) tk-	 = happyThen (case happyOutTok happy_x_1 of { (TokKeyword KwPatternSyn happy_var_1) -> -	case happyOut15 happy_x_2 of { happy_var_2 -> -	case happyOut101 happy_x_3 of { happy_var_3 -> -	case happyOutTok happy_x_4 of { (TokSymbol SymEqual happy_var_4) -> -	case happyOut32 happy_x_5 of { happy_var_5 -> -	( do-  p <- exprToPattern happy_var_5-  return (PatternSyn (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5)) happy_var_2 happy_var_3 p))}}}}}-	) (\r -> happyReturn (happyIn100 r))--happyReduce_330 = happySpecReduce_0  95# happyReduction_330-happyReduction_330  =  happyIn101-		 ([]-	)--happyReduce_331 = happyMonadReduce 1# 95# happyReduction_331-happyReduction_331 (happy_x_1 `HappyStk`-	happyRest) tk-	 = happyThen (case happyOut53 happy_x_1 of { happy_var_1 -> -	( patternSynArgs happy_var_1)}-	) (\r -> happyReturn (happyIn101 r))--happyReduce_332 = happySpecReduce_1  96# happyReduction_332-happyReduction_332 happy_x_1-	 =  case happyOut107 happy_x_1 of { happy_var_1 -> -	happyIn102-		 ([happy_var_1]-	)}--happyReduce_333 = happySpecReduce_2  96# happyReduction_333-happyReduction_333 happy_x_2-	happy_x_1-	 =  case happyOut102 happy_x_1 of { happy_var_1 -> -	case happyOut107 happy_x_2 of { happy_var_2 -> -	happyIn102-		 (happy_var_1 ++ [happy_var_2]-	)}}--happyReduce_334 = happySpecReduce_1  97# happyReduction_334-happyReduction_334 happy_x_1-	 =  case happyOut104 happy_x_1 of { happy_var_1 -> -	happyIn103-		 ([happy_var_1]-	)}--happyReduce_335 = happySpecReduce_2  97# happyReduction_335-happyReduction_335 happy_x_2-	happy_x_1-	 =  case happyOut103 happy_x_1 of { happy_var_1 -> -	case happyOut104 happy_x_2 of { happy_var_2 -> -	happyIn103-		 (happy_var_1 ++ [happy_var_2]-	)}}--happyReduce_336 = happySpecReduce_1  98# happyReduction_336-happyReduction_336 happy_x_1-	 =  case happyOut105 happy_x_1 of { happy_var_1 -> -	happyIn104-		 (defaultNamedArg happy_var_1-	)}--happyReduce_337 = happySpecReduce_3  98# happyReduction_337-happyReduction_337 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut106 happy_x_2 of { happy_var_2 -> -	happyIn104-		 (setHiding Hidden   $ defaultNamedArg happy_var_2-	)}--happyReduce_338 = happySpecReduce_3  98# happyReduction_338-happyReduction_338 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut106 happy_x_2 of { happy_var_2 -> -	happyIn104-		 (setHiding Instance $ defaultNamedArg happy_var_2-	)}--happyReduce_339 = happyReduce 5# 98# happyReduction_339-happyReduction_339 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut107 happy_x_2 of { happy_var_2 -> -	case happyOut106 happy_x_4 of { happy_var_4 -> -	happyIn104-		 (setHiding Hidden   $ defaultArg $ named happy_var_2 happy_var_4-	) `HappyStk` happyRest}}--happyReduce_340 = happyReduce 5# 98# happyReduction_340-happyReduction_340 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut107 happy_x_2 of { happy_var_2 -> -	case happyOut106 happy_x_4 of { happy_var_4 -> -	happyIn104-		 (setHiding Instance $ defaultArg $ named happy_var_2 happy_var_4-	) `HappyStk` happyRest}}--happyReduce_341 = happySpecReduce_1  99# happyReduction_341-happyReduction_341 happy_x_1-	 =  case happyOut107 happy_x_1 of { happy_var_1 -> -	happyIn105-		 (ExprHole (rangedThing happy_var_1)-	)}--happyReduce_342 = happyReduce 6# 99# happyReduction_342-happyReduction_342 (happy_x_6 `HappyStk`-	happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut107 happy_x_3 of { happy_var_3 -> -	case happyOut107 happy_x_5 of { happy_var_5 -> -	happyIn105-		 (LambdaHole (rangedThing happy_var_3) (rangedThing happy_var_5)-	) `HappyStk` happyRest}}--happyReduce_343 = happySpecReduce_1  100# happyReduction_343-happyReduction_343 happy_x_1-	 =  case happyOut107 happy_x_1 of { happy_var_1 -> -	happyIn106-		 (ExprHole (rangedThing happy_var_1)-	)}--happyReduce_344 = happyReduce 4# 100# happyReduction_344-happyReduction_344 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut107 happy_x_2 of { happy_var_2 -> -	case happyOut107 happy_x_4 of { happy_var_4 -> -	happyIn106-		 (LambdaHole (rangedThing happy_var_2) (rangedThing happy_var_4)-	) `HappyStk` happyRest}}--happyReduce_345 = happySpecReduce_1  101# happyReduction_345-happyReduction_345 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokId happy_var_1) -> -	happyIn107-		 (Ranged (getRange $ fst happy_var_1) (stringToRawName $ snd happy_var_1)-	)}--happyReduce_346 = happySpecReduce_1  102# happyReduction_346-happyReduction_346 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwOpen happy_var_1) -> -	happyIn108-		 (Just (getRange happy_var_1)-	)}--happyReduce_347 = happySpecReduce_0  102# happyReduction_347-happyReduction_347  =  happyIn108-		 (Nothing-	)--happyReduce_348 = happyMonadReduce 5# 103# happyReduction_348-happyReduction_348 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest) tk-	 = happyThen (case happyOut108 happy_x_1 of { happy_var_1 -> -	case happyOutTok happy_x_2 of { (TokKeyword KwImport happy_var_2) -> -	case happyOut22 happy_x_3 of { happy_var_3 -> -	case happyOut110 happy_x_4 of { happy_var_4 -> -	case happyOut64 happy_x_5 of { happy_var_5 -> -	(-    let-    { doOpen = maybe DontOpen (const DoOpen) happy_var_1-    ; m   = happy_var_3-    ; es  = happy_var_4-    ; dir = happy_var_5-    ; r   = getRange (m, es, dir)-    ; mr  = getRange m-    ; unique = hashString $ show $ (Nothing :: Maybe ()) <$ r-         -- turn range into unique id, but delete file path-         -- which is absolute and messes up suite of failing tests-         -- (different hashs on different installations)-         -- TODO: Don't use (insecure) hashes in this way.-    ; fresh = Name mr [ Id $ stringToRawName $ ".#" ++ show m ++ "-" ++ show unique ]-    ; impStm asR = Import mr m (Just (AsName fresh asR)) DontOpen defaultImportDir-    ; appStm m' es =-        let r = getRange (m, es) in-        Private r-          [ ModuleMacro r m'-             (SectionApp (getRange es) []-               (RawApp (getRange es) (Ident (QName fresh) : es)))-             doOpen dir-          ]-    ; (initArgs, last2Args) = splitAt (length es - 2) es-    ; parseAsClause = case last2Args of-      { [ Ident (QName (Name asR [Id x]))-        , Ident (QName m')-        ] | rawNameToString x == "as" -> Just (asR, m')-      ; _ -> Nothing-      }-    } in-    case es of-      { [] -> return [Import mr m Nothing doOpen dir]-      ; _ | Just (asR, m') <- parseAsClause ->-              if null initArgs then return-                 [ Import (getRange (m, asR, m', dir)) m-                     (Just (AsName m' asR)) doOpen dir-                 ]-              else return [ impStm asR, appStm m' initArgs ]-          | DontOpen <- doOpen -> parseErrorAt (fromJust $ rStart $ getRange happy_var_2) "An import statement with module instantiation does not actually import the module.  This statement achieves nothing.  Either add the `open' keyword or bind the instantiated module with an `as' clause."-          | otherwise -> return-              [ impStm noRange-              , appStm (noName $ beginningOf $ getRange m) es-              ]-      })}}}}}-	) (\r -> happyReturn (happyIn109 r))--happyReduce_349 = happyReduce 4# 103# happyReduction_349-happyReduction_349 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut22 happy_x_2 of { happy_var_2 -> -	case happyOut110 happy_x_3 of { happy_var_3 -> -	case happyOut64 happy_x_4 of { happy_var_4 -> -	happyIn109-		 (let-    { m   = happy_var_2-    ; es  = happy_var_3-    ; dir = happy_var_4-    ; r   = getRange (m, es, dir)-    } in-    [ case es of-      { []  -> Open r m dir-      ; _   -> Private r [ ModuleMacro r (noName $ beginningOf $ getRange m)-                             (SectionApp (getRange (m , es)) [] (RawApp (fuseRange m es) (Ident m : es)))-                             DoOpen dir-                         ]-      }-    ]-	) `HappyStk` happyRest}}}--happyReduce_350 = happyReduce 6# 103# happyReduction_350-happyReduction_350 (happy_x_6 `HappyStk`-	happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut22 happy_x_2 of { happy_var_2 -> -	case happyOut64 happy_x_6 of { happy_var_6 -> -	happyIn109-		 (let r = getRange happy_var_2 in-    [ Private r [ ModuleMacro r (noName $ beginningOf $ getRange happy_var_2)-                (RecordModuleIFS r happy_var_2) DoOpen happy_var_6-                ]-    ]-	) `HappyStk` happyRest}}--happyReduce_351 = happySpecReduce_0  104# happyReduction_351-happyReduction_351  =  happyIn110-		 ([]-	)--happyReduce_352 = happySpecReduce_2  104# happyReduction_352-happyReduction_352 happy_x_2-	happy_x_1-	 =  case happyOut41 happy_x_1 of { happy_var_1 -> -	case happyOut110 happy_x_2 of { happy_var_2 -> -	happyIn110-		 (happy_var_1 : happy_var_2-	)}}--happyReduce_353 = happyReduce 4# 105# happyReduction_353-happyReduction_353 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut22 happy_x_1 of { happy_var_1 -> -	case happyOutTok happy_x_2 of { (TokSymbol SymDoubleOpenBrace happy_var_2) -> -	case happyOutTok happy_x_3 of { (TokSymbol SymEllipsis happy_var_3) -> -	case happyOut17 happy_x_4 of { happy_var_4 -> -	happyIn111-		 ((\ts ->-                    if null ts then return $ RecordModuleIFS (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4)) happy_var_1-                    else parseError "No bindings allowed for record module with non-canonical implicits" )-	) `HappyStk` happyRest}}}}--happyReduce_354 = happySpecReduce_2  105# happyReduction_354-happyReduction_354 happy_x_2-	happy_x_1-	 =  case happyOut22 happy_x_1 of { happy_var_1 -> -	case happyOut110 happy_x_2 of { happy_var_2 -> -	happyIn111-		 ((\ts -> return $ SectionApp (getRange (happy_var_1, happy_var_2)) ts (RawApp (fuseRange happy_var_1 happy_var_2) (Ident happy_var_1 : happy_var_2)) )-	)}}--happyReduce_355 = happyMonadReduce 6# 106# happyReduction_355-happyReduction_355 (happy_x_6 `HappyStk`-	happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest) tk-	 = happyThen (case happyOutTok happy_x_1 of { (TokKeyword KwModule happy_var_1) -> -	case happyOut22 happy_x_2 of { happy_var_2 -> -	case happyOut61 happy_x_3 of { happy_var_3 -> -	case happyOut111 happy_x_5 of { happy_var_5 -> -	case happyOut64 happy_x_6 of { happy_var_6 -> -	( do { ma <- happy_var_5 (map addType happy_var_3)-                          ; name <- ensureUnqual happy_var_2-                          ; return $ ModuleMacro (getRange (happy_var_1, happy_var_2, ma, happy_var_6)) name ma DontOpen happy_var_6 })}}}}}-	) (\r -> happyReturn (happyIn112 r))--happyReduce_356 = happyMonadReduce 7# 106# happyReduction_356-happyReduction_356 (happy_x_7 `HappyStk`-	happy_x_6 `HappyStk`-	happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest) tk-	 = happyThen (case happyOutTok happy_x_1 of { (TokKeyword KwOpen happy_var_1) -> -	case happyOutTok happy_x_2 of { (TokKeyword KwModule happy_var_2) -> -	case happyOut15 happy_x_3 of { happy_var_3 -> -	case happyOut61 happy_x_4 of { happy_var_4 -> -	case happyOut111 happy_x_6 of { happy_var_6 -> -	case happyOut64 happy_x_7 of { happy_var_7 -> -	( do {ma <- happy_var_6 (map addType happy_var_4); return $ ModuleMacro (getRange (happy_var_1, happy_var_2, happy_var_3, ma, happy_var_7)) happy_var_3 ma DoOpen happy_var_7 })}}}}}}-	) (\r -> happyReturn (happyIn112 r))--happyReduce_357 = happyReduce 5# 107# happyReduction_357-happyReduction_357 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokKeyword KwModule happy_var_1) -> -	case happyOut22 happy_x_2 of { happy_var_2 -> -	case happyOut61 happy_x_3 of { happy_var_3 -> -	case happyOutTok happy_x_4 of { (TokKeyword KwWhere happy_var_4) -> -	case happyOut143 happy_x_5 of { happy_var_5 -> -	happyIn113-		 (Module (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5)) happy_var_2 (map addType happy_var_3) happy_var_5-	) `HappyStk` happyRest}}}}}--happyReduce_358 = happyReduce 5# 107# happyReduction_358-happyReduction_358 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokKeyword KwModule happy_var_1) -> -	case happyOut114 happy_x_2 of { happy_var_2 -> -	case happyOut61 happy_x_3 of { happy_var_3 -> -	case happyOutTok happy_x_4 of { (TokKeyword KwWhere happy_var_4) -> -	case happyOut143 happy_x_5 of { happy_var_5 -> -	happyIn113-		 (Module (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5)) (QName happy_var_2) (map addType happy_var_3) happy_var_5-	) `HappyStk` happyRest}}}}}--happyReduce_359 = happySpecReduce_1  108# happyReduction_359-happyReduction_359 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymUnderscore happy_var_1) -> -	happyIn114-		 (noName (getRange happy_var_1)-	)}--happyReduce_360 = happySpecReduce_1  109# happyReduction_360-happyReduction_360 happy_x_1-	 =  case happyOut145 happy_x_1 of { happy_var_1 -> -	happyIn115-		 (figureOutTopLevelModule happy_var_1-	)}--happyReduce_361 = happySpecReduce_1  110# happyReduction_361-happyReduction_361 happy_x_1-	 =  case happyOut117 happy_x_1 of { happy_var_1 -> -	happyIn116-		 (Pragma happy_var_1-	)}--happyReduce_362 = happySpecReduce_1  111# happyReduction_362-happyReduction_362 happy_x_1-	 =  case happyOut119 happy_x_1 of { happy_var_1 -> -	happyIn117-		 (happy_var_1-	)}--happyReduce_363 = happySpecReduce_1  111# happyReduction_363-happyReduction_363 happy_x_1-	 =  case happyOut120 happy_x_1 of { happy_var_1 -> -	happyIn117-		 (happy_var_1-	)}--happyReduce_364 = happySpecReduce_1  111# happyReduction_364-happyReduction_364 happy_x_1-	 =  case happyOut121 happy_x_1 of { happy_var_1 -> -	happyIn117-		 (happy_var_1-	)}--happyReduce_365 = happySpecReduce_1  111# happyReduction_365-happyReduction_365 happy_x_1-	 =  case happyOut122 happy_x_1 of { happy_var_1 -> -	happyIn117-		 (happy_var_1-	)}--happyReduce_366 = happySpecReduce_1  111# happyReduction_366-happyReduction_366 happy_x_1-	 =  case happyOut124 happy_x_1 of { happy_var_1 -> -	happyIn117-		 (happy_var_1-	)}--happyReduce_367 = happySpecReduce_1  111# happyReduction_367-happyReduction_367 happy_x_1-	 =  case happyOut123 happy_x_1 of { happy_var_1 -> -	happyIn117-		 (happy_var_1-	)}--happyReduce_368 = happySpecReduce_1  111# happyReduction_368-happyReduction_368 happy_x_1-	 =  case happyOut125 happy_x_1 of { happy_var_1 -> -	happyIn117-		 (happy_var_1-	)}--happyReduce_369 = happySpecReduce_1  111# happyReduction_369-happyReduction_369 happy_x_1-	 =  case happyOut126 happy_x_1 of { happy_var_1 -> -	happyIn117-		 (happy_var_1-	)}--happyReduce_370 = happySpecReduce_1  111# happyReduction_370-happyReduction_370 happy_x_1-	 =  case happyOut127 happy_x_1 of { happy_var_1 -> -	happyIn117-		 (happy_var_1-	)}--happyReduce_371 = happySpecReduce_1  111# happyReduction_371-happyReduction_371 happy_x_1-	 =  case happyOut133 happy_x_1 of { happy_var_1 -> -	happyIn117-		 (happy_var_1-	)}--happyReduce_372 = happySpecReduce_1  111# happyReduction_372-happyReduction_372 happy_x_1-	 =  case happyOut134 happy_x_1 of { happy_var_1 -> -	happyIn117-		 (happy_var_1-	)}--happyReduce_373 = happySpecReduce_1  111# happyReduction_373-happyReduction_373 happy_x_1-	 =  case happyOut128 happy_x_1 of { happy_var_1 -> -	happyIn117-		 (happy_var_1-	)}--happyReduce_374 = happySpecReduce_1  111# happyReduction_374-happyReduction_374 happy_x_1-	 =  case happyOut131 happy_x_1 of { happy_var_1 -> -	happyIn117-		 (happy_var_1-	)}--happyReduce_375 = happySpecReduce_1  111# happyReduction_375-happyReduction_375 happy_x_1-	 =  case happyOut130 happy_x_1 of { happy_var_1 -> -	happyIn117-		 (happy_var_1-	)}--happyReduce_376 = happySpecReduce_1  111# happyReduction_376-happyReduction_376 happy_x_1-	 =  case happyOut129 happy_x_1 of { happy_var_1 -> -	happyIn117-		 (happy_var_1-	)}--happyReduce_377 = happySpecReduce_1  111# happyReduction_377-happyReduction_377 happy_x_1-	 =  case happyOut132 happy_x_1 of { happy_var_1 -> -	happyIn117-		 (happy_var_1-	)}--happyReduce_378 = happySpecReduce_1  111# happyReduction_378-happyReduction_378 happy_x_1-	 =  case happyOut118 happy_x_1 of { happy_var_1 -> -	happyIn117-		 (happy_var_1-	)}--happyReduce_379 = happyReduce 4# 112# happyReduction_379-happyReduction_379 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> -	case happyOutTok happy_x_2 of { (TokKeyword KwOPTIONS happy_var_2) -> -	case happyOut28 happy_x_3 of { happy_var_3 -> -	case happyOutTok happy_x_4 of { (TokSymbol SymClosePragma happy_var_4) -> -	happyIn118-		 (OptionsPragma (getRange (happy_var_1,happy_var_2,happy_var_4)) happy_var_3-	) `HappyStk` happyRest}}}}--happyReduce_380 = happyReduce 5# 113# happyReduction_380-happyReduction_380 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> -	case happyOutTok happy_x_2 of { (TokKeyword KwBUILTIN happy_var_2) -> -	case happyOutTok happy_x_3 of { (TokString happy_var_3) -> -	case happyOut31 happy_x_4 of { happy_var_4 -> -	case happyOutTok happy_x_5 of { (TokSymbol SymClosePragma happy_var_5) -> -	happyIn119-		 (BuiltinPragma (getRange (happy_var_1,happy_var_2,fst happy_var_3,happy_var_4,happy_var_5)) (snd happy_var_3) (Ident happy_var_4)-	) `HappyStk` happyRest}}}}}--happyReduce_381 = happyReduce 5# 113# happyReduction_381-happyReduction_381 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> -	case happyOutTok happy_x_2 of { (TokKeyword KwBUILTIN happy_var_2) -> -	case happyOutTok happy_x_3 of { (TokKeyword KwREWRITE happy_var_3) -> -	case happyOut31 happy_x_4 of { happy_var_4 -> -	case happyOutTok happy_x_5 of { (TokSymbol SymClosePragma happy_var_5) -> -	happyIn119-		 (BuiltinPragma (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5)) "REWRITE" (Ident happy_var_4)-	) `HappyStk` happyRest}}}}}--happyReduce_382 = happyReduce 4# 114# happyReduction_382-happyReduction_382 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> -	case happyOutTok happy_x_2 of { (TokKeyword KwREWRITE happy_var_2) -> -	case happyOut31 happy_x_3 of { happy_var_3 -> -	case happyOutTok happy_x_4 of { (TokSymbol SymClosePragma happy_var_4) -> -	happyIn120-		 (RewritePragma (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4)) happy_var_3-	) `HappyStk` happyRest}}}}--happyReduce_383 = happyReduce 5# 115# happyReduction_383-happyReduction_383 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> -	case happyOutTok happy_x_2 of { (TokKeyword KwCOMPILED happy_var_2) -> -	case happyOut31 happy_x_3 of { happy_var_3 -> -	case happyOut28 happy_x_4 of { happy_var_4 -> -	case happyOutTok happy_x_5 of { (TokSymbol SymClosePragma happy_var_5) -> -	happyIn121-		 (CompiledPragma (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_5)) happy_var_3 (unwords happy_var_4)-	) `HappyStk` happyRest}}}}}--happyReduce_384 = happyReduce 5# 116# happyReduction_384-happyReduction_384 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> -	case happyOutTok happy_x_2 of { (TokKeyword KwCOMPILED_EXPORT happy_var_2) -> -	case happyOut31 happy_x_3 of { happy_var_3 -> -	case happyOut29 happy_x_4 of { happy_var_4 -> -	case happyOutTok happy_x_5 of { (TokSymbol SymClosePragma happy_var_5) -> -	happyIn122-		 (CompiledExportPragma (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_5)) happy_var_3 happy_var_4-	) `HappyStk` happyRest}}}}}--happyReduce_385 = happyReduce 5# 117# happyReduction_385-happyReduction_385 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> -	case happyOutTok happy_x_2 of { (TokKeyword KwCOMPILED_TYPE happy_var_2) -> -	case happyOut31 happy_x_3 of { happy_var_3 -> -	case happyOut28 happy_x_4 of { happy_var_4 -> -	case happyOutTok happy_x_5 of { (TokSymbol SymClosePragma happy_var_5) -> -	happyIn123-		 (CompiledTypePragma (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_5)) happy_var_3 (unwords happy_var_4)-	) `HappyStk` happyRest}}}}}--happyReduce_386 = happyReduce 6# 118# happyReduction_386-happyReduction_386 (happy_x_6 `HappyStk`-	happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> -	case happyOutTok happy_x_2 of { (TokKeyword KwCOMPILED_DATA happy_var_2) -> -	case happyOut31 happy_x_3 of { happy_var_3 -> -	case happyOutTok happy_x_4 of { (TokString happy_var_4) -> -	case happyOut28 happy_x_5 of { happy_var_5 -> -	case happyOutTok happy_x_6 of { (TokSymbol SymClosePragma happy_var_6) -> -	happyIn124-		 (CompiledDataPragma (getRange (happy_var_1,happy_var_2,happy_var_3,fst happy_var_4,happy_var_6)) happy_var_3 (snd happy_var_4) happy_var_5-	) `HappyStk` happyRest}}}}}}--happyReduce_387 = happyReduce 5# 119# happyReduction_387-happyReduction_387 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> -	case happyOutTok happy_x_2 of { (TokKeyword KwCOMPILED_EPIC happy_var_2) -> -	case happyOut31 happy_x_3 of { happy_var_3 -> -	case happyOut28 happy_x_4 of { happy_var_4 -> -	case happyOutTok happy_x_5 of { (TokSymbol SymClosePragma happy_var_5) -> -	happyIn125-		 (CompiledEpicPragma (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_5)) happy_var_3 (unwords happy_var_4)-	) `HappyStk` happyRest}}}}}--happyReduce_388 = happyReduce 5# 120# happyReduction_388-happyReduction_388 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> -	case happyOutTok happy_x_2 of { (TokKeyword KwCOMPILED_JS happy_var_2) -> -	case happyOut31 happy_x_3 of { happy_var_3 -> -	case happyOut28 happy_x_4 of { happy_var_4 -> -	case happyOutTok happy_x_5 of { (TokSymbol SymClosePragma happy_var_5) -> -	happyIn126-		 (CompiledJSPragma (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_5)) happy_var_3 (unwords happy_var_4)-	) `HappyStk` happyRest}}}}}--happyReduce_389 = happyReduce 4# 121# happyReduction_389-happyReduction_389 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> -	case happyOutTok happy_x_2 of { (TokKeyword KwSTATIC happy_var_2) -> -	case happyOut31 happy_x_3 of { happy_var_3 -> -	case happyOutTok happy_x_4 of { (TokSymbol SymClosePragma happy_var_4) -> -	happyIn127-		 (StaticPragma (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4)) happy_var_3-	) `HappyStk` happyRest}}}}--happyReduce_390 = happyReduce 4# 122# happyReduction_390-happyReduction_390 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> -	case happyOutTok happy_x_2 of { (TokKeyword KwETA happy_var_2) -> -	case happyOut31 happy_x_3 of { happy_var_3 -> -	case happyOutTok happy_x_4 of { (TokSymbol SymClosePragma happy_var_4) -> -	happyIn128-		 (EtaPragma (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4)) happy_var_3-	) `HappyStk` happyRest}}}}--happyReduce_391 = happySpecReduce_3  123# happyReduction_391-happyReduction_391 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> -	case happyOutTok happy_x_2 of { (TokKeyword KwNO_TERMINATION_CHECK happy_var_2) -> -	case happyOutTok happy_x_3 of { (TokSymbol SymClosePragma happy_var_3) -> -	happyIn129-		 (TerminationCheckPragma (getRange (happy_var_1,happy_var_2,happy_var_3)) NoTerminationCheck-	)}}}--happyReduce_392 = happySpecReduce_3  124# happyReduction_392-happyReduction_392 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> -	case happyOutTok happy_x_2 of { (TokKeyword KwNON_TERMINATING happy_var_2) -> -	case happyOutTok happy_x_3 of { (TokSymbol SymClosePragma happy_var_3) -> -	happyIn130-		 (TerminationCheckPragma (getRange (happy_var_1,happy_var_2,happy_var_3)) NonTerminating-	)}}}--happyReduce_393 = happySpecReduce_3  125# happyReduction_393-happyReduction_393 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> -	case happyOutTok happy_x_2 of { (TokKeyword KwTERMINATING happy_var_2) -> -	case happyOutTok happy_x_3 of { (TokSymbol SymClosePragma happy_var_3) -> -	happyIn131-		 (TerminationCheckPragma (getRange (happy_var_1,happy_var_2,happy_var_3)) Terminating-	)}}}--happyReduce_394 = happyReduce 4# 126# happyReduction_394-happyReduction_394 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> -	case happyOutTok happy_x_2 of { (TokKeyword KwMEASURE happy_var_2) -> -	case happyOut30 happy_x_3 of { happy_var_3 -> -	case happyOutTok happy_x_4 of { (TokSymbol SymClosePragma happy_var_4) -> -	happyIn132-		 (let r = getRange (happy_var_1, happy_var_2, happy_var_3, happy_var_4) in-      TerminationCheckPragma r (TerminationMeasure r happy_var_3)-	) `HappyStk` happyRest}}}}--happyReduce_395 = happyMonadReduce 4# 127# happyReduction_395-happyReduction_395 (happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest) tk-	 = happyThen (case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> -	case happyOutTok happy_x_2 of { (TokKeyword KwIMPORT happy_var_2) -> -	case happyOutTok happy_x_3 of { (TokString happy_var_3) -> -	case happyOutTok happy_x_4 of { (TokSymbol SymClosePragma happy_var_4) -> -	( let s = snd happy_var_3 in-       if validHaskellModuleName s-       then return $ ImportPragma (getRange (happy_var_1,happy_var_2,fst happy_var_3,happy_var_4)) s-       else parseError $ "Malformed module name: " ++ s ++ ".")}}}}-	) (\r -> happyReturn (happyIn133 r))--happyReduce_396 = happySpecReduce_3  128# happyReduction_396-happyReduction_396 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> -	case happyOutTok happy_x_2 of { (TokKeyword KwIMPOSSIBLE happy_var_2) -> -	case happyOutTok happy_x_3 of { (TokSymbol SymClosePragma happy_var_3) -> -	happyIn134-		 (ImpossiblePragma (getRange (happy_var_1,happy_var_2,happy_var_3))-	)}}}--happyReduce_397 = happySpecReduce_3  129# happyReduction_397-happyReduction_397 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut136 happy_x_2 of { happy_var_2 -> -	happyIn135-		 (reverse happy_var_2-	)}--happyReduce_398 = happySpecReduce_3  130# happyReduction_398-happyReduction_398 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut136 happy_x_1 of { happy_var_1 -> -	case happyOut81 happy_x_3 of { happy_var_3 -> -	happyIn136-		 (reverse happy_var_3 ++ happy_var_1-	)}}--happyReduce_399 = happySpecReduce_1  130# happyReduction_399-happyReduction_399 happy_x_1-	 =  case happyOut81 happy_x_1 of { happy_var_1 -> -	happyIn136-		 (reverse happy_var_1-	)}--happyReduce_400 = happySpecReduce_3  131# happyReduction_400-happyReduction_400 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut138 happy_x_2 of { happy_var_2 -> -	happyIn137-		 (reverse happy_var_2-	)}--happyReduce_401 = happySpecReduce_3  132# happyReduction_401-happyReduction_401 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut138 happy_x_1 of { happy_var_1 -> -	case happyOut82 happy_x_3 of { happy_var_3 -> -	happyIn138-		 (reverse happy_var_3 ++ happy_var_1-	)}}--happyReduce_402 = happySpecReduce_1  132# happyReduction_402-happyReduction_402 happy_x_1-	 =  case happyOut82 happy_x_1 of { happy_var_1 -> -	happyIn138-		 (reverse happy_var_1-	)}--happyReduce_403 = happySpecReduce_2  133# happyReduction_403-happyReduction_403 happy_x_2-	happy_x_1-	 =  happyIn139-		 ([]-	)--happyReduce_404 = happySpecReduce_1  133# happyReduction_404-happyReduction_404 happy_x_1-	 =  case happyOut135 happy_x_1 of { happy_var_1 -> -	happyIn139-		 (happy_var_1-	)}--happyReduce_405 = happySpecReduce_2  134# happyReduction_405-happyReduction_405 happy_x_2-	happy_x_1-	 =  happyIn140-		 ((Nothing, Nothing, [])-	)--happyReduce_406 = happySpecReduce_3  134# happyReduction_406-happyReduction_406 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut89 happy_x_2 of { happy_var_2 -> -	happyIn140-		 ((Nothing, Just happy_var_2, [])-	)}--happyReduce_407 = happyReduce 5# 134# happyReduction_407-happyReduction_407 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut89 happy_x_2 of { happy_var_2 -> -	case happyOut144 happy_x_4 of { happy_var_4 -> -	happyIn140-		 ((Nothing, Just happy_var_2, happy_var_4)-	) `HappyStk` happyRest}}--happyReduce_408 = happySpecReduce_3  134# happyReduction_408-happyReduction_408 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut144 happy_x_2 of { happy_var_2 -> -	happyIn140-		 ((Nothing, Nothing, happy_var_2)-	)}--happyReduce_409 = happySpecReduce_3  134# happyReduction_409-happyReduction_409 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut141 happy_x_2 of { happy_var_2 -> -	happyIn140-		 ((Just happy_var_2, Nothing, [])-	)}--happyReduce_410 = happyReduce 5# 134# happyReduction_410-happyReduction_410 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut141 happy_x_2 of { happy_var_2 -> -	case happyOut89 happy_x_4 of { happy_var_4 -> -	happyIn140-		 ((Just happy_var_2, Just happy_var_4, [])-	) `HappyStk` happyRest}}--happyReduce_411 = happyReduce 7# 134# happyReduction_411-happyReduction_411 (happy_x_7 `HappyStk`-	happy_x_6 `HappyStk`-	happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut141 happy_x_2 of { happy_var_2 -> -	case happyOut89 happy_x_4 of { happy_var_4 -> -	case happyOut144 happy_x_6 of { happy_var_6 -> -	happyIn140-		 ((Just happy_var_2, Just happy_var_4, happy_var_6)-	) `HappyStk` happyRest}}}--happyReduce_412 = happyReduce 5# 134# happyReduction_412-happyReduction_412 (happy_x_5 `HappyStk`-	happy_x_4 `HappyStk`-	happy_x_3 `HappyStk`-	happy_x_2 `HappyStk`-	happy_x_1 `HappyStk`-	happyRest)-	 = case happyOut141 happy_x_2 of { happy_var_2 -> -	case happyOut144 happy_x_4 of { happy_var_4 -> -	happyIn140-		 ((Just happy_var_2, Nothing, happy_var_4)-	) `HappyStk` happyRest}}--happyReduce_413 = happySpecReduce_1  135# happyReduction_413-happyReduction_413 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwInductive happy_var_1) -> -	happyIn141-		 (Ranged (getRange happy_var_1) Inductive-	)}--happyReduce_414 = happySpecReduce_1  135# happyReduction_414-happyReduction_414 happy_x_1-	 =  case happyOutTok happy_x_1 of { (TokKeyword KwCoInductive happy_var_1) -> -	happyIn141-		 (Ranged (getRange happy_var_1) CoInductive-	)}--happyReduce_415 = happySpecReduce_3  136# happyReduction_415-happyReduction_415 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut144 happy_x_2 of { happy_var_2 -> -	happyIn142-		 (happy_var_2-	)}--happyReduce_416 = happySpecReduce_2  137# happyReduction_416-happyReduction_416 happy_x_2-	happy_x_1-	 =  happyIn143-		 ([]-	)--happyReduce_417 = happySpecReduce_1  137# happyReduction_417-happyReduction_417 happy_x_1-	 =  case happyOut142 happy_x_1 of { happy_var_1 -> -	happyIn143-		 (happy_var_1-	)}--happyReduce_418 = happySpecReduce_3  138# happyReduction_418-happyReduction_418 happy_x_3-	happy_x_2-	happy_x_1-	 =  case happyOut80 happy_x_1 of { happy_var_1 -> -	case happyOut144 happy_x_3 of { happy_var_3 -> -	happyIn144-		 (happy_var_1 ++ happy_var_3-	)}}--happyReduce_419 = happySpecReduce_1  138# happyReduction_419-happyReduction_419 happy_x_1-	 =  case happyOut80 happy_x_1 of { happy_var_1 -> -	happyIn144-		 (happy_var_1-	)}--happyReduce_420 = happySpecReduce_0  139# happyReduction_420-happyReduction_420  =  happyIn145-		 ([]-	)--happyReduce_421 = happySpecReduce_1  139# happyReduction_421-happyReduction_421 happy_x_1-	 =  case happyOut144 happy_x_1 of { happy_var_1 -> -	happyIn145-		 (happy_var_1-	)}--happyNewToken action sts stk-	= lexer(\tk -> -	let cont i = happyDoAction i tk action sts stk in-	case tk of {-	TokEOF -> happyDoAction 89# tk action sts stk;-	TokKeyword KwLet happy_dollar_dollar -> cont 1#;-	TokKeyword KwIn happy_dollar_dollar -> cont 2#;-	TokKeyword KwWhere happy_dollar_dollar -> cont 3#;-	TokKeyword KwWith happy_dollar_dollar -> cont 4#;-	TokKeyword KwRewrite happy_dollar_dollar -> cont 5#;-	TokKeyword KwPostulate happy_dollar_dollar -> cont 6#;-	TokKeyword KwPrimitive happy_dollar_dollar -> cont 7#;-	TokKeyword KwOpen happy_dollar_dollar -> cont 8#;-	TokKeyword KwImport happy_dollar_dollar -> cont 9#;-	TokKeyword KwUsing happy_dollar_dollar -> cont 10#;-	TokKeyword KwHiding happy_dollar_dollar -> cont 11#;-	TokKeyword KwRenaming happy_dollar_dollar -> cont 12#;-	TokKeyword KwTo happy_dollar_dollar -> cont 13#;-	TokKeyword KwPublic happy_dollar_dollar -> cont 14#;-	TokKeyword KwModule happy_dollar_dollar -> cont 15#;-	TokKeyword KwData happy_dollar_dollar -> cont 16#;-	TokKeyword KwCoData happy_dollar_dollar -> cont 17#;-	TokKeyword KwRecord happy_dollar_dollar -> cont 18#;-	TokKeyword KwConstructor happy_dollar_dollar -> cont 19#;-	TokKeyword KwInductive happy_dollar_dollar -> cont 20#;-	TokKeyword KwCoInductive happy_dollar_dollar -> cont 21#;-	TokKeyword KwField happy_dollar_dollar -> cont 22#;-	TokKeyword KwInfix happy_dollar_dollar -> cont 23#;-	TokKeyword KwInfixL happy_dollar_dollar -> cont 24#;-	TokKeyword KwInfixR happy_dollar_dollar -> cont 25#;-	TokKeyword KwMutual happy_dollar_dollar -> cont 26#;-	TokKeyword KwAbstract happy_dollar_dollar -> cont 27#;-	TokKeyword KwPrivate happy_dollar_dollar -> cont 28#;-	TokKeyword KwInstance happy_dollar_dollar -> cont 29#;-	TokKeyword KwProp happy_dollar_dollar -> cont 30#;-	TokKeyword KwSet happy_dollar_dollar -> cont 31#;-	TokKeyword KwForall happy_dollar_dollar -> cont 32#;-	TokKeyword KwSyntax happy_dollar_dollar -> cont 33#;-	TokKeyword KwPatternSyn happy_dollar_dollar -> cont 34#;-	TokKeyword KwOPTIONS happy_dollar_dollar -> cont 35#;-	TokKeyword KwBUILTIN happy_dollar_dollar -> cont 36#;-	TokKeyword KwREWRITE happy_dollar_dollar -> cont 37#;-	TokKeyword KwIMPORT happy_dollar_dollar -> cont 38#;-	TokKeyword KwIMPOSSIBLE happy_dollar_dollar -> cont 39#;-	TokKeyword KwETA happy_dollar_dollar -> cont 40#;-	TokKeyword KwNO_TERMINATION_CHECK happy_dollar_dollar -> cont 41#;-	TokKeyword KwNON_TERMINATING happy_dollar_dollar -> cont 42#;-	TokKeyword KwTERMINATING happy_dollar_dollar -> cont 43#;-	TokKeyword KwMEASURE happy_dollar_dollar -> cont 44#;-	TokKeyword KwCOMPILED happy_dollar_dollar -> cont 45#;-	TokKeyword KwCOMPILED_EXPORT happy_dollar_dollar -> cont 46#;-	TokKeyword KwCOMPILED_DATA happy_dollar_dollar -> cont 47#;-	TokKeyword KwCOMPILED_TYPE happy_dollar_dollar -> cont 48#;-	TokKeyword KwCOMPILED_EPIC happy_dollar_dollar -> cont 49#;-	TokKeyword KwCOMPILED_JS happy_dollar_dollar -> cont 50#;-	TokKeyword KwSTATIC happy_dollar_dollar -> cont 51#;-	TokKeyword KwQuoteGoal happy_dollar_dollar -> cont 52#;-	TokKeyword KwQuoteContext happy_dollar_dollar -> cont 53#;-	TokKeyword KwQuote happy_dollar_dollar -> cont 54#;-	TokKeyword KwQuoteTerm happy_dollar_dollar -> cont 55#;-	TokKeyword KwTactic happy_dollar_dollar -> cont 56#;-	TokKeyword KwUnquote happy_dollar_dollar -> cont 57#;-	TokKeyword KwUnquoteDecl happy_dollar_dollar -> cont 58#;-	TokSetN happy_dollar_dollar -> cont 59#;-	TokTeX happy_dollar_dollar -> cont 60#;-	TokComment happy_dollar_dollar -> cont 61#;-	TokSymbol SymEllipsis happy_dollar_dollar -> cont 62#;-	TokSymbol SymDotDot happy_dollar_dollar -> cont 63#;-	TokSymbol SymDot happy_dollar_dollar -> cont 64#;-	TokSymbol SymSemi happy_dollar_dollar -> cont 65#;-	TokSymbol SymColon happy_dollar_dollar -> cont 66#;-	TokSymbol SymEqual happy_dollar_dollar -> cont 67#;-	TokSymbol SymUnderscore happy_dollar_dollar -> cont 68#;-	TokSymbol SymQuestionMark happy_dollar_dollar -> cont 69#;-	TokSymbol SymArrow happy_dollar_dollar -> cont 70#;-	TokSymbol SymLambda happy_dollar_dollar -> cont 71#;-	TokSymbol SymAs happy_dollar_dollar -> cont 72#;-	TokSymbol SymBar happy_dollar_dollar -> cont 73#;-	TokSymbol SymOpenParen happy_dollar_dollar -> cont 74#;-	TokSymbol SymCloseParen happy_dollar_dollar -> cont 75#;-	TokSymbol SymDoubleOpenBrace happy_dollar_dollar -> cont 76#;-	TokSymbol SymDoubleCloseBrace happy_dollar_dollar -> cont 77#;-	TokSymbol SymOpenBrace happy_dollar_dollar -> cont 78#;-	TokSymbol SymCloseBrace happy_dollar_dollar -> cont 79#;-	TokSymbol SymOpenVirtualBrace happy_dollar_dollar -> cont 80#;-	TokSymbol SymCloseVirtualBrace happy_dollar_dollar -> cont 81#;-	TokSymbol SymVirtualSemi happy_dollar_dollar -> cont 82#;-	TokSymbol SymOpenPragma happy_dollar_dollar -> cont 83#;-	TokSymbol SymClosePragma happy_dollar_dollar -> cont 84#;-	TokId happy_dollar_dollar -> cont 85#;-	TokQId happy_dollar_dollar -> cont 86#;-	TokString happy_dollar_dollar -> cont 87#;-	TokLiteral happy_dollar_dollar -> cont 88#;-	_ -> happyError' tk-	})--happyError_ 89# tk = happyError' tk-happyError_ _ tk = happyError' tk--happyThen :: () => Parser a -> (a -> Parser b) -> Parser b-happyThen = (>>=)-happyReturn :: () => a -> Parser a-happyReturn = (return)-happyThen1 = happyThen-happyReturn1 :: () => a -> Parser a-happyReturn1 = happyReturn-happyError' :: () => (Token) -> Parser a-happyError' tk = (\token -> happyError) tk--tokensParser = happySomeParser where-  happySomeParser = happyThen (happyParse 0#) (\x -> happyReturn (happyOut6 x))--exprParser = happySomeParser where-  happySomeParser = happyThen (happyParse 1#) (\x -> happyReturn (happyOut32 x))--moduleParser = happySomeParser where-  happySomeParser = happyThen (happyParse 2#) (\x -> happyReturn (happyOut9 x))--happySeq = happyDontSeq---{---------------------------------------------------------------------------    Parsers- --------------------------------------------------------------------------}---- | Parse the token stream. Used by the TeX compiler.-tokensParser :: Parser [Token]---- | Parse an expression. Could be used in interactions.-exprParser :: Parser Expr---- | Parse a module.-moduleParser :: Parser Module---{---------------------------------------------------------------------------    Happy stuff- --------------------------------------------------------------------------}---- | Required by Happy.-happyError :: Parser a-happyError = parseError "Parse error"---{---------------------------------------------------------------------------    Utility functions- --------------------------------------------------------------------------}---- | Grab leading OPTIONS pragmas.-takeOptionsPragmas :: [Declaration] -> ([Pragma], [Declaration])-takeOptionsPragmas = spanJust $ \ d -> case d of-  Pragma p@OptionsPragma{} -> Just p-  _                        -> Nothing---- | Insert a top-level module if there is none.-figureOutTopLevelModule :: [Declaration] -> [Declaration]-figureOutTopLevelModule ds =-  case span isAllowedBeforeModule ds of-    (ds0, Module r m tel ds1 : ds2) -> ds0 ++ [Module r m tel $ ds1 ++ ds2]-    (ds0, ds1)                      -> ds0 ++ [Module (getRange ds1) (QName noName_) [] ds1]-  where-    isAllowedBeforeModule (Pragma OptionsPragma{}) = True-    isAllowedBeforeModule (Private _ ds) = all isAllowedBeforeModule ds-    isAllowedBeforeModule Import{}       = True-    isAllowedBeforeModule ModuleMacro{}  = True-    isAllowedBeforeModule Open{}         = True-    isAllowedBeforeModule _              = False---- | Create a name from a string.--mkName :: (Interval, String) -> Parser Name-mkName (i, s) = do-    let xs = C.stringNameParts s-    mapM_ isValidId xs-    unless (alternating xs) $ fail $ "a name cannot contain two consecutive underscores"-    return $ Name (getRange i) xs-    where-        isValidId Hole   = return ()-        isValidId (Id y) = do-          let x = rawNameToString y-          case parse defaultParseFlags [0] (lexer return) x of-            ParseOk _ (TokId _) -> return ()-            _                   -> fail $ "in the name " ++ s ++ ", the part " ++ x ++ " is not valid"--        -- we know that there are no two Ids in a row-        alternating (Hole : Hole : _) = False-        alternating (_ : xs)          = alternating xs-        alternating []                = True---- | Create a qualified name from a list of strings-mkQName :: [(Interval, String)] -> Parser QName-mkQName ss = do-    xs <- mapM mkName ss-    return $ foldr Qual (QName $ last xs) (init xs)--ensureUnqual :: QName -> Parser Name-ensureUnqual (QName x) = return x-ensureUnqual q@Qual{}  = parseError' (rStart $ getRange q) "Qualified name not allowed here"---- | Match a particular name.-isName :: String -> (Interval, String) -> Parser ()-isName s (_,s')-    | s == s'   = return ()-    | otherwise = fail $ "expected " ++ s ++ ", found " ++ s'---- | Build a forall pi (forall x y z -> ...)-forallPi :: [LamBinding] -> Expr -> Expr-forallPi bs e = Pi (map addType bs) e---- | Build a telescoping let (let Ds)-tLet :: Range -> [Declaration] -> TypedBindings-tLet r = TypedBindings r . Common.Arg defaultArgInfo . TLet r---- | Converts lambda bindings to typed bindings.-addType :: LamBinding -> TypedBindings-addType (DomainFull b)   = b-addType (DomainFree info x) = TypedBindings r $ Common.Arg info $ TBind r [pure x] $ Underscore r Nothing-  where r = getRange x--mergeImportDirectives :: [ImportDirective] -> Parser ImportDirective-mergeImportDirectives is = do-  i <- foldl merge (return defaultImportDir) is-  verifyImportDirective i-  where-    merge mi i2 = do-      i1 <- mi-      let err = parseError' (rStart $ getRange i2) "Cannot mix using and hiding module directives"-      uh <- case (usingOrHiding i1, usingOrHiding i2) of-            (Hiding [], u)         -> return u-            (u, Hiding [])         -> return u-            (Using{}, Hiding{})    -> err-            (Hiding{}, Using{})    -> err-            (Using xs, Using ys)   -> return $ Using (xs ++ ys)-            (Hiding xs, Hiding ys) -> return $ Hiding (xs ++ ys)-      return $ ImportDirective-        { importDirRange = fuseRange i1 i2-        , usingOrHiding  = uh-        , renaming       = renaming i1 ++ renaming i2-        , publicOpen     = publicOpen i1 || publicOpen i2 }---- | Check that an import directive doesn't contain repeated names-verifyImportDirective :: ImportDirective -> Parser ImportDirective-verifyImportDirective i =-    case filter ((>1) . length)-         $ group-         $ sort xs-    of-        []  -> return i-        yss -> let Just pos = rStart $ getRange $ head $ concat yss in-               parseErrorAt pos $-                "Repeated name" ++ s ++ " in import directive: " ++-                concat (intersperse ", " $ map (show . head) yss)-            where-                s = case yss of-                        [_] -> ""-                        _   -> "s"-    where-        xs = names (usingOrHiding i) ++ map renFrom (renaming i)-        names (Using xs)    = xs-        names (Hiding xs)   = xs---- | Breaks up a string into substrings. Returns every maximal--- subsequence of zero or more characters distinct from @'.'@.------ > splitOnDots ""         == [""]--- > splitOnDots "foo.bar"  == ["foo", "bar"]--- > splitOnDots ".foo.bar" == ["", "foo", "bar"]--- > splitOnDots "foo.bar." == ["foo", "bar", ""]--- > splitOnDots "foo..bar" == ["foo", "", "bar"]-splitOnDots :: String -> [String]-splitOnDots ""        = [""]-splitOnDots ('.' : s) = [] : splitOnDots s-splitOnDots (c   : s) = case splitOnDots s of-  p : ps -> (c : p) : ps--prop_splitOnDots = and-  [ splitOnDots ""         == [""]-  , splitOnDots "foo.bar"  == ["foo", "bar"]-  , splitOnDots ".foo.bar" == ["", "foo", "bar"]-  , splitOnDots "foo.bar." == ["foo", "bar", ""]-  , splitOnDots "foo..bar" == ["foo", "", "bar"]-  ]---- | Returns 'True' iff the name is a valid Haskell (hierarchical)--- module name.-validHaskellModuleName :: String -> Bool-validHaskellModuleName = all ok . splitOnDots-  where-  -- Checks if a dot-less module name is well-formed.-  ok :: String -> Bool-  ok []      = False-  ok (c : s) =-    isUpper c &&-    all (\c -> isLower c || c == '_' ||-               isUpper c ||-               generalCategory c == DecimalNumber ||-               c == '\'')-        s--{---------------------------------------------------------------------------    Patterns- --------------------------------------------------------------------------}---- | Turn an expression into a left hand side.-exprToLHS :: Expr -> Parser ([Expr] -> [Expr] -> LHS)-exprToLHS e = case e of-  WithApp r e es -> LHS <$> exprToPattern e <*> mapM exprToPattern es-  _              -> LHS <$> exprToPattern e <*> return []---- | Turn an expression into a pattern. Fails if the expression is not a---   valid pattern.-exprToPattern :: Expr -> Parser Pattern-exprToPattern e =-    case e of-        Ident x                 -> return $ IdentP x-        App _ e1 e2             -> AppP <$> exprToPattern e1-                                        <*> T.mapM (T.mapM exprToPattern) e2-        Paren r e               -> ParenP r-                                        <$> exprToPattern e-        Underscore r _          -> return $ WildP r-        Absurd r                -> return $ AbsurdP r-        As r x e                -> AsP r x <$> exprToPattern e-        Dot r (HiddenArg _ e)   -> return $ HiddenP r $ fmap (DotP r) e-        Dot r e                 -> return $ DotP r e-        Lit l                   -> return $ LitP l-        HiddenArg r e           -> HiddenP r <$> T.mapM exprToPattern e-        InstanceArg r e         -> InstanceP r <$> T.mapM exprToPattern e-        RawApp r es             -> RawAppP r <$> mapM exprToPattern es-        Quote r                 -> return $ QuoteP r-        _                       ->-          let Just pos = rStart $ getRange e in-          parseErrorAt pos $ "Not a valid pattern: " ++ show e--opAppExprToPattern :: OpApp Expr -> Parser Pattern-opAppExprToPattern (SyntaxBindingLambda _ _ _) = parseError "Syntax binding lambda cannot appear in a pattern"-opAppExprToPattern (Ordinary e) = exprToPattern e---- | Turn an expression into a name. Fails if the expression is not a---   valid identifier.-exprToName :: Expr -> Parser Name-exprToName (Ident (QName x)) = return x-exprToName e =-  let Just pos = rStart $ getRange e in-  parseErrorAt pos $ "Not a valid identifier: " ++ show e--stripSingletonRawApp :: Expr -> Expr-stripSingletonRawApp (RawApp _ [e]) = stripSingletonRawApp e-stripSingletonRawApp e = e--isEqual :: Expr -> Maybe (Expr, Expr)-isEqual e =-  case stripSingletonRawApp e of-    Equal _ a b -> Just (stripSingletonRawApp a, stripSingletonRawApp b)-    _           -> Nothing--maybeNamed :: Expr -> Named_ Expr-maybeNamed e =-  case isEqual e of-    Just (Ident (QName x), b) -> named (Ranged (getRange x) (nameToRawName x)) b-    _                         -> unnamed e--patternSynArgs :: [Either Hiding LamBinding] -> Parser [Arg Name]-patternSynArgs = mapM pSynArg-  where-    pSynArg Left{}                   = parseError "Absurd patterns are not allowed in pattern synonyms"-    pSynArg (Right DomainFull{})     = parseError "Unexpected type signature in pattern synonym argument"-    pSynArg (Right (DomainFree a x))-      | getHiding a `notElem` [Hidden, NotHidden] = parseError $ show (getHiding a) ++ " arguments not allowed to pattern synonyms"-      | getRelevance a /= Relevant                = parseError "Arguments to pattern synonyms must be relevant"-      | otherwise                                 = return $ Common.Arg a (boundName x)--parsePanic s = parseError $ "Internal parser error: " ++ s ++ ". Please report this as a bug."--{- RHS or type signature -}--data RHSOrTypeSigs = JustRHS RHS-                   | TypeSigsRHS Expr--namesOfPattern :: Pattern -> Maybe [(C.ArgInfo, Name)]-namesOfPattern (IdentP (QName i))         = Just [(defaultArgInfo, i)]-namesOfPattern (WildP r)                  = Just [(defaultArgInfo, C.noName r)]-namesOfPattern (DotP _ (Ident (QName i))) = Just [(setRelevance Irrelevant defaultArgInfo, i)]-namesOfPattern (RawAppP _ ps)             = fmap concat $ mapM namesOfPattern ps-namesOfPattern _                          = Nothing--funClauseOrTypeSigs :: LHS -> RHSOrTypeSigs -> WhereClause -> Parser [Declaration]-funClauseOrTypeSigs lhs (JustRHS   rhs) wh = return [FunClause lhs rhs wh]-funClauseOrTypeSigs lhs (TypeSigsRHS e) wh-  | NoWhere <- wh,-    LHS p [] [] [] <- lhs,-    Just names <- namesOfPattern p = return $ map (\(x,y) -> TypeSig x y e) names-  | otherwise                      = parseError "Illegal function clause or type signature"--{---------------------------------------------------------------------------    Tests- --------------------------------------------------------------------------}---- | Test suite.-tests :: IO Bool-tests = runTests "Agda.Syntax.Parser.Parser"-  [ quickCheck' prop_splitOnDots-  ]-{-# LINE 1 "templates/GenericTemplate.hs" #-}-{-# LINE 1 "templates/GenericTemplate.hs" #-}-{-# LINE 1 "<built-in>" #-}-{-# LINE 1 "<command-line>" #-}+    , moduleNameParser+    , exprParser+    , tokensParser+    , tests+    ) where++import Control.Monad++import Data.Char+import Data.Functor+import Data.List+import Data.Maybe+import qualified Data.Traversable as T++import Debug.Trace++import Agda.Syntax.Position hiding (tests)+import Agda.Syntax.Parser.Monad+import Agda.Syntax.Parser.Lexer+import Agda.Syntax.Parser.Tokens+import Agda.Syntax.Concrete as C+import Agda.Syntax.Concrete.Pretty ()+import Agda.Syntax.Common hiding (Arg, Dom, NamedArg)+import qualified Agda.Syntax.Common as Common+import Agda.Syntax.Fixity+import Agda.Syntax.Notation+import Agda.Syntax.Literal++import Agda.Utils.Hash+import Agda.Utils.List (spanJust)+import Agda.Utils.Monad+import Agda.Utils.Pretty+import Agda.Utils.QuickCheck+import Agda.Utils.Singleton+import Agda.Utils.TestHelpers+import Agda.Utils.Tuple+import qualified Data.Array as Happy_Data_Array+import qualified GHC.Exts as Happy_GHC_Exts+import Control.Applicative(Applicative(..))+import Control.Monad (ap)++-- parser produced by Happy Version 1.19.5++newtype HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75 = HappyAbsSyn HappyAny+#if __GLASGOW_HASKELL__ >= 607+type HappyAny = Happy_GHC_Exts.Any+#else+type HappyAny = forall a . a+#endif+happyIn7 :: ([Token]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn7 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn7 #-}+happyOut7 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([Token])+happyOut7 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut7 #-}+happyIn8 :: ([Token]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn8 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn8 #-}+happyOut8 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([Token])+happyOut8 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut8 #-}+happyIn9 :: (Token) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn9 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn9 #-}+happyOut9 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Token)+happyOut9 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut9 #-}+happyIn10 :: (([Pragma], [Declaration])) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn10 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn10 #-}+happyOut10 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (([Pragma], [Declaration]))+happyOut10 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut10 #-}+happyIn11 :: t11 -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn11 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn11 #-}+happyOut11 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> t11+happyOut11 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut11 #-}+happyIn12 :: t12 -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn12 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn12 #-}+happyOut12 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> t12+happyOut12 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut12 #-}+happyIn13 :: t13 -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn13 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn13 #-}+happyOut13 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> t13+happyOut13 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut13 #-}+happyIn14 :: (()) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn14 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn14 #-}+happyOut14 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (())+happyOut14 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut14 #-}+happyIn15 :: (Integer) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn15 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn15 #-}+happyOut15 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Integer)+happyOut15 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut15 #-}+happyIn16 :: (Name) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn16 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn16 #-}+happyOut16 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Name)+happyOut16 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut16 #-}+happyIn17 :: ([Name]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn17 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn17 #-}+happyOut17 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([Name])+happyOut17 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut17 #-}+happyIn18 :: (Range) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn18 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn18 #-}+happyOut18 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Range)+happyOut18 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut18 #-}+happyIn19 :: (Arg Name) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn19 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn19 #-}+happyOut19 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Arg Name)+happyOut19 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut19 #-}+happyIn20 :: ([Arg Name]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn20 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn20 #-}+happyOut20 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([Arg Name])+happyOut20 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut20 #-}+happyIn21 :: ([Arg Name]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn21 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn21 #-}+happyOut21 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([Arg Name])+happyOut21 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut21 #-}+happyIn22 :: (QName) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn22 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn22 #-}+happyOut22 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (QName)+happyOut22 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut22 #-}+happyIn23 :: (QName) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn23 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn23 #-}+happyOut23 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (QName)+happyOut23 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut23 #-}+happyIn24 :: (Name) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn24 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn24 #-}+happyOut24 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Name)+happyOut24 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut24 #-}+happyIn25 :: ([Name]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn25 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn25 #-}+happyOut25 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([Name])+happyOut25 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut25 #-}+happyIn26 :: ([Name]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn26 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn26 #-}+happyOut26 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([Name])+happyOut26 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut26 #-}+happyIn27 :: (Either [Name] [Expr]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn27 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn27 #-}+happyOut27 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Either [Name] [Expr])+happyOut27 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut27 #-}+happyIn28 :: ([WithHiding Name]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn28 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn28 #-}+happyOut28 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([WithHiding Name])+happyOut28 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut28 #-}+happyIn29 :: ([String]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn29 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn29 #-}+happyOut29 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([String])+happyOut29 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut29 #-}+happyIn30 :: (String) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn30 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn30 #-}+happyOut30 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (String)+happyOut30 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut30 #-}+happyIn31 :: (Name) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn31 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn31 #-}+happyOut31 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Name)+happyOut31 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut31 #-}+happyIn32 :: (QName) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn32 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn32 #-}+happyOut32 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (QName)+happyOut32 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut32 #-}+happyIn33 :: (Expr) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn33 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn33 #-}+happyOut33 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Expr)+happyOut33 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut33 #-}+happyIn34 :: t34 -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn34 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn34 #-}+happyOut34 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> t34+happyOut34 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut34 #-}+happyIn35 :: ([Expr]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn35 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn35 #-}+happyOut35 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([Expr])+happyOut35 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut35 #-}+happyIn36 :: ([Expr]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn36 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn36 #-}+happyOut36 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([Expr])+happyOut36 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut36 #-}+happyIn37 :: t37 -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn37 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn37 #-}+happyOut37 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> t37+happyOut37 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut37 #-}+happyIn38 :: (Expr) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn38 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn38 #-}+happyOut38 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Expr)+happyOut38 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut38 #-}+happyIn39 :: ([Expr]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn39 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn39 #-}+happyOut39 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([Expr])+happyOut39 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut39 #-}+happyIn40 :: t40 -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn40 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn40 #-}+happyOut40 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> t40+happyOut40 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut40 #-}+happyIn41 :: t41 -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn41 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn41 #-}+happyOut41 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> t41+happyOut41 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut41 #-}+happyIn42 :: t42 -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn42 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn42 #-}+happyOut42 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> t42+happyOut42 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut42 #-}+happyIn43 :: ([(Name, Expr)]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn43 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn43 #-}+happyOut43 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([(Name, Expr)])+happyOut43 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut43 #-}+happyIn44 :: ([(Name, Expr)]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn44 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn44 #-}+happyOut44 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([(Name, Expr)])+happyOut44 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut44 #-}+happyIn45 :: ((Name, Expr)) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn45 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn45 #-}+happyOut45 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ((Name, Expr))+happyOut45 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut45 #-}+happyIn46 :: t46 -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn46 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn46 #-}+happyOut46 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> t46+happyOut46 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut46 #-}+happyIn47 :: t47 -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn47 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn47 #-}+happyOut47 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> t47+happyOut47 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut47 #-}+happyIn48 :: ([TypedBindings]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn48 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn48 #-}+happyOut48 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([TypedBindings])+happyOut48 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut48 #-}+happyIn49 :: (TypedBindings) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn49 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn49 #-}+happyOut49 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (TypedBindings)+happyOut49 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut49 #-}+happyIn50 :: (TypedBindings) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn50 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn50 #-}+happyOut50 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (TypedBindings)+happyOut50 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut50 #-}+happyIn51 :: (TypedBindings) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn51 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn51 #-}+happyOut51 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (TypedBindings)+happyOut51 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut51 #-}+happyIn52 :: ([LamBinding]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn52 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn52 #-}+happyOut52 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([LamBinding])+happyOut52 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut52 #-}+happyIn53 :: (Either ([LamBinding], Hiding) [Expr]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn53 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn53 #-}+happyOut53 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Either ([LamBinding], Hiding) [Expr])+happyOut53 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut53 #-}+happyIn54 :: ([Either Hiding LamBinding]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn54 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn54 #-}+happyOut54 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([Either Hiding LamBinding])+happyOut54 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut54 #-}+happyIn55 :: (Either [Either Hiding LamBinding] [Expr]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn55 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn55 #-}+happyOut55 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Either [Either Hiding LamBinding] [Expr])+happyOut55 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut55 #-}+happyIn56 :: ((LHS,RHS,WhereClause)) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn56 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn56 #-}+happyOut56 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ((LHS,RHS,WhereClause))+happyOut56 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut56 #-}+happyIn57 :: ((LHS,RHS,WhereClause)) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn57 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn57 #-}+happyOut57 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ((LHS,RHS,WhereClause))+happyOut57 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut57 #-}+happyIn58 :: ((LHS,RHS,WhereClause)) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn58 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn58 #-}+happyOut58 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ((LHS,RHS,WhereClause))+happyOut58 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut58 #-}+happyIn59 :: ([(LHS,RHS,WhereClause)]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn59 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn59 #-}+happyOut59 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([(LHS,RHS,WhereClause)])+happyOut59 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut59 #-}+happyIn60 :: ([LamBinding]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn60 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn60 #-}+happyOut60 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([LamBinding])+happyOut60 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut60 #-}+happyIn61 :: ([LamBinding]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn61 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn61 #-}+happyOut61 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([LamBinding])+happyOut61 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut61 #-}+happyIn62 :: ([LamBinding]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn62 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn62 #-}+happyOut62 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([LamBinding])+happyOut62 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut62 #-}+happyIn63 :: ([LamBinding]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn63 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn63 #-}+happyOut63 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([LamBinding])+happyOut63 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut63 #-}+happyIn64 :: (Either [LamBinding] [Expr]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn64 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn64 #-}+happyOut64 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Either [LamBinding] [Expr])+happyOut64 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut64 #-}+happyIn65 :: (ImportDirective) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn65 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn65 #-}+happyOut65 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (ImportDirective)+happyOut65 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut65 #-}+happyIn66 :: ([ImportDirective]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn66 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn66 #-}+happyOut66 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([ImportDirective])+happyOut66 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut66 #-}+happyIn67 :: (ImportDirective) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn67 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn67 #-}+happyOut67 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (ImportDirective)+happyOut67 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut67 #-}+happyIn68 :: ((UsingOrHiding , Range)) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn68 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn68 #-}+happyOut68 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ((UsingOrHiding , Range))+happyOut68 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut68 #-}+happyIn69 :: (([Renaming] , Range)) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn69 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn69 #-}+happyOut69 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (([Renaming] , Range))+happyOut69 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut69 #-}+happyIn70 :: ([Renaming]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn70 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn70 #-}+happyOut70 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([Renaming])+happyOut70 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut70 #-}+happyIn71 :: (Renaming) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn71 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn71 #-}+happyOut71 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Renaming)+happyOut71 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut71 #-}+happyIn72 :: (ImportedName) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn72 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn72 #-}+happyOut72 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (ImportedName)+happyOut72 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut72 #-}+happyIn73 :: (ImportedName) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn73 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn73 #-}+happyOut73 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (ImportedName)+happyOut73 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut73 #-}+happyIn74 :: ([ImportedName]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn74 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn74 #-}+happyOut74 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([ImportedName])+happyOut74 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut74 #-}+happyIn75 :: t75 -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn75 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn75 #-}+happyOut75 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> t75+happyOut75 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut75 #-}+happyIn76 :: (LHS) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn76 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn76 #-}+happyOut76 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (LHS)+happyOut76 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut76 #-}+happyIn77 :: ([Pattern]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn77 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn77 #-}+happyOut77 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([Pattern])+happyOut77 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut77 #-}+happyIn78 :: ([Expr]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn78 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn78 #-}+happyOut78 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([Expr])+happyOut78 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut78 #-}+happyIn79 :: ([Expr]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn79 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn79 #-}+happyOut79 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([Expr])+happyOut79 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut79 #-}+happyIn80 :: (WhereClause) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn80 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn80 #-}+happyOut80 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (WhereClause)+happyOut80 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut80 #-}+happyIn81 :: ([Declaration]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn81 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn81 #-}+happyOut81 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([Declaration])+happyOut81 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut81 #-}+happyIn82 :: ([Declaration]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn82 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn82 #-}+happyOut82 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([Declaration])+happyOut82 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut82 #-}+happyIn83 :: ([Arg Declaration]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn83 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn83 #-}+happyOut83 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([Arg Declaration])+happyOut83 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut83 #-}+happyIn84 :: ([Declaration]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn84 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn84 #-}+happyOut84 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([Declaration])+happyOut84 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut84 #-}+happyIn85 :: (RHSOrTypeSigs) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn85 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn85 #-}+happyOut85 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (RHSOrTypeSigs)+happyOut85 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut85 #-}+happyIn86 :: (Declaration) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn86 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn86 #-}+happyOut86 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Declaration)+happyOut86 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut86 #-}+happyIn87 :: (Declaration) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn87 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn87 #-}+happyOut87 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Declaration)+happyOut87 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut87 #-}+happyIn88 :: (Declaration) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn88 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn88 #-}+happyOut88 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Declaration)+happyOut88 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut88 #-}+happyIn89 :: (Declaration) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn89 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn89 #-}+happyOut89 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Declaration)+happyOut89 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut89 #-}+happyIn90 :: (Name) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn90 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn90 #-}+happyOut90 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Name)+happyOut90 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut90 #-}+happyIn91 :: (Declaration) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn91 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn91 #-}+happyOut91 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Declaration)+happyOut91 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut91 #-}+happyIn92 :: ([Declaration]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn92 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn92 #-}+happyOut92 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([Declaration])+happyOut92 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut92 #-}+happyIn93 :: (Declaration) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn93 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn93 #-}+happyOut93 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Declaration)+happyOut93 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut93 #-}+happyIn94 :: (Declaration) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn94 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn94 #-}+happyOut94 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Declaration)+happyOut94 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut94 #-}+happyIn95 :: (Declaration) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn95 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn95 #-}+happyOut95 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Declaration)+happyOut95 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut95 #-}+happyIn96 :: (Declaration) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn96 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn96 #-}+happyOut96 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Declaration)+happyOut96 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut96 #-}+happyIn97 :: (Declaration) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn97 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn97 #-}+happyOut97 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Declaration)+happyOut97 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut97 #-}+happyIn98 :: (Declaration) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn98 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn98 #-}+happyOut98 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Declaration)+happyOut98 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut98 #-}+happyIn99 :: (Declaration) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn99 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn99 #-}+happyOut99 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Declaration)+happyOut99 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut99 #-}+happyIn100 :: (Declaration) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn100 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn100 #-}+happyOut100 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Declaration)+happyOut100 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut100 #-}+happyIn101 :: (Declaration) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn101 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn101 #-}+happyOut101 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Declaration)+happyOut101 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut101 #-}+happyIn102 :: ([Arg Name]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn102 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn102 #-}+happyOut102 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([Arg Name])+happyOut102 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut102 #-}+happyIn103 :: ([RString]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn103 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn103 #-}+happyOut103 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([RString])+happyOut103 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut103 #-}+happyIn104 :: ([NamedArg HoleName]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn104 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn104 #-}+happyOut104 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([NamedArg HoleName])+happyOut104 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut104 #-}+happyIn105 :: (NamedArg HoleName) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn105 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn105 #-}+happyOut105 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (NamedArg HoleName)+happyOut105 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut105 #-}+happyIn106 :: (HoleName) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn106 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn106 #-}+happyOut106 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (HoleName)+happyOut106 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut106 #-}+happyIn107 :: (HoleName) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn107 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn107 #-}+happyOut107 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (HoleName)+happyOut107 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut107 #-}+happyIn108 :: (RString) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn108 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn108 #-}+happyOut108 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (RString)+happyOut108 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut108 #-}+happyIn109 :: (Maybe Range) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn109 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn109 #-}+happyOut109 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Maybe Range)+happyOut109 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut109 #-}+happyIn110 :: ([Declaration]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn110 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn110 #-}+happyOut110 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([Declaration])+happyOut110 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut110 #-}+happyIn111 :: ([Expr]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn111 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn111 #-}+happyOut111 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([Expr])+happyOut111 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut111 #-}+happyIn112 :: ([TypedBindings] -> Parser ModuleApplication) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn112 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn112 #-}+happyOut112 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([TypedBindings] -> Parser ModuleApplication)+happyOut112 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut112 #-}+happyIn113 :: (Declaration) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn113 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn113 #-}+happyOut113 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Declaration)+happyOut113 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut113 #-}+happyIn114 :: (Declaration) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn114 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn114 #-}+happyOut114 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Declaration)+happyOut114 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut114 #-}+happyIn115 :: (Name) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn115 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn115 #-}+happyOut115 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Name)+happyOut115 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut115 #-}+happyIn116 :: ([Declaration]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn116 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn116 #-}+happyOut116 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([Declaration])+happyOut116 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut116 #-}+happyIn117 :: (Declaration) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn117 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn117 #-}+happyOut117 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Declaration)+happyOut117 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut117 #-}+happyIn118 :: (Pragma) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn118 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn118 #-}+happyOut118 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Pragma)+happyOut118 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut118 #-}+happyIn119 :: (Pragma) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn119 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn119 #-}+happyOut119 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Pragma)+happyOut119 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut119 #-}+happyIn120 :: (Pragma) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn120 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn120 #-}+happyOut120 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Pragma)+happyOut120 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut120 #-}+happyIn121 :: (Pragma) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn121 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn121 #-}+happyOut121 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Pragma)+happyOut121 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut121 #-}+happyIn122 :: (Pragma) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn122 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn122 #-}+happyOut122 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Pragma)+happyOut122 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut122 #-}+happyIn123 :: (Pragma) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn123 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn123 #-}+happyOut123 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Pragma)+happyOut123 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut123 #-}+happyIn124 :: (Pragma) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn124 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn124 #-}+happyOut124 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Pragma)+happyOut124 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut124 #-}+happyIn125 :: (Pragma) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn125 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn125 #-}+happyOut125 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Pragma)+happyOut125 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut125 #-}+happyIn126 :: (Pragma) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn126 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn126 #-}+happyOut126 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Pragma)+happyOut126 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut126 #-}+happyIn127 :: (Pragma) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn127 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn127 #-}+happyOut127 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Pragma)+happyOut127 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut127 #-}+happyIn128 :: (Pragma) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn128 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn128 #-}+happyOut128 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Pragma)+happyOut128 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut128 #-}+happyIn129 :: (Pragma) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn129 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn129 #-}+happyOut129 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Pragma)+happyOut129 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut129 #-}+happyIn130 :: (Pragma) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn130 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn130 #-}+happyOut130 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Pragma)+happyOut130 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut130 #-}+happyIn131 :: (Pragma) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn131 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn131 #-}+happyOut131 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Pragma)+happyOut131 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut131 #-}+happyIn132 :: (Pragma) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn132 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn132 #-}+happyOut132 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Pragma)+happyOut132 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut132 #-}+happyIn133 :: (Pragma) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn133 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn133 #-}+happyOut133 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Pragma)+happyOut133 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut133 #-}+happyIn134 :: (Pragma) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn134 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn134 #-}+happyOut134 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Pragma)+happyOut134 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut134 #-}+happyIn135 :: (Pragma) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn135 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn135 #-}+happyOut135 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Pragma)+happyOut135 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut135 #-}+happyIn136 :: ([TypeSignature]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn136 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn136 #-}+happyOut136 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([TypeSignature])+happyOut136 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut136 #-}+happyIn137 :: ([TypeSignature]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn137 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn137 #-}+happyOut137 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([TypeSignature])+happyOut137 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut137 #-}+happyIn138 :: ([Arg TypeSignature]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn138 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn138 #-}+happyOut138 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([Arg TypeSignature])+happyOut138 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut138 #-}+happyIn139 :: ([Arg TypeSignature]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn139 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn139 #-}+happyOut139 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([Arg TypeSignature])+happyOut139 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut139 #-}+happyIn140 :: ([Constructor]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn140 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn140 #-}+happyOut140 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([Constructor])+happyOut140 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut140 #-}+happyIn141 :: ((Maybe (Ranged Induction), Maybe Name, [Declaration])) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn141 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn141 #-}+happyOut141 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ((Maybe (Ranged Induction), Maybe Name, [Declaration]))+happyOut141 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut141 #-}+happyIn142 :: (Ranged Induction) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn142 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn142 #-}+happyOut142 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Ranged Induction)+happyOut142 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut142 #-}+happyIn143 :: ([Declaration]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn143 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn143 #-}+happyOut143 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([Declaration])+happyOut143 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut143 #-}+happyIn144 :: ([Declaration]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn144 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn144 #-}+happyOut144 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([Declaration])+happyOut144 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut144 #-}+happyIn145 :: ([Declaration]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn145 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn145 #-}+happyOut145 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([Declaration])+happyOut145 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut145 #-}+happyIn146 :: ([Declaration]) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyIn146 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn146 #-}+happyOut146 :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> ([Declaration])+happyOut146 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut146 #-}+happyInTok :: (Token) -> (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75)+happyInTok x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyInTok #-}+happyOutTok :: (HappyAbsSyn t11 t12 t13 t34 t37 t40 t41 t42 t46 t47 t75) -> (Token)+happyOutTok x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOutTok #-}+++happyActOffsets :: HappyAddr+happyActOffsets = HappyA# "\x00\x00\xfc\x09\xee\x05\x20\x04\x00\x00\xd2\x04\x00\x00\x00\x00\xe7\x05\x00\x00\x00\x00\xe7\x05\x79\x04\xf4\x05\x00\x00\xdd\x05\xf5\x05\x00\x00\x00\x00\x00\x00\x00\x00\x9b\x02\x00\x00\x00\x00\x87\x08\xfc\x09\xef\x05\x00\x00\xb6\x02\xde\x05\x83\x0b\x00\x00\x00\x00\x9a\x0f\xdb\x05\xdb\x05\x00\x00\x00\x00\x5b\x0b\x00\x00\x00\x00\xe6\x02\x38\x0b\x00\x00\x00\x00\x5a\x0b\x65\x06\x25\x06\x4c\x08\x00\x00\xd4\x05\xe9\x05\x00\x00\xd9\x05\x1f\x02\xd8\x05\x00\x00\x00\x00\xef\x00\xef\x00\x00\x00\xd3\x05\xd5\x05\xd6\x05\x31\x01\xcd\x05\x06\x06\xc8\x05\xbe\x05\x20\x04\x00\x00\x00\x00\x00\x00\x8a\x0f\xfc\x09\x00\x00\xc6\x05\x00\x00\x37\x0b\x87\x0f\x39\x04\xd3\x00\x00\x00\x1b\x08\xdd\x07\xc1\x09\x00\x00\x10\x0b\xac\x07\x25\x06\x71\x07\x2d\x0a\x2d\x0a\x2d\x0a\xc4\x05\x10\x0b\x40\x07\x25\x06\x05\x07\x09\x06\x08\x06\x0f\x0b\x90\x09\xc3\x05\x0f\x0b\x00\x00\x5f\x09\x2d\x0a\x2d\x0a\xb9\x05\xb1\x05\xff\x05\x74\x05\x00\x00\xb7\x02\x2d\x0a\x2d\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x24\x09\x2d\x0a\x24\x09\x10\x0b\xfb\x05\xb6\x05\x2c\x04\x3c\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xae\x05\xa9\x05\x82\x00\xd0\x00\xa3\x05\xa3\x05\xed\x0a\xa6\x05\x88\x02\x88\x02\x88\x02\x9b\x05\x9b\x05\x9b\x05\x9b\x05\x98\x05\x98\x05\x98\x05\x8c\x05\xcd\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x99\x05\xe4\xff\x97\x05\x8b\x05\x94\x05\x8a\x05\x93\x05\x83\x05\x82\x05\x88\x05\x81\x05\x81\x05\x81\x05\x81\x05\x81\x05\x81\x05\x81\x05\xce\x05\xc5\x0a\x8f\x05\xec\x0a\x7f\x01\x00\x00\x00\x00\x00\x00\x00\x00\xff\x00\x00\x00\x00\x00\xff\x00\xff\x00\x00\x00\xca\x03\xc4\x0a\xa1\x0a\xa1\x0a\xa1\x0a\xa1\x0a\x00\x00\xa2\x0a\x7f\x05\x00\x00\x7f\x05\x00\x00\x00\x00\x00\x00\x74\x05\x00\x00\x00\x00\xd6\x00\x24\x09\x24\x09\xcc\x05\x2d\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2d\x0a\x2d\x0a\x2d\x0a\x2d\x0a\x10\x00\x24\x09\x8e\x05\x80\x05\x00\x00\x8d\x05\x65\x05\x7e\x05\x62\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x09\x24\x09\x2d\x0a\x7c\x05\xef\x00\x7d\x05\x72\x05\xef\x00\x7b\x05\x30\x01\x79\x05\x00\x00\xe2\x00\x3d\x01\x77\x05\x76\x05\x70\x05\x00\x00\x2d\x0a\x2d\x0a\x00\x00\x2d\x0a\x2d\x0a\x79\x0a\x6f\x05\x79\x0a\xd4\x06\x96\x06\xe9\x08\x00\x00\x00\x00\x6b\x05\x35\x00\x00\x00\x12\x04\x00\x00\x00\x00\xb8\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb8\x08\x00\x00\x00\x00\x7a\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc6\x00\x62\x01\x66\x00\x62\x01\x2d\x0a\x00\x00\x2d\x0a\xb8\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x64\x05\x5b\x05\x00\x00\xb8\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb8\x08\x00\x00\x00\x00\x00\x00\x57\x05\xde\x00\x00\x00\x50\x05\x62\x05\x00\x00\x3d\x00\x56\x0a\x7a\x0a\x0d\x03\xe5\x05\x56\x0a\xa0\x05\x56\x0a\x1d\x00\xb9\x00\x9f\x00\x9a\x00\x2d\x0a\x00\x00\xca\x03\x60\x05\x00\x00\x3d\x00\x34\x01\x5e\x01\xd5\xff\xd5\xff\xf2\xff\x00\x00\x00\x00\x00\x00\x29\x03\x00\x00\x00\x00\x00\x00\x5a\x05\xed\xff\xed\xff\x00\x00\x00\x00\x5d\x05\xb8\x08\x52\x05\x96\x05\x4b\x05\x00\x00\x47\x05\x47\x05\x47\x05\x46\x05\x45\x05\x42\x05\x44\x05\x00\x00\x00\x00\x00\x00\x00\x00\x43\x05\x00\x00\x35\x05\x34\x05\x30\x05\x30\x05\x2d\x05\x27\x05\x00\x00\x00\x00\x25\x05\x23\x05\x00\x00\x00\x00\x00\x00\x00\x00\x1f\x05\x1e\x05\x00\x00\x16\x05\x1c\x05\x18\x05\x17\x05\x00\x00\x00\x00\x00\x00\x00\x00\xb8\x08\x1a\x05\x24\x05\x11\x05\x10\x05\x19\x05\x05\x05\x00\x00\x05\x05\x00\x00\xd5\xff\x0c\x05\x04\x05\x60\x00\x00\x00\x04\x05\x04\x05\x04\x05\x04\x05\x00\x00\xca\x03\xb8\x08\x00\x00\x48\x00\x08\x05\xb8\x08\x07\x05\xb8\x08\x07\x05\xb8\x08\x06\x05\x12\x04\x00\x00\x06\x05\x00\x00\x60\x00\x00\x00\x00\x00\x0d\x03\x00\x00\x00\x00\x0b\x05\x0a\x05\x09\x05\x00\x00\x00\x00\x0f\x05\x00\x00\xfc\x04\xb8\x08\x00\x00\x4d\x05\x4c\x05\x00\x00\x00\x00\x26\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0d\x03\x00\x00\x00\x00\xfe\x04\xfe\x04\x00\x00\x00\x00\x12\x04\x90\x00\x2d\x00\x2d\x00\x00\x00\x0d\x03\x00\x00\x57\x0a\x0d\x03\x00\x00\x4a\x05\x00\x00\x00\x00\x0a\x00\x3c\x05\x00\x00\x3b\x05\x00\x00\xcd\x03\x00\x00\x00\x00\xe9\x04\x60\x00\xe7\x04\x60\x00\xca\x03\xca\x03\x00\x00\xe2\x04\x00\x00\xef\x04\xed\xff\x00\x00\xee\x04\xed\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7c\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe4\x04\x00\x00\xda\x04\xe1\x04\xd8\x04\x00\x00\x00\x00\x00\x00\xca\x03\xca\x03\xca\x03\xca\x03\x00\x00\x3d\x00\x3d\x00\x10\x00\x74\x04\x00\x00\x00\x00\xdc\x04\x7d\x04\x00\x00\x7d\x04\x00\x00\x00\x00\xa5\x05\x00\x00\x00\x00\x83\x04\x80\x04\x00\x00\x73\x04\x77\x04\x71\x04\x76\x04\x7e\x04\xaf\x04\x00\x00\x00\x00\x0d\x03\x00\x00\x00\x00\x00\x00\x63\x04\x63\x04\xac\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2d\x00\x60\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2a\x05\x00\x00\x74\x05\x00\x00\x00\x00\x00\x00\x00\x00\x6f\x04\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x3d\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x74\x05\x00\x00\x10\x00\x00\x00\x00\x00"#++happyGotoOffsets :: HappyAddr+happyGotoOffsets = HappyA# "\x4a\x04\x9b\x0f\xb3\x04\xeb\x02\xb4\x04\xa9\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\x06\x7f\x0f\x00\x00\x00\x00\x08\x04\x24\x04\xa5\x01\x00\x00\x00\x00\xe3\x01\xa0\x04\x84\x04\x00\x00\x00\x00\x4d\x03\x00\x00\x00\x00\x00\x00\x2b\x04\x00\x00\x00\x00\x70\x01\x0f\x01\xff\x0b\x39\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x81\x04\x7b\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfc\x03\x06\x02\x00\x00\x00\x00\x00\x00\x2a\x04\x63\x0f\x00\x00\x00\x00\x00\x00\x4c\x03\x00\x00\x81\x00\x03\x00\x00\x00\x84\x01\x5c\x0c\xc1\x0b\x00\x00\x2b\x04\x47\x07\xdc\x0b\x1c\x0c\xd8\x06\x34\x0d\x17\x0d\x00\x00\xef\x02\x47\x0f\x4f\x0d\x2b\x0f\x00\x00\x00\x00\x1f\x04\x0f\x0f\x00\x00\xc6\x03\x00\x00\x84\x01\x10\x0d\xf3\x0c\x00\x00\x1a\x00\x00\x00\x48\x03\x00\x00\x00\x00\xec\x0c\xcf\x0c\x00\x00\x00\x00\x00\x00\x00\x00\xf3\x0e\x60\x02\xd7\x0e\x87\x03\x3a\x04\x00\x00\x25\x04\x72\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6d\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe4\x03\xe8\x03\x06\x02\x1c\x00\x5c\x04\x4d\x04\xfa\x00\xb6\x03\x23\x04\x1c\x04\x19\x04\x92\x03\x8d\x03\x8b\x03\x88\x03\x03\x04\xf7\x03\xf4\x03\xb5\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x91\x03\x00\x00\x94\x03\x00\x00\x00\x00\x82\x03\x00\x00\x00\x00\x00\x00\x7b\x03\x78\x03\x70\x03\x58\x03\x49\x03\x45\x03\x3b\x03\x1f\x03\xed\x02\x7e\x02\x00\x00\x7b\x00\x45\x04\x00\x00\x00\x00\x00\x00\x00\x00\x3b\x02\x00\x00\x00\x00\xe4\x01\xbf\x01\x00\x00\x18\x00\x4a\x03\x28\x03\xd5\x02\xd2\x02\xb0\x02\x00\x00\x9d\x00\x2a\x03\x00\x00\x1e\x00\x00\x00\x00\x00\x00\x00\xd0\x02\x00\x00\x00\x00\xda\x02\xbb\x0e\x9f\x0e\xe8\x02\x25\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05\x02\xf3\x05\xc8\x0c\xab\x0c\x19\x03\x83\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x0d\x00\x00\x00\x11\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x67\x0e\x4b\x0e\xe8\x01\x00\x00\x0b\x03\x00\x00\x00\x00\xf2\x02\x00\x00\x00\x00\x00\x00\x00\x00\x02\x03\xf3\x02\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x0c\x87\x0c\x00\x00\x80\x0c\x63\x0c\x5f\x02\x00\x00\x5c\x02\x84\x01\xa3\x0b\x69\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xea\x01\x00\x00\x00\x00\x2f\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x13\x0e\x00\x00\x00\x00\x98\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xec\x02\x00\x00\xdf\x02\x70\x06\x00\x00\x30\x06\xf7\x0d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\xdb\x0d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xbf\x0d\x00\x00\x00\x00\x00\x00\xa1\x03\x19\x00\x00\x00\x13\x04\x00\x00\x00\x00\x09\x04\x5a\x02\x95\x00\x67\x04\x4f\x0d\x09\x02\x00\x00\xe7\x01\x00\x00\x00\x00\x00\x00\x00\x00\x64\x09\x00\x00\xaf\x02\x00\x00\x00\x00\xd5\x03\x00\x00\xdc\x02\x83\x02\x3c\x02\xa0\x00\x00\x00\x00\x00\x00\x00\x41\x02\x00\x00\x00\x00\x00\x00\x00\x00\x74\x03\x6c\x03\x00\x00\x00\x00\x00\x00\xa3\x0d\x96\x02\x79\x02\x00\x00\x00\x00\x95\x02\x86\x02\x84\x02\x00\x00\x4f\x02\x4e\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2a\x02\x26\x02\x00\x00\x15\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0b\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x87\x0d\x00\x00\x00\x00\xb8\x01\x00\x00\x00\x00\x89\x01\x00\x00\xad\xff\x00\x00\x8f\x01\x00\x00\xcc\x01\xc1\x01\x00\x00\xab\x03\xa7\x03\xa2\x03\x4f\x03\x00\x00\xb8\x00\x6b\x0d\x00\x00\x00\x00\x44\x01\x03\x0a\x92\x01\x2b\x09\x8b\x01\x8e\x08\x06\x03\x20\x00\x00\x00\xf7\x02\x00\x00\xab\x01\x00\x00\x00\x00\x8e\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfa\xff\xb3\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x78\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x62\x04\x00\x00\x00\x00\xf1\x02\x8b\x02\x00\x00\x00\x00\xff\xff\x55\x01\x0d\x01\xd7\x00\x00\x00\x15\x04\x00\x00\x3b\x00\xbc\x03\x00\x00\x00\x00\x00\x00\x00\x00\xfd\xff\x00\x00\x00\x00\x00\x00\x00\x00\xfc\xff\x00\x00\x00\x00\x00\x00\xa0\x01\x00\x00\x1c\x01\xae\x02\x8d\x02\x00\x00\x32\x01\x00\x00\x00\x00\xd8\x02\x00\x00\x00\x00\xa2\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x13\x01\x00\x00\x0e\x01\x00\x00\x00\x00\x00\x00\x7c\x02\x20\x02\xa2\x00\x2c\x00\x00\x00\xbf\x02\x6c\x02\x1b\x01\xfe\x00\x00\x00\x00\x00\x57\x00\xd4\x00\x00\x00\x85\x00\x00\x00\x00\x00\x4f\x0d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf8\x00\x00\x00\xf1\x00\x00\x00\x00\x00\x00\x00\xdd\x00\x00\x00\xb7\x03\x00\x00\x00\x00\x00\x00\xc2\x00\x84\x00\x51\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xba\x00\x5a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x68\x01\x00\x00\x58\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3e\x00\x4d\x01\x34\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\x01\x00\x00\x0e\x00\x00\x00\x00\x00"#++happyDefActions :: HappyAddr+happyDefActions = HappyA# "\xf9\xff\x00\x00\x00\x00\x00\x00\x00\x00\xfb\xff\x7e\xff\x7d\xff\x00\x00\x96\xff\x7f\xff\x00\x00\xa3\xfe\x7e\xff\x58\xff\x00\x00\x6d\xff\x6c\xff\x6a\xff\x69\xff\x66\xff\x00\x00\x46\xff\x45\xff\x63\xff\x00\x00\x00\x00\x3e\xff\x3c\xff\x00\x00\x00\x00\x54\xff\x53\xff\x00\x00\x00\x00\x00\x00\x52\xff\x51\xff\x00\x00\x50\xff\x4f\xff\x00\x00\x00\x00\x55\xff\x56\xff\x00\x00\xa3\xfe\x00\x00\x00\x00\x57\xff\x00\x00\x00\x00\x78\xff\x00\x00\x77\xff\x00\x00\x59\xff\x4b\xff\x00\x00\x00\x00\x93\xff\x00\x00\x00\x00\x00\x00\x76\xff\x00\x00\x00\x00\x00\x00\x00\x00\xa4\xfe\x4c\xff\x7c\xff\x0e\xff\x22\xff\x00\x00\x5d\xff\x00\x00\x2d\xff\x2a\xff\x23\xff\x00\x00\x00\x00\x7b\xff\xa3\xfe\x00\x00\x00\x00\x49\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x60\xff\x5c\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x13\xff\x00\x00\x00\x00\x14\xff\x0f\xff\xa3\xfe\x00\x00\x00\x00\x00\x00\x44\xff\x00\x00\xa3\xfe\x3d\xff\x00\x00\x00\x00\x00\x00\x3f\xff\x70\xff\x68\xff\x5b\xff\x00\x00\x00\x00\x00\x00\x00\x00\xea\xfe\x00\x00\xcb\xfe\x5b\xfe\xe3\xfe\xe2\xfe\xe1\xfe\xe0\xfe\xdf\xfe\xde\xfe\xe4\xfe\xdd\xfe\xdc\xfe\xdb\xfe\xda\xfe\xd9\xfe\xd8\xfe\xd1\xfe\xd3\xfe\xd2\xfe\xd7\xfe\xd6\xfe\xd5\xfe\x9f\xff\xd4\xfe\x95\xfe\x84\xfe\x94\xfe\x93\xfe\x92\xfe\x91\xfe\x8f\xfe\x90\xfe\x8e\xfe\x8d\xfe\x8c\xfe\x89\xfe\x86\xfe\x87\xfe\x88\xfe\x85\xfe\x8b\xfe\x8a\xfe\x59\xfe\x96\xfe\x00\x00\x00\x00\xa4\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xee\xfe\x00\x00\xfa\xff\xf8\xff\xf7\xff\xf6\xff\xf5\xff\xf4\xff\xf3\xff\xf2\xff\xf1\xff\xf0\xff\xef\xff\xee\xff\xed\xff\xec\xff\xeb\xff\xea\xff\xe9\xff\xe8\xff\xe7\xff\xe6\xff\xe5\xff\xe4\xff\xe3\xff\xe2\xff\xe1\xff\xe0\xff\xdf\xff\xde\xff\xdd\xff\xdc\xff\xdb\xff\xda\xff\xd9\xff\xd8\xff\xd7\xff\xd6\xff\xd5\xff\xd4\xff\xd3\xff\xcb\xff\xca\xff\xc9\xff\xc8\xff\xc7\xff\xc6\xff\xd2\xff\xd1\xff\xd0\xff\xcf\xff\xce\xff\xcd\xff\xcc\xff\xc5\xff\xc4\xff\xc3\xff\xc2\xff\xc1\xff\xc0\xff\xbf\xff\xbe\xff\xbd\xff\xbc\xff\xbb\xff\xba\xff\xb9\xff\xb8\xff\xb7\xff\xb6\xff\xb5\xff\xb4\xff\xb3\xff\xb2\xff\xb1\xff\xb0\xff\xaf\xff\xae\xff\xad\xff\xac\xff\xab\xff\xaa\xff\xa9\xff\xa8\xff\xa7\xff\xa6\xff\xa5\xff\xa4\xff\xa3\xff\xa2\xff\xa1\xff\x75\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xea\xfe\x00\x00\x00\x00\xb4\xfe\x00\x00\xba\xfe\xbb\xfe\xbc\xfe\xbd\xfe\x00\x00\x97\xff\x98\xff\x00\x00\x00\x00\xbe\xfe\x00\x00\x10\xff\x10\xff\x10\xff\x10\xff\x10\xff\x97\xfe\x9f\xfe\x00\x00\xb8\xfe\x00\x00\xb9\xfe\xa0\xff\x9e\xff\xa3\xfe\x9b\xff\x9a\xff\xe8\xfe\x00\x00\x00\x00\xec\xfe\x00\x00\x4a\xff\x6e\xff\x6b\xff\x6f\xff\x77\xff\x63\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x43\xff\x42\xff\x44\xff\x78\xff\x00\x00\x76\xff\x16\xff\x17\xff\x65\xff\x15\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1d\xff\x00\x00\x18\xff\x00\x00\x00\x00\x20\xff\x1f\xff\x21\xff\x0d\xff\x00\x00\x00\x00\x0c\xff\x00\x00\x00\x00\x29\xff\x25\xff\x2a\xff\xa3\xfe\x00\x00\x00\x00\x2e\xff\x67\xff\x24\xff\x00\x00\x32\xff\x00\x00\x35\xff\x4d\xff\x00\x00\x92\xff\x34\xff\x4e\xff\x33\xff\x5a\xff\x00\x00\x30\xff\x2f\xff\x9f\xfe\x31\xff\x27\xff\x26\xff\x28\xff\x2c\xff\x2b\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x5e\xff\x00\x00\x00\x00\x3b\xff\x39\xff\x3a\xff\x38\xff\x36\xff\x37\xff\x5f\xff\x61\xff\x62\xff\x0a\xff\x0b\xff\x00\x00\x00\x00\x48\xff\x00\x00\x64\xff\x5f\xfe\x9c\xff\x9d\xff\xe9\xfe\xf0\xfe\x00\x00\xcd\xfe\xcc\xfe\xce\xfe\x00\x00\x00\x00\x5c\xfe\x94\xff\x00\x00\x6f\xfe\x00\x00\x10\xff\x9f\xfe\x03\xff\x00\x00\x10\xff\x00\x00\x10\xff\x00\x00\x00\x00\x00\x00\x00\x00\x44\xff\x90\xff\x8c\xff\x00\x00\x6c\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x79\xff\xc1\xfe\xc0\xfe\xbf\xfe\x00\x00\xb0\xfe\xae\xfe\xa9\xfe\x00\x00\x00\x00\x00\x00\xa5\xfe\xb3\xfe\x00\x00\x00\x00\xee\xfe\xec\xfe\x00\x00\x71\xff\x75\xff\x75\xff\x75\xff\x00\x00\x00\x00\x75\xff\x00\x00\x72\xff\x75\xfe\x76\xfe\x77\xfe\x00\x00\x72\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x75\xff\x74\xff\x83\xfe\x00\x00\x00\x00\x80\xfe\x73\xfe\x78\xfe\x74\xfe\x00\x00\x00\x00\x73\xff\x75\xff\x00\x00\x00\x00\x00\x00\x79\xfe\xef\xfe\xed\xfe\xb7\xfe\x00\x00\x00\x00\xa7\xfe\x00\x00\x00\x00\xa7\xfe\x00\x00\xaf\xfe\x00\x00\x7a\xff\x8e\xff\x00\x00\x00\x00\x00\x00\x91\xff\x00\x00\x00\x00\x00\x00\x00\x00\x6e\xfe\x00\x00\x00\x00\x8d\xff\x7e\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12\xff\x00\x00\x11\xff\x00\x00\xa1\xfe\x05\xff\x03\xff\x01\xff\x00\xff\x00\x00\x00\x00\x00\x00\x02\xff\x9e\xfe\x00\x00\x71\xfe\x00\x00\x00\x00\x95\xff\x00\x00\x00\x00\x5d\xfe\xe7\xfe\x00\x00\xeb\xfe\x40\xff\x41\xff\x47\xff\x1e\xff\x1d\xff\x1c\xff\x1b\xff\x19\xff\x1a\xff\x08\xff\x09\xff\x06\xff\x07\xff\x03\xff\xa2\xfe\x5e\xfe\x00\x00\x00\x00\xd0\xfe\x70\xfe\x00\x00\x99\xff\xf4\xfe\xf4\xfe\x04\xff\x03\xff\x98\xfe\x9f\xfe\x03\xff\x99\xfe\xc6\xfe\x6a\xfe\xc8\xfe\x00\x00\x00\x00\xc7\xfe\xc3\xfe\xc4\xfe\x00\x00\xcf\xfe\x6d\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x8a\xff\x88\xff\x8f\xff\xb6\xfe\xb2\xfe\x00\x00\x00\x00\xac\xfe\x00\x00\x00\x00\xad\xfe\xb5\xfe\x7a\xfe\x7b\xfe\x7d\xfe\x00\x00\x7e\xfe\x7f\xfe\x81\xfe\x82\xfe\x7c\xfe\x00\x00\xa7\xfe\x00\x00\x00\x00\x00\x00\xb1\xfe\x89\xff\x8b\xff\x84\xff\x86\xff\x80\xff\x82\xff\x69\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x61\xfe\x60\xfe\x00\x00\x00\x00\x6b\xfe\x00\x00\x9b\xfe\x9c\xfe\x00\x00\xa0\xfe\xf6\xfe\xf2\xfe\x00\x00\xf3\xfe\x00\x00\x00\x00\x00\x00\x00\x00\xfa\xfe\x00\x00\x99\xff\xfc\xfe\x03\xff\xe6\xfe\xe5\xfe\x9a\xfe\x00\x00\x00\x00\x99\xff\xfd\xfe\xf8\xfe\xfe\xfe\xf5\xfe\xff\xfe\x00\x00\x00\x00\xca\xfe\xc9\xfe\xc5\xfe\xc2\xfe\x66\xfe\x65\xfe\xa3\xfe\x68\xfe\xa3\xfe\x83\xff\x81\xff\x87\xff\x85\xff\x00\x00\xaa\xfe\xa6\xfe\xab\xfe\xa8\xfe\x00\x00\x00\x00\x00\x00\x9d\xfe\xf1\xfe\xfb\xfe\xf9\xfe\xf7\xfe\x62\xfe\x64\xfe\xa3\xfe\x67\xfe\x00\x00\x63\xfe"#++happyCheck :: HappyAddr+happyCheck = HappyA# "\xff\xff\x05\x00\x05\x00\x09\x00\x0a\x00\x09\x00\x09\x00\x0a\x00\x09\x00\x25\x00\x00\x00\x0f\x00\x09\x00\x60\x00\x0f\x00\x10\x00\x00\x00\x09\x00\x65\x00\x05\x00\x11\x00\x40\x00\x09\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x03\x00\x09\x00\x09\x00\x09\x00\x0c\x00\x09\x00\x0e\x00\x09\x00\x0a\x00\x09\x00\x55\x00\x0f\x00\x10\x00\x25\x00\x26\x00\x0f\x00\x10\x00\x24\x00\x25\x00\x26\x00\x47\x00\x09\x00\x44\x00\x02\x00\x0c\x00\x05\x00\x0e\x00\x57\x00\x0f\x00\x00\x00\x24\x00\x25\x00\x26\x00\x45\x00\x55\x00\x05\x00\x09\x00\x4b\x00\x4a\x00\x55\x00\x4b\x00\x4d\x00\x0f\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x51\x00\x21\x00\x22\x00\x23\x00\x55\x00\x43\x00\x51\x00\x66\x00\x67\x00\x4c\x00\x0b\x00\x6a\x00\x6b\x00\x69\x00\x4b\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x80\x00\x05\x00\x41\x00\x82\x00\x4b\x00\x09\x00\x55\x00\x87\x00\x09\x00\x6c\x00\x8a\x00\x0f\x00\x6c\x00\x69\x00\x09\x00\x43\x00\x11\x00\x09\x00\x51\x00\x52\x00\x48\x00\x0f\x00\x11\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x84\x00\x03\x00\x09\x00\x0f\x00\x82\x00\x09\x00\x03\x00\x68\x00\x0f\x00\x2a\x00\x09\x00\x0f\x00\x42\x00\x09\x00\x2f\x00\x09\x00\x0f\x00\x4d\x00\x0c\x00\x4f\x00\x0e\x00\x11\x00\x12\x00\x38\x00\x39\x00\x4f\x00\x21\x00\x22\x00\x23\x00\x21\x00\x22\x00\x23\x00\x03\x00\x45\x00\x21\x00\x22\x00\x23\x00\x09\x00\x4a\x00\x09\x00\x0c\x00\x4d\x00\x0e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x09\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x55\x00\x56\x00\x03\x00\x5f\x00\x4b\x00\x42\x00\x86\x00\x66\x00\x67\x00\x09\x00\x42\x00\x6a\x00\x6b\x00\x07\x00\x0f\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x80\x00\x09\x00\x09\x00\x42\x00\x42\x00\x68\x00\x44\x00\x0f\x00\x68\x00\x09\x00\x8a\x00\x09\x00\x4c\x00\x68\x00\x81\x00\x09\x00\x42\x00\x0f\x00\x85\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x44\x00\x4f\x00\x09\x00\x44\x00\x09\x00\x42\x00\x43\x00\x44\x00\x22\x00\x4a\x00\x0f\x00\x4c\x00\x05\x00\x4e\x00\x44\x00\x41\x00\x15\x00\x55\x00\x56\x00\x0b\x00\x55\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x55\x00\x52\x00\x45\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x4a\x00\x2c\x00\x4d\x00\x4d\x00\x4f\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x44\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x42\x00\x43\x00\x44\x00\x05\x00\x06\x00\x55\x00\x81\x00\x66\x00\x67\x00\x07\x00\x85\x00\x6a\x00\x6b\x00\x07\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x80\x00\x09\x00\x42\x00\x65\x00\x43\x00\x66\x00\x67\x00\x0f\x00\x65\x00\x09\x00\x8a\x00\x8b\x00\x4b\x00\x41\x00\x41\x00\x4f\x00\x4c\x00\x11\x00\x4e\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x4f\x00\x09\x00\x52\x00\x52\x00\x3f\x00\x40\x00\x41\x00\x0f\x00\x3f\x00\x40\x00\x41\x00\x65\x00\x09\x00\x15\x00\x2a\x00\x0c\x00\x0d\x00\x2d\x00\x2e\x00\x2f\x00\x30\x00\x1d\x00\x1e\x00\x1f\x00\x42\x00\x21\x00\x22\x00\x23\x00\x38\x00\x39\x00\x4c\x00\x0b\x00\x4e\x00\x45\x00\x09\x00\x4d\x00\x2c\x00\x4f\x00\x4a\x00\x55\x00\x0f\x00\x4d\x00\x0b\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x22\x00\x09\x00\x4a\x00\x86\x00\x4c\x00\x0b\x00\x4e\x00\x66\x00\x67\x00\x11\x00\x12\x00\x6a\x00\x6b\x00\x55\x00\x09\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x80\x00\x09\x00\x66\x00\x67\x00\x09\x00\x09\x00\x65\x00\x0f\x00\x09\x00\x09\x00\x8a\x00\x09\x00\x11\x00\x11\x00\x12\x00\x0f\x00\x11\x00\x0f\x00\x10\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x81\x00\x2a\x00\x09\x00\x09\x00\x85\x00\x2a\x00\x09\x00\x81\x00\x0f\x00\x0f\x00\x10\x00\x85\x00\x35\x00\x36\x00\x11\x00\x38\x00\x39\x00\x65\x00\x37\x00\x38\x00\x39\x00\x16\x00\x1d\x00\x1e\x00\x1f\x00\x45\x00\x21\x00\x22\x00\x23\x00\x09\x00\x4a\x00\x16\x00\x0c\x00\x4d\x00\x0e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x2a\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x19\x00\x37\x00\x38\x00\x39\x00\x19\x00\x09\x00\x09\x00\x66\x00\x67\x00\x0c\x00\x0d\x00\x6a\x00\x6b\x00\x11\x00\x12\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x80\x00\x09\x00\x43\x00\x09\x00\x16\x00\x09\x00\x17\x00\x0f\x00\x09\x00\x09\x00\x8a\x00\x11\x00\x4d\x00\x11\x00\x4f\x00\x0f\x00\x11\x00\x05\x00\x06\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x2a\x00\x09\x00\x2a\x00\x09\x00\x0c\x00\x2a\x00\x0e\x00\x2f\x00\x09\x00\x0f\x00\x2f\x00\x0c\x00\x0d\x00\x37\x00\x38\x00\x39\x00\x38\x00\x39\x00\x09\x00\x38\x00\x39\x00\x0c\x00\x16\x00\x0e\x00\x16\x00\x45\x00\x20\x00\x21\x00\x22\x00\x23\x00\x4a\x00\x62\x00\x63\x00\x4d\x00\x65\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x16\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x09\x00\x09\x00\x09\x00\x0c\x00\x0c\x00\x0e\x00\x0e\x00\x66\x00\x67\x00\x47\x00\x11\x00\x6a\x00\x6b\x00\x05\x00\x06\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x80\x00\x09\x00\x2a\x00\x09\x00\x46\x00\x55\x00\x09\x00\x0f\x00\x58\x00\x46\x00\x8a\x00\x11\x00\x49\x00\x09\x00\x11\x00\x37\x00\x38\x00\x39\x00\x0b\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x09\x00\x3f\x00\x40\x00\x0b\x00\x09\x00\x06\x00\x0f\x00\x10\x00\x2a\x00\x0b\x00\x0f\x00\x2a\x00\x4a\x00\x4a\x00\x4c\x00\x4c\x00\x4e\x00\x4e\x00\x64\x00\x65\x00\x06\x00\x37\x00\x38\x00\x39\x00\x37\x00\x38\x00\x39\x00\x20\x00\x21\x00\x22\x00\x23\x00\x88\x00\x89\x00\x45\x00\x0b\x00\x0a\x00\x0b\x00\x0c\x00\x4a\x00\x0e\x00\x0b\x00\x4d\x00\x05\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x49\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x47\x00\x4a\x00\x09\x00\x4c\x00\x09\x00\x4e\x00\x48\x00\x66\x00\x67\x00\x19\x00\x11\x00\x6a\x00\x6b\x00\x64\x00\x65\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x80\x00\x09\x00\x2a\x00\x09\x00\x19\x00\x09\x00\x09\x00\x0f\x00\x09\x00\x0a\x00\x8a\x00\x11\x00\x0f\x00\x11\x00\x19\x00\x37\x00\x38\x00\x39\x00\x19\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x43\x00\x20\x00\x21\x00\x22\x00\x23\x00\x19\x00\x09\x00\x4a\x00\x2a\x00\x4c\x00\x2a\x00\x4e\x00\x0f\x00\x88\x00\x89\x00\x2f\x00\x13\x00\x14\x00\x55\x00\x88\x00\x89\x00\x37\x00\x38\x00\x39\x00\x38\x00\x39\x00\x1d\x00\x1e\x00\x1f\x00\x19\x00\x21\x00\x22\x00\x23\x00\x45\x00\x88\x00\x89\x00\x09\x00\x19\x00\x4a\x00\x18\x00\x2b\x00\x4d\x00\x0f\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x19\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x16\x00\x21\x00\x22\x00\x23\x00\x09\x00\x0a\x00\x19\x00\x66\x00\x67\x00\x09\x00\x0a\x00\x6a\x00\x6b\x00\x09\x00\x0a\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x80\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x00\x00\x01\x00\x09\x00\x64\x00\x65\x00\x8a\x00\x06\x00\x07\x00\x08\x00\x09\x00\x11\x00\x64\x00\x65\x00\x05\x00\x06\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x2a\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x46\x00\x36\x00\x09\x00\x38\x00\x39\x00\x09\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3f\x00\x40\x00\x3e\x00\x09\x00\x40\x00\x05\x00\x06\x00\x88\x00\x44\x00\x45\x00\x88\x00\x47\x00\x88\x00\x4c\x00\x4a\x00\x4e\x00\x4c\x00\x88\x00\x4e\x00\x09\x00\x0a\x00\x51\x00\x55\x00\x53\x00\x08\x00\x55\x00\x56\x00\x08\x00\x58\x00\x00\x00\x01\x00\x09\x00\x88\x00\x89\x00\x08\x00\x06\x00\x07\x00\x08\x00\x09\x00\x11\x00\x29\x00\x2a\x00\x09\x00\x09\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x83\x00\x0f\x00\x11\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x2a\x00\x00\x00\x01\x00\x21\x00\x22\x00\x23\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x2a\x00\x36\x00\x09\x00\x38\x00\x39\x00\x2f\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x38\x00\x39\x00\x3e\x00\x09\x00\x40\x00\x55\x00\x56\x00\x81\x00\x44\x00\x45\x00\x88\x00\x47\x00\x42\x00\x43\x00\x4a\x00\x04\x00\x4c\x00\x4e\x00\x4e\x00\x55\x00\x56\x00\x51\x00\x06\x00\x53\x00\x01\x00\x55\x00\x56\x00\x44\x00\x58\x00\x06\x00\x07\x00\x08\x00\x48\x00\x4a\x00\x88\x00\x4c\x00\x0b\x00\x4e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x0b\x00\x09\x00\x55\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x61\x00\x62\x00\x63\x00\x09\x00\x65\x00\x02\x00\x88\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x01\x00\x03\x00\x3e\x00\x55\x00\x40\x00\x4b\x00\x0f\x00\x0d\x00\x44\x00\x45\x00\x41\x00\x47\x00\x4b\x00\x4b\x00\x4a\x00\x41\x00\x4c\x00\x55\x00\x4e\x00\x55\x00\x55\x00\x51\x00\x4b\x00\x53\x00\x50\x00\x55\x00\x56\x00\x54\x00\x58\x00\x59\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x01\x00\x50\x00\x55\x00\x4d\x00\x55\x00\x06\x00\x07\x00\x08\x00\x4f\x00\x46\x00\x46\x00\x4f\x00\x55\x00\x4f\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x03\x00\x03\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x03\x00\x50\x00\x03\x00\x03\x00\x55\x00\x43\x00\x4a\x00\x4a\x00\x4a\x00\x50\x00\x50\x00\x50\x00\x55\x00\x55\x00\x4f\x00\x43\x00\x4d\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x55\x00\x43\x00\x3e\x00\x4f\x00\x40\x00\x54\x00\x54\x00\x57\x00\x44\x00\x45\x00\x54\x00\x47\x00\x54\x00\x54\x00\x4a\x00\x01\x00\x4c\x00\x54\x00\x4e\x00\x54\x00\x06\x00\x07\x00\x08\x00\x53\x00\x57\x00\x55\x00\x56\x00\x54\x00\x58\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x57\x00\x54\x00\x54\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x54\x00\x54\x00\x57\x00\x04\x00\x49\x00\x57\x00\x57\x00\x57\x00\x54\x00\x43\x00\x47\x00\x42\x00\x03\x00\x42\x00\x55\x00\x01\x00\x50\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x55\x00\x46\x00\x3e\x00\x4f\x00\x40\x00\x46\x00\x46\x00\x12\x00\x44\x00\x45\x00\x55\x00\x47\x00\x46\x00\x46\x00\x4a\x00\x46\x00\x4c\x00\x4f\x00\x4e\x00\x1e\x00\x1f\x00\x20\x00\x4b\x00\x53\x00\x4b\x00\x55\x00\x56\x00\x4f\x00\x58\x00\x4f\x00\x41\x00\x4f\x00\x04\x00\x43\x00\x43\x00\x05\x00\x55\x00\x49\x00\x54\x00\x54\x00\x57\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x57\x00\x3b\x00\x57\x00\x57\x00\x3e\x00\x3f\x00\x40\x00\x01\x00\x54\x00\x54\x00\x44\x00\x45\x00\x50\x00\x47\x00\x55\x00\x57\x00\x4a\x00\x57\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x51\x00\x50\x00\x12\x00\x55\x00\x50\x00\x55\x00\x56\x00\x09\x00\x58\x00\x50\x00\x49\x00\x05\x00\x02\x00\x0f\x00\x1e\x00\x1f\x00\x20\x00\x55\x00\x4e\x00\x15\x00\x46\x00\x02\x00\x02\x00\x46\x00\x49\x00\x50\x00\x09\x00\x1d\x00\x1e\x00\x1f\x00\x4b\x00\x21\x00\x22\x00\x23\x00\x42\x00\x4b\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x2c\x00\x3b\x00\x4b\x00\x4f\x00\x3e\x00\x3f\x00\x40\x00\x01\x00\x4f\x00\x4f\x00\x44\x00\x45\x00\x42\x00\x47\x00\x59\x00\x50\x00\x4a\x00\x55\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x46\x00\x59\x00\x12\x00\x43\x00\x09\x00\x55\x00\x56\x00\x48\x00\x58\x00\x50\x00\x0f\x00\x59\x00\xff\xff\xff\xff\x1e\x00\x1f\x00\x20\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\x31\x00\x32\x00\x33\x00\x3f\x00\x40\x00\x01\x00\xff\xff\xff\xff\x44\x00\x45\x00\xff\xff\x47\x00\x08\x00\xff\xff\x4a\x00\xff\xff\x4c\x00\x4d\x00\x4e\x00\x4f\x00\xff\xff\xff\xff\x12\x00\xff\xff\x09\x00\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\x1e\x00\x1f\x00\x20\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\xff\xff\xff\xff\x01\x00\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\x31\x00\x32\x00\x33\x00\x3f\x00\x40\x00\xff\xff\xff\xff\x12\x00\x44\x00\x45\x00\xff\xff\x47\x00\xff\xff\xff\xff\x4a\x00\x4b\x00\x4c\x00\xff\xff\x4e\x00\x1e\x00\x1f\x00\x20\x00\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\xff\xff\xff\xff\xff\xff\x01\x00\x40\x00\xff\xff\xff\xff\xff\xff\x44\x00\x45\x00\x08\x00\x47\x00\xff\xff\xff\xff\x4a\x00\x09\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x12\x00\x0f\x00\xff\xff\x09\x00\xff\xff\x55\x00\x56\x00\x15\x00\x58\x00\x0f\x00\xff\xff\xff\xff\x1e\x00\x1f\x00\x20\x00\x1d\x00\x1e\x00\x1f\x00\xff\xff\x21\x00\x22\x00\x23\x00\xff\xff\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x2c\x00\xff\xff\x01\x00\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\xff\xff\xff\xff\xff\xff\xff\xff\x40\x00\xff\xff\xff\xff\x12\x00\x44\x00\x45\x00\xff\xff\x47\x00\xff\xff\xff\xff\x4a\x00\x4b\x00\x4c\x00\xff\xff\x4e\x00\x1e\x00\x1f\x00\x20\x00\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\x01\x00\xff\xff\xff\xff\x3f\x00\x40\x00\xff\xff\xff\xff\xff\xff\x44\x00\x45\x00\xff\xff\x47\x00\xff\xff\xff\xff\x4a\x00\x09\x00\x4c\x00\x12\x00\x4e\x00\x4f\x00\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\x15\x00\x58\x00\x1e\x00\x1f\x00\x20\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\xff\xff\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x01\x00\x2c\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\xff\xff\xff\xff\xff\xff\x3f\x00\x40\x00\xff\xff\xff\xff\x12\x00\x44\x00\x45\x00\xff\xff\x47\x00\xff\xff\xff\xff\x4a\x00\x4b\x00\x4c\x00\xff\xff\x4e\x00\x1e\x00\x1f\x00\x20\x00\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\x01\x00\xff\xff\xff\xff\x3f\x00\x40\x00\xff\xff\xff\xff\xff\xff\x44\x00\x45\x00\xff\xff\x47\x00\xff\xff\xff\xff\x4a\x00\x09\x00\x4c\x00\x12\x00\x4e\x00\x4f\x00\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\x1e\x00\x1f\x00\x20\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\xff\xff\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x01\x00\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\xff\xff\xff\xff\xff\xff\x3f\x00\x40\x00\xff\xff\xff\xff\x12\x00\x44\x00\x45\x00\xff\xff\x47\x00\xff\xff\xff\xff\x4a\x00\x4b\x00\x4c\x00\xff\xff\x4e\x00\x1e\x00\x1f\x00\x20\x00\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\xff\xff\xff\xff\xff\xff\x01\x00\x40\x00\xff\xff\xff\xff\xff\xff\x44\x00\x45\x00\x08\x00\x47\x00\xff\xff\xff\xff\x4a\x00\xff\xff\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x12\x00\x09\x00\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\x0f\x00\x58\x00\xff\xff\xff\xff\xff\xff\x1e\x00\x1f\x00\x20\x00\xff\xff\xff\xff\xff\xff\xff\xff\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\xff\xff\xff\xff\xff\xff\x01\x00\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\xff\xff\xff\xff\xff\xff\xff\xff\x40\x00\xff\xff\xff\xff\x12\x00\x44\x00\x45\x00\xff\xff\x47\x00\xff\xff\xff\xff\x4a\x00\x4b\x00\x4c\x00\xff\xff\x4e\x00\x1e\x00\x1f\x00\x20\x00\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\x01\x00\xff\xff\xff\xff\x3f\x00\x40\x00\xff\xff\xff\xff\xff\xff\x44\x00\x45\x00\xff\xff\x47\x00\xff\xff\xff\xff\x4a\x00\x09\x00\x4c\x00\x12\x00\x4e\x00\x4f\x00\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\x1e\x00\x1f\x00\x20\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\xff\xff\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x01\x00\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\xff\xff\xff\xff\xff\xff\xff\xff\x40\x00\xff\xff\xff\xff\x12\x00\x44\x00\x45\x00\x46\x00\x47\x00\xff\xff\x49\x00\x4a\x00\xff\xff\x4c\x00\xff\xff\x4e\x00\x1e\x00\x1f\x00\x20\x00\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x00\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\xff\xff\xff\xff\xff\xff\x3f\x00\x40\x00\xff\xff\xff\xff\x12\x00\x44\x00\x45\x00\xff\xff\x47\x00\xff\xff\xff\xff\x4a\x00\xff\xff\x4c\x00\xff\xff\x4e\x00\x1e\x00\x1f\x00\x20\x00\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\x01\x00\xff\xff\xff\xff\xff\xff\x40\x00\xff\xff\xff\xff\xff\xff\x44\x00\x45\x00\xff\xff\x47\x00\xff\xff\xff\xff\x4a\x00\x09\x00\x4c\x00\x12\x00\x4e\x00\x4f\x00\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\x1e\x00\x1f\x00\x20\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\xff\xff\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\x01\x00\xff\xff\xff\xff\x3f\x00\x40\x00\xff\xff\xff\xff\x08\x00\x44\x00\x45\x00\xff\xff\x47\x00\xff\xff\x09\x00\x4a\x00\xff\xff\x4c\x00\x12\x00\x4e\x00\x0f\x00\xff\xff\xff\xff\xff\xff\x13\x00\x14\x00\x55\x00\x56\x00\xff\xff\x58\x00\x1e\x00\x1f\x00\x20\x00\xff\xff\x1d\x00\x1e\x00\x1f\x00\xff\xff\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\xff\xff\xff\xff\xff\xff\xff\xff\x2b\x00\xff\xff\x01\x00\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\xff\xff\xff\xff\xff\xff\xff\xff\x40\x00\xff\xff\xff\xff\x12\x00\x44\x00\x45\x00\xff\xff\x47\x00\xff\xff\xff\xff\x4a\x00\xff\xff\x4c\x00\xff\xff\x4e\x00\x1e\x00\x1f\x00\x20\x00\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x00\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\xff\xff\xff\xff\xff\xff\x3f\x00\x40\x00\xff\xff\xff\xff\x12\x00\x44\x00\x45\x00\xff\xff\x47\x00\xff\xff\xff\xff\x4a\x00\xff\xff\x4c\x00\xff\xff\x4e\x00\x1e\x00\x1f\x00\x20\x00\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\x01\x00\xff\xff\xff\xff\xff\xff\x40\x00\xff\xff\xff\xff\xff\xff\x44\x00\x45\x00\xff\xff\x47\x00\xff\xff\xff\xff\x4a\x00\x09\x00\x4c\x00\x12\x00\x4e\x00\x4f\x00\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\x1e\x00\x1f\x00\x20\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\xff\xff\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x01\x00\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\xff\xff\xff\xff\xff\xff\x3f\x00\x40\x00\xff\xff\xff\xff\x12\x00\x44\x00\x45\x00\xff\xff\x47\x00\xff\xff\xff\xff\x4a\x00\xff\xff\x4c\x00\xff\xff\x4e\x00\x1e\x00\x1f\x00\x20\x00\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\x3b\x00\x12\x00\xff\xff\xff\xff\xff\xff\x40\x00\xff\xff\xff\xff\xff\xff\x44\x00\x45\x00\xff\xff\x47\x00\x1e\x00\x1f\x00\x4a\x00\xff\xff\x4c\x00\xff\xff\x4e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x12\x00\x36\x00\x37\x00\xff\xff\x39\x00\xff\xff\x3b\x00\xff\xff\xff\xff\x3f\x00\x40\x00\x40\x00\x1e\x00\x1f\x00\x44\x00\x44\x00\x45\x00\xff\xff\xff\xff\xff\xff\x4a\x00\x4a\x00\x4c\x00\x4c\x00\x4e\x00\x4e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x55\x00\x55\x00\x56\x00\xff\xff\x58\x00\x36\x00\x37\x00\xff\xff\x39\x00\x12\x00\x3b\x00\xff\xff\xff\xff\x3f\x00\x40\x00\x40\x00\xff\xff\xff\xff\x44\x00\x44\x00\x45\x00\x1e\x00\x1f\x00\xff\xff\x4a\x00\x4a\x00\x4c\x00\x4c\x00\x4e\x00\x4e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x55\x00\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\xff\xff\xff\xff\x12\x00\x36\x00\x37\x00\xff\xff\x39\x00\xff\xff\x3b\x00\xff\xff\xff\xff\x3f\x00\x40\x00\x40\x00\x1e\x00\x1f\x00\x44\x00\x44\x00\x45\x00\xff\xff\xff\xff\xff\xff\x4a\x00\x4a\x00\x4c\x00\x4c\x00\x4e\x00\x4e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x55\x00\x55\x00\x56\x00\xff\xff\x58\x00\x36\x00\x37\x00\xff\xff\x39\x00\x12\x00\x3b\x00\xff\xff\xff\xff\x3f\x00\x40\x00\x40\x00\xff\xff\xff\xff\x44\x00\x44\x00\x45\x00\x1e\x00\x1f\x00\xff\xff\x4a\x00\x4a\x00\x4c\x00\x4c\x00\x4e\x00\x4e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x55\x00\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\xff\xff\xff\xff\x12\x00\x36\x00\x37\x00\xff\xff\x39\x00\xff\xff\x3b\x00\xff\xff\xff\xff\x3f\x00\x40\x00\x40\x00\x1e\x00\x1f\x00\x44\x00\x44\x00\x45\x00\xff\xff\xff\xff\xff\xff\x4a\x00\x4a\x00\x4c\x00\x4c\x00\x4e\x00\x4e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x55\x00\x55\x00\x56\x00\xff\xff\x58\x00\x36\x00\x37\x00\xff\xff\x39\x00\x12\x00\x3b\x00\xff\xff\xff\xff\x3f\x00\x40\x00\x40\x00\xff\xff\xff\xff\x44\x00\x44\x00\x45\x00\x1e\x00\x1f\x00\xff\xff\x4a\x00\x4a\x00\x4c\x00\x4c\x00\x4e\x00\x4e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x55\x00\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\xff\xff\xff\xff\x12\x00\x36\x00\x37\x00\xff\xff\x39\x00\xff\xff\x3b\x00\xff\xff\xff\xff\x3f\x00\x40\x00\x40\x00\x1e\x00\x1f\x00\x44\x00\x44\x00\x45\x00\xff\xff\xff\xff\xff\xff\x4a\x00\x4a\x00\x4c\x00\x4c\x00\x4e\x00\x4e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x55\x00\x55\x00\x56\x00\xff\xff\x58\x00\x36\x00\x37\x00\xff\xff\x39\x00\x12\x00\x3b\x00\xff\xff\xff\xff\x3f\x00\x40\x00\x40\x00\xff\xff\xff\xff\x44\x00\x44\x00\x45\x00\x1e\x00\x1f\x00\xff\xff\x4a\x00\x4a\x00\x4c\x00\x4c\x00\x4e\x00\x4e\x00\xff\xff\xff\xff\x09\x00\xff\xff\x0b\x00\x55\x00\x55\x00\x56\x00\x0f\x00\x58\x00\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\x36\x00\x37\x00\xff\xff\x39\x00\xff\xff\x3b\x00\xff\xff\x1d\x00\x1e\x00\x1f\x00\x40\x00\x21\x00\x22\x00\x23\x00\x44\x00\x45\x00\xff\xff\x09\x00\xff\xff\xff\xff\x4a\x00\x2b\x00\x4c\x00\x0f\x00\x4e\x00\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\xff\xff\x55\x00\x56\x00\xff\xff\x58\x00\xff\xff\xff\xff\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x09\x00\xff\xff\x0b\x00\xff\xff\xff\xff\xff\xff\x0f\x00\x2b\x00\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\x31\x00\x32\x00\xff\xff\x34\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\xff\xff\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x09\x00\xff\xff\x0b\x00\xff\xff\xff\xff\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\xff\xff\x09\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x0f\x00\xff\xff\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\xff\xff\x09\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x0f\x00\xff\xff\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\xff\xff\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x09\x00\xff\xff\x0b\x00\xff\xff\xff\xff\xff\xff\x0f\x00\x09\x00\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\x1d\x00\x1e\x00\x1f\x00\xff\xff\x21\x00\x22\x00\x23\x00\x1d\x00\x1e\x00\x1f\x00\xff\xff\x21\x00\x22\x00\x23\x00\x2b\x00\xff\xff\x09\x00\xff\xff\xff\xff\xff\xff\xff\xff\x2b\x00\x0f\x00\x09\x00\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\x1d\x00\x1e\x00\x1f\x00\xff\xff\x21\x00\x22\x00\x23\x00\x1d\x00\x1e\x00\x1f\x00\xff\xff\x21\x00\x22\x00\x23\x00\x2b\x00\xff\xff\x09\x00\xff\xff\xff\xff\xff\xff\xff\xff\x2b\x00\x0f\x00\x09\x00\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\x1d\x00\x1e\x00\x1f\x00\xff\xff\x21\x00\x22\x00\x23\x00\x1d\x00\x1e\x00\x1f\x00\xff\xff\x21\x00\x22\x00\x23\x00\x2b\x00\xff\xff\x09\x00\xff\xff\xff\xff\xff\xff\xff\xff\x2b\x00\x0f\x00\x09\x00\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\x1d\x00\x1e\x00\x1f\x00\xff\xff\x21\x00\x22\x00\x23\x00\x1d\x00\x1e\x00\x1f\x00\xff\xff\x21\x00\x22\x00\x23\x00\x2b\x00\xff\xff\x09\x00\xff\xff\xff\xff\xff\xff\xff\xff\x2b\x00\x0f\x00\x09\x00\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\x1d\x00\x1e\x00\x1f\x00\xff\xff\x21\x00\x22\x00\x23\x00\x1d\x00\x1e\x00\x1f\x00\xff\xff\x21\x00\x22\x00\x23\x00\x2b\x00\xff\xff\x09\x00\xff\xff\xff\xff\xff\xff\xff\xff\x2b\x00\x0f\x00\x09\x00\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\x1d\x00\x1e\x00\x1f\x00\xff\xff\x21\x00\x22\x00\x23\x00\x1d\x00\x1e\x00\x1f\x00\xff\xff\x21\x00\x22\x00\x23\x00\x2b\x00\xff\xff\x09\x00\xff\xff\xff\xff\xff\xff\xff\xff\x2b\x00\x0f\x00\xff\xff\xff\xff\xff\xff\x13\x00\x14\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1d\x00\x1e\x00\x1f\x00\xff\xff\x21\x00\x22\x00\x23\x00\x09\x00\xff\xff\x0b\x00\xff\xff\xff\xff\xff\xff\x0f\x00\x2b\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\x09\x00\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\xff\xff\xff\xff\xff\xff\x27\x00\x28\x00\x29\x00\x2a\x00\x3f\x00\x40\x00\xff\xff\x3f\x00\x40\x00\x44\x00\xff\xff\x46\x00\x44\x00\xff\xff\x46\x00\x4a\x00\xff\xff\x4c\x00\x4a\x00\x4e\x00\x4c\x00\xff\xff\x4e\x00\x3f\x00\x40\x00\xff\xff\x55\x00\xff\xff\x44\x00\x55\x00\xff\xff\xff\xff\xff\xff\xff\xff\x4a\x00\xff\xff\x4c\x00\xff\xff\x4e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x55\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\x30\x00\x31\x00\x32\x00\x33\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"#++happyTable :: HappyAddr+happyTable = HappyA# "\x00\x00\x96\x02\x9f\x02\xbd\x01\xbe\x01\x0d\x00\xbd\x01\xbe\x01\x06\x00\xf9\x01\xb3\x01\x0e\x00\x47\x00\x78\x02\x07\x00\x63\x02\xb3\x01\x58\x01\x79\x02\xde\x02\x75\x01\x1c\x02\x58\x01\x7d\x00\x11\x00\x12\x00\x13\x00\x14\x00\x7e\x00\x16\x00\x17\x00\x18\x00\x2e\x02\xcd\x01\x42\x02\x58\x01\xce\x01\x06\x00\xcf\x01\xbd\x01\xbe\x01\x06\x00\x0a\x00\x07\x00\x3b\x01\x49\x02\x5b\x01\x07\x00\x63\x02\xac\x01\x5a\x01\x5b\x01\x13\x02\xcd\x01\x53\x00\x58\x01\xce\x01\xd9\x02\xc8\x02\xfa\x01\xaa\x02\xb3\x01\x59\x01\x5a\x01\x5b\x01\x7f\x00\xe2\x01\xdc\x02\x0d\x00\x5b\x02\x80\x00\x0a\x00\xbf\x01\x81\x00\x0e\x00\x82\x00\x83\x00\x84\x00\x85\x00\x97\x02\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\xb4\x01\x16\x00\x17\x00\xc2\x01\x0a\x00\x2f\x02\xb4\x01\x42\x00\x91\x00\xd0\x01\xd4\x02\x92\x00\x93\x00\xb1\x02\xbf\x01\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\x57\x02\x47\x01\xc0\x01\x94\x01\x0d\x00\x0a\x00\x98\x02\x47\x00\x43\x02\x99\x02\x0e\x00\x3c\x01\x64\x02\x47\x00\xb0\x01\x48\x00\xd7\x02\xb4\x01\x48\x01\x7d\x00\x40\x01\x78\x01\x7d\x00\x11\x00\x12\x00\x13\x00\x14\x00\x7e\x00\x16\x00\x17\x00\x18\x00\xd1\x01\x28\x02\x0d\x00\xb0\x02\xc0\x01\x0d\x00\x2a\x02\xa2\x02\x0e\x00\x7b\x01\x0d\x00\x0e\x00\x90\x01\x47\x00\xe2\x01\xcd\x01\x0e\x00\x3d\x00\xce\x01\x3e\x00\xc9\x02\xd6\x01\x18\x02\x7d\x01\x69\x00\x53\x02\x16\x00\x17\x00\xc2\x01\x16\x00\x17\x00\xc2\x01\x2c\x02\x7f\x00\x16\x00\x17\x00\xc2\x01\xcd\x01\x80\x00\xa5\x02\xce\x01\x81\x00\xcf\x01\x82\x00\x83\x00\x84\x00\x85\x00\xd8\x02\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x0a\x00\x0b\x00\xbb\x01\xe3\x01\xb1\x02\x29\x02\xc1\x02\x42\x00\x91\x00\xa5\x02\x2b\x02\x92\x00\x93\x00\xb5\x02\xbc\x01\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\x0d\x00\xb9\x02\x2d\x02\xa6\x02\x3c\x02\xd5\x02\x0e\x00\x55\x02\xbb\x02\x56\x01\x0d\x00\x70\x02\xc3\x01\x67\x02\xc2\x02\x90\x01\x0e\x00\xbf\x02\x7d\x00\x11\x00\x12\x00\x13\x00\x14\x00\x7e\x00\x16\x00\x17\x00\x18\x00\x3e\x01\x55\x02\xa5\x02\x53\x00\x0d\x00\xa6\x02\xa7\x02\xa8\x02\x38\x01\x54\x01\x0e\x00\x77\x01\xc3\x02\x78\x01\x3e\x01\x47\x01\x3e\x00\x0a\x00\x0b\x00\x92\x02\x0a\x00\x3f\x00\x10\x00\x11\x00\x40\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x0a\x00\x48\x01\x7f\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x80\x00\x41\x00\x3d\x00\x81\x00\x3e\x00\x82\x00\x83\x00\x84\x00\x85\x00\x53\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\xa6\x02\xaa\x02\xa8\x02\xda\x02\xdb\x02\x0a\x00\x67\x02\x42\x00\x91\x00\xab\x02\xc0\x02\x92\x00\x93\x00\xab\x02\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\x0d\x00\x77\xff\xcc\x02\x6a\xff\x42\x00\x43\x00\x0e\x00\xce\x02\x47\x00\xa8\x00\xa9\x00\x6a\xff\x47\x01\x47\x01\x77\xff\x21\x02\x48\x00\x22\x02\x7d\x00\x11\x00\x12\x00\x13\x00\x14\x00\x7e\x00\x16\x00\x17\x00\x18\x00\x9f\x01\x0d\x00\x48\x01\x48\x01\xd6\x02\xad\x02\xae\x02\x0e\x00\xac\x02\xad\x02\xae\x02\x8f\x02\xcd\x01\x3e\x00\x49\x00\x19\x02\x77\x02\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x5f\x01\x13\x00\x14\x00\x90\x01\x16\x00\x17\x00\x52\x01\x4e\x00\x4f\x00\x1f\x02\x94\x02\x20\x02\x7f\x00\x0d\x00\x3d\x00\x41\x00\x3e\x00\x80\x00\x0a\x00\x0e\x00\x81\x00\x61\x02\x82\x00\x83\x00\x84\x00\x85\x00\xd2\x02\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x6d\x00\x47\x00\xdf\x01\x6d\x02\xe0\x01\x75\x02\xe1\x01\x42\x00\x91\x00\xd6\x01\xd7\x01\x92\x00\x93\x00\xe2\x01\x1d\x02\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\x0d\x00\x42\x00\x43\x00\x47\x00\x47\x00\x7a\x02\x0e\x00\x47\x00\x0d\x00\xd3\x02\x06\x00\x48\x00\xd6\x01\xd8\x01\x0e\x00\x48\x00\x07\x00\x92\x01\x7d\x00\x11\x00\x12\x00\x13\x00\x14\x00\x7e\x00\x16\x00\x17\x00\x18\x00\xa7\x01\x12\x00\x13\x00\x14\x00\x7e\x00\x16\x00\x17\x00\x18\x00\x67\x02\x65\x00\x0d\x00\x06\x00\x68\x02\xc5\x01\x47\x00\x67\x02\x0e\x00\x07\x00\x3e\x01\x6b\x02\x66\x00\x67\x00\x48\x00\x68\x00\x69\x00\x7d\x02\x2f\x02\xc7\x01\x69\x00\x84\x02\x77\x00\x13\x00\x14\x00\x7f\x00\x16\x00\x17\x00\x52\x01\xcd\x01\x80\x00\xfc\x01\xce\x01\x81\x00\xca\x02\x82\x00\x83\x00\x84\x00\x85\x00\xc5\x01\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\xfe\x01\x31\x02\xc7\x01\x69\x00\xff\x01\x47\x00\xcd\x01\x42\x00\x91\x00\x19\x02\x1a\x02\x92\x00\x93\x00\xd6\x01\xd9\x01\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\x0d\x00\x6a\xff\x47\x00\x04\x02\x47\x00\x05\x02\x0e\x00\x47\x00\x0d\x00\xdd\x02\x48\x00\x6a\xff\x48\x00\x6a\xff\x0e\x00\x48\x00\xc4\x02\xc5\x02\x7d\x00\x11\x00\x12\x00\x13\x00\x14\x00\x7e\x00\x16\x00\x17\x00\x18\x00\x4f\x01\x12\x00\x13\x00\x14\x00\x7e\x00\x16\x00\x17\x00\x18\x00\xc5\x01\xcd\x01\x7b\x01\x0d\x00\xce\x01\x7b\x01\xcb\x02\x97\x01\xcd\x01\x0e\x00\x98\x01\x19\x02\x1c\x02\x3d\x02\xc7\x01\x69\x00\x7d\x01\x69\x00\xcd\x01\x7d\x01\x69\x00\xce\x01\x08\x02\x90\x02\x09\x02\x7f\x00\xe5\x01\x16\x00\x17\x00\x5f\x00\x80\x00\x16\x02\xdc\x01\x81\x00\xdd\x01\x82\x00\x83\x00\x84\x00\x85\x00\x0a\x02\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\xcd\x01\xcd\x01\x47\x00\xce\x01\xce\x01\x91\x02\x25\x02\x42\x00\x91\x00\x0c\x02\x48\x00\x92\x00\x93\x00\xc6\x02\xc7\x02\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\x0d\x00\xc5\x01\x47\x00\x0d\x02\x33\x01\x47\x00\x0e\x00\x34\x01\x7a\x00\xd1\x02\x48\x00\x7b\x00\x1d\x02\x48\x00\xc6\x01\xc7\x01\x69\x00\x51\x02\x7d\x00\x11\x00\x12\x00\x13\x00\x14\x00\x7e\x00\x16\x00\x17\x00\x18\x00\x06\x00\x2a\x00\x73\x00\x53\x02\x0d\x00\x9d\x01\x07\x00\x08\x00\xc5\x01\xa2\x01\x0e\x00\xc5\x01\x6b\x00\x54\x01\x74\x00\x55\x01\x75\x00\x56\x01\x8a\x02\x8b\x02\x9f\x01\xc8\x01\xc7\x01\x69\x00\xc9\x01\xc7\x01\x69\x00\x78\x00\x16\x00\x17\x00\x5f\x00\x44\x02\xb2\x02\x7f\x00\xa5\x01\x39\x02\x3a\x02\x3b\x02\x80\x00\x3c\x02\xaa\x01\x81\x00\xb1\x01\x82\x00\x83\x00\x84\x00\x85\x00\xb9\x01\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\xb5\x01\x5c\x00\x47\x00\x5d\x00\xc1\x01\x5e\x00\xe6\x01\x42\x00\x91\x00\xe7\x01\x48\x00\x92\x00\x93\x00\x8d\x02\x8b\x02\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\x0d\x00\xc5\x01\x47\x00\xe9\x01\x47\x00\x0d\x00\x0e\x00\xbd\x01\x71\x02\xbc\x01\x48\x00\x0e\x00\x48\x00\xea\x01\xca\x01\xc7\x01\x69\x00\xeb\x01\x7d\x00\x11\x00\x12\x00\x13\x00\x14\x00\x7e\x00\x16\x00\x17\x00\x18\x00\x18\x02\x5e\x00\x16\x00\x17\x00\x5f\x00\xec\x01\x0d\x00\xdf\x01\xc5\x01\xe0\x01\x7b\x01\xe1\x01\x0e\x00\x44\x02\xb3\x02\x7c\x01\x33\x00\x5d\x01\xe2\x01\x44\x02\x62\x02\xcb\x01\xc7\x01\x69\x00\x7d\x01\x69\x00\x51\x01\x13\x00\x14\x00\xed\x01\x16\x00\x17\x00\x52\x01\x7f\x00\x44\x02\x65\x02\x0d\x00\xee\x01\x80\x00\xef\x01\x37\x00\x81\x00\x0e\x00\x82\x00\x83\x00\x84\x00\x85\x00\xf4\x01\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\xfa\x01\x16\x00\x17\x00\x4d\x01\xbd\x01\x72\x02\xf7\x01\x42\x00\x91\x00\xbd\x01\x73\x02\x92\x00\x93\x00\xbd\x01\x74\x02\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\x60\x02\x35\x02\x36\x02\x37\x02\xb3\x01\x1e\x00\x47\x00\x10\x02\x11\x02\x56\x01\xab\x00\xac\x00\xad\x00\xa3\xfe\x48\x00\x13\x02\x14\x02\x22\x02\x23\x02\xae\x00\xaf\x00\xb0\x00\xb1\x00\x9b\x02\x9c\x02\x9d\x02\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\x20\x00\x21\x00\x22\x00\xba\x00\xbb\x00\x65\x00\xb4\x02\x34\x02\x35\x02\x36\x02\x37\x02\xa1\x02\x34\x02\x35\x02\x36\x02\x37\x02\x28\x01\x60\x01\x2a\x01\x68\x00\x69\x00\x2b\x01\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\xbc\x00\x29\x00\xd3\x01\xd4\x01\xbd\x00\x2c\x01\x58\x00\x3e\x02\x3f\x02\x2d\x01\x2c\x00\x2d\x00\x2e\x01\x2e\x00\x2f\x01\xd5\x01\x61\x00\xd6\x01\x62\x00\x30\x01\x63\x00\xbd\x01\x41\x02\xb4\x01\x0a\x00\xbe\x00\x31\x01\x0a\x00\x0b\x00\x34\x01\x32\x00\xb3\x01\x1e\x00\x47\x00\x44\x02\x45\x02\x35\x01\xab\x00\xac\x00\xad\x00\xa3\xfe\x48\x00\x71\x00\x1c\x00\x47\x00\x0d\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\x36\x01\x0e\x00\x48\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\x20\x00\x21\x00\x22\x00\xba\x00\xbb\x00\x65\x00\x32\x00\x05\x00\x16\x00\x17\x00\x56\x00\xa4\x02\x34\x02\x35\x02\x36\x02\x37\x02\x7b\x01\x63\x01\x39\x01\x68\x00\x69\x00\x83\x01\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\xbc\x00\x29\x00\x7d\x01\x69\x00\xbd\x00\x3a\x01\x58\x00\x0a\x00\x0b\x00\x40\x01\x2c\x00\x2d\x00\x42\x01\x2e\x00\x4a\x01\x4b\x01\x61\x00\x43\x01\x62\x00\x48\x01\x63\x00\x0a\x00\x0b\x00\xb4\x01\x45\x01\xbe\x00\x1e\x00\x0a\x00\x0b\x00\x53\x00\x32\x00\xab\x00\xac\x00\xad\x00\x4b\x01\x5c\x00\x84\x01\x7a\x01\x8b\x01\x7b\x01\xae\x00\xaf\x00\xb0\x00\xb1\x00\x8c\x01\x63\x00\x0a\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\x20\x00\x21\x00\x22\x00\xba\x00\xbb\x00\x56\x02\x34\x02\x35\x02\x36\x02\x37\x02\x33\x02\x34\x02\x35\x02\x36\x02\x37\x02\xda\x01\xdb\x01\xdc\x01\x64\x00\xdd\x01\xbe\x00\x6f\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\xbc\x00\x29\x00\x05\x00\x0b\x00\xbd\x00\x0a\x00\x58\x00\xd1\x02\xb0\x02\xb7\x02\x2c\x00\x2d\x00\xb8\x02\x2e\x00\xb9\x02\xbb\x02\x61\x00\xbe\x02\x62\x00\x0a\x00\x63\x00\x0a\x00\x0a\x00\x5a\xfe\xbd\x02\xbe\x00\x6a\x02\x0a\x00\x0b\x00\x8a\x02\x32\x00\x5a\xfe\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x00\x01\x01\x01\x02\x01\x03\x01\x04\x01\x05\x01\x06\x01\x07\x01\x08\x01\x09\x01\x0a\x01\x0b\x01\x0c\x01\x0d\x01\x0e\x01\x0f\x01\x10\x01\x11\x01\x12\x01\x13\x01\x14\x01\x15\x01\x16\x01\x17\x01\x1e\x00\x6f\x02\xe2\x01\xce\x02\xe2\x01\xab\x00\xac\x00\xad\x00\xd0\x02\x8d\x02\x8f\x02\x94\x02\xe2\x01\x96\x02\xae\x00\xaf\x00\xb0\x00\xb1\x00\x9b\x02\x9e\x02\x9f\x02\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\x20\x00\x21\x00\x22\x00\xba\x00\xbb\x00\xa1\x02\x47\x02\x59\x02\x5a\x02\x0a\x00\x5d\x02\x5e\x02\x5f\x02\x60\x02\x47\x02\x6a\x02\x6f\x02\x0a\x00\xe2\x01\x77\x02\x7c\x02\x7d\x02\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\xbc\x00\x29\x00\xe2\x01\x7f\x02\xbd\x00\x80\x02\x58\x00\x82\x02\x83\x02\xfc\x01\x2c\x00\x2d\x00\x84\x02\x2e\x00\x86\x02\x87\x02\x61\x00\x1e\x00\x62\x00\x88\x02\x63\x00\x89\x02\xab\x00\xac\x00\xad\x00\xbe\x00\xfc\x01\x0a\x00\x0b\x00\xfe\x01\x32\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xe9\x01\x01\x02\x02\x02\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\x20\x00\x21\x00\x22\x00\xba\x00\xbb\x00\x03\x02\x04\x02\xfc\x01\xb7\x01\x2a\x01\x07\x02\x08\x02\xfc\x01\x0c\x02\x10\x02\x16\x02\x25\x02\x31\x02\x41\x02\x0a\x00\x1e\x00\x47\x02\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\xbc\x00\x29\x00\x0a\x00\x2b\xff\xbd\x00\x4b\x02\x58\x00\x2c\xff\x28\xff\x1f\x00\x2c\x00\x2d\x00\x0a\x00\x2e\x00\x26\xff\x27\xff\x61\x00\xa1\x01\x62\x00\xa4\x01\x63\x00\x20\x00\x21\x00\x22\x00\xa2\x01\xbe\x00\xa5\x01\x0a\x00\x0b\x00\xa7\x01\x32\x00\xac\x01\xae\x01\xaf\x01\xb7\x01\xb0\x01\xe5\x01\x4d\x01\x0a\x00\x2a\x01\xf2\x01\xf3\x01\xe9\x01\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\xf1\x01\x29\x00\xe9\x01\xf7\x01\xbf\x02\x2a\x00\x2b\x00\x1e\x00\xf4\x01\xf6\x01\x2c\x00\x2d\x00\x71\x00\x2e\x00\x0a\x00\xe9\x01\x2f\x00\xfc\x01\x30\x00\x3d\x00\x31\x00\x3e\x00\x45\x01\x38\x01\x1f\x00\x0a\x00\x42\x01\x0a\x00\x0b\x00\x0d\x00\x32\x00\x71\x00\x7b\x00\x4d\x01\x58\x01\x0e\x00\x20\x00\x21\x00\x22\x00\x0a\x00\x5d\x01\x3e\x00\x62\x01\x65\x01\x66\x01\x82\x01\x67\x01\x71\x00\x87\x01\x5f\x01\x13\x00\x14\x00\x86\x01\x16\x00\x17\x00\x52\x01\x8a\x01\x88\x01\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x6c\x01\x29\x00\x89\x01\x8b\x01\x33\x02\x2a\x00\x2b\x00\x1e\x00\x8e\x01\x8f\x01\x2c\x00\x2d\x00\x90\x01\x2e\x00\xff\xff\x71\x00\x2f\x00\x0a\x00\x30\x00\x3d\x00\x31\x00\x3e\x00\x76\x00\xff\xff\x1f\x00\x7c\x00\x0d\x00\x0a\x00\x0b\x00\x7d\x00\x32\x00\x0d\x00\x0e\x00\xff\xff\x00\x00\x00\x00\x20\x00\x21\x00\x22\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x4c\x02\x13\x00\x14\x00\x6e\x01\x16\x00\x17\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x00\x00\x29\x00\x4d\x02\x4e\x02\x4f\x02\x2a\x00\x2b\x00\x45\x00\x00\x00\x00\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x46\x00\x00\x00\x2f\x00\x00\x00\x30\x00\x3d\x00\x31\x00\x3e\x00\x00\x00\x00\x00\x1f\x00\x00\x00\x0d\x00\x0a\x00\x0b\x00\x00\x00\x32\x00\x00\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x20\x00\x21\x00\x22\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x4c\x02\x13\x00\x14\x00\x6e\x01\x16\x00\x17\x00\x18\x00\x00\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x00\x00\x29\x00\x4d\x02\x4e\x02\x50\x02\x2a\x00\x2b\x00\x00\x00\x00\x00\x1f\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x2f\x00\x47\x00\x30\x00\x00\x00\x31\x00\x20\x00\x21\x00\x22\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x0b\x00\x00\x00\x32\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x00\x00\x29\x00\x00\x00\x00\x00\x00\x00\x45\x00\x58\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2d\x00\x46\x00\x2e\x00\x00\x00\x00\x00\x61\x00\x0d\x00\x62\x00\x3d\x00\x63\x00\x3e\x00\x1f\x00\x0e\x00\x00\x00\x0d\x00\x00\x00\x0a\x00\x0b\x00\x3e\x00\x32\x00\x0e\x00\x00\x00\x00\x00\x20\x00\x21\x00\x22\x00\x5f\x01\x13\x00\x14\x00\x00\x00\x16\x00\x17\x00\x52\x01\x00\x00\x77\x00\x13\x00\x14\x00\x78\x00\x16\x00\x17\x00\x18\x00\x69\x01\x00\x00\x1e\x00\x00\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x00\x00\x29\x00\x00\x00\x00\x00\x00\x00\x00\x00\x58\x00\x00\x00\x00\x00\x1f\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x61\x00\x97\x01\x62\x00\x00\x00\x63\x00\x20\x00\x21\x00\x22\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x0b\x00\x00\x00\x32\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x00\x00\x29\x00\x1e\x00\x00\x00\x00\x00\x2a\x00\x2b\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x2f\x00\x0d\x00\x30\x00\x1f\x00\x31\x00\x39\x00\x00\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x0b\x00\x3e\x00\x32\x00\x20\x00\x21\x00\x22\x00\x3f\x00\x10\x00\x11\x00\x40\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x00\x00\x00\x00\x00\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1e\x00\x6c\x01\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x00\x00\x29\x00\x00\x00\x00\x00\x00\x00\x2a\x00\x2b\x00\x00\x00\x00\x00\x1f\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x2f\x00\x47\x00\x30\x00\x00\x00\x31\x00\x20\x00\x21\x00\x22\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x0b\x00\x00\x00\x32\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x00\x00\x29\x00\x1e\x00\x00\x00\x00\x00\x2a\x00\x2b\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x2f\x00\x0d\x00\x30\x00\x1f\x00\x31\x00\x39\x00\x00\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x0b\x00\x00\x00\x32\x00\x20\x00\x21\x00\x22\x00\x5a\x02\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x00\x00\x00\x00\x00\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1e\x00\x00\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x00\x00\x29\x00\x00\x00\x00\x00\x00\x00\x2a\x00\x2b\x00\x00\x00\x00\x00\x1f\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x2f\x00\x47\x00\x30\x00\x00\x00\x31\x00\x20\x00\x21\x00\x22\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x0b\x00\x00\x00\x32\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x00\x00\x29\x00\x00\x00\x00\x00\x00\x00\x45\x00\x58\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2d\x00\x46\x00\x2e\x00\x00\x00\x00\x00\x61\x00\x00\x00\x62\x00\x3d\x00\x63\x00\x3e\x00\x1f\x00\x0d\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x0b\x00\x0e\x00\x32\x00\x00\x00\x00\x00\x00\x00\x20\x00\x21\x00\x22\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb4\x01\x11\x00\x12\x00\x13\x00\x14\x00\x7e\x00\x16\x00\x17\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x00\x00\x29\x00\x00\x00\x00\x00\x00\x00\x00\x00\x58\x00\x00\x00\x00\x00\x1f\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x61\x00\x75\x01\x62\x00\x00\x00\x63\x00\x20\x00\x21\x00\x22\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x0b\x00\x00\x00\x32\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x00\x00\x29\x00\x1e\x00\x00\x00\x00\x00\x2a\x00\x2b\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x2f\x00\x0d\x00\x30\x00\x1f\x00\x31\x00\x39\x00\x00\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x0b\x00\x00\x00\x32\x00\x20\x00\x21\x00\x22\x00\x66\x02\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x00\x00\x00\x00\x00\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1e\x00\x00\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x00\x00\x29\x00\x00\x00\x00\x00\x00\x00\x00\x00\x58\x00\x00\x00\x00\x00\x1f\x00\x2c\x00\x2d\x00\x5c\xff\x2e\x00\x00\x00\x5c\xff\x61\x00\x00\x00\x62\x00\x00\x00\x63\x00\x20\x00\x21\x00\x22\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x0b\x00\x00\x00\x32\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x00\x00\x29\x00\x00\x00\x00\x00\x00\x00\x2a\x00\x2b\x00\x00\x00\x00\x00\x1f\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x2f\x00\x00\x00\x30\x00\x00\x00\x31\x00\x20\x00\x21\x00\x22\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x0b\x00\x00\x00\x32\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x00\x00\x29\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x58\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x61\x00\x0d\x00\x62\x00\x1f\x00\x63\x00\x95\x01\x00\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x0b\x00\x00\x00\x32\x00\x20\x00\x21\x00\x22\x00\x6a\x02\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x00\x00\x00\x00\x00\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x00\x00\x00\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x00\x00\x29\x00\x45\x00\x00\x00\x00\x00\x2a\x00\x2b\x00\x00\x00\x00\x00\x46\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x26\x02\x2f\x00\x00\x00\x30\x00\x1f\x00\x31\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x33\x00\x5d\x01\x0a\x00\x0b\x00\x00\x00\x32\x00\x20\x00\x21\x00\x22\x00\x00\x00\x51\x01\x13\x00\x14\x00\x00\x00\x16\x00\x17\x00\x52\x01\xac\x01\x5a\x01\x5b\x01\x00\x00\x00\x00\x00\x00\x00\x00\x37\x00\x00\x00\x1e\x00\x00\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x00\x00\x29\x00\x00\x00\x00\x00\x00\x00\x00\x00\x58\x00\x00\x00\x00\x00\x1f\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x61\x00\x00\x00\x62\x00\x00\x00\x63\x00\x20\x00\x21\x00\x22\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x0b\x00\x00\x00\x32\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x00\x00\x29\x00\x00\x00\x00\x00\x00\x00\x2a\x00\x2b\x00\x00\x00\x00\x00\x1f\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x2f\x00\x00\x00\x30\x00\x00\x00\x31\x00\x20\x00\x21\x00\x22\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x0b\x00\x00\x00\x32\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x00\x00\x29\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x58\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x61\x00\x0d\x00\x62\x00\x1f\x00\x63\x00\x73\x01\x00\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x0b\x00\x00\x00\x32\x00\x20\x00\x21\x00\x22\x00\x6c\x02\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x00\x00\x00\x00\x00\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1e\x00\x00\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x00\x00\x29\x00\x00\x00\x00\x00\x00\x00\x2a\x00\x2b\x00\x00\x00\x00\x00\x1f\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x2f\x00\x00\x00\x30\x00\x00\x00\x31\x00\x20\x00\x21\x00\x22\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x0b\x00\x00\x00\x32\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x00\x00\x29\x00\x1f\x00\x00\x00\x00\x00\x00\x00\x58\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x2d\x00\x00\x00\x2e\x00\x20\x00\x21\x00\x61\x00\x00\x00\x62\x00\x00\x00\x63\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x0b\x00\x00\x00\x32\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1f\x00\x25\x00\x26\x00\x00\x00\x28\x00\x00\x00\x29\x00\x00\x00\x00\x00\x51\x00\x52\x00\x58\x00\x20\x00\x21\x00\x53\x00\x2c\x00\x2d\x00\x00\x00\x00\x00\x00\x00\x6b\x00\x61\x00\x6c\x00\xa4\x02\x6d\x00\x63\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x0a\x00\x0b\x00\x00\x00\x32\x00\x25\x00\x26\x00\x00\x00\x28\x00\x1f\x00\x29\x00\x00\x00\x00\x00\x51\x00\x52\x00\x58\x00\x00\x00\x00\x00\x53\x00\x2c\x00\x2d\x00\x20\x00\x21\x00\x00\x00\x7f\x01\x61\x00\x80\x01\x62\x00\x81\x01\x63\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x0a\x00\x0b\x00\x00\x00\x32\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1f\x00\x25\x00\x26\x00\x00\x00\x28\x00\x00\x00\x29\x00\x00\x00\x00\x00\x51\x00\x52\x00\x58\x00\x20\x00\x21\x00\x53\x00\x2c\x00\x2d\x00\x00\x00\x00\x00\x00\x00\x6b\x00\x61\x00\x6c\x00\xc5\x01\x6d\x00\x63\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x0a\x00\x0b\x00\x00\x00\x32\x00\x25\x00\x26\x00\x00\x00\x28\x00\x1f\x00\x29\x00\x00\x00\x00\x00\x51\x00\x52\x00\x58\x00\x00\x00\x00\x00\x53\x00\x2c\x00\x2d\x00\x20\x00\x21\x00\x00\x00\x6b\x00\x61\x00\x6c\x00\x62\x00\xcd\x01\x63\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x0a\x00\x0b\x00\x00\x00\x32\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1f\x00\x25\x00\x26\x00\x00\x00\x28\x00\x00\x00\x29\x00\x00\x00\x00\x00\x51\x00\x52\x00\x58\x00\x20\x00\x21\x00\x53\x00\x2c\x00\x2d\x00\x00\x00\x00\x00\x00\x00\x7f\x01\x61\x00\x80\x01\x62\x00\x81\x01\x6f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x0a\x00\x0b\x00\x00\x00\x32\x00\x25\x00\x26\x00\x00\x00\x28\x00\x1f\x00\x29\x00\x00\x00\x00\x00\x51\x00\x52\x00\x58\x00\x00\x00\x00\x00\x53\x00\x2c\x00\x2d\x00\x20\x00\x21\x00\x00\x00\x6b\x00\x61\x00\x6c\x00\x62\x00\x6d\x00\x63\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x0a\x00\x0b\x00\x00\x00\x32\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1f\x00\x25\x00\x26\x00\x00\x00\x28\x00\x00\x00\x29\x00\x00\x00\x00\x00\x51\x00\x52\x00\x58\x00\x20\x00\x21\x00\x53\x00\x2c\x00\x2d\x00\x00\x00\x00\x00\x00\x00\x7f\x01\x59\x00\x80\x01\x5a\x00\x81\x01\x5b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x0a\x00\x0b\x00\x00\x00\x32\x00\x25\x00\x26\x00\x00\x00\x28\x00\x1f\x00\x29\x00\x00\x00\x00\x00\x51\x00\x52\x00\x58\x00\x00\x00\x00\x00\x53\x00\x2c\x00\x2d\x00\x20\x00\x21\x00\x00\x00\x54\x00\x61\x00\x55\x00\x62\x00\x56\x00\x63\x00\x00\x00\x00\x00\x0d\x00\x00\x00\x95\x01\x0a\x00\x0a\x00\x0b\x00\x0e\x00\x32\x00\x00\x00\x00\x00\x5e\x01\x34\x00\x00\x00\x25\x00\x26\x00\x00\x00\x28\x00\x00\x00\x29\x00\x00\x00\x51\x01\x13\x00\x14\x00\x58\x00\x16\x00\x17\x00\x52\x01\x2c\x00\x2d\x00\x00\x00\x0d\x00\x00\x00\x00\x00\x61\x00\x3b\x00\x62\x00\x0e\x00\x6f\x00\x00\x00\x00\x00\x33\x00\x5d\x01\x00\x00\x00\x00\x0a\x00\x0b\x00\x00\x00\x32\x00\x00\x00\x00\x00\x6d\x01\x13\x00\x14\x00\x6e\x01\x16\x00\x17\x00\x18\x00\x0d\x00\x00\x00\x39\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x37\x00\x00\x00\x00\x00\x33\x00\x34\x00\x00\x00\x6f\x01\x70\x01\x00\x00\x71\x01\x3a\x00\x10\x00\x11\x00\x36\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x00\x00\x00\x00\x00\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x6b\x01\x0d\x00\x00\x00\x39\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x33\x00\x34\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3a\x00\x10\x00\x11\x00\x36\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x00\x00\x00\x00\x0d\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x3b\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x33\x00\x34\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x35\x00\x10\x00\x11\x00\x36\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x00\x00\x00\x00\x0d\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x6a\x01\x0e\x00\x00\x00\x00\x00\x00\x00\x33\x00\x34\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x35\x00\x10\x00\x11\x00\x36\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x00\x00\x00\x00\x00\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x37\x00\x0d\x00\x00\x00\x73\x01\x00\x00\x00\x00\x00\x00\x0e\x00\x0d\x00\x00\x00\x00\x00\x5e\x01\x34\x00\x00\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x99\x01\x34\x00\x00\x00\x51\x01\x13\x00\x14\x00\x00\x00\x16\x00\x17\x00\x52\x01\x51\x01\x13\x00\x14\x00\x00\x00\x16\x00\x17\x00\x52\x01\x3b\x00\x00\x00\x0d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x67\x01\x0e\x00\x0d\x00\x00\x00\x00\x00\x9a\x01\x34\x00\x00\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x9b\x01\x34\x00\x00\x00\x51\x01\x13\x00\x14\x00\x00\x00\x16\x00\x17\x00\x52\x01\x51\x01\x13\x00\x14\x00\x00\x00\x16\x00\x17\x00\x52\x01\x68\x01\x00\x00\x0d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x01\x0e\x00\x0d\x00\x00\x00\x00\x00\x9c\x01\x34\x00\x00\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x33\x00\x34\x00\x00\x00\x51\x01\x13\x00\x14\x00\x00\x00\x16\x00\x17\x00\x52\x01\x51\x01\x13\x00\x14\x00\x00\x00\x16\x00\x17\x00\x52\x01\x6b\x01\x00\x00\x0d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x01\x0e\x00\x0d\x00\x00\x00\x00\x00\x33\x00\x34\x00\x00\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x33\x00\x34\x00\x00\x00\x51\x01\x13\x00\x14\x00\x00\x00\x16\x00\x17\x00\x52\x01\x51\x01\x13\x00\x14\x00\x00\x00\x16\x00\x17\x00\x52\x01\x6b\x01\x00\x00\x0d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x37\x00\x0e\x00\x0d\x00\x00\x00\x00\x00\x33\x00\x34\x00\x00\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x33\x00\x5d\x01\x00\x00\x51\x01\x13\x00\x14\x00\x00\x00\x16\x00\x17\x00\x52\x01\x51\x01\x13\x00\x14\x00\x00\x00\x16\x00\x17\x00\x52\x01\x3b\x00\x00\x00\x0d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x37\x00\x0e\x00\x0d\x00\x00\x00\x00\x00\x5e\x01\x34\x00\x00\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x33\x00\x34\x00\x00\x00\x51\x01\x13\x00\x14\x00\x00\x00\x16\x00\x17\x00\x52\x01\x51\x01\x13\x00\x14\x00\x00\x00\x16\x00\x17\x00\x52\x01\x3b\x00\x00\x00\x0d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x67\x01\x0e\x00\x00\x00\x00\x00\x00\x00\x33\x00\x34\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x51\x01\x13\x00\x14\x00\x00\x00\x16\x00\x17\x00\x52\x01\x0d\x00\x00\x00\x39\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x68\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3a\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x00\x00\x0d\x00\x00\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6f\x02\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x00\x00\x0d\x00\x00\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x02\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x00\x00\x0d\x00\x00\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x02\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x00\x00\x0d\x00\x00\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x47\x02\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x00\x00\x0d\x00\x00\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x48\x02\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x00\x00\x0d\x00\x00\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x4b\x02\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x00\x00\x0d\x00\x00\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x90\x01\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x00\x00\x0d\x00\x00\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x91\x01\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x00\x00\x0d\x00\x00\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa8\x01\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x00\x00\x0d\x00\x00\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa9\x01\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x00\x00\x0d\x00\x00\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb0\x01\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x00\x00\x0d\x00\x00\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb7\x01\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x00\x00\x0d\x00\x00\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb8\x01\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x00\x00\x0d\x00\x00\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x4e\x01\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x00\x00\x0d\x00\x00\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x50\x01\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x00\x00\x0d\x00\x00\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x62\x01\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x00\x00\x0d\x00\x00\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x35\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x00\x00\x0d\x00\x00\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x00\x00\x0d\x00\x00\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x82\x01\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x00\x00\x0d\x00\x00\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x76\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x00\x00\x0d\x00\x00\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x00\x00\x00\x00\x00\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x0f\xff\x0f\xff\x00\x00\x51\x00\x52\x00\x0f\xff\x00\x00\x0f\xff\x53\x00\x00\x00\x29\xff\x0f\xff\x00\x00\x0f\xff\x7f\x01\x0f\xff\x80\x01\x00\x00\x81\x01\x51\x00\x52\x00\x00\x00\x0f\xff\x00\x00\x53\x00\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6b\x00\x00\x00\x6c\x00\x00\x00\x6d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x18\x01\x19\x01\x1a\x01\x1b\x01\x1c\x01\x1d\x01\x1e\x01\x1f\x01\x20\x01\x21\x01\x22\x01\x23\x01\x24\x01\x25\x01\x26\x01\x27\x01\x28\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#++happyReduceArr = Happy_Data_Array.array (4, 422) [+	(4 , happyReduce_4),+	(5 , happyReduce_5),+	(6 , happyReduce_6),+	(7 , happyReduce_7),+	(8 , happyReduce_8),+	(9 , happyReduce_9),+	(10 , happyReduce_10),+	(11 , happyReduce_11),+	(12 , happyReduce_12),+	(13 , happyReduce_13),+	(14 , happyReduce_14),+	(15 , happyReduce_15),+	(16 , happyReduce_16),+	(17 , happyReduce_17),+	(18 , happyReduce_18),+	(19 , happyReduce_19),+	(20 , happyReduce_20),+	(21 , happyReduce_21),+	(22 , happyReduce_22),+	(23 , happyReduce_23),+	(24 , happyReduce_24),+	(25 , happyReduce_25),+	(26 , happyReduce_26),+	(27 , happyReduce_27),+	(28 , happyReduce_28),+	(29 , happyReduce_29),+	(30 , happyReduce_30),+	(31 , happyReduce_31),+	(32 , happyReduce_32),+	(33 , happyReduce_33),+	(34 , happyReduce_34),+	(35 , happyReduce_35),+	(36 , happyReduce_36),+	(37 , happyReduce_37),+	(38 , happyReduce_38),+	(39 , happyReduce_39),+	(40 , happyReduce_40),+	(41 , happyReduce_41),+	(42 , happyReduce_42),+	(43 , happyReduce_43),+	(44 , happyReduce_44),+	(45 , happyReduce_45),+	(46 , happyReduce_46),+	(47 , happyReduce_47),+	(48 , happyReduce_48),+	(49 , happyReduce_49),+	(50 , happyReduce_50),+	(51 , happyReduce_51),+	(52 , happyReduce_52),+	(53 , happyReduce_53),+	(54 , happyReduce_54),+	(55 , happyReduce_55),+	(56 , happyReduce_56),+	(57 , happyReduce_57),+	(58 , happyReduce_58),+	(59 , happyReduce_59),+	(60 , happyReduce_60),+	(61 , happyReduce_61),+	(62 , happyReduce_62),+	(63 , happyReduce_63),+	(64 , happyReduce_64),+	(65 , happyReduce_65),+	(66 , happyReduce_66),+	(67 , happyReduce_67),+	(68 , happyReduce_68),+	(69 , happyReduce_69),+	(70 , happyReduce_70),+	(71 , happyReduce_71),+	(72 , happyReduce_72),+	(73 , happyReduce_73),+	(74 , happyReduce_74),+	(75 , happyReduce_75),+	(76 , happyReduce_76),+	(77 , happyReduce_77),+	(78 , happyReduce_78),+	(79 , happyReduce_79),+	(80 , happyReduce_80),+	(81 , happyReduce_81),+	(82 , happyReduce_82),+	(83 , happyReduce_83),+	(84 , happyReduce_84),+	(85 , happyReduce_85),+	(86 , happyReduce_86),+	(87 , happyReduce_87),+	(88 , happyReduce_88),+	(89 , happyReduce_89),+	(90 , happyReduce_90),+	(91 , happyReduce_91),+	(92 , happyReduce_92),+	(93 , happyReduce_93),+	(94 , happyReduce_94),+	(95 , happyReduce_95),+	(96 , happyReduce_96),+	(97 , happyReduce_97),+	(98 , happyReduce_98),+	(99 , happyReduce_99),+	(100 , happyReduce_100),+	(101 , happyReduce_101),+	(102 , happyReduce_102),+	(103 , happyReduce_103),+	(104 , happyReduce_104),+	(105 , happyReduce_105),+	(106 , happyReduce_106),+	(107 , happyReduce_107),+	(108 , happyReduce_108),+	(109 , happyReduce_109),+	(110 , happyReduce_110),+	(111 , happyReduce_111),+	(112 , happyReduce_112),+	(113 , happyReduce_113),+	(114 , happyReduce_114),+	(115 , happyReduce_115),+	(116 , happyReduce_116),+	(117 , happyReduce_117),+	(118 , happyReduce_118),+	(119 , happyReduce_119),+	(120 , happyReduce_120),+	(121 , happyReduce_121),+	(122 , happyReduce_122),+	(123 , happyReduce_123),+	(124 , happyReduce_124),+	(125 , happyReduce_125),+	(126 , happyReduce_126),+	(127 , happyReduce_127),+	(128 , happyReduce_128),+	(129 , happyReduce_129),+	(130 , happyReduce_130),+	(131 , happyReduce_131),+	(132 , happyReduce_132),+	(133 , happyReduce_133),+	(134 , happyReduce_134),+	(135 , happyReduce_135),+	(136 , happyReduce_136),+	(137 , happyReduce_137),+	(138 , happyReduce_138),+	(139 , happyReduce_139),+	(140 , happyReduce_140),+	(141 , happyReduce_141),+	(142 , happyReduce_142),+	(143 , happyReduce_143),+	(144 , happyReduce_144),+	(145 , happyReduce_145),+	(146 , happyReduce_146),+	(147 , happyReduce_147),+	(148 , happyReduce_148),+	(149 , happyReduce_149),+	(150 , happyReduce_150),+	(151 , happyReduce_151),+	(152 , happyReduce_152),+	(153 , happyReduce_153),+	(154 , happyReduce_154),+	(155 , happyReduce_155),+	(156 , happyReduce_156),+	(157 , happyReduce_157),+	(158 , happyReduce_158),+	(159 , happyReduce_159),+	(160 , happyReduce_160),+	(161 , happyReduce_161),+	(162 , happyReduce_162),+	(163 , happyReduce_163),+	(164 , happyReduce_164),+	(165 , happyReduce_165),+	(166 , happyReduce_166),+	(167 , happyReduce_167),+	(168 , happyReduce_168),+	(169 , happyReduce_169),+	(170 , happyReduce_170),+	(171 , happyReduce_171),+	(172 , happyReduce_172),+	(173 , happyReduce_173),+	(174 , happyReduce_174),+	(175 , happyReduce_175),+	(176 , happyReduce_176),+	(177 , happyReduce_177),+	(178 , happyReduce_178),+	(179 , happyReduce_179),+	(180 , happyReduce_180),+	(181 , happyReduce_181),+	(182 , happyReduce_182),+	(183 , happyReduce_183),+	(184 , happyReduce_184),+	(185 , happyReduce_185),+	(186 , happyReduce_186),+	(187 , happyReduce_187),+	(188 , happyReduce_188),+	(189 , happyReduce_189),+	(190 , happyReduce_190),+	(191 , happyReduce_191),+	(192 , happyReduce_192),+	(193 , happyReduce_193),+	(194 , happyReduce_194),+	(195 , happyReduce_195),+	(196 , happyReduce_196),+	(197 , happyReduce_197),+	(198 , happyReduce_198),+	(199 , happyReduce_199),+	(200 , happyReduce_200),+	(201 , happyReduce_201),+	(202 , happyReduce_202),+	(203 , happyReduce_203),+	(204 , happyReduce_204),+	(205 , happyReduce_205),+	(206 , happyReduce_206),+	(207 , happyReduce_207),+	(208 , happyReduce_208),+	(209 , happyReduce_209),+	(210 , happyReduce_210),+	(211 , happyReduce_211),+	(212 , happyReduce_212),+	(213 , happyReduce_213),+	(214 , happyReduce_214),+	(215 , happyReduce_215),+	(216 , happyReduce_216),+	(217 , happyReduce_217),+	(218 , happyReduce_218),+	(219 , happyReduce_219),+	(220 , happyReduce_220),+	(221 , happyReduce_221),+	(222 , happyReduce_222),+	(223 , happyReduce_223),+	(224 , happyReduce_224),+	(225 , happyReduce_225),+	(226 , happyReduce_226),+	(227 , happyReduce_227),+	(228 , happyReduce_228),+	(229 , happyReduce_229),+	(230 , happyReduce_230),+	(231 , happyReduce_231),+	(232 , happyReduce_232),+	(233 , happyReduce_233),+	(234 , happyReduce_234),+	(235 , happyReduce_235),+	(236 , happyReduce_236),+	(237 , happyReduce_237),+	(238 , happyReduce_238),+	(239 , happyReduce_239),+	(240 , happyReduce_240),+	(241 , happyReduce_241),+	(242 , happyReduce_242),+	(243 , happyReduce_243),+	(244 , happyReduce_244),+	(245 , happyReduce_245),+	(246 , happyReduce_246),+	(247 , happyReduce_247),+	(248 , happyReduce_248),+	(249 , happyReduce_249),+	(250 , happyReduce_250),+	(251 , happyReduce_251),+	(252 , happyReduce_252),+	(253 , happyReduce_253),+	(254 , happyReduce_254),+	(255 , happyReduce_255),+	(256 , happyReduce_256),+	(257 , happyReduce_257),+	(258 , happyReduce_258),+	(259 , happyReduce_259),+	(260 , happyReduce_260),+	(261 , happyReduce_261),+	(262 , happyReduce_262),+	(263 , happyReduce_263),+	(264 , happyReduce_264),+	(265 , happyReduce_265),+	(266 , happyReduce_266),+	(267 , happyReduce_267),+	(268 , happyReduce_268),+	(269 , happyReduce_269),+	(270 , happyReduce_270),+	(271 , happyReduce_271),+	(272 , happyReduce_272),+	(273 , happyReduce_273),+	(274 , happyReduce_274),+	(275 , happyReduce_275),+	(276 , happyReduce_276),+	(277 , happyReduce_277),+	(278 , happyReduce_278),+	(279 , happyReduce_279),+	(280 , happyReduce_280),+	(281 , happyReduce_281),+	(282 , happyReduce_282),+	(283 , happyReduce_283),+	(284 , happyReduce_284),+	(285 , happyReduce_285),+	(286 , happyReduce_286),+	(287 , happyReduce_287),+	(288 , happyReduce_288),+	(289 , happyReduce_289),+	(290 , happyReduce_290),+	(291 , happyReduce_291),+	(292 , happyReduce_292),+	(293 , happyReduce_293),+	(294 , happyReduce_294),+	(295 , happyReduce_295),+	(296 , happyReduce_296),+	(297 , happyReduce_297),+	(298 , happyReduce_298),+	(299 , happyReduce_299),+	(300 , happyReduce_300),+	(301 , happyReduce_301),+	(302 , happyReduce_302),+	(303 , happyReduce_303),+	(304 , happyReduce_304),+	(305 , happyReduce_305),+	(306 , happyReduce_306),+	(307 , happyReduce_307),+	(308 , happyReduce_308),+	(309 , happyReduce_309),+	(310 , happyReduce_310),+	(311 , happyReduce_311),+	(312 , happyReduce_312),+	(313 , happyReduce_313),+	(314 , happyReduce_314),+	(315 , happyReduce_315),+	(316 , happyReduce_316),+	(317 , happyReduce_317),+	(318 , happyReduce_318),+	(319 , happyReduce_319),+	(320 , happyReduce_320),+	(321 , happyReduce_321),+	(322 , happyReduce_322),+	(323 , happyReduce_323),+	(324 , happyReduce_324),+	(325 , happyReduce_325),+	(326 , happyReduce_326),+	(327 , happyReduce_327),+	(328 , happyReduce_328),+	(329 , happyReduce_329),+	(330 , happyReduce_330),+	(331 , happyReduce_331),+	(332 , happyReduce_332),+	(333 , happyReduce_333),+	(334 , happyReduce_334),+	(335 , happyReduce_335),+	(336 , happyReduce_336),+	(337 , happyReduce_337),+	(338 , happyReduce_338),+	(339 , happyReduce_339),+	(340 , happyReduce_340),+	(341 , happyReduce_341),+	(342 , happyReduce_342),+	(343 , happyReduce_343),+	(344 , happyReduce_344),+	(345 , happyReduce_345),+	(346 , happyReduce_346),+	(347 , happyReduce_347),+	(348 , happyReduce_348),+	(349 , happyReduce_349),+	(350 , happyReduce_350),+	(351 , happyReduce_351),+	(352 , happyReduce_352),+	(353 , happyReduce_353),+	(354 , happyReduce_354),+	(355 , happyReduce_355),+	(356 , happyReduce_356),+	(357 , happyReduce_357),+	(358 , happyReduce_358),+	(359 , happyReduce_359),+	(360 , happyReduce_360),+	(361 , happyReduce_361),+	(362 , happyReduce_362),+	(363 , happyReduce_363),+	(364 , happyReduce_364),+	(365 , happyReduce_365),+	(366 , happyReduce_366),+	(367 , happyReduce_367),+	(368 , happyReduce_368),+	(369 , happyReduce_369),+	(370 , happyReduce_370),+	(371 , happyReduce_371),+	(372 , happyReduce_372),+	(373 , happyReduce_373),+	(374 , happyReduce_374),+	(375 , happyReduce_375),+	(376 , happyReduce_376),+	(377 , happyReduce_377),+	(378 , happyReduce_378),+	(379 , happyReduce_379),+	(380 , happyReduce_380),+	(381 , happyReduce_381),+	(382 , happyReduce_382),+	(383 , happyReduce_383),+	(384 , happyReduce_384),+	(385 , happyReduce_385),+	(386 , happyReduce_386),+	(387 , happyReduce_387),+	(388 , happyReduce_388),+	(389 , happyReduce_389),+	(390 , happyReduce_390),+	(391 , happyReduce_391),+	(392 , happyReduce_392),+	(393 , happyReduce_393),+	(394 , happyReduce_394),+	(395 , happyReduce_395),+	(396 , happyReduce_396),+	(397 , happyReduce_397),+	(398 , happyReduce_398),+	(399 , happyReduce_399),+	(400 , happyReduce_400),+	(401 , happyReduce_401),+	(402 , happyReduce_402),+	(403 , happyReduce_403),+	(404 , happyReduce_404),+	(405 , happyReduce_405),+	(406 , happyReduce_406),+	(407 , happyReduce_407),+	(408 , happyReduce_408),+	(409 , happyReduce_409),+	(410 , happyReduce_410),+	(411 , happyReduce_411),+	(412 , happyReduce_412),+	(413 , happyReduce_413),+	(414 , happyReduce_414),+	(415 , happyReduce_415),+	(416 , happyReduce_416),+	(417 , happyReduce_417),+	(418 , happyReduce_418),+	(419 , happyReduce_419),+	(420 , happyReduce_420),+	(421 , happyReduce_421),+	(422 , happyReduce_422)+	]++happy_n_terms = 90 :: Int+happy_n_nonterms = 140 :: Int++happyReduce_4 = happySpecReduce_1  0# happyReduction_4+happyReduction_4 happy_x_1+	 =  case happyOut8 happy_x_1 of { happy_var_1 -> +	happyIn7+		 (reverse happy_var_1+	)}++happyReduce_5 = happySpecReduce_2  1# happyReduction_5+happyReduction_5 happy_x_2+	happy_x_1+	 =  case happyOut8 happy_x_1 of { happy_var_1 -> +	case happyOut9 happy_x_2 of { happy_var_2 -> +	happyIn8+		 (happy_var_2 : happy_var_1+	)}}++happyReduce_6 = happySpecReduce_0  1# happyReduction_6+happyReduction_6  =  happyIn8+		 ([]+	)++happyReduce_7 = happySpecReduce_1  2# happyReduction_7+happyReduction_7 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwLet happy_var_1) -> +	happyIn9+		 (TokKeyword KwLet happy_var_1+	)}++happyReduce_8 = happySpecReduce_1  2# happyReduction_8+happyReduction_8 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwIn happy_var_1) -> +	happyIn9+		 (TokKeyword KwIn happy_var_1+	)}++happyReduce_9 = happySpecReduce_1  2# happyReduction_9+happyReduction_9 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwWhere happy_var_1) -> +	happyIn9+		 (TokKeyword KwWhere happy_var_1+	)}++happyReduce_10 = happySpecReduce_1  2# happyReduction_10+happyReduction_10 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwWith happy_var_1) -> +	happyIn9+		 (TokKeyword KwWith happy_var_1+	)}++happyReduce_11 = happySpecReduce_1  2# happyReduction_11+happyReduction_11 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwRewrite happy_var_1) -> +	happyIn9+		 (TokKeyword KwRewrite happy_var_1+	)}++happyReduce_12 = happySpecReduce_1  2# happyReduction_12+happyReduction_12 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwPostulate happy_var_1) -> +	happyIn9+		 (TokKeyword KwPostulate happy_var_1+	)}++happyReduce_13 = happySpecReduce_1  2# happyReduction_13+happyReduction_13 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwPrimitive happy_var_1) -> +	happyIn9+		 (TokKeyword KwPrimitive happy_var_1+	)}++happyReduce_14 = happySpecReduce_1  2# happyReduction_14+happyReduction_14 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwOpen happy_var_1) -> +	happyIn9+		 (TokKeyword KwOpen happy_var_1+	)}++happyReduce_15 = happySpecReduce_1  2# happyReduction_15+happyReduction_15 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwImport happy_var_1) -> +	happyIn9+		 (TokKeyword KwImport happy_var_1+	)}++happyReduce_16 = happySpecReduce_1  2# happyReduction_16+happyReduction_16 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwUsing happy_var_1) -> +	happyIn9+		 (TokKeyword KwUsing happy_var_1+	)}++happyReduce_17 = happySpecReduce_1  2# happyReduction_17+happyReduction_17 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwHiding happy_var_1) -> +	happyIn9+		 (TokKeyword KwHiding happy_var_1+	)}++happyReduce_18 = happySpecReduce_1  2# happyReduction_18+happyReduction_18 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwRenaming happy_var_1) -> +	happyIn9+		 (TokKeyword KwRenaming happy_var_1+	)}++happyReduce_19 = happySpecReduce_1  2# happyReduction_19+happyReduction_19 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwTo happy_var_1) -> +	happyIn9+		 (TokKeyword KwTo happy_var_1+	)}++happyReduce_20 = happySpecReduce_1  2# happyReduction_20+happyReduction_20 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwPublic happy_var_1) -> +	happyIn9+		 (TokKeyword KwPublic happy_var_1+	)}++happyReduce_21 = happySpecReduce_1  2# happyReduction_21+happyReduction_21 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwModule happy_var_1) -> +	happyIn9+		 (TokKeyword KwModule happy_var_1+	)}++happyReduce_22 = happySpecReduce_1  2# happyReduction_22+happyReduction_22 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwData happy_var_1) -> +	happyIn9+		 (TokKeyword KwData happy_var_1+	)}++happyReduce_23 = happySpecReduce_1  2# happyReduction_23+happyReduction_23 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwCoData happy_var_1) -> +	happyIn9+		 (TokKeyword KwCoData happy_var_1+	)}++happyReduce_24 = happySpecReduce_1  2# happyReduction_24+happyReduction_24 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwRecord happy_var_1) -> +	happyIn9+		 (TokKeyword KwRecord happy_var_1+	)}++happyReduce_25 = happySpecReduce_1  2# happyReduction_25+happyReduction_25 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwConstructor happy_var_1) -> +	happyIn9+		 (TokKeyword KwConstructor happy_var_1+	)}++happyReduce_26 = happySpecReduce_1  2# happyReduction_26+happyReduction_26 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwInductive happy_var_1) -> +	happyIn9+		 (TokKeyword KwInductive happy_var_1+	)}++happyReduce_27 = happySpecReduce_1  2# happyReduction_27+happyReduction_27 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwCoInductive happy_var_1) -> +	happyIn9+		 (TokKeyword KwCoInductive happy_var_1+	)}++happyReduce_28 = happySpecReduce_1  2# happyReduction_28+happyReduction_28 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwField happy_var_1) -> +	happyIn9+		 (TokKeyword KwField happy_var_1+	)}++happyReduce_29 = happySpecReduce_1  2# happyReduction_29+happyReduction_29 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwInfix happy_var_1) -> +	happyIn9+		 (TokKeyword KwInfix happy_var_1+	)}++happyReduce_30 = happySpecReduce_1  2# happyReduction_30+happyReduction_30 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwInfixL happy_var_1) -> +	happyIn9+		 (TokKeyword KwInfixL happy_var_1+	)}++happyReduce_31 = happySpecReduce_1  2# happyReduction_31+happyReduction_31 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwInfixR happy_var_1) -> +	happyIn9+		 (TokKeyword KwInfixR happy_var_1+	)}++happyReduce_32 = happySpecReduce_1  2# happyReduction_32+happyReduction_32 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwMutual happy_var_1) -> +	happyIn9+		 (TokKeyword KwMutual happy_var_1+	)}++happyReduce_33 = happySpecReduce_1  2# happyReduction_33+happyReduction_33 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwAbstract happy_var_1) -> +	happyIn9+		 (TokKeyword KwAbstract happy_var_1+	)}++happyReduce_34 = happySpecReduce_1  2# happyReduction_34+happyReduction_34 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwPrivate happy_var_1) -> +	happyIn9+		 (TokKeyword KwPrivate happy_var_1+	)}++happyReduce_35 = happySpecReduce_1  2# happyReduction_35+happyReduction_35 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwInstance happy_var_1) -> +	happyIn9+		 (TokKeyword KwInstance happy_var_1+	)}++happyReduce_36 = happySpecReduce_1  2# happyReduction_36+happyReduction_36 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwProp happy_var_1) -> +	happyIn9+		 (TokKeyword KwProp happy_var_1+	)}++happyReduce_37 = happySpecReduce_1  2# happyReduction_37+happyReduction_37 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwSet happy_var_1) -> +	happyIn9+		 (TokKeyword KwSet happy_var_1+	)}++happyReduce_38 = happySpecReduce_1  2# happyReduction_38+happyReduction_38 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwForall happy_var_1) -> +	happyIn9+		 (TokKeyword KwForall happy_var_1+	)}++happyReduce_39 = happySpecReduce_1  2# happyReduction_39+happyReduction_39 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwSyntax happy_var_1) -> +	happyIn9+		 (TokKeyword KwSyntax happy_var_1+	)}++happyReduce_40 = happySpecReduce_1  2# happyReduction_40+happyReduction_40 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwPatternSyn happy_var_1) -> +	happyIn9+		 (TokKeyword KwPatternSyn happy_var_1+	)}++happyReduce_41 = happySpecReduce_1  2# happyReduction_41+happyReduction_41 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwOPTIONS happy_var_1) -> +	happyIn9+		 (TokKeyword KwOPTIONS happy_var_1+	)}++happyReduce_42 = happySpecReduce_1  2# happyReduction_42+happyReduction_42 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwBUILTIN happy_var_1) -> +	happyIn9+		 (TokKeyword KwBUILTIN happy_var_1+	)}++happyReduce_43 = happySpecReduce_1  2# happyReduction_43+happyReduction_43 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwREWRITE happy_var_1) -> +	happyIn9+		 (TokKeyword KwREWRITE happy_var_1+	)}++happyReduce_44 = happySpecReduce_1  2# happyReduction_44+happyReduction_44 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwIMPORT happy_var_1) -> +	happyIn9+		 (TokKeyword KwIMPORT happy_var_1+	)}++happyReduce_45 = happySpecReduce_1  2# happyReduction_45+happyReduction_45 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwCOMPILED happy_var_1) -> +	happyIn9+		 (TokKeyword KwCOMPILED happy_var_1+	)}++happyReduce_46 = happySpecReduce_1  2# happyReduction_46+happyReduction_46 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwCOMPILED_EXPORT happy_var_1) -> +	happyIn9+		 (TokKeyword KwCOMPILED_EXPORT happy_var_1+	)}++happyReduce_47 = happySpecReduce_1  2# happyReduction_47+happyReduction_47 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwCOMPILED_DATA happy_var_1) -> +	happyIn9+		 (TokKeyword KwCOMPILED_DATA happy_var_1+	)}++happyReduce_48 = happySpecReduce_1  2# happyReduction_48+happyReduction_48 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwCOMPILED_TYPE happy_var_1) -> +	happyIn9+		 (TokKeyword KwCOMPILED_TYPE happy_var_1+	)}++happyReduce_49 = happySpecReduce_1  2# happyReduction_49+happyReduction_49 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwCOMPILED_EPIC happy_var_1) -> +	happyIn9+		 (TokKeyword KwCOMPILED_EPIC happy_var_1+	)}++happyReduce_50 = happySpecReduce_1  2# happyReduction_50+happyReduction_50 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwCOMPILED_JS happy_var_1) -> +	happyIn9+		 (TokKeyword KwCOMPILED_JS happy_var_1+	)}++happyReduce_51 = happySpecReduce_1  2# happyReduction_51+happyReduction_51 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwSTATIC happy_var_1) -> +	happyIn9+		 (TokKeyword KwSTATIC happy_var_1+	)}++happyReduce_52 = happySpecReduce_1  2# happyReduction_52+happyReduction_52 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwIMPOSSIBLE happy_var_1) -> +	happyIn9+		 (TokKeyword KwIMPOSSIBLE happy_var_1+	)}++happyReduce_53 = happySpecReduce_1  2# happyReduction_53+happyReduction_53 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwETA happy_var_1) -> +	happyIn9+		 (TokKeyword KwETA happy_var_1+	)}++happyReduce_54 = happySpecReduce_1  2# happyReduction_54+happyReduction_54 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwNO_TERMINATION_CHECK happy_var_1) -> +	happyIn9+		 (TokKeyword KwNO_TERMINATION_CHECK happy_var_1+	)}++happyReduce_55 = happySpecReduce_1  2# happyReduction_55+happyReduction_55 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwNON_TERMINATING happy_var_1) -> +	happyIn9+		 (TokKeyword KwNON_TERMINATING happy_var_1+	)}++happyReduce_56 = happySpecReduce_1  2# happyReduction_56+happyReduction_56 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwTERMINATING happy_var_1) -> +	happyIn9+		 (TokKeyword KwTERMINATING happy_var_1+	)}++happyReduce_57 = happySpecReduce_1  2# happyReduction_57+happyReduction_57 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwMEASURE happy_var_1) -> +	happyIn9+		 (TokKeyword KwMEASURE happy_var_1+	)}++happyReduce_58 = happySpecReduce_1  2# happyReduction_58+happyReduction_58 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwQuoteGoal happy_var_1) -> +	happyIn9+		 (TokKeyword KwQuoteGoal happy_var_1+	)}++happyReduce_59 = happySpecReduce_1  2# happyReduction_59+happyReduction_59 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwQuoteContext happy_var_1) -> +	happyIn9+		 (TokKeyword KwQuoteContext happy_var_1+	)}++happyReduce_60 = happySpecReduce_1  2# happyReduction_60+happyReduction_60 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwQuote happy_var_1) -> +	happyIn9+		 (TokKeyword KwQuote happy_var_1+	)}++happyReduce_61 = happySpecReduce_1  2# happyReduction_61+happyReduction_61 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwQuoteTerm happy_var_1) -> +	happyIn9+		 (TokKeyword KwQuoteTerm happy_var_1+	)}++happyReduce_62 = happySpecReduce_1  2# happyReduction_62+happyReduction_62 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwTactic happy_var_1) -> +	happyIn9+		 (TokKeyword KwTactic happy_var_1+	)}++happyReduce_63 = happySpecReduce_1  2# happyReduction_63+happyReduction_63 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwUnquote happy_var_1) -> +	happyIn9+		 (TokKeyword KwUnquote happy_var_1+	)}++happyReduce_64 = happySpecReduce_1  2# happyReduction_64+happyReduction_64 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwUnquoteDecl happy_var_1) -> +	happyIn9+		 (TokKeyword KwUnquoteDecl happy_var_1+	)}++happyReduce_65 = happySpecReduce_1  2# happyReduction_65+happyReduction_65 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSetN happy_var_1) -> +	happyIn9+		 (TokSetN happy_var_1+	)}++happyReduce_66 = happySpecReduce_1  2# happyReduction_66+happyReduction_66 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokTeX happy_var_1) -> +	happyIn9+		 (TokTeX happy_var_1+	)}++happyReduce_67 = happySpecReduce_1  2# happyReduction_67+happyReduction_67 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokComment happy_var_1) -> +	happyIn9+		 (TokComment happy_var_1+	)}++happyReduce_68 = happySpecReduce_1  2# happyReduction_68+happyReduction_68 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymEllipsis happy_var_1) -> +	happyIn9+		 (TokSymbol SymEllipsis happy_var_1+	)}++happyReduce_69 = happySpecReduce_1  2# happyReduction_69+happyReduction_69 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymDotDot happy_var_1) -> +	happyIn9+		 (TokSymbol SymDotDot happy_var_1+	)}++happyReduce_70 = happySpecReduce_1  2# happyReduction_70+happyReduction_70 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymDot happy_var_1) -> +	happyIn9+		 (TokSymbol SymDot happy_var_1+	)}++happyReduce_71 = happySpecReduce_1  2# happyReduction_71+happyReduction_71 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymSemi happy_var_1) -> +	happyIn9+		 (TokSymbol SymSemi happy_var_1+	)}++happyReduce_72 = happySpecReduce_1  2# happyReduction_72+happyReduction_72 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymColon happy_var_1) -> +	happyIn9+		 (TokSymbol SymColon happy_var_1+	)}++happyReduce_73 = happySpecReduce_1  2# happyReduction_73+happyReduction_73 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymEqual happy_var_1) -> +	happyIn9+		 (TokSymbol SymEqual happy_var_1+	)}++happyReduce_74 = happySpecReduce_1  2# happyReduction_74+happyReduction_74 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymUnderscore happy_var_1) -> +	happyIn9+		 (TokSymbol SymUnderscore happy_var_1+	)}++happyReduce_75 = happySpecReduce_1  2# happyReduction_75+happyReduction_75 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymQuestionMark happy_var_1) -> +	happyIn9+		 (TokSymbol SymQuestionMark happy_var_1+	)}++happyReduce_76 = happySpecReduce_1  2# happyReduction_76+happyReduction_76 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymArrow happy_var_1) -> +	happyIn9+		 (TokSymbol SymArrow happy_var_1+	)}++happyReduce_77 = happySpecReduce_1  2# happyReduction_77+happyReduction_77 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymLambda happy_var_1) -> +	happyIn9+		 (TokSymbol SymLambda happy_var_1+	)}++happyReduce_78 = happySpecReduce_1  2# happyReduction_78+happyReduction_78 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymAs happy_var_1) -> +	happyIn9+		 (TokSymbol SymAs happy_var_1+	)}++happyReduce_79 = happySpecReduce_1  2# happyReduction_79+happyReduction_79 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymBar happy_var_1) -> +	happyIn9+		 (TokSymbol SymBar happy_var_1+	)}++happyReduce_80 = happySpecReduce_1  2# happyReduction_80+happyReduction_80 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenParen happy_var_1) -> +	happyIn9+		 (TokSymbol SymOpenParen happy_var_1+	)}++happyReduce_81 = happySpecReduce_1  2# happyReduction_81+happyReduction_81 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymCloseParen happy_var_1) -> +	happyIn9+		 (TokSymbol SymCloseParen happy_var_1+	)}++happyReduce_82 = happySpecReduce_1  2# happyReduction_82+happyReduction_82 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymDoubleOpenBrace happy_var_1) -> +	happyIn9+		 (TokSymbol SymDoubleOpenBrace happy_var_1+	)}++happyReduce_83 = happySpecReduce_1  2# happyReduction_83+happyReduction_83 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymDoubleCloseBrace happy_var_1) -> +	happyIn9+		 (TokSymbol SymDoubleCloseBrace happy_var_1+	)}++happyReduce_84 = happySpecReduce_1  2# happyReduction_84+happyReduction_84 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenBrace happy_var_1) -> +	happyIn9+		 (TokSymbol SymOpenBrace happy_var_1+	)}++happyReduce_85 = happySpecReduce_1  2# happyReduction_85+happyReduction_85 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymCloseBrace happy_var_1) -> +	happyIn9+		 (TokSymbol SymCloseBrace happy_var_1+	)}++happyReduce_86 = happySpecReduce_1  2# happyReduction_86+happyReduction_86 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenVirtualBrace happy_var_1) -> +	happyIn9+		 (TokSymbol SymOpenVirtualBrace happy_var_1+	)}++happyReduce_87 = happySpecReduce_1  2# happyReduction_87+happyReduction_87 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymCloseVirtualBrace happy_var_1) -> +	happyIn9+		 (TokSymbol SymCloseVirtualBrace happy_var_1+	)}++happyReduce_88 = happySpecReduce_1  2# happyReduction_88+happyReduction_88 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymVirtualSemi happy_var_1) -> +	happyIn9+		 (TokSymbol SymVirtualSemi happy_var_1+	)}++happyReduce_89 = happySpecReduce_1  2# happyReduction_89+happyReduction_89 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> +	happyIn9+		 (TokSymbol SymOpenPragma happy_var_1+	)}++happyReduce_90 = happySpecReduce_1  2# happyReduction_90+happyReduction_90 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymClosePragma happy_var_1) -> +	happyIn9+		 (TokSymbol SymClosePragma happy_var_1+	)}++happyReduce_91 = happySpecReduce_1  2# happyReduction_91+happyReduction_91 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokId happy_var_1) -> +	happyIn9+		 (TokId happy_var_1+	)}++happyReduce_92 = happySpecReduce_1  2# happyReduction_92+happyReduction_92 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokQId happy_var_1) -> +	happyIn9+		 (TokQId happy_var_1+	)}++happyReduce_93 = happySpecReduce_1  2# happyReduction_93+happyReduction_93 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokString happy_var_1) -> +	happyIn9+		 (TokString happy_var_1+	)}++happyReduce_94 = happySpecReduce_1  2# happyReduction_94+happyReduction_94 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokLiteral happy_var_1) -> +	happyIn9+		 (TokLiteral happy_var_1+	)}++happyReduce_95 = happySpecReduce_3  3# happyReduction_95+happyReduction_95 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut116 happy_x_2 of { happy_var_2 -> +	happyIn10+		 (takeOptionsPragmas happy_var_2+	)}++happyReduce_96 = happySpecReduce_0  4# happyReduction_96+happyReduction_96  =  happyIn11+		 (()+	)++happyReduce_97 = happySpecReduce_1  4# happyReduction_97+happyReduction_97 happy_x_1+	 =  happyIn11+		 (()+	)++happyReduce_98 = happySpecReduce_1  5# happyReduction_98+happyReduction_98 happy_x_1+	 =  happyIn12+		 (()+	)++happyReduce_99 = happyMonadReduce 1# 5# happyReduction_99+happyReduction_99 (happy_x_1 `HappyStk`+	happyRest) tk+	 = happyThen (( popContext)+	) (\r -> happyReturn (happyIn12 r))++happyReduce_100 = happySpecReduce_1  6# happyReduction_100+happyReduction_100 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymSemi happy_var_1) -> +	happyIn13+		 (happy_var_1+	)}++happyReduce_101 = happySpecReduce_1  6# happyReduction_101+happyReduction_101 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymVirtualSemi happy_var_1) -> +	happyIn13+		 (happy_var_1+	)}++happyReduce_102 = happyMonadReduce 0# 7# happyReduction_102+happyReduction_102 (happyRest) tk+	 = happyThen (( pushLexState imp_dir)+	) (\r -> happyReturn (happyIn14 r))++happyReduce_103 = happyMonadReduce 1# 8# happyReduction_103+happyReduction_103 (happy_x_1 `HappyStk`+	happyRest) tk+	 = happyThen (case happyOutTok happy_x_1 of { (TokLiteral happy_var_1) -> +	( case happy_var_1 of {+                     LitInt _ i -> return i;+                     _          -> fail $ "Expected integer"+                   })}+	) (\r -> happyReturn (happyIn15 r))++happyReduce_104 = happyMonadReduce 1# 8# happyReduction_104+happyReduction_104 (happy_x_1 `HappyStk`+	happyRest) tk+	 = happyThen (case happyOutTok happy_x_1 of { (TokId happy_var_1) -> +	( case happy_var_1 of {+             (_, s) -> case readM s of {+                         Right i  -> return i;+                         Left (err :: String) -> fail $ "Expected integer"+                       }+           })}+	) (\r -> happyReturn (happyIn15 r))++happyReduce_105 = happyMonadReduce 1# 9# happyReduction_105+happyReduction_105 (happy_x_1 `HappyStk`+	happyRest) tk+	 = happyThen (case happyOutTok happy_x_1 of { (TokId happy_var_1) -> +	( mkName happy_var_1)}+	) (\r -> happyReturn (happyIn16 r))++happyReduce_106 = happySpecReduce_2  10# happyReduction_106+happyReduction_106 happy_x_2+	happy_x_1+	 =  case happyOut16 happy_x_1 of { happy_var_1 -> +	case happyOut17 happy_x_2 of { happy_var_2 -> +	happyIn17+		 (happy_var_1 : happy_var_2+	)}}++happyReduce_107 = happySpecReduce_1  10# happyReduction_107+happyReduction_107 happy_x_1+	 =  case happyOut16 happy_x_1 of { happy_var_1 -> +	happyIn17+		 ([happy_var_1]+	)}++happyReduce_108 = happySpecReduce_1  11# happyReduction_108+happyReduction_108 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymDoubleCloseBrace happy_var_1) -> +	happyIn18+		 (getRange happy_var_1+	)}++happyReduce_109 = happyMonadReduce 2# 11# happyReduction_109+happyReduction_109 (happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest) tk+	 = happyThen (case happyOutTok happy_x_1 of { (TokSymbol SymCloseBrace happy_var_1) -> +	case happyOutTok happy_x_2 of { (TokSymbol SymCloseBrace happy_var_2) -> +	(+      if posPos (fromJust (rEnd (getRange happy_var_2))) -+         posPos (fromJust (rStart (getRange happy_var_1))) > 2+      then parseErrorAt (fromJust (rStart (getRange happy_var_2)))+         "Expecting '}}', found separated '}'s."+      else return $ getRange (happy_var_1, happy_var_2))}}+	) (\r -> happyReturn (happyIn18 r))++happyReduce_110 = happySpecReduce_2  12# happyReduction_110+happyReduction_110 happy_x_2+	happy_x_1+	 =  case happyOut16 happy_x_2 of { happy_var_2 -> +	happyIn19+		 (setRelevance Irrelevant $ defaultArg happy_var_2+	)}++happyReduce_111 = happySpecReduce_1  12# happyReduction_111+happyReduction_111 happy_x_1+	 =  case happyOut16 happy_x_1 of { happy_var_1 -> +	happyIn19+		 (defaultArg happy_var_1+	)}++happyReduce_112 = happySpecReduce_2  13# happyReduction_112+happyReduction_112 happy_x_2+	happy_x_1+	 =  case happyOut19 happy_x_1 of { happy_var_1 -> +	case happyOut20 happy_x_2 of { happy_var_2 -> +	happyIn20+		 (happy_var_1 : happy_var_2+	)}}++happyReduce_113 = happySpecReduce_1  13# happyReduction_113+happyReduction_113 happy_x_1+	 =  case happyOut19 happy_x_1 of { happy_var_1 -> +	happyIn20+		 ([happy_var_1]+	)}++happyReduce_114 = happySpecReduce_2  14# happyReduction_114+happyReduction_114 happy_x_2+	happy_x_1+	 =  case happyOut19 happy_x_1 of { happy_var_1 -> +	case happyOut21 happy_x_2 of { happy_var_2 -> +	happyIn21+		 (happy_var_1 : happy_var_2+	)}}++happyReduce_115 = happySpecReduce_1  14# happyReduction_115+happyReduction_115 happy_x_1+	 =  case happyOut19 happy_x_1 of { happy_var_1 -> +	happyIn21+		 ([happy_var_1]+	)}++happyReduce_116 = happyReduce 4# 14# happyReduction_116+happyReduction_116 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut20 happy_x_2 of { happy_var_2 -> +	case happyOut21 happy_x_4 of { happy_var_4 -> +	happyIn21+		 (map makeInstance happy_var_2 ++ happy_var_4+	) `HappyStk` happyRest}}++happyReduce_117 = happySpecReduce_3  14# happyReduction_117+happyReduction_117 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut20 happy_x_2 of { happy_var_2 -> +	happyIn21+		 (map makeInstance happy_var_2+	)}++happyReduce_118 = happyReduce 4# 14# happyReduction_118+happyReduction_118 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut20 happy_x_2 of { happy_var_2 -> +	case happyOut21 happy_x_4 of { happy_var_4 -> +	happyIn21+		 (map hide happy_var_2 ++ happy_var_4+	) `HappyStk` happyRest}}++happyReduce_119 = happySpecReduce_3  14# happyReduction_119+happyReduction_119 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut20 happy_x_2 of { happy_var_2 -> +	happyIn21+		 (map hide happy_var_2+	)}++happyReduce_120 = happyReduce 5# 14# happyReduction_120+happyReduction_120 (happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut17 happy_x_3 of { happy_var_3 -> +	case happyOut21 happy_x_5 of { happy_var_5 -> +	happyIn21+		 (map (hide . setRelevance Irrelevant . defaultArg) happy_var_3 ++ happy_var_5+	) `HappyStk` happyRest}}++happyReduce_121 = happyReduce 4# 14# happyReduction_121+happyReduction_121 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut17 happy_x_3 of { happy_var_3 -> +	happyIn21+		 (map (hide . setRelevance Irrelevant . defaultArg) happy_var_3+	) `HappyStk` happyRest}++happyReduce_122 = happyReduce 5# 14# happyReduction_122+happyReduction_122 (happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut17 happy_x_3 of { happy_var_3 -> +	case happyOut21 happy_x_5 of { happy_var_5 -> +	happyIn21+		 (map (makeInstance . setRelevance Irrelevant . defaultArg) happy_var_3 ++ happy_var_5+	) `HappyStk` happyRest}}++happyReduce_123 = happyReduce 4# 14# happyReduction_123+happyReduction_123 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut17 happy_x_3 of { happy_var_3 -> +	happyIn21+		 (map (makeInstance . setRelevance Irrelevant . defaultArg) happy_var_3+	) `HappyStk` happyRest}++happyReduce_124 = happyReduce 5# 14# happyReduction_124+happyReduction_124 (happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut17 happy_x_3 of { happy_var_3 -> +	case happyOut21 happy_x_5 of { happy_var_5 -> +	happyIn21+		 (map (hide . setRelevance NonStrict . defaultArg) happy_var_3 ++ happy_var_5+	) `HappyStk` happyRest}}++happyReduce_125 = happyReduce 4# 14# happyReduction_125+happyReduction_125 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut17 happy_x_3 of { happy_var_3 -> +	happyIn21+		 (map (hide . setRelevance NonStrict . defaultArg) happy_var_3+	) `HappyStk` happyRest}++happyReduce_126 = happyReduce 5# 14# happyReduction_126+happyReduction_126 (happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut17 happy_x_3 of { happy_var_3 -> +	case happyOut21 happy_x_5 of { happy_var_5 -> +	happyIn21+		 (map (makeInstance . setRelevance NonStrict . defaultArg) happy_var_3 ++ happy_var_5+	) `HappyStk` happyRest}}++happyReduce_127 = happyReduce 4# 14# happyReduction_127+happyReduction_127 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut17 happy_x_3 of { happy_var_3 -> +	happyIn21+		 (map (makeInstance . setRelevance NonStrict . defaultArg) happy_var_3+	) `HappyStk` happyRest}++happyReduce_128 = happyMonadReduce 1# 15# happyReduction_128+happyReduction_128 (happy_x_1 `HappyStk`+	happyRest) tk+	 = happyThen (case happyOutTok happy_x_1 of { (TokQId happy_var_1) -> +	( mkQName happy_var_1)}+	) (\r -> happyReturn (happyIn22 r))++happyReduce_129 = happySpecReduce_1  15# happyReduction_129+happyReduction_129 happy_x_1+	 =  case happyOut16 happy_x_1 of { happy_var_1 -> +	happyIn22+		 (QName happy_var_1+	)}++happyReduce_130 = happySpecReduce_1  16# happyReduction_130+happyReduction_130 happy_x_1+	 =  case happyOut22 happy_x_1 of { happy_var_1 -> +	happyIn23+		 (happy_var_1+	)}++happyReduce_131 = happySpecReduce_1  17# happyReduction_131+happyReduction_131 happy_x_1+	 =  case happyOut16 happy_x_1 of { happy_var_1 -> +	happyIn24+		 (happy_var_1+	)}++happyReduce_132 = happySpecReduce_1  17# happyReduction_132+happyReduction_132 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymUnderscore happy_var_1) -> +	happyIn24+		 (Name (getRange happy_var_1) [Hole]+	)}++happyReduce_133 = happySpecReduce_2  18# happyReduction_133+happyReduction_133 happy_x_2+	happy_x_1+	 =  case happyOut24 happy_x_1 of { happy_var_1 -> +	case happyOut25 happy_x_2 of { happy_var_2 -> +	happyIn25+		 (happy_var_1 : happy_var_2+	)}}++happyReduce_134 = happySpecReduce_1  18# happyReduction_134+happyReduction_134 happy_x_1+	 =  case happyOut24 happy_x_1 of { happy_var_1 -> +	happyIn25+		 ([happy_var_1]+	)}++happyReduce_135 = happySpecReduce_1  19# happyReduction_135+happyReduction_135 happy_x_1+	 =  case happyOut27 happy_x_1 of { happy_var_1 -> +	happyIn26+		 (case happy_var_1 of+      Left ns -> ns+      Right _ -> fail $ "expected sequence of bound identifiers, not absurd pattern"+	)}++happyReduce_136 = happyMonadReduce 1# 20# happyReduction_136+happyReduction_136 (happy_x_1 `HappyStk`+	happyRest) tk+	 = happyThen (case happyOut36 happy_x_1 of { happy_var_1 -> +	(+    let getName :: Expr -> Maybe Name+        getName (Ident (QName x)) = Just x+        getName (Underscore r _)  = Just (Name r [Hole])+        getName _                 = Nothing++        isAbsurd :: Expr -> Bool+        isAbsurd (Absurd _)                  = True+        isAbsurd (HiddenArg _ (Named _ e))   = isAbsurd e+        isAbsurd (InstanceArg _ (Named _ e)) = isAbsurd e+        isAbsurd (Paren _ expr)              = isAbsurd expr+        isAbsurd (RawApp _ exprs)            = any isAbsurd exprs+        isAbsurd _                           = False+    in+    if any isAbsurd happy_var_1 then return $ Right happy_var_1 else+    case mapM getName happy_var_1 of+        Just good -> return $ Left good+        Nothing   -> fail $ "expected sequence of bound identifiers")}+	) (\r -> happyReturn (happyIn27 r))++happyReduce_137 = happyMonadReduce 1# 21# happyReduction_137+happyReduction_137 (happy_x_1 `HappyStk`+	happyRest) tk+	 = happyThen (case happyOut36 happy_x_1 of { happy_var_1 -> +	(+    let -- interpret an expression as name+        getName :: Expr -> Maybe Name+        getName (Ident (QName x)) = Just x+        getName (Underscore r _)  = Just (Name r [Hole])+        getName _                 = Nothing++        getNames :: Expr -> Maybe [Name]+        getNames (RawApp _ es) = mapM getName es+        getNames e             = singleton `fmap` getName e++        -- interpret an expression as name or list of hidden names+        getName1 :: Expr -> Maybe [WithHiding Name]+        getName1 (Ident (QName x)) = Just [WithHiding NotHidden x]+        getName1 (Underscore r _)  = Just [WithHiding NotHidden $ Name r [Hole]]+        getName1 (HiddenArg _ (Named Nothing e))+                                   = map (WithHiding Hidden) `fmap` getNames e+        getName1 _                 = Nothing++    in+    case mapM getName1 happy_var_1 of+        Just good -> return $ concat good+        Nothing   -> fail $ "expected sequence of possibly hidden bound identifiers")}+	) (\r -> happyReturn (happyIn28 r))++happyReduce_138 = happySpecReduce_0  22# happyReduction_138+happyReduction_138  =  happyIn29+		 ([]+	)++happyReduce_139 = happySpecReduce_2  22# happyReduction_139+happyReduction_139 happy_x_2+	happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokString happy_var_1) -> +	case happyOut29 happy_x_2 of { happy_var_2 -> +	happyIn29+		 (snd happy_var_1 : happy_var_2+	)}}++happyReduce_140 = happySpecReduce_1  23# happyReduction_140+happyReduction_140 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokString happy_var_1) -> +	happyIn30+		 (snd happy_var_1+	)}++happyReduce_141 = happyMonadReduce 1# 24# happyReduction_141+happyReduction_141 (happy_x_1 `HappyStk`+	happyRest) tk+	 = happyThen (case happyOutTok happy_x_1 of { (TokString happy_var_1) -> +	( mkName happy_var_1)}+	) (\r -> happyReturn (happyIn31 r))++happyReduce_142 = happyMonadReduce 1# 25# happyReduction_142+happyReduction_142 (happy_x_1 `HappyStk`+	happyRest) tk+	 = happyThen (case happyOutTok happy_x_1 of { (TokString happy_var_1) -> +	( fmap QName (mkName happy_var_1))}+	) (\r -> happyReturn (happyIn32 r))++happyReduce_143 = happySpecReduce_2  26# happyReduction_143+happyReduction_143 happy_x_2+	happy_x_1+	 =  case happyOut46 happy_x_1 of { happy_var_1 -> +	case happyOut33 happy_x_2 of { happy_var_2 -> +	happyIn33+		 (Pi happy_var_1 happy_var_2+	)}}++happyReduce_144 = happySpecReduce_3  26# happyReduction_144+happyReduction_144 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut39 happy_x_1 of { happy_var_1 -> +	case happyOutTok happy_x_2 of { (TokSymbol SymArrow happy_var_2) -> +	case happyOut33 happy_x_3 of { happy_var_3 -> +	happyIn33+		 (Fun (getRange (happy_var_1,happy_var_2,happy_var_3))+                                              (RawApp (getRange happy_var_1) happy_var_1)+                                              happy_var_3+	)}}}++happyReduce_145 = happySpecReduce_3  26# happyReduction_145+happyReduction_145 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut34 happy_x_1 of { happy_var_1 -> +	case happyOutTok happy_x_2 of { (TokSymbol SymEqual happy_var_2) -> +	case happyOut33 happy_x_3 of { happy_var_3 -> +	happyIn33+		 (Equal (getRange (happy_var_1, happy_var_2, happy_var_3)) happy_var_1 happy_var_3+	)}}}++happyReduce_146 = happySpecReduce_1  26# happyReduction_146+happyReduction_146 happy_x_1+	 =  case happyOut34 happy_x_1 of { happy_var_1 -> +	happyIn33+		 (happy_var_1+	)}++happyReduce_147 = happyMonadReduce 1# 27# happyReduction_147+happyReduction_147 (happy_x_1 `HappyStk`+	happyRest) tk+	 = happyThen (case happyOut35 happy_x_1 of { happy_var_1 -> +	( case happy_var_1 of+                      { [e]    -> return e+                      ; e : es -> return $ WithApp (fuseRange e es) e es+                      ; []     -> fail "impossible: empty with expressions"+                      })}+	) (\r -> happyReturn (happyIn34 r))++happyReduce_148 = happySpecReduce_3  28# happyReduction_148+happyReduction_148 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut39 happy_x_1 of { happy_var_1 -> +	case happyOut35 happy_x_3 of { happy_var_3 -> +	happyIn35+		 (RawApp (getRange happy_var_1) happy_var_1 :  happy_var_3+	)}}++happyReduce_149 = happySpecReduce_1  28# happyReduction_149+happyReduction_149 happy_x_1+	 =  case happyOut36 happy_x_1 of { happy_var_1 -> +	happyIn35+		 ([RawApp (getRange happy_var_1) happy_var_1]+	)}++happyReduce_150 = happySpecReduce_1  29# happyReduction_150+happyReduction_150 happy_x_1+	 =  case happyOut37 happy_x_1 of { happy_var_1 -> +	happyIn36+		 ([happy_var_1]+	)}++happyReduce_151 = happySpecReduce_2  29# happyReduction_151+happyReduction_151 happy_x_2+	happy_x_1+	 =  case happyOut42 happy_x_1 of { happy_var_1 -> +	case happyOut36 happy_x_2 of { happy_var_2 -> +	happyIn36+		 (happy_var_1 : happy_var_2+	)}}++happyReduce_152 = happySpecReduce_3  30# happyReduction_152+happyReduction_152 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymLambda happy_var_1) -> +	case happyOut52 happy_x_2 of { happy_var_2 -> +	case happyOut33 happy_x_3 of { happy_var_3 -> +	happyIn37+		 (Lam (getRange (happy_var_1,happy_var_2,happy_var_3)) happy_var_2 happy_var_3+	)}}}++happyReduce_153 = happySpecReduce_1  30# happyReduction_153+happyReduction_153 happy_x_1+	 =  case happyOut38 happy_x_1 of { happy_var_1 -> +	happyIn37+		 (happy_var_1+	)}++happyReduce_154 = happySpecReduce_3  30# happyReduction_154+happyReduction_154 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut60 happy_x_2 of { happy_var_2 -> +	case happyOut33 happy_x_3 of { happy_var_3 -> +	happyIn37+		 (forallPi happy_var_2 happy_var_3+	)}}++happyReduce_155 = happyReduce 4# 30# happyReduction_155+happyReduction_155 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokKeyword KwLet happy_var_1) -> +	case happyOut143 happy_x_2 of { happy_var_2 -> +	case happyOutTok happy_x_3 of { (TokKeyword KwIn happy_var_3) -> +	case happyOut33 happy_x_4 of { happy_var_4 -> +	happyIn37+		 (Let (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4)) happy_var_2 happy_var_4+	) `HappyStk` happyRest}}}}++happyReduce_156 = happySpecReduce_1  30# happyReduction_156+happyReduction_156 happy_x_1+	 =  case happyOut42 happy_x_1 of { happy_var_1 -> +	happyIn37+		 (happy_var_1+	)}++happyReduce_157 = happyReduce 4# 30# happyReduction_157+happyReduction_157 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokKeyword KwQuoteGoal happy_var_1) -> +	case happyOut16 happy_x_2 of { happy_var_2 -> +	case happyOutTok happy_x_3 of { (TokKeyword KwIn happy_var_3) -> +	case happyOut33 happy_x_4 of { happy_var_4 -> +	happyIn37+		 (QuoteGoal (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4)) happy_var_2 happy_var_4+	) `HappyStk` happyRest}}}}++happyReduce_158 = happyReduce 4# 30# happyReduction_158+happyReduction_158 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokKeyword KwQuoteContext happy_var_1) -> +	case happyOut16 happy_x_2 of { happy_var_2 -> +	case happyOutTok happy_x_3 of { (TokKeyword KwIn happy_var_3) -> +	case happyOut33 happy_x_4 of { happy_var_4 -> +	happyIn37+		 (QuoteContext (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4)) happy_var_2 happy_var_4+	) `HappyStk` happyRest}}}}++happyReduce_159 = happySpecReduce_2  30# happyReduction_159+happyReduction_159 happy_x_2+	happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwTactic happy_var_1) -> +	case happyOut39 happy_x_2 of { happy_var_2 -> +	happyIn37+		 (Tactic (getRange (happy_var_1, happy_var_2)) (RawApp (getRange happy_var_2) happy_var_2) []+	)}}++happyReduce_160 = happyReduce 4# 30# happyReduction_160+happyReduction_160 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokKeyword KwTactic happy_var_1) -> +	case happyOut39 happy_x_2 of { happy_var_2 -> +	case happyOutTok happy_x_3 of { (TokSymbol SymBar happy_var_3) -> +	case happyOut35 happy_x_4 of { happy_var_4 -> +	happyIn37+		 (Tactic (getRange (happy_var_1, happy_var_2, happy_var_3, happy_var_4)) (RawApp (getRange happy_var_2) happy_var_2) happy_var_4+	) `HappyStk` happyRest}}}}++happyReduce_161 = happyReduce 4# 31# happyReduction_161+happyReduction_161 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokSymbol SymLambda happy_var_1) -> +	case happyOutTok happy_x_2 of { (TokSymbol SymOpenBrace happy_var_2) -> +	case happyOut59 happy_x_3 of { happy_var_3 -> +	case happyOutTok happy_x_4 of { (TokSymbol SymCloseBrace happy_var_4) -> +	happyIn38+		 (ExtendedLam (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4)) (reverse happy_var_3)+	) `HappyStk` happyRest}}}}++happyReduce_162 = happyMonadReduce 2# 31# happyReduction_162+happyReduction_162 (happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest) tk+	 = happyThen (case happyOutTok happy_x_1 of { (TokSymbol SymLambda happy_var_1) -> +	case happyOut53 happy_x_2 of { happy_var_2 -> +	( case happy_var_2 of+                                       Left (bs, h) -> if null bs then return $ AbsurdLam r h else+                                                       return $ Lam r bs (AbsurdLam r h)+                                                         where r = fuseRange happy_var_1 bs+                                       Right es -> do -- it is of the form @\ { p1 ... () }@+                                                     p <- exprToLHS (RawApp (getRange es) es);+                                                     return $ ExtendedLam (fuseRange happy_var_1 es)+                                                                     [(p [] [], AbsurdRHS, NoWhere)])}}+	) (\r -> happyReturn (happyIn38 r))++happyReduce_163 = happySpecReduce_1  32# happyReduction_163+happyReduction_163 happy_x_1+	 =  case happyOut42 happy_x_1 of { happy_var_1 -> +	happyIn39+		 ([happy_var_1]+	)}++happyReduce_164 = happySpecReduce_2  32# happyReduction_164+happyReduction_164 happy_x_2+	happy_x_1+	 =  case happyOut42 happy_x_1 of { happy_var_1 -> +	case happyOut39 happy_x_2 of { happy_var_2 -> +	happyIn39+		 (happy_var_1 : happy_var_2+	)}}++happyReduce_165 = happySpecReduce_3  33# happyReduction_165+happyReduction_165 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenBrace happy_var_1) -> +	case happyOut33 happy_x_2 of { happy_var_2 -> +	case happyOutTok happy_x_3 of { (TokSymbol SymCloseBrace happy_var_3) -> +	happyIn40+		 (HiddenArg (getRange (happy_var_1,happy_var_2,happy_var_3)) (maybeNamed happy_var_2)+	)}}}++happyReduce_166 = happySpecReduce_2  33# happyReduction_166+happyReduction_166 happy_x_2+	happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenBrace happy_var_1) -> +	case happyOutTok happy_x_2 of { (TokSymbol SymCloseBrace happy_var_2) -> +	happyIn40+		 (let r = fuseRange happy_var_1 happy_var_2 in HiddenArg r $ unnamed $ Absurd r+	)}}++happyReduce_167 = happySpecReduce_1  34# happyReduction_167+happyReduction_167 happy_x_1+	 =  case happyOut22 happy_x_1 of { happy_var_1 -> +	happyIn41+		 (Ident happy_var_1+	)}++happyReduce_168 = happySpecReduce_1  34# happyReduction_168+happyReduction_168 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokLiteral happy_var_1) -> +	happyIn41+		 (Lit happy_var_1+	)}++happyReduce_169 = happySpecReduce_1  34# happyReduction_169+happyReduction_169 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymQuestionMark happy_var_1) -> +	happyIn41+		 (QuestionMark (getRange happy_var_1) Nothing+	)}++happyReduce_170 = happySpecReduce_1  34# happyReduction_170+happyReduction_170 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymUnderscore happy_var_1) -> +	happyIn41+		 (Underscore (getRange happy_var_1) Nothing+	)}++happyReduce_171 = happySpecReduce_1  34# happyReduction_171+happyReduction_171 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwProp happy_var_1) -> +	happyIn41+		 (Prop (getRange happy_var_1)+	)}++happyReduce_172 = happySpecReduce_1  34# happyReduction_172+happyReduction_172 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwSet happy_var_1) -> +	happyIn41+		 (Set (getRange happy_var_1)+	)}++happyReduce_173 = happySpecReduce_1  34# happyReduction_173+happyReduction_173 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwQuote happy_var_1) -> +	happyIn41+		 (Quote (getRange happy_var_1)+	)}++happyReduce_174 = happySpecReduce_1  34# happyReduction_174+happyReduction_174 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwQuoteTerm happy_var_1) -> +	happyIn41+		 (QuoteTerm (getRange happy_var_1)+	)}++happyReduce_175 = happySpecReduce_1  34# happyReduction_175+happyReduction_175 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwUnquote happy_var_1) -> +	happyIn41+		 (Unquote (getRange happy_var_1)+	)}++happyReduce_176 = happySpecReduce_1  34# happyReduction_176+happyReduction_176 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSetN happy_var_1) -> +	happyIn41+		 (SetN (getRange (fst happy_var_1)) (snd happy_var_1)+	)}++happyReduce_177 = happySpecReduce_3  34# happyReduction_177+happyReduction_177 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymDoubleOpenBrace happy_var_1) -> +	case happyOut33 happy_x_2 of { happy_var_2 -> +	case happyOut18 happy_x_3 of { happy_var_3 -> +	happyIn41+		 (InstanceArg (getRange (happy_var_1,happy_var_2,happy_var_3))+                                                          (maybeNamed happy_var_2)+	)}}}++happyReduce_178 = happySpecReduce_3  34# happyReduction_178+happyReduction_178 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenParen happy_var_1) -> +	case happyOut33 happy_x_2 of { happy_var_2 -> +	case happyOutTok happy_x_3 of { (TokSymbol SymCloseParen happy_var_3) -> +	happyIn41+		 (Paren (getRange (happy_var_1,happy_var_2,happy_var_3)) happy_var_2+	)}}}++happyReduce_179 = happySpecReduce_2  34# happyReduction_179+happyReduction_179 happy_x_2+	happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenParen happy_var_1) -> +	case happyOutTok happy_x_2 of { (TokSymbol SymCloseParen happy_var_2) -> +	happyIn41+		 (Absurd (fuseRange happy_var_1 happy_var_2)+	)}}++happyReduce_180 = happySpecReduce_2  34# happyReduction_180+happyReduction_180 happy_x_2+	happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymDoubleOpenBrace happy_var_1) -> +	case happyOut18 happy_x_2 of { happy_var_2 -> +	happyIn41+		 (let r = fuseRange happy_var_1 happy_var_2 in InstanceArg r $ unnamed $ Absurd r+	)}}++happyReduce_181 = happySpecReduce_3  34# happyReduction_181+happyReduction_181 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut16 happy_x_1 of { happy_var_1 -> +	case happyOutTok happy_x_2 of { (TokSymbol SymAs happy_var_2) -> +	case happyOut42 happy_x_3 of { happy_var_3 -> +	happyIn41+		 (As (getRange (happy_var_1,happy_var_2,happy_var_3)) happy_var_1 happy_var_3+	)}}}++happyReduce_182 = happySpecReduce_2  34# happyReduction_182+happyReduction_182 happy_x_2+	happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymDot happy_var_1) -> +	case happyOut42 happy_x_2 of { happy_var_2 -> +	happyIn41+		 (Dot (fuseRange happy_var_1 happy_var_2) happy_var_2+	)}}++happyReduce_183 = happyReduce 4# 34# happyReduction_183+happyReduction_183 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokKeyword KwRecord happy_var_1) -> +	case happyOutTok happy_x_2 of { (TokSymbol SymOpenBrace happy_var_2) -> +	case happyOut43 happy_x_3 of { happy_var_3 -> +	case happyOutTok happy_x_4 of { (TokSymbol SymCloseBrace happy_var_4) -> +	happyIn41+		 (Rec (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4)) happy_var_3+	) `HappyStk` happyRest}}}}++happyReduce_184 = happyReduce 5# 34# happyReduction_184+happyReduction_184 (happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokKeyword KwRecord happy_var_1) -> +	case happyOut41 happy_x_2 of { happy_var_2 -> +	case happyOutTok happy_x_3 of { (TokSymbol SymOpenBrace happy_var_3) -> +	case happyOut43 happy_x_4 of { happy_var_4 -> +	case happyOutTok happy_x_5 of { (TokSymbol SymCloseBrace happy_var_5) -> +	happyIn41+		 (RecUpdate (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5)) happy_var_2 happy_var_4+	) `HappyStk` happyRest}}}}}++happyReduce_185 = happySpecReduce_1  35# happyReduction_185+happyReduction_185 happy_x_1+	 =  case happyOut40 happy_x_1 of { happy_var_1 -> +	happyIn42+		 (happy_var_1+	)}++happyReduce_186 = happySpecReduce_1  35# happyReduction_186+happyReduction_186 happy_x_1+	 =  case happyOut41 happy_x_1 of { happy_var_1 -> +	happyIn42+		 (happy_var_1+	)}++happyReduce_187 = happySpecReduce_0  36# happyReduction_187+happyReduction_187  =  happyIn43+		 ([]+	)++happyReduce_188 = happySpecReduce_1  36# happyReduction_188+happyReduction_188 happy_x_1+	 =  case happyOut44 happy_x_1 of { happy_var_1 -> +	happyIn43+		 (happy_var_1+	)}++happyReduce_189 = happySpecReduce_1  37# happyReduction_189+happyReduction_189 happy_x_1+	 =  case happyOut45 happy_x_1 of { happy_var_1 -> +	happyIn44+		 ([happy_var_1]+	)}++happyReduce_190 = happySpecReduce_3  37# happyReduction_190+happyReduction_190 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut45 happy_x_1 of { happy_var_1 -> +	case happyOut44 happy_x_3 of { happy_var_3 -> +	happyIn44+		 (happy_var_1 : happy_var_3+	)}}++happyReduce_191 = happySpecReduce_3  38# happyReduction_191+happyReduction_191 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut16 happy_x_1 of { happy_var_1 -> +	case happyOut33 happy_x_3 of { happy_var_3 -> +	happyIn45+		 ((happy_var_1, happy_var_3)+	)}}++happyReduce_192 = happySpecReduce_2  39# happyReduction_192+happyReduction_192 happy_x_2+	happy_x_1+	 =  case happyOut47 happy_x_1 of { happy_var_1 -> +	happyIn46+		 (happy_var_1+	)}++happyReduce_193 = happySpecReduce_1  40# happyReduction_193+happyReduction_193 happy_x_1+	 =  case happyOut48 happy_x_1 of { happy_var_1 -> +	happyIn47+		 ({-TeleBind-} happy_var_1+	)}++happyReduce_194 = happySpecReduce_2  41# happyReduction_194+happyReduction_194 happy_x_2+	happy_x_1+	 =  case happyOut49 happy_x_1 of { happy_var_1 -> +	case happyOut48 happy_x_2 of { happy_var_2 -> +	happyIn48+		 (happy_var_1 : happy_var_2+	)}}++happyReduce_195 = happySpecReduce_1  41# happyReduction_195+happyReduction_195 happy_x_1+	 =  case happyOut49 happy_x_1 of { happy_var_1 -> +	happyIn48+		 ([happy_var_1]+	)}++happyReduce_196 = happyReduce 4# 42# happyReduction_196+happyReduction_196 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_2 of { (TokSymbol SymOpenParen happy_var_2) -> +	case happyOut51 happy_x_3 of { happy_var_3 -> +	case happyOutTok happy_x_4 of { (TokSymbol SymCloseParen happy_var_4) -> +	happyIn49+		 (setRange (getRange (happy_var_2,happy_var_3,happy_var_4)) $+                             setRelevance Irrelevant happy_var_3+	) `HappyStk` happyRest}}}++happyReduce_197 = happyReduce 4# 42# happyReduction_197+happyReduction_197 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_2 of { (TokSymbol SymOpenBrace happy_var_2) -> +	case happyOut50 happy_x_3 of { happy_var_3 -> +	case happyOutTok happy_x_4 of { (TokSymbol SymCloseBrace happy_var_4) -> +	happyIn49+		 (setRange (getRange (happy_var_2,happy_var_3,happy_var_4)) $+                             setHiding Hidden $+                             setRelevance Irrelevant happy_var_3+	) `HappyStk` happyRest}}}++happyReduce_198 = happyReduce 4# 42# happyReduction_198+happyReduction_198 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_2 of { (TokSymbol SymDoubleOpenBrace happy_var_2) -> +	case happyOut50 happy_x_3 of { happy_var_3 -> +	case happyOut18 happy_x_4 of { happy_var_4 -> +	happyIn49+		 (setRange (getRange (happy_var_2,happy_var_3,happy_var_4)) $+                             setHiding Instance $+                             setRelevance Irrelevant happy_var_3+	) `HappyStk` happyRest}}}++happyReduce_199 = happyReduce 4# 42# happyReduction_199+happyReduction_199 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_2 of { (TokSymbol SymOpenParen happy_var_2) -> +	case happyOut51 happy_x_3 of { happy_var_3 -> +	case happyOutTok happy_x_4 of { (TokSymbol SymCloseParen happy_var_4) -> +	happyIn49+		 (setRange (getRange (happy_var_2,happy_var_3,happy_var_4)) $+                             setRelevance NonStrict happy_var_3+	) `HappyStk` happyRest}}}++happyReduce_200 = happyReduce 4# 42# happyReduction_200+happyReduction_200 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_2 of { (TokSymbol SymOpenBrace happy_var_2) -> +	case happyOut50 happy_x_3 of { happy_var_3 -> +	case happyOutTok happy_x_4 of { (TokSymbol SymCloseBrace happy_var_4) -> +	happyIn49+		 (setRange (getRange (happy_var_2,happy_var_3,happy_var_4)) $+                             setHiding Hidden $+                             setRelevance NonStrict happy_var_3+	) `HappyStk` happyRest}}}++happyReduce_201 = happyReduce 4# 42# happyReduction_201+happyReduction_201 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_2 of { (TokSymbol SymDoubleOpenBrace happy_var_2) -> +	case happyOut50 happy_x_3 of { happy_var_3 -> +	case happyOut18 happy_x_4 of { happy_var_4 -> +	happyIn49+		 (setRange (getRange (happy_var_2,happy_var_3,happy_var_4)) $+                             setHiding Instance $+                             setRelevance NonStrict happy_var_3+	) `HappyStk` happyRest}}}++happyReduce_202 = happySpecReduce_3  42# happyReduction_202+happyReduction_202 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenParen happy_var_1) -> +	case happyOut51 happy_x_2 of { happy_var_2 -> +	case happyOutTok happy_x_3 of { (TokSymbol SymCloseParen happy_var_3) -> +	happyIn49+		 (setRange (getRange (happy_var_1,happy_var_2,happy_var_3)) happy_var_2+	)}}}++happyReduce_203 = happySpecReduce_3  42# happyReduction_203+happyReduction_203 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymDoubleOpenBrace happy_var_1) -> +	case happyOut50 happy_x_2 of { happy_var_2 -> +	case happyOut18 happy_x_3 of { happy_var_3 -> +	happyIn49+		 (setRange (getRange (happy_var_1,happy_var_2,happy_var_3)) $+                             setHiding Instance happy_var_2+	)}}}++happyReduce_204 = happySpecReduce_3  42# happyReduction_204+happyReduction_204 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenBrace happy_var_1) -> +	case happyOut50 happy_x_2 of { happy_var_2 -> +	case happyOutTok happy_x_3 of { (TokSymbol SymCloseBrace happy_var_3) -> +	happyIn49+		 (setRange (getRange (happy_var_1,happy_var_2,happy_var_3)) $+                             setHiding Hidden happy_var_2+	)}}}++happyReduce_205 = happySpecReduce_3  42# happyReduction_205+happyReduction_205 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenParen happy_var_1) -> +	case happyOut110 happy_x_2 of { happy_var_2 -> +	case happyOutTok happy_x_3 of { (TokSymbol SymCloseParen happy_var_3) -> +	happyIn49+		 (tLet (getRange (happy_var_1,happy_var_3)) happy_var_2+	)}}}++happyReduce_206 = happyReduce 4# 42# happyReduction_206+happyReduction_206 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenParen happy_var_1) -> +	case happyOut143 happy_x_3 of { happy_var_3 -> +	case happyOutTok happy_x_4 of { (TokSymbol SymCloseParen happy_var_4) -> +	happyIn49+		 (tLet (getRange (happy_var_1,happy_var_4)) happy_var_3+	) `HappyStk` happyRest}}}++happyReduce_207 = happySpecReduce_3  43# happyReduction_207+happyReduction_207 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut26 happy_x_1 of { happy_var_1 -> +	case happyOutTok happy_x_2 of { (TokSymbol SymColon happy_var_2) -> +	case happyOut33 happy_x_3 of { happy_var_3 -> +	happyIn50+		 (let r = getRange (happy_var_1,happy_var_2,happy_var_3) -- the range is approximate only for TypedBindings+    in TypedBindings r $ defaultArg $ TBind r (map (pure . mkBoundName_) happy_var_1) happy_var_3+	)}}}++happyReduce_208 = happySpecReduce_3  44# happyReduction_208+happyReduction_208 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut28 happy_x_1 of { happy_var_1 -> +	case happyOutTok happy_x_2 of { (TokSymbol SymColon happy_var_2) -> +	case happyOut33 happy_x_3 of { happy_var_3 -> +	happyIn51+		 (let r = getRange (happy_var_1,happy_var_2,happy_var_3) -- the range is approximate only for TypedBindings+    in TypedBindings r $ defaultArg $ TBind r (map (fmap mkBoundName_) happy_var_1) happy_var_3+	)}}}++happyReduce_209 = happyMonadReduce 2# 45# happyReduction_209+happyReduction_209 (happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest) tk+	 = happyThen (case happyOut54 happy_x_1 of { happy_var_1 -> +	(+      case reverse happy_var_1 of+        Left _ : _ -> parseError "Absurd lambda cannot have a body."+        _ : _      -> return [ b | Right b <- happy_var_1 ]+        []         -> parsePanic "Empty LamBinds")}+	) (\r -> happyReturn (happyIn52 r))++happyReduce_210 = happyMonadReduce 1# 46# happyReduction_210+happyReduction_210 (happy_x_1 `HappyStk`+	happyRest) tk+	 = happyThen (case happyOut55 happy_x_1 of { happy_var_1 -> +	(+    case happy_var_1 of+      Left lb -> case reverse lb of+                   Right _ : _ -> parseError "Missing body for lambda"+                   Left h  : _ -> return $ Left ([ b | Right b <- init lb], h)+                   _           -> parseError "Unsupported variant of lambda"+      Right es -> return $ Right es)}+	) (\r -> happyReturn (happyIn53 r))++happyReduce_211 = happySpecReduce_2  47# happyReduction_211+happyReduction_211 happy_x_2+	happy_x_1+	 =  case happyOut63 happy_x_1 of { happy_var_1 -> +	case happyOut54 happy_x_2 of { happy_var_2 -> +	happyIn54+		 (map Right happy_var_1 ++ happy_var_2+	)}}++happyReduce_212 = happySpecReduce_2  47# happyReduction_212+happyReduction_212 happy_x_2+	happy_x_1+	 =  case happyOut49 happy_x_1 of { happy_var_1 -> +	case happyOut54 happy_x_2 of { happy_var_2 -> +	happyIn54+		 (Right (DomainFull happy_var_1) : happy_var_2+	)}}++happyReduce_213 = happySpecReduce_1  47# happyReduction_213+happyReduction_213 happy_x_1+	 =  case happyOut63 happy_x_1 of { happy_var_1 -> +	happyIn54+		 (map Right happy_var_1+	)}++happyReduce_214 = happySpecReduce_1  47# happyReduction_214+happyReduction_214 happy_x_1+	 =  case happyOut49 happy_x_1 of { happy_var_1 -> +	happyIn54+		 ([Right $ DomainFull happy_var_1]+	)}++happyReduce_215 = happySpecReduce_2  47# happyReduction_215+happyReduction_215 happy_x_2+	happy_x_1+	 =  happyIn54+		 ([Left NotHidden]+	)++happyReduce_216 = happySpecReduce_2  47# happyReduction_216+happyReduction_216 happy_x_2+	happy_x_1+	 =  happyIn54+		 ([Left Hidden]+	)++happyReduce_217 = happySpecReduce_2  47# happyReduction_217+happyReduction_217 happy_x_2+	happy_x_1+	 =  happyIn54+		 ([Left Instance]+	)++happyReduce_218 = happySpecReduce_2  48# happyReduction_218+happyReduction_218 happy_x_2+	happy_x_1+	 =  case happyOut63 happy_x_1 of { happy_var_1 -> +	case happyOut54 happy_x_2 of { happy_var_2 -> +	happyIn55+		 (Left $ map Right happy_var_1 ++ happy_var_2+	)}}++happyReduce_219 = happySpecReduce_2  48# happyReduction_219+happyReduction_219 happy_x_2+	happy_x_1+	 =  case happyOut49 happy_x_1 of { happy_var_1 -> +	case happyOut54 happy_x_2 of { happy_var_2 -> +	happyIn55+		 (Left $ Right (DomainFull happy_var_1) : happy_var_2+	)}}++happyReduce_220 = happySpecReduce_1  48# happyReduction_220+happyReduction_220 happy_x_1+	 =  case happyOut64 happy_x_1 of { happy_var_1 -> +	happyIn55+		 (case happy_var_1 of+                                    Left lb -> Left $ map Right lb+                                    Right es -> Right es+	)}++happyReduce_221 = happySpecReduce_1  48# happyReduction_221+happyReduction_221 happy_x_1+	 =  case happyOut49 happy_x_1 of { happy_var_1 -> +	happyIn55+		 (Left [Right $ DomainFull happy_var_1]+	)}++happyReduce_222 = happySpecReduce_2  48# happyReduction_222+happyReduction_222 happy_x_2+	happy_x_1+	 =  happyIn55+		 (Left [Left NotHidden]+	)++happyReduce_223 = happySpecReduce_2  48# happyReduction_223+happyReduction_223 happy_x_2+	happy_x_1+	 =  happyIn55+		 (Left [Left Hidden]+	)++happyReduce_224 = happySpecReduce_2  48# happyReduction_224+happyReduction_224 happy_x_2+	happy_x_1+	 =  happyIn55+		 (Left [Left Instance]+	)++happyReduce_225 = happyMonadReduce 3# 49# happyReduction_225+happyReduction_225 (happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest) tk+	 = happyThen (case happyOut39 happy_x_1 of { happy_var_1 -> +	case happyOut33 happy_x_3 of { happy_var_3 -> +	( do+      p <- exprToLHS (RawApp (getRange happy_var_1) happy_var_1) ;+      return (p [] [], RHS happy_var_3, NoWhere))}}+	) (\r -> happyReturn (happyIn56 r))++happyReduce_226 = happyMonadReduce 1# 50# happyReduction_226+happyReduction_226 (happy_x_1 `HappyStk`+	happyRest) tk+	 = happyThen (case happyOut36 happy_x_1 of { happy_var_1 -> +	( do+      p <- exprToLHS (RawApp (getRange happy_var_1) happy_var_1);+      return (p [] [], AbsurdRHS, NoWhere))}+	) (\r -> happyReturn (happyIn57 r))++happyReduce_227 = happySpecReduce_1  51# happyReduction_227+happyReduction_227 happy_x_1+	 =  case happyOut56 happy_x_1 of { happy_var_1 -> +	happyIn58+		 (happy_var_1+	)}++happyReduce_228 = happySpecReduce_1  51# happyReduction_228+happyReduction_228 happy_x_1+	 =  case happyOut57 happy_x_1 of { happy_var_1 -> +	happyIn58+		 (happy_var_1+	)}++happyReduce_229 = happySpecReduce_3  52# happyReduction_229+happyReduction_229 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut59 happy_x_1 of { happy_var_1 -> +	case happyOut58 happy_x_3 of { happy_var_3 -> +	happyIn59+		 (happy_var_3 : happy_var_1+	)}}++happyReduce_230 = happySpecReduce_3  52# happyReduction_230+happyReduction_230 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut57 happy_x_1 of { happy_var_1 -> +	case happyOut58 happy_x_3 of { happy_var_3 -> +	happyIn59+		 ([happy_var_3, happy_var_1]+	)}}++happyReduce_231 = happySpecReduce_1  52# happyReduction_231+happyReduction_231 happy_x_1+	 =  case happyOut56 happy_x_1 of { happy_var_1 -> +	happyIn59+		 ([happy_var_1]+	)}++happyReduce_232 = happySpecReduce_2  53# happyReduction_232+happyReduction_232 happy_x_2+	happy_x_1+	 =  case happyOut61 happy_x_1 of { happy_var_1 -> +	happyIn60+		 (happy_var_1+	)}++happyReduce_233 = happySpecReduce_2  54# happyReduction_233+happyReduction_233 happy_x_2+	happy_x_1+	 =  case happyOut63 happy_x_1 of { happy_var_1 -> +	case happyOut61 happy_x_2 of { happy_var_2 -> +	happyIn61+		 (happy_var_1 ++ happy_var_2+	)}}++happyReduce_234 = happySpecReduce_2  54# happyReduction_234+happyReduction_234 happy_x_2+	happy_x_1+	 =  case happyOut49 happy_x_1 of { happy_var_1 -> +	case happyOut61 happy_x_2 of { happy_var_2 -> +	happyIn61+		 (DomainFull happy_var_1 : happy_var_2+	)}}++happyReduce_235 = happySpecReduce_1  54# happyReduction_235+happyReduction_235 happy_x_1+	 =  case happyOut63 happy_x_1 of { happy_var_1 -> +	happyIn61+		 (happy_var_1+	)}++happyReduce_236 = happySpecReduce_1  54# happyReduction_236+happyReduction_236 happy_x_1+	 =  case happyOut49 happy_x_1 of { happy_var_1 -> +	happyIn61+		 ([DomainFull happy_var_1]+	)}++happyReduce_237 = happySpecReduce_2  55# happyReduction_237+happyReduction_237 happy_x_2+	happy_x_1+	 =  case happyOut63 happy_x_1 of { happy_var_1 -> +	case happyOut62 happy_x_2 of { happy_var_2 -> +	happyIn62+		 (happy_var_1 ++ happy_var_2+	)}}++happyReduce_238 = happySpecReduce_2  55# happyReduction_238+happyReduction_238 happy_x_2+	happy_x_1+	 =  case happyOut49 happy_x_1 of { happy_var_1 -> +	case happyOut62 happy_x_2 of { happy_var_2 -> +	happyIn62+		 (DomainFull happy_var_1 : happy_var_2+	)}}++happyReduce_239 = happySpecReduce_0  55# happyReduction_239+happyReduction_239  =  happyIn62+		 ([]+	)++happyReduce_240 = happySpecReduce_1  56# happyReduction_240+happyReduction_240 happy_x_1+	 =  case happyOut64 happy_x_1 of { happy_var_1 -> +	happyIn63+		 (case happy_var_1 of+                             Left lbs -> lbs+                             Right _ -> fail "expected sequence of bound identifiers, not absurd pattern"+	)}++happyReduce_241 = happySpecReduce_1  57# happyReduction_241+happyReduction_241 happy_x_1+	 =  case happyOut24 happy_x_1 of { happy_var_1 -> +	happyIn64+		 (Left [DomainFree defaultArgInfo $ mkBoundName_ happy_var_1]+	)}++happyReduce_242 = happySpecReduce_2  57# happyReduction_242+happyReduction_242 happy_x_2+	happy_x_1+	 =  case happyOut24 happy_x_2 of { happy_var_2 -> +	happyIn64+		 (Left [DomainFree (setRelevance Irrelevant $ defaultArgInfo) $ mkBoundName_ happy_var_2]+	)}++happyReduce_243 = happySpecReduce_2  57# happyReduction_243+happyReduction_243 happy_x_2+	happy_x_1+	 =  case happyOut24 happy_x_2 of { happy_var_2 -> +	happyIn64+		 (Left [DomainFree (setRelevance NonStrict $ defaultArgInfo) $ mkBoundName_ happy_var_2]+	)}++happyReduce_244 = happySpecReduce_3  57# happyReduction_244+happyReduction_244 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut27 happy_x_2 of { happy_var_2 -> +	happyIn64+		 (either (Left . map (DomainFree (setHiding Hidden $ defaultArgInfo) . mkBoundName_)) Right happy_var_2+	)}++happyReduce_245 = happySpecReduce_3  57# happyReduction_245+happyReduction_245 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut26 happy_x_2 of { happy_var_2 -> +	happyIn64+		 (Left $ map (DomainFree (setHiding Instance $ defaultArgInfo) . mkBoundName_) happy_var_2+	)}++happyReduce_246 = happyReduce 4# 57# happyReduction_246+happyReduction_246 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut26 happy_x_3 of { happy_var_3 -> +	happyIn64+		 (Left $ map (DomainFree (setHiding Hidden $ setRelevance Irrelevant $ defaultArgInfo) . mkBoundName_) happy_var_3+	) `HappyStk` happyRest}++happyReduce_247 = happyReduce 4# 57# happyReduction_247+happyReduction_247 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut26 happy_x_3 of { happy_var_3 -> +	happyIn64+		 (Left $ map (DomainFree (setHiding Instance $ setRelevance Irrelevant $ defaultArgInfo) . mkBoundName_) happy_var_3+	) `HappyStk` happyRest}++happyReduce_248 = happyReduce 4# 57# happyReduction_248+happyReduction_248 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut26 happy_x_3 of { happy_var_3 -> +	happyIn64+		 (Left $ map (DomainFree (setHiding Hidden $ setRelevance NonStrict $ defaultArgInfo) . mkBoundName_) happy_var_3+	) `HappyStk` happyRest}++happyReduce_249 = happyReduce 4# 57# happyReduction_249+happyReduction_249 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut26 happy_x_3 of { happy_var_3 -> +	happyIn64+		 (Left $ map (DomainFree  (setHiding Instance $ setRelevance NonStrict $ defaultArgInfo) . mkBoundName_) happy_var_3+	) `HappyStk` happyRest}++happyReduce_250 = happyMonadReduce 1# 58# happyReduction_250+happyReduction_250 (happy_x_1 `HappyStk`+	happyRest) tk+	 = happyThen (case happyOut66 happy_x_1 of { happy_var_1 -> +	( mergeImportDirectives happy_var_1)}+	) (\r -> happyReturn (happyIn65 r))++happyReduce_251 = happySpecReduce_2  59# happyReduction_251+happyReduction_251 happy_x_2+	happy_x_1+	 =  case happyOut67 happy_x_1 of { happy_var_1 -> +	case happyOut66 happy_x_2 of { happy_var_2 -> +	happyIn66+		 (happy_var_1 : happy_var_2+	)}}++happyReduce_252 = happySpecReduce_0  59# happyReduction_252+happyReduction_252  =  happyIn66+		 ([]+	)++happyReduce_253 = happySpecReduce_1  60# happyReduction_253+happyReduction_253 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwPublic happy_var_1) -> +	happyIn67+		 (defaultImportDir { importDirRange = getRange happy_var_1, publicOpen = True }+	)}++happyReduce_254 = happySpecReduce_1  60# happyReduction_254+happyReduction_254 happy_x_1+	 =  case happyOut68 happy_x_1 of { happy_var_1 -> +	happyIn67+		 (defaultImportDir { importDirRange = snd happy_var_1, usingOrHiding = fst happy_var_1 }+	)}++happyReduce_255 = happySpecReduce_1  60# happyReduction_255+happyReduction_255 happy_x_1+	 =  case happyOut69 happy_x_1 of { happy_var_1 -> +	happyIn67+		 (defaultImportDir { importDirRange = snd happy_var_1, renaming = fst happy_var_1 }+	)}++happyReduce_256 = happyReduce 4# 61# happyReduction_256+happyReduction_256 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokKeyword KwUsing happy_var_1) -> +	case happyOutTok happy_x_2 of { (TokSymbol SymOpenParen happy_var_2) -> +	case happyOut74 happy_x_3 of { happy_var_3 -> +	case happyOutTok happy_x_4 of { (TokSymbol SymCloseParen happy_var_4) -> +	happyIn68+		 ((Using happy_var_3 , getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4))+	) `HappyStk` happyRest}}}}++happyReduce_257 = happyReduce 4# 61# happyReduction_257+happyReduction_257 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokKeyword KwHiding happy_var_1) -> +	case happyOutTok happy_x_2 of { (TokSymbol SymOpenParen happy_var_2) -> +	case happyOut74 happy_x_3 of { happy_var_3 -> +	case happyOutTok happy_x_4 of { (TokSymbol SymCloseParen happy_var_4) -> +	happyIn68+		 ((Hiding happy_var_3 , getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4))+	) `HappyStk` happyRest}}}}++happyReduce_258 = happyReduce 4# 62# happyReduction_258+happyReduction_258 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokKeyword KwRenaming happy_var_1) -> +	case happyOutTok happy_x_2 of { (TokSymbol SymOpenParen happy_var_2) -> +	case happyOut70 happy_x_3 of { happy_var_3 -> +	case happyOutTok happy_x_4 of { (TokSymbol SymCloseParen happy_var_4) -> +	happyIn69+		 ((happy_var_3 , getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4))+	) `HappyStk` happyRest}}}}++happyReduce_259 = happySpecReduce_3  62# happyReduction_259+happyReduction_259 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwRenaming happy_var_1) -> +	case happyOutTok happy_x_2 of { (TokSymbol SymOpenParen happy_var_2) -> +	case happyOutTok happy_x_3 of { (TokSymbol SymCloseParen happy_var_3) -> +	happyIn69+		 (([] , getRange (happy_var_1,happy_var_2,happy_var_3))+	)}}}++happyReduce_260 = happySpecReduce_3  63# happyReduction_260+happyReduction_260 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut71 happy_x_1 of { happy_var_1 -> +	case happyOut70 happy_x_3 of { happy_var_3 -> +	happyIn70+		 (happy_var_1 : happy_var_3+	)}}++happyReduce_261 = happySpecReduce_1  63# happyReduction_261+happyReduction_261 happy_x_1+	 =  case happyOut71 happy_x_1 of { happy_var_1 -> +	happyIn70+		 ([happy_var_1]+	)}++happyReduce_262 = happySpecReduce_3  64# happyReduction_262+happyReduction_262 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut72 happy_x_1 of { happy_var_1 -> +	case happyOutTok happy_x_2 of { (TokKeyword KwTo happy_var_2) -> +	case happyOut16 happy_x_3 of { happy_var_3 -> +	happyIn71+		 (Renaming happy_var_1 happy_var_3 (getRange happy_var_2)+	)}}}++happyReduce_263 = happySpecReduce_2  65# happyReduction_263+happyReduction_263 happy_x_2+	happy_x_1+	 =  case happyOut16 happy_x_2 of { happy_var_2 -> +	happyIn72+		 (ImportedName happy_var_2+	)}++happyReduce_264 = happySpecReduce_3  65# happyReduction_264+happyReduction_264 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut16 happy_x_3 of { happy_var_3 -> +	happyIn72+		 (ImportedModule happy_var_3+	)}++happyReduce_265 = happySpecReduce_1  66# happyReduction_265+happyReduction_265 happy_x_1+	 =  case happyOut16 happy_x_1 of { happy_var_1 -> +	happyIn73+		 (ImportedName happy_var_1+	)}++happyReduce_266 = happySpecReduce_2  66# happyReduction_266+happyReduction_266 happy_x_2+	happy_x_1+	 =  case happyOut16 happy_x_2 of { happy_var_2 -> +	happyIn73+		 (ImportedModule happy_var_2+	)}++happyReduce_267 = happySpecReduce_0  67# happyReduction_267+happyReduction_267  =  happyIn74+		 ([]+	)++happyReduce_268 = happySpecReduce_1  67# happyReduction_268+happyReduction_268 happy_x_1+	 =  case happyOut75 happy_x_1 of { happy_var_1 -> +	happyIn74+		 (happy_var_1+	)}++happyReduce_269 = happySpecReduce_1  68# happyReduction_269+happyReduction_269 happy_x_1+	 =  case happyOut73 happy_x_1 of { happy_var_1 -> +	happyIn75+		 ([happy_var_1]+	)}++happyReduce_270 = happySpecReduce_3  68# happyReduction_270+happyReduction_270 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut73 happy_x_1 of { happy_var_1 -> +	case happyOut75 happy_x_3 of { happy_var_3 -> +	happyIn75+		 (happy_var_1 : happy_var_3+	)}}++happyReduce_271 = happyMonadReduce 3# 69# happyReduction_271+happyReduction_271 (happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest) tk+	 = happyThen (case happyOut34 happy_x_1 of { happy_var_1 -> +	case happyOut79 happy_x_2 of { happy_var_2 -> +	case happyOut78 happy_x_3 of { happy_var_3 -> +	( exprToLHS happy_var_1 >>= \p -> return (p happy_var_2 happy_var_3))}}}+	) (\r -> happyReturn (happyIn76 r))++happyReduce_272 = happyReduce 4# 69# happyReduction_272+happyReduction_272 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokSymbol SymEllipsis happy_var_1) -> +	case happyOut77 happy_x_2 of { happy_var_2 -> +	case happyOut79 happy_x_3 of { happy_var_3 -> +	case happyOut78 happy_x_4 of { happy_var_4 -> +	happyIn76+		 (Ellipsis (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4)) happy_var_2 happy_var_3 happy_var_4+	) `HappyStk` happyRest}}}}++happyReduce_273 = happySpecReduce_0  70# happyReduction_273+happyReduction_273  =  happyIn77+		 ([]+	)++happyReduce_274 = happyMonadReduce 3# 70# happyReduction_274+happyReduction_274 (happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest) tk+	 = happyThen (case happyOut39 happy_x_2 of { happy_var_2 -> +	case happyOut77 happy_x_3 of { happy_var_3 -> +	( exprToPattern (RawApp (getRange happy_var_2) happy_var_2) >>= \p ->+                   return (p : happy_var_3))}}+	) (\r -> happyReturn (happyIn77 r))++happyReduce_275 = happySpecReduce_0  71# happyReduction_275+happyReduction_275  =  happyIn78+		 ([]+	)++happyReduce_276 = happySpecReduce_2  71# happyReduction_276+happyReduction_276 happy_x_2+	happy_x_1+	 =  case happyOut33 happy_x_2 of { happy_var_2 -> +	happyIn78+		 (case happy_var_2 of { WithApp _ e es -> e : es; e -> [e] }+	)}++happyReduce_277 = happySpecReduce_0  72# happyReduction_277+happyReduction_277  =  happyIn79+		 ([]+	)++happyReduce_278 = happySpecReduce_2  72# happyReduction_278+happyReduction_278 happy_x_2+	happy_x_1+	 =  case happyOut34 happy_x_2 of { happy_var_2 -> +	happyIn79+		 (case happy_var_2 of { WithApp _ e es -> e : es; e -> [e] }+	)}++happyReduce_279 = happySpecReduce_0  73# happyReduction_279+happyReduction_279  =  happyIn80+		 (NoWhere+	)++happyReduce_280 = happySpecReduce_2  73# happyReduction_280+happyReduction_280 happy_x_2+	happy_x_1+	 =  case happyOut144 happy_x_2 of { happy_var_2 -> +	happyIn80+		 (AnyWhere happy_var_2+	)}++happyReduce_281 = happyReduce 4# 73# happyReduction_281+happyReduction_281 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut16 happy_x_2 of { happy_var_2 -> +	case happyOut144 happy_x_4 of { happy_var_4 -> +	happyIn80+		 (SomeWhere happy_var_2 happy_var_4+	) `HappyStk` happyRest}}++happyReduce_282 = happyReduce 4# 73# happyReduction_282+happyReduction_282 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut115 happy_x_2 of { happy_var_2 -> +	case happyOut144 happy_x_4 of { happy_var_4 -> +	happyIn80+		 (SomeWhere happy_var_2 happy_var_4+	) `HappyStk` happyRest}}++happyReduce_283 = happySpecReduce_1  74# happyReduction_283+happyReduction_283 happy_x_1+	 =  case happyOut92 happy_x_1 of { happy_var_1 -> +	happyIn81+		 (happy_var_1+	)}++happyReduce_284 = happySpecReduce_1  74# happyReduction_284+happyReduction_284 happy_x_1+	 =  case happyOut84 happy_x_1 of { happy_var_1 -> +	happyIn81+		 (happy_var_1+	)}++happyReduce_285 = happySpecReduce_1  74# happyReduction_285+happyReduction_285 happy_x_1+	 =  case happyOut86 happy_x_1 of { happy_var_1 -> +	happyIn81+		 ([happy_var_1]+	)}++happyReduce_286 = happySpecReduce_1  74# happyReduction_286+happyReduction_286 happy_x_1+	 =  case happyOut87 happy_x_1 of { happy_var_1 -> +	happyIn81+		 ([happy_var_1]+	)}++happyReduce_287 = happySpecReduce_1  74# happyReduction_287+happyReduction_287 happy_x_1+	 =  case happyOut88 happy_x_1 of { happy_var_1 -> +	happyIn81+		 ([happy_var_1]+	)}++happyReduce_288 = happySpecReduce_1  74# happyReduction_288+happyReduction_288 happy_x_1+	 =  case happyOut89 happy_x_1 of { happy_var_1 -> +	happyIn81+		 ([happy_var_1]+	)}++happyReduce_289 = happySpecReduce_1  74# happyReduction_289+happyReduction_289 happy_x_1+	 =  case happyOut91 happy_x_1 of { happy_var_1 -> +	happyIn81+		 ([happy_var_1]+	)}++happyReduce_290 = happySpecReduce_1  74# happyReduction_290+happyReduction_290 happy_x_1+	 =  case happyOut93 happy_x_1 of { happy_var_1 -> +	happyIn81+		 ([happy_var_1]+	)}++happyReduce_291 = happySpecReduce_1  74# happyReduction_291+happyReduction_291 happy_x_1+	 =  case happyOut94 happy_x_1 of { happy_var_1 -> +	happyIn81+		 ([happy_var_1]+	)}++happyReduce_292 = happySpecReduce_1  74# happyReduction_292+happyReduction_292 happy_x_1+	 =  case happyOut95 happy_x_1 of { happy_var_1 -> +	happyIn81+		 ([happy_var_1]+	)}++happyReduce_293 = happySpecReduce_1  74# happyReduction_293+happyReduction_293 happy_x_1+	 =  case happyOut96 happy_x_1 of { happy_var_1 -> +	happyIn81+		 ([happy_var_1]+	)}++happyReduce_294 = happySpecReduce_1  74# happyReduction_294+happyReduction_294 happy_x_1+	 =  case happyOut97 happy_x_1 of { happy_var_1 -> +	happyIn81+		 ([happy_var_1]+	)}++happyReduce_295 = happySpecReduce_1  74# happyReduction_295+happyReduction_295 happy_x_1+	 =  case happyOut98 happy_x_1 of { happy_var_1 -> +	happyIn81+		 ([happy_var_1]+	)}++happyReduce_296 = happySpecReduce_1  74# happyReduction_296+happyReduction_296 happy_x_1+	 =  case happyOut110 happy_x_1 of { happy_var_1 -> +	happyIn81+		 (happy_var_1+	)}++happyReduce_297 = happySpecReduce_1  74# happyReduction_297+happyReduction_297 happy_x_1+	 =  case happyOut113 happy_x_1 of { happy_var_1 -> +	happyIn81+		 ([happy_var_1]+	)}++happyReduce_298 = happySpecReduce_1  74# happyReduction_298+happyReduction_298 happy_x_1+	 =  case happyOut114 happy_x_1 of { happy_var_1 -> +	happyIn81+		 ([happy_var_1]+	)}++happyReduce_299 = happySpecReduce_1  74# happyReduction_299+happyReduction_299 happy_x_1+	 =  case happyOut117 happy_x_1 of { happy_var_1 -> +	happyIn81+		 ([happy_var_1]+	)}++happyReduce_300 = happySpecReduce_1  74# happyReduction_300+happyReduction_300 happy_x_1+	 =  case happyOut100 happy_x_1 of { happy_var_1 -> +	happyIn81+		 ([happy_var_1]+	)}++happyReduce_301 = happySpecReduce_1  74# happyReduction_301+happyReduction_301 happy_x_1+	 =  case happyOut101 happy_x_1 of { happy_var_1 -> +	happyIn81+		 ([happy_var_1]+	)}++happyReduce_302 = happySpecReduce_1  74# happyReduction_302+happyReduction_302 happy_x_1+	 =  case happyOut99 happy_x_1 of { happy_var_1 -> +	happyIn81+		 ([happy_var_1]+	)}++happyReduce_303 = happySpecReduce_3  75# happyReduction_303+happyReduction_303 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut17 happy_x_1 of { happy_var_1 -> +	case happyOut33 happy_x_3 of { happy_var_3 -> +	happyIn82+		 (map (\ x -> TypeSig defaultArgInfo x happy_var_3) happy_var_1+	)}}++happyReduce_304 = happySpecReduce_3  76# happyReduction_304+happyReduction_304 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut21 happy_x_1 of { happy_var_1 -> +	case happyOut33 happy_x_3 of { happy_var_3 -> +	happyIn83+		 (map (fmap (\ x -> TypeSig defaultArgInfo x happy_var_3)) happy_var_1+	)}}++happyReduce_305 = happyMonadReduce 3# 77# happyReduction_305+happyReduction_305 (happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest) tk+	 = happyThen (case happyOut76 happy_x_1 of { happy_var_1 -> +	case happyOut85 happy_x_2 of { happy_var_2 -> +	case happyOut80 happy_x_3 of { happy_var_3 -> +	( funClauseOrTypeSigs happy_var_1 happy_var_2 happy_var_3)}}}+	) (\r -> happyReturn (happyIn84 r))++happyReduce_306 = happySpecReduce_2  78# happyReduction_306+happyReduction_306 happy_x_2+	happy_x_1+	 =  case happyOut33 happy_x_2 of { happy_var_2 -> +	happyIn85+		 (JustRHS (RHS happy_var_2)+	)}++happyReduce_307 = happySpecReduce_2  78# happyReduction_307+happyReduction_307 happy_x_2+	happy_x_1+	 =  case happyOut33 happy_x_2 of { happy_var_2 -> +	happyIn85+		 (TypeSigsRHS happy_var_2+	)}++happyReduce_308 = happySpecReduce_0  78# happyReduction_308+happyReduction_308  =  happyIn85+		 (JustRHS AbsurdRHS+	)++happyReduce_309 = happyReduce 7# 79# happyReduction_309+happyReduction_309 (happy_x_7 `HappyStk`+	happy_x_6 `HappyStk`+	happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokKeyword KwData happy_var_1) -> +	case happyOut16 happy_x_2 of { happy_var_2 -> +	case happyOut62 happy_x_3 of { happy_var_3 -> +	case happyOutTok happy_x_4 of { (TokSymbol SymColon happy_var_4) -> +	case happyOut33 happy_x_5 of { happy_var_5 -> +	case happyOutTok happy_x_6 of { (TokKeyword KwWhere happy_var_6) -> +	case happyOut140 happy_x_7 of { happy_var_7 -> +	happyIn86+		 (Data (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5,happy_var_6,happy_var_7)) Inductive happy_var_2 happy_var_3 (Just happy_var_5) happy_var_7+	) `HappyStk` happyRest}}}}}}}++happyReduce_310 = happyReduce 7# 79# happyReduction_310+happyReduction_310 (happy_x_7 `HappyStk`+	happy_x_6 `HappyStk`+	happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokKeyword KwCoData happy_var_1) -> +	case happyOut16 happy_x_2 of { happy_var_2 -> +	case happyOut62 happy_x_3 of { happy_var_3 -> +	case happyOutTok happy_x_4 of { (TokSymbol SymColon happy_var_4) -> +	case happyOut33 happy_x_5 of { happy_var_5 -> +	case happyOutTok happy_x_6 of { (TokKeyword KwWhere happy_var_6) -> +	case happyOut140 happy_x_7 of { happy_var_7 -> +	happyIn86+		 (Data (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5,happy_var_6,happy_var_7)) CoInductive happy_var_2 happy_var_3 (Just happy_var_5) happy_var_7+	) `HappyStk` happyRest}}}}}}}++happyReduce_311 = happyReduce 5# 79# happyReduction_311+happyReduction_311 (happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokKeyword KwData happy_var_1) -> +	case happyOut16 happy_x_2 of { happy_var_2 -> +	case happyOut62 happy_x_3 of { happy_var_3 -> +	case happyOutTok happy_x_4 of { (TokKeyword KwWhere happy_var_4) -> +	case happyOut140 happy_x_5 of { happy_var_5 -> +	happyIn86+		 (Data (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5)) Inductive happy_var_2 happy_var_3 Nothing happy_var_5+	) `HappyStk` happyRest}}}}}++happyReduce_312 = happyReduce 5# 79# happyReduction_312+happyReduction_312 (happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokKeyword KwCoData happy_var_1) -> +	case happyOut16 happy_x_2 of { happy_var_2 -> +	case happyOut62 happy_x_3 of { happy_var_3 -> +	case happyOutTok happy_x_4 of { (TokKeyword KwWhere happy_var_4) -> +	case happyOut140 happy_x_5 of { happy_var_5 -> +	happyIn86+		 (Data (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5)) CoInductive happy_var_2 happy_var_3 Nothing happy_var_5+	) `HappyStk` happyRest}}}}}++happyReduce_313 = happyReduce 5# 80# happyReduction_313+happyReduction_313 (happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokKeyword KwData happy_var_1) -> +	case happyOut16 happy_x_2 of { happy_var_2 -> +	case happyOut62 happy_x_3 of { happy_var_3 -> +	case happyOutTok happy_x_4 of { (TokSymbol SymColon happy_var_4) -> +	case happyOut33 happy_x_5 of { happy_var_5 -> +	happyIn87+		 (DataSig (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5)) Inductive happy_var_2 happy_var_3 happy_var_5+	) `HappyStk` happyRest}}}}}++happyReduce_314 = happyMonadReduce 7# 81# happyReduction_314+happyReduction_314 (happy_x_7 `HappyStk`+	happy_x_6 `HappyStk`+	happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest) tk+	 = happyThen (case happyOutTok happy_x_1 of { (TokKeyword KwRecord happy_var_1) -> +	case happyOut41 happy_x_2 of { happy_var_2 -> +	case happyOut62 happy_x_3 of { happy_var_3 -> +	case happyOutTok happy_x_4 of { (TokSymbol SymColon happy_var_4) -> +	case happyOut33 happy_x_5 of { happy_var_5 -> +	case happyOutTok happy_x_6 of { (TokKeyword KwWhere happy_var_6) -> +	case happyOut141 happy_x_7 of { happy_var_7 -> +	( exprToName happy_var_2 >>= \ n -> return $ Record (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5,happy_var_6,happy_var_7)) n (fst3 happy_var_7) (snd3 happy_var_7) happy_var_3 (Just happy_var_5) (thd3 happy_var_7))}}}}}}}+	) (\r -> happyReturn (happyIn88 r))++happyReduce_315 = happyMonadReduce 5# 81# happyReduction_315+happyReduction_315 (happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest) tk+	 = happyThen (case happyOutTok happy_x_1 of { (TokKeyword KwRecord happy_var_1) -> +	case happyOut41 happy_x_2 of { happy_var_2 -> +	case happyOut62 happy_x_3 of { happy_var_3 -> +	case happyOutTok happy_x_4 of { (TokKeyword KwWhere happy_var_4) -> +	case happyOut141 happy_x_5 of { happy_var_5 -> +	( exprToName happy_var_2 >>= \ n -> return $ Record (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5)) n (fst3 happy_var_5) (snd3 happy_var_5) happy_var_3 Nothing (thd3 happy_var_5))}}}}}+	) (\r -> happyReturn (happyIn88 r))++happyReduce_316 = happyMonadReduce 5# 82# happyReduction_316+happyReduction_316 (happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest) tk+	 = happyThen (case happyOutTok happy_x_1 of { (TokKeyword KwRecord happy_var_1) -> +	case happyOut41 happy_x_2 of { happy_var_2 -> +	case happyOut62 happy_x_3 of { happy_var_3 -> +	case happyOutTok happy_x_4 of { (TokSymbol SymColon happy_var_4) -> +	case happyOut33 happy_x_5 of { happy_var_5 -> +	( exprToName happy_var_2 >>= \ n -> return $ RecordSig (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5)) n happy_var_3 happy_var_5)}}}}}+	) (\r -> happyReturn (happyIn89 r))++happyReduce_317 = happySpecReduce_2  83# happyReduction_317+happyReduction_317 happy_x_2+	happy_x_1+	 =  case happyOut16 happy_x_2 of { happy_var_2 -> +	happyIn90+		 (happy_var_2+	)}++happyReduce_318 = happySpecReduce_3  84# happyReduction_318+happyReduction_318 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwInfix happy_var_1) -> +	case happyOut15 happy_x_2 of { happy_var_2 -> +	case happyOut25 happy_x_3 of { happy_var_3 -> +	happyIn91+		 (Infix (Fixity (getRange (happy_var_1,happy_var_3)) happy_var_2 NonAssoc)   happy_var_3+	)}}}++happyReduce_319 = happySpecReduce_3  84# happyReduction_319+happyReduction_319 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwInfixL happy_var_1) -> +	case happyOut15 happy_x_2 of { happy_var_2 -> +	case happyOut25 happy_x_3 of { happy_var_3 -> +	happyIn91+		 (Infix (Fixity (getRange (happy_var_1,happy_var_3)) happy_var_2 LeftAssoc)  happy_var_3+	)}}}++happyReduce_320 = happySpecReduce_3  84# happyReduction_320+happyReduction_320 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwInfixR happy_var_1) -> +	case happyOut15 happy_x_2 of { happy_var_2 -> +	case happyOut25 happy_x_3 of { happy_var_3 -> +	happyIn91+		 (Infix (Fixity (getRange (happy_var_1,happy_var_3)) happy_var_2 RightAssoc) happy_var_3+	)}}}++happyReduce_321 = happySpecReduce_2  85# happyReduction_321+happyReduction_321 happy_x_2+	happy_x_1+	 =  case happyOut138 happy_x_2 of { happy_var_2 -> +	happyIn92+		 (let toField (Common.Arg info (TypeSig _ x t)) = Field x (Common.Arg info t) in map toField happy_var_2+	)}++happyReduce_322 = happySpecReduce_2  86# happyReduction_322+happyReduction_322 happy_x_2+	happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwMutual happy_var_1) -> +	case happyOut143 happy_x_2 of { happy_var_2 -> +	happyIn93+		 (Mutual (fuseRange happy_var_1 happy_var_2) happy_var_2+	)}}++happyReduce_323 = happySpecReduce_2  87# happyReduction_323+happyReduction_323 happy_x_2+	happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwAbstract happy_var_1) -> +	case happyOut143 happy_x_2 of { happy_var_2 -> +	happyIn94+		 (Abstract (fuseRange happy_var_1 happy_var_2) happy_var_2+	)}}++happyReduce_324 = happySpecReduce_2  88# happyReduction_324+happyReduction_324 happy_x_2+	happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwPrivate happy_var_1) -> +	case happyOut143 happy_x_2 of { happy_var_2 -> +	happyIn95+		 (Private (fuseRange happy_var_1 happy_var_2) happy_var_2+	)}}++happyReduce_325 = happySpecReduce_2  89# happyReduction_325+happyReduction_325 happy_x_2+	happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwInstance happy_var_1) -> +	case happyOut143 happy_x_2 of { happy_var_2 -> +	happyIn96+		 (InstanceB (fuseRange happy_var_1 happy_var_2) happy_var_2+	)}}++happyReduce_326 = happySpecReduce_2  90# happyReduction_326+happyReduction_326 happy_x_2+	happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwPostulate happy_var_1) -> +	case happyOut143 happy_x_2 of { happy_var_2 -> +	happyIn97+		 (Postulate (fuseRange happy_var_1 happy_var_2) happy_var_2+	)}}++happyReduce_327 = happySpecReduce_2  91# happyReduction_327+happyReduction_327 happy_x_2+	happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwPrimitive happy_var_1) -> +	case happyOut136 happy_x_2 of { happy_var_2 -> +	happyIn98+		 (Primitive (fuseRange happy_var_1 happy_var_2) happy_var_2+	)}}++happyReduce_328 = happyReduce 4# 92# happyReduction_328+happyReduction_328 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokKeyword KwUnquoteDecl happy_var_1) -> +	case happyOut16 happy_x_2 of { happy_var_2 -> +	case happyOut33 happy_x_4 of { happy_var_4 -> +	happyIn99+		 (UnquoteDecl (fuseRange happy_var_1 happy_var_4) happy_var_2 happy_var_4+	) `HappyStk` happyRest}}}++happyReduce_329 = happyMonadReduce 5# 93# happyReduction_329+happyReduction_329 (happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest) tk+	 = happyThen (case happyOut16 happy_x_2 of { happy_var_2 -> +	case happyOut104 happy_x_3 of { happy_var_3 -> +	case happyOut103 happy_x_5 of { happy_var_5 -> +	(+  case happy_var_2 of+    Name _ [_] -> case mkNotation happy_var_3 (map rangedThing happy_var_5) of+      Left err -> parseError $ "Malformed syntax declaration: " ++ err+      Right n -> return $ Syntax happy_var_2 n+    _ -> parseError "Syntax declarations are allowed only for simple names (without holes)")}}}+	) (\r -> happyReturn (happyIn100 r))++happyReduce_330 = happyMonadReduce 5# 94# happyReduction_330+happyReduction_330 (happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest) tk+	 = happyThen (case happyOutTok happy_x_1 of { (TokKeyword KwPatternSyn happy_var_1) -> +	case happyOut16 happy_x_2 of { happy_var_2 -> +	case happyOut102 happy_x_3 of { happy_var_3 -> +	case happyOutTok happy_x_4 of { (TokSymbol SymEqual happy_var_4) -> +	case happyOut33 happy_x_5 of { happy_var_5 -> +	( do+  p <- exprToPattern happy_var_5+  return (PatternSyn (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5)) happy_var_2 happy_var_3 p))}}}}}+	) (\r -> happyReturn (happyIn101 r))++happyReduce_331 = happySpecReduce_0  95# happyReduction_331+happyReduction_331  =  happyIn102+		 ([]+	)++happyReduce_332 = happyMonadReduce 1# 95# happyReduction_332+happyReduction_332 (happy_x_1 `HappyStk`+	happyRest) tk+	 = happyThen (case happyOut54 happy_x_1 of { happy_var_1 -> +	( patternSynArgs happy_var_1)}+	) (\r -> happyReturn (happyIn102 r))++happyReduce_333 = happySpecReduce_1  96# happyReduction_333+happyReduction_333 happy_x_1+	 =  case happyOut108 happy_x_1 of { happy_var_1 -> +	happyIn103+		 ([happy_var_1]+	)}++happyReduce_334 = happySpecReduce_2  96# happyReduction_334+happyReduction_334 happy_x_2+	happy_x_1+	 =  case happyOut103 happy_x_1 of { happy_var_1 -> +	case happyOut108 happy_x_2 of { happy_var_2 -> +	happyIn103+		 (happy_var_1 ++ [happy_var_2]+	)}}++happyReduce_335 = happySpecReduce_1  97# happyReduction_335+happyReduction_335 happy_x_1+	 =  case happyOut105 happy_x_1 of { happy_var_1 -> +	happyIn104+		 ([happy_var_1]+	)}++happyReduce_336 = happySpecReduce_2  97# happyReduction_336+happyReduction_336 happy_x_2+	happy_x_1+	 =  case happyOut104 happy_x_1 of { happy_var_1 -> +	case happyOut105 happy_x_2 of { happy_var_2 -> +	happyIn104+		 (happy_var_1 ++ [happy_var_2]+	)}}++happyReduce_337 = happySpecReduce_1  98# happyReduction_337+happyReduction_337 happy_x_1+	 =  case happyOut106 happy_x_1 of { happy_var_1 -> +	happyIn105+		 (defaultNamedArg happy_var_1+	)}++happyReduce_338 = happySpecReduce_3  98# happyReduction_338+happyReduction_338 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut107 happy_x_2 of { happy_var_2 -> +	happyIn105+		 (setHiding Hidden   $ defaultNamedArg happy_var_2+	)}++happyReduce_339 = happySpecReduce_3  98# happyReduction_339+happyReduction_339 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut107 happy_x_2 of { happy_var_2 -> +	happyIn105+		 (setHiding Instance $ defaultNamedArg happy_var_2+	)}++happyReduce_340 = happyReduce 5# 98# happyReduction_340+happyReduction_340 (happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut108 happy_x_2 of { happy_var_2 -> +	case happyOut107 happy_x_4 of { happy_var_4 -> +	happyIn105+		 (setHiding Hidden   $ defaultArg $ named happy_var_2 happy_var_4+	) `HappyStk` happyRest}}++happyReduce_341 = happyReduce 5# 98# happyReduction_341+happyReduction_341 (happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut108 happy_x_2 of { happy_var_2 -> +	case happyOut107 happy_x_4 of { happy_var_4 -> +	happyIn105+		 (setHiding Instance $ defaultArg $ named happy_var_2 happy_var_4+	) `HappyStk` happyRest}}++happyReduce_342 = happySpecReduce_1  99# happyReduction_342+happyReduction_342 happy_x_1+	 =  case happyOut108 happy_x_1 of { happy_var_1 -> +	happyIn106+		 (ExprHole (rangedThing happy_var_1)+	)}++happyReduce_343 = happyReduce 6# 99# happyReduction_343+happyReduction_343 (happy_x_6 `HappyStk`+	happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut108 happy_x_3 of { happy_var_3 -> +	case happyOut108 happy_x_5 of { happy_var_5 -> +	happyIn106+		 (LambdaHole (rangedThing happy_var_3) (rangedThing happy_var_5)+	) `HappyStk` happyRest}}++happyReduce_344 = happySpecReduce_1  100# happyReduction_344+happyReduction_344 happy_x_1+	 =  case happyOut108 happy_x_1 of { happy_var_1 -> +	happyIn107+		 (ExprHole (rangedThing happy_var_1)+	)}++happyReduce_345 = happyReduce 4# 100# happyReduction_345+happyReduction_345 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut108 happy_x_2 of { happy_var_2 -> +	case happyOut108 happy_x_4 of { happy_var_4 -> +	happyIn107+		 (LambdaHole (rangedThing happy_var_2) (rangedThing happy_var_4)+	) `HappyStk` happyRest}}++happyReduce_346 = happySpecReduce_1  101# happyReduction_346+happyReduction_346 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokId happy_var_1) -> +	happyIn108+		 (Ranged (getRange $ fst happy_var_1) (stringToRawName $ snd happy_var_1)+	)}++happyReduce_347 = happySpecReduce_1  102# happyReduction_347+happyReduction_347 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwOpen happy_var_1) -> +	happyIn109+		 (Just (getRange happy_var_1)+	)}++happyReduce_348 = happySpecReduce_0  102# happyReduction_348+happyReduction_348  =  happyIn109+		 (Nothing+	)++happyReduce_349 = happyMonadReduce 5# 103# happyReduction_349+happyReduction_349 (happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest) tk+	 = happyThen (case happyOut109 happy_x_1 of { happy_var_1 -> +	case happyOutTok happy_x_2 of { (TokKeyword KwImport happy_var_2) -> +	case happyOut23 happy_x_3 of { happy_var_3 -> +	case happyOut111 happy_x_4 of { happy_var_4 -> +	case happyOut65 happy_x_5 of { happy_var_5 -> +	(+    let+    { doOpen = maybe DontOpen (const DoOpen) happy_var_1+    ; m   = happy_var_3+    ; es  = happy_var_4+    ; dir = happy_var_5+    ; r   = getRange (m, es, dir)+    ; mr  = getRange m+    ; unique = hashString $ show $ (Nothing :: Maybe ()) <$ r+         -- turn range into unique id, but delete file path+         -- which is absolute and messes up suite of failing tests+         -- (different hashs on different installations)+         -- TODO: Don't use (insecure) hashes in this way.+    ; fresh = Name mr [ Id $ stringToRawName $ ".#" ++ show m ++ "-" ++ show unique ]+    ; impStm asR = Import mr m (Just (AsName fresh asR)) DontOpen defaultImportDir+    ; appStm m' es =+        let r = getRange (m, es) in+        Private r+          [ ModuleMacro r m'+             (SectionApp (getRange es) []+               (RawApp (getRange es) (Ident (QName fresh) : es)))+             doOpen dir+          ]+    ; (initArgs, last2Args) = splitAt (length es - 2) es+    ; parseAsClause = case last2Args of+      { [ Ident (QName (Name asR [Id x]))+        , Ident (QName m')+        ] | rawNameToString x == "as" -> Just (asR, m')+      ; _ -> Nothing+      }+    } in+    case es of+      { [] -> return [Import mr m Nothing doOpen dir]+      ; _ | Just (asR, m') <- parseAsClause ->+              if null initArgs then return+                 [ Import (getRange (m, asR, m', dir)) m+                     (Just (AsName m' asR)) doOpen dir+                 ]+              else return [ impStm asR, appStm m' initArgs ]+          | DontOpen <- doOpen -> parseErrorAt (fromJust $ rStart $ getRange happy_var_2) "An import statement with module instantiation does not actually import the module.  This statement achieves nothing.  Either add the `open' keyword or bind the instantiated module with an `as' clause."+          | otherwise -> return+              [ impStm noRange+              , appStm (noName $ beginningOf $ getRange m) es+              ]+      })}}}}}+	) (\r -> happyReturn (happyIn110 r))++happyReduce_350 = happyReduce 4# 103# happyReduction_350+happyReduction_350 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut23 happy_x_2 of { happy_var_2 -> +	case happyOut111 happy_x_3 of { happy_var_3 -> +	case happyOut65 happy_x_4 of { happy_var_4 -> +	happyIn110+		 (let+    { m   = happy_var_2+    ; es  = happy_var_3+    ; dir = happy_var_4+    ; r   = getRange (m, es, dir)+    } in+    [ case es of+      { []  -> Open r m dir+      ; _   -> Private r [ ModuleMacro r (noName $ beginningOf $ getRange m)+                             (SectionApp (getRange (m , es)) [] (RawApp (fuseRange m es) (Ident m : es)))+                             DoOpen dir+                         ]+      }+    ]+	) `HappyStk` happyRest}}}++happyReduce_351 = happyReduce 6# 103# happyReduction_351+happyReduction_351 (happy_x_6 `HappyStk`+	happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut23 happy_x_2 of { happy_var_2 -> +	case happyOut65 happy_x_6 of { happy_var_6 -> +	happyIn110+		 (let r = getRange happy_var_2 in+    [ Private r [ ModuleMacro r (noName $ beginningOf $ getRange happy_var_2)+                (RecordModuleIFS r happy_var_2) DoOpen happy_var_6+                ]+    ]+	) `HappyStk` happyRest}}++happyReduce_352 = happySpecReduce_0  104# happyReduction_352+happyReduction_352  =  happyIn111+		 ([]+	)++happyReduce_353 = happySpecReduce_2  104# happyReduction_353+happyReduction_353 happy_x_2+	happy_x_1+	 =  case happyOut42 happy_x_1 of { happy_var_1 -> +	case happyOut111 happy_x_2 of { happy_var_2 -> +	happyIn111+		 (happy_var_1 : happy_var_2+	)}}++happyReduce_354 = happyReduce 4# 105# happyReduction_354+happyReduction_354 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut23 happy_x_1 of { happy_var_1 -> +	case happyOutTok happy_x_2 of { (TokSymbol SymDoubleOpenBrace happy_var_2) -> +	case happyOutTok happy_x_3 of { (TokSymbol SymEllipsis happy_var_3) -> +	case happyOut18 happy_x_4 of { happy_var_4 -> +	happyIn112+		 ((\ts ->+                    if null ts then return $ RecordModuleIFS (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4)) happy_var_1+                    else parseError "No bindings allowed for record module with non-canonical implicits" )+	) `HappyStk` happyRest}}}}++happyReduce_355 = happySpecReduce_2  105# happyReduction_355+happyReduction_355 happy_x_2+	happy_x_1+	 =  case happyOut23 happy_x_1 of { happy_var_1 -> +	case happyOut111 happy_x_2 of { happy_var_2 -> +	happyIn112+		 ((\ts -> return $ SectionApp (getRange (happy_var_1, happy_var_2)) ts (RawApp (fuseRange happy_var_1 happy_var_2) (Ident happy_var_1 : happy_var_2)) )+	)}}++happyReduce_356 = happyMonadReduce 6# 106# happyReduction_356+happyReduction_356 (happy_x_6 `HappyStk`+	happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest) tk+	 = happyThen (case happyOutTok happy_x_1 of { (TokKeyword KwModule happy_var_1) -> +	case happyOut23 happy_x_2 of { happy_var_2 -> +	case happyOut62 happy_x_3 of { happy_var_3 -> +	case happyOut112 happy_x_5 of { happy_var_5 -> +	case happyOut65 happy_x_6 of { happy_var_6 -> +	( do { ma <- happy_var_5 (map addType happy_var_3)+                          ; name <- ensureUnqual happy_var_2+                          ; return $ ModuleMacro (getRange (happy_var_1, happy_var_2, ma, happy_var_6)) name ma DontOpen happy_var_6 })}}}}}+	) (\r -> happyReturn (happyIn113 r))++happyReduce_357 = happyMonadReduce 7# 106# happyReduction_357+happyReduction_357 (happy_x_7 `HappyStk`+	happy_x_6 `HappyStk`+	happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest) tk+	 = happyThen (case happyOutTok happy_x_1 of { (TokKeyword KwOpen happy_var_1) -> +	case happyOutTok happy_x_2 of { (TokKeyword KwModule happy_var_2) -> +	case happyOut16 happy_x_3 of { happy_var_3 -> +	case happyOut62 happy_x_4 of { happy_var_4 -> +	case happyOut112 happy_x_6 of { happy_var_6 -> +	case happyOut65 happy_x_7 of { happy_var_7 -> +	( do {ma <- happy_var_6 (map addType happy_var_4); return $ ModuleMacro (getRange (happy_var_1, happy_var_2, happy_var_3, ma, happy_var_7)) happy_var_3 ma DoOpen happy_var_7 })}}}}}}+	) (\r -> happyReturn (happyIn113 r))++happyReduce_358 = happyReduce 5# 107# happyReduction_358+happyReduction_358 (happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokKeyword KwModule happy_var_1) -> +	case happyOut23 happy_x_2 of { happy_var_2 -> +	case happyOut62 happy_x_3 of { happy_var_3 -> +	case happyOutTok happy_x_4 of { (TokKeyword KwWhere happy_var_4) -> +	case happyOut144 happy_x_5 of { happy_var_5 -> +	happyIn114+		 (Module (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5)) happy_var_2 (map addType happy_var_3) happy_var_5+	) `HappyStk` happyRest}}}}}++happyReduce_359 = happyReduce 5# 107# happyReduction_359+happyReduction_359 (happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokKeyword KwModule happy_var_1) -> +	case happyOut115 happy_x_2 of { happy_var_2 -> +	case happyOut62 happy_x_3 of { happy_var_3 -> +	case happyOutTok happy_x_4 of { (TokKeyword KwWhere happy_var_4) -> +	case happyOut144 happy_x_5 of { happy_var_5 -> +	happyIn114+		 (Module (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5)) (QName happy_var_2) (map addType happy_var_3) happy_var_5+	) `HappyStk` happyRest}}}}}++happyReduce_360 = happySpecReduce_1  108# happyReduction_360+happyReduction_360 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymUnderscore happy_var_1) -> +	happyIn115+		 (noName (getRange happy_var_1)+	)}++happyReduce_361 = happySpecReduce_1  109# happyReduction_361+happyReduction_361 happy_x_1+	 =  case happyOut146 happy_x_1 of { happy_var_1 -> +	happyIn116+		 (figureOutTopLevelModule happy_var_1+	)}++happyReduce_362 = happySpecReduce_1  110# happyReduction_362+happyReduction_362 happy_x_1+	 =  case happyOut118 happy_x_1 of { happy_var_1 -> +	happyIn117+		 (Pragma happy_var_1+	)}++happyReduce_363 = happySpecReduce_1  111# happyReduction_363+happyReduction_363 happy_x_1+	 =  case happyOut120 happy_x_1 of { happy_var_1 -> +	happyIn118+		 (happy_var_1+	)}++happyReduce_364 = happySpecReduce_1  111# happyReduction_364+happyReduction_364 happy_x_1+	 =  case happyOut121 happy_x_1 of { happy_var_1 -> +	happyIn118+		 (happy_var_1+	)}++happyReduce_365 = happySpecReduce_1  111# happyReduction_365+happyReduction_365 happy_x_1+	 =  case happyOut122 happy_x_1 of { happy_var_1 -> +	happyIn118+		 (happy_var_1+	)}++happyReduce_366 = happySpecReduce_1  111# happyReduction_366+happyReduction_366 happy_x_1+	 =  case happyOut123 happy_x_1 of { happy_var_1 -> +	happyIn118+		 (happy_var_1+	)}++happyReduce_367 = happySpecReduce_1  111# happyReduction_367+happyReduction_367 happy_x_1+	 =  case happyOut125 happy_x_1 of { happy_var_1 -> +	happyIn118+		 (happy_var_1+	)}++happyReduce_368 = happySpecReduce_1  111# happyReduction_368+happyReduction_368 happy_x_1+	 =  case happyOut124 happy_x_1 of { happy_var_1 -> +	happyIn118+		 (happy_var_1+	)}++happyReduce_369 = happySpecReduce_1  111# happyReduction_369+happyReduction_369 happy_x_1+	 =  case happyOut126 happy_x_1 of { happy_var_1 -> +	happyIn118+		 (happy_var_1+	)}++happyReduce_370 = happySpecReduce_1  111# happyReduction_370+happyReduction_370 happy_x_1+	 =  case happyOut127 happy_x_1 of { happy_var_1 -> +	happyIn118+		 (happy_var_1+	)}++happyReduce_371 = happySpecReduce_1  111# happyReduction_371+happyReduction_371 happy_x_1+	 =  case happyOut128 happy_x_1 of { happy_var_1 -> +	happyIn118+		 (happy_var_1+	)}++happyReduce_372 = happySpecReduce_1  111# happyReduction_372+happyReduction_372 happy_x_1+	 =  case happyOut134 happy_x_1 of { happy_var_1 -> +	happyIn118+		 (happy_var_1+	)}++happyReduce_373 = happySpecReduce_1  111# happyReduction_373+happyReduction_373 happy_x_1+	 =  case happyOut135 happy_x_1 of { happy_var_1 -> +	happyIn118+		 (happy_var_1+	)}++happyReduce_374 = happySpecReduce_1  111# happyReduction_374+happyReduction_374 happy_x_1+	 =  case happyOut129 happy_x_1 of { happy_var_1 -> +	happyIn118+		 (happy_var_1+	)}++happyReduce_375 = happySpecReduce_1  111# happyReduction_375+happyReduction_375 happy_x_1+	 =  case happyOut132 happy_x_1 of { happy_var_1 -> +	happyIn118+		 (happy_var_1+	)}++happyReduce_376 = happySpecReduce_1  111# happyReduction_376+happyReduction_376 happy_x_1+	 =  case happyOut131 happy_x_1 of { happy_var_1 -> +	happyIn118+		 (happy_var_1+	)}++happyReduce_377 = happySpecReduce_1  111# happyReduction_377+happyReduction_377 happy_x_1+	 =  case happyOut130 happy_x_1 of { happy_var_1 -> +	happyIn118+		 (happy_var_1+	)}++happyReduce_378 = happySpecReduce_1  111# happyReduction_378+happyReduction_378 happy_x_1+	 =  case happyOut133 happy_x_1 of { happy_var_1 -> +	happyIn118+		 (happy_var_1+	)}++happyReduce_379 = happySpecReduce_1  111# happyReduction_379+happyReduction_379 happy_x_1+	 =  case happyOut119 happy_x_1 of { happy_var_1 -> +	happyIn118+		 (happy_var_1+	)}++happyReduce_380 = happyReduce 4# 112# happyReduction_380+happyReduction_380 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> +	case happyOutTok happy_x_2 of { (TokKeyword KwOPTIONS happy_var_2) -> +	case happyOut29 happy_x_3 of { happy_var_3 -> +	case happyOutTok happy_x_4 of { (TokSymbol SymClosePragma happy_var_4) -> +	happyIn119+		 (OptionsPragma (getRange (happy_var_1,happy_var_2,happy_var_4)) happy_var_3+	) `HappyStk` happyRest}}}}++happyReduce_381 = happyReduce 5# 113# happyReduction_381+happyReduction_381 (happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> +	case happyOutTok happy_x_2 of { (TokKeyword KwBUILTIN happy_var_2) -> +	case happyOutTok happy_x_3 of { (TokString happy_var_3) -> +	case happyOut32 happy_x_4 of { happy_var_4 -> +	case happyOutTok happy_x_5 of { (TokSymbol SymClosePragma happy_var_5) -> +	happyIn120+		 (BuiltinPragma (getRange (happy_var_1,happy_var_2,fst happy_var_3,happy_var_4,happy_var_5)) (snd happy_var_3) (Ident happy_var_4)+	) `HappyStk` happyRest}}}}}++happyReduce_382 = happyReduce 5# 113# happyReduction_382+happyReduction_382 (happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> +	case happyOutTok happy_x_2 of { (TokKeyword KwBUILTIN happy_var_2) -> +	case happyOutTok happy_x_3 of { (TokKeyword KwREWRITE happy_var_3) -> +	case happyOut32 happy_x_4 of { happy_var_4 -> +	case happyOutTok happy_x_5 of { (TokSymbol SymClosePragma happy_var_5) -> +	happyIn120+		 (BuiltinPragma (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5)) "REWRITE" (Ident happy_var_4)+	) `HappyStk` happyRest}}}}}++happyReduce_383 = happyReduce 4# 114# happyReduction_383+happyReduction_383 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> +	case happyOutTok happy_x_2 of { (TokKeyword KwREWRITE happy_var_2) -> +	case happyOut32 happy_x_3 of { happy_var_3 -> +	case happyOutTok happy_x_4 of { (TokSymbol SymClosePragma happy_var_4) -> +	happyIn121+		 (RewritePragma (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4)) happy_var_3+	) `HappyStk` happyRest}}}}++happyReduce_384 = happyReduce 5# 115# happyReduction_384+happyReduction_384 (happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> +	case happyOutTok happy_x_2 of { (TokKeyword KwCOMPILED happy_var_2) -> +	case happyOut32 happy_x_3 of { happy_var_3 -> +	case happyOut29 happy_x_4 of { happy_var_4 -> +	case happyOutTok happy_x_5 of { (TokSymbol SymClosePragma happy_var_5) -> +	happyIn122+		 (CompiledPragma (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_5)) happy_var_3 (unwords happy_var_4)+	) `HappyStk` happyRest}}}}}++happyReduce_385 = happyReduce 5# 116# happyReduction_385+happyReduction_385 (happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> +	case happyOutTok happy_x_2 of { (TokKeyword KwCOMPILED_EXPORT happy_var_2) -> +	case happyOut32 happy_x_3 of { happy_var_3 -> +	case happyOut30 happy_x_4 of { happy_var_4 -> +	case happyOutTok happy_x_5 of { (TokSymbol SymClosePragma happy_var_5) -> +	happyIn123+		 (CompiledExportPragma (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_5)) happy_var_3 happy_var_4+	) `HappyStk` happyRest}}}}}++happyReduce_386 = happyReduce 5# 117# happyReduction_386+happyReduction_386 (happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> +	case happyOutTok happy_x_2 of { (TokKeyword KwCOMPILED_TYPE happy_var_2) -> +	case happyOut32 happy_x_3 of { happy_var_3 -> +	case happyOut29 happy_x_4 of { happy_var_4 -> +	case happyOutTok happy_x_5 of { (TokSymbol SymClosePragma happy_var_5) -> +	happyIn124+		 (CompiledTypePragma (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_5)) happy_var_3 (unwords happy_var_4)+	) `HappyStk` happyRest}}}}}++happyReduce_387 = happyReduce 6# 118# happyReduction_387+happyReduction_387 (happy_x_6 `HappyStk`+	happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> +	case happyOutTok happy_x_2 of { (TokKeyword KwCOMPILED_DATA happy_var_2) -> +	case happyOut32 happy_x_3 of { happy_var_3 -> +	case happyOutTok happy_x_4 of { (TokString happy_var_4) -> +	case happyOut29 happy_x_5 of { happy_var_5 -> +	case happyOutTok happy_x_6 of { (TokSymbol SymClosePragma happy_var_6) -> +	happyIn125+		 (CompiledDataPragma (getRange (happy_var_1,happy_var_2,happy_var_3,fst happy_var_4,happy_var_6)) happy_var_3 (snd happy_var_4) happy_var_5+	) `HappyStk` happyRest}}}}}}++happyReduce_388 = happyReduce 5# 119# happyReduction_388+happyReduction_388 (happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> +	case happyOutTok happy_x_2 of { (TokKeyword KwCOMPILED_EPIC happy_var_2) -> +	case happyOut32 happy_x_3 of { happy_var_3 -> +	case happyOut29 happy_x_4 of { happy_var_4 -> +	case happyOutTok happy_x_5 of { (TokSymbol SymClosePragma happy_var_5) -> +	happyIn126+		 (CompiledEpicPragma (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_5)) happy_var_3 (unwords happy_var_4)+	) `HappyStk` happyRest}}}}}++happyReduce_389 = happyReduce 5# 120# happyReduction_389+happyReduction_389 (happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> +	case happyOutTok happy_x_2 of { (TokKeyword KwCOMPILED_JS happy_var_2) -> +	case happyOut32 happy_x_3 of { happy_var_3 -> +	case happyOut29 happy_x_4 of { happy_var_4 -> +	case happyOutTok happy_x_5 of { (TokSymbol SymClosePragma happy_var_5) -> +	happyIn127+		 (CompiledJSPragma (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_5)) happy_var_3 (unwords happy_var_4)+	) `HappyStk` happyRest}}}}}++happyReduce_390 = happyReduce 4# 121# happyReduction_390+happyReduction_390 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> +	case happyOutTok happy_x_2 of { (TokKeyword KwSTATIC happy_var_2) -> +	case happyOut32 happy_x_3 of { happy_var_3 -> +	case happyOutTok happy_x_4 of { (TokSymbol SymClosePragma happy_var_4) -> +	happyIn128+		 (StaticPragma (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4)) happy_var_3+	) `HappyStk` happyRest}}}}++happyReduce_391 = happyReduce 4# 122# happyReduction_391+happyReduction_391 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> +	case happyOutTok happy_x_2 of { (TokKeyword KwETA happy_var_2) -> +	case happyOut32 happy_x_3 of { happy_var_3 -> +	case happyOutTok happy_x_4 of { (TokSymbol SymClosePragma happy_var_4) -> +	happyIn129+		 (EtaPragma (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4)) happy_var_3+	) `HappyStk` happyRest}}}}++happyReduce_392 = happySpecReduce_3  123# happyReduction_392+happyReduction_392 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> +	case happyOutTok happy_x_2 of { (TokKeyword KwNO_TERMINATION_CHECK happy_var_2) -> +	case happyOutTok happy_x_3 of { (TokSymbol SymClosePragma happy_var_3) -> +	happyIn130+		 (TerminationCheckPragma (getRange (happy_var_1,happy_var_2,happy_var_3)) NoTerminationCheck+	)}}}++happyReduce_393 = happySpecReduce_3  124# happyReduction_393+happyReduction_393 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> +	case happyOutTok happy_x_2 of { (TokKeyword KwNON_TERMINATING happy_var_2) -> +	case happyOutTok happy_x_3 of { (TokSymbol SymClosePragma happy_var_3) -> +	happyIn131+		 (TerminationCheckPragma (getRange (happy_var_1,happy_var_2,happy_var_3)) NonTerminating+	)}}}++happyReduce_394 = happySpecReduce_3  125# happyReduction_394+happyReduction_394 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> +	case happyOutTok happy_x_2 of { (TokKeyword KwTERMINATING happy_var_2) -> +	case happyOutTok happy_x_3 of { (TokSymbol SymClosePragma happy_var_3) -> +	happyIn132+		 (TerminationCheckPragma (getRange (happy_var_1,happy_var_2,happy_var_3)) Terminating+	)}}}++happyReduce_395 = happyReduce 4# 126# happyReduction_395+happyReduction_395 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> +	case happyOutTok happy_x_2 of { (TokKeyword KwMEASURE happy_var_2) -> +	case happyOut31 happy_x_3 of { happy_var_3 -> +	case happyOutTok happy_x_4 of { (TokSymbol SymClosePragma happy_var_4) -> +	happyIn133+		 (let r = getRange (happy_var_1, happy_var_2, happy_var_3, happy_var_4) in+      TerminationCheckPragma r (TerminationMeasure r happy_var_3)+	) `HappyStk` happyRest}}}}++happyReduce_396 = happyMonadReduce 4# 127# happyReduction_396+happyReduction_396 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest) tk+	 = happyThen (case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> +	case happyOutTok happy_x_2 of { (TokKeyword KwIMPORT happy_var_2) -> +	case happyOutTok happy_x_3 of { (TokString happy_var_3) -> +	case happyOutTok happy_x_4 of { (TokSymbol SymClosePragma happy_var_4) -> +	( let s = snd happy_var_3 in+       if validHaskellModuleName s+       then return $ ImportPragma (getRange (happy_var_1,happy_var_2,fst happy_var_3,happy_var_4)) s+       else parseError $ "Malformed module name: " ++ s ++ ".")}}}}+	) (\r -> happyReturn (happyIn134 r))++happyReduce_397 = happySpecReduce_3  128# happyReduction_397+happyReduction_397 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> +	case happyOutTok happy_x_2 of { (TokKeyword KwIMPOSSIBLE happy_var_2) -> +	case happyOutTok happy_x_3 of { (TokSymbol SymClosePragma happy_var_3) -> +	happyIn135+		 (ImpossiblePragma (getRange (happy_var_1,happy_var_2,happy_var_3))+	)}}}++happyReduce_398 = happySpecReduce_3  129# happyReduction_398+happyReduction_398 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut137 happy_x_2 of { happy_var_2 -> +	happyIn136+		 (reverse happy_var_2+	)}++happyReduce_399 = happySpecReduce_3  130# happyReduction_399+happyReduction_399 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut137 happy_x_1 of { happy_var_1 -> +	case happyOut82 happy_x_3 of { happy_var_3 -> +	happyIn137+		 (reverse happy_var_3 ++ happy_var_1+	)}}++happyReduce_400 = happySpecReduce_1  130# happyReduction_400+happyReduction_400 happy_x_1+	 =  case happyOut82 happy_x_1 of { happy_var_1 -> +	happyIn137+		 (reverse happy_var_1+	)}++happyReduce_401 = happySpecReduce_3  131# happyReduction_401+happyReduction_401 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut139 happy_x_2 of { happy_var_2 -> +	happyIn138+		 (reverse happy_var_2+	)}++happyReduce_402 = happySpecReduce_3  132# happyReduction_402+happyReduction_402 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut139 happy_x_1 of { happy_var_1 -> +	case happyOut83 happy_x_3 of { happy_var_3 -> +	happyIn139+		 (reverse happy_var_3 ++ happy_var_1+	)}}++happyReduce_403 = happySpecReduce_1  132# happyReduction_403+happyReduction_403 happy_x_1+	 =  case happyOut83 happy_x_1 of { happy_var_1 -> +	happyIn139+		 (reverse happy_var_1+	)}++happyReduce_404 = happySpecReduce_2  133# happyReduction_404+happyReduction_404 happy_x_2+	happy_x_1+	 =  happyIn140+		 ([]+	)++happyReduce_405 = happySpecReduce_1  133# happyReduction_405+happyReduction_405 happy_x_1+	 =  case happyOut136 happy_x_1 of { happy_var_1 -> +	happyIn140+		 (happy_var_1+	)}++happyReduce_406 = happySpecReduce_2  134# happyReduction_406+happyReduction_406 happy_x_2+	happy_x_1+	 =  happyIn141+		 ((Nothing, Nothing, [])+	)++happyReduce_407 = happySpecReduce_3  134# happyReduction_407+happyReduction_407 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut90 happy_x_2 of { happy_var_2 -> +	happyIn141+		 ((Nothing, Just happy_var_2, [])+	)}++happyReduce_408 = happyReduce 5# 134# happyReduction_408+happyReduction_408 (happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut90 happy_x_2 of { happy_var_2 -> +	case happyOut145 happy_x_4 of { happy_var_4 -> +	happyIn141+		 ((Nothing, Just happy_var_2, happy_var_4)+	) `HappyStk` happyRest}}++happyReduce_409 = happySpecReduce_3  134# happyReduction_409+happyReduction_409 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut145 happy_x_2 of { happy_var_2 -> +	happyIn141+		 ((Nothing, Nothing, happy_var_2)+	)}++happyReduce_410 = happySpecReduce_3  134# happyReduction_410+happyReduction_410 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut142 happy_x_2 of { happy_var_2 -> +	happyIn141+		 ((Just happy_var_2, Nothing, [])+	)}++happyReduce_411 = happyReduce 5# 134# happyReduction_411+happyReduction_411 (happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut142 happy_x_2 of { happy_var_2 -> +	case happyOut90 happy_x_4 of { happy_var_4 -> +	happyIn141+		 ((Just happy_var_2, Just happy_var_4, [])+	) `HappyStk` happyRest}}++happyReduce_412 = happyReduce 7# 134# happyReduction_412+happyReduction_412 (happy_x_7 `HappyStk`+	happy_x_6 `HappyStk`+	happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut142 happy_x_2 of { happy_var_2 -> +	case happyOut90 happy_x_4 of { happy_var_4 -> +	case happyOut145 happy_x_6 of { happy_var_6 -> +	happyIn141+		 ((Just happy_var_2, Just happy_var_4, happy_var_6)+	) `HappyStk` happyRest}}}++happyReduce_413 = happyReduce 5# 134# happyReduction_413+happyReduction_413 (happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut142 happy_x_2 of { happy_var_2 -> +	case happyOut145 happy_x_4 of { happy_var_4 -> +	happyIn141+		 ((Just happy_var_2, Nothing, happy_var_4)+	) `HappyStk` happyRest}}++happyReduce_414 = happySpecReduce_1  135# happyReduction_414+happyReduction_414 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwInductive happy_var_1) -> +	happyIn142+		 (Ranged (getRange happy_var_1) Inductive+	)}++happyReduce_415 = happySpecReduce_1  135# happyReduction_415+happyReduction_415 happy_x_1+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwCoInductive happy_var_1) -> +	happyIn142+		 (Ranged (getRange happy_var_1) CoInductive+	)}++happyReduce_416 = happySpecReduce_3  136# happyReduction_416+happyReduction_416 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut145 happy_x_2 of { happy_var_2 -> +	happyIn143+		 (happy_var_2+	)}++happyReduce_417 = happySpecReduce_2  137# happyReduction_417+happyReduction_417 happy_x_2+	happy_x_1+	 =  happyIn144+		 ([]+	)++happyReduce_418 = happySpecReduce_1  137# happyReduction_418+happyReduction_418 happy_x_1+	 =  case happyOut143 happy_x_1 of { happy_var_1 -> +	happyIn144+		 (happy_var_1+	)}++happyReduce_419 = happySpecReduce_3  138# happyReduction_419+happyReduction_419 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut81 happy_x_1 of { happy_var_1 -> +	case happyOut145 happy_x_3 of { happy_var_3 -> +	happyIn145+		 (happy_var_1 ++ happy_var_3+	)}}++happyReduce_420 = happySpecReduce_1  138# happyReduction_420+happyReduction_420 happy_x_1+	 =  case happyOut81 happy_x_1 of { happy_var_1 -> +	happyIn145+		 (happy_var_1+	)}++happyReduce_421 = happySpecReduce_0  139# happyReduction_421+happyReduction_421  =  happyIn146+		 ([]+	)++happyReduce_422 = happySpecReduce_1  139# happyReduction_422+happyReduction_422 happy_x_1+	 =  case happyOut145 happy_x_1 of { happy_var_1 -> +	happyIn146+		 (happy_var_1+	)}++happyNewToken action sts stk+	= lexer(\tk -> +	let cont i = happyDoAction i tk action sts stk in+	case tk of {+	TokEOF -> happyDoAction 89# tk action sts stk;+	TokKeyword KwLet happy_dollar_dollar -> cont 1#;+	TokKeyword KwIn happy_dollar_dollar -> cont 2#;+	TokKeyword KwWhere happy_dollar_dollar -> cont 3#;+	TokKeyword KwWith happy_dollar_dollar -> cont 4#;+	TokKeyword KwRewrite happy_dollar_dollar -> cont 5#;+	TokKeyword KwPostulate happy_dollar_dollar -> cont 6#;+	TokKeyword KwPrimitive happy_dollar_dollar -> cont 7#;+	TokKeyword KwOpen happy_dollar_dollar -> cont 8#;+	TokKeyword KwImport happy_dollar_dollar -> cont 9#;+	TokKeyword KwUsing happy_dollar_dollar -> cont 10#;+	TokKeyword KwHiding happy_dollar_dollar -> cont 11#;+	TokKeyword KwRenaming happy_dollar_dollar -> cont 12#;+	TokKeyword KwTo happy_dollar_dollar -> cont 13#;+	TokKeyword KwPublic happy_dollar_dollar -> cont 14#;+	TokKeyword KwModule happy_dollar_dollar -> cont 15#;+	TokKeyword KwData happy_dollar_dollar -> cont 16#;+	TokKeyword KwCoData happy_dollar_dollar -> cont 17#;+	TokKeyword KwRecord happy_dollar_dollar -> cont 18#;+	TokKeyword KwConstructor happy_dollar_dollar -> cont 19#;+	TokKeyword KwInductive happy_dollar_dollar -> cont 20#;+	TokKeyword KwCoInductive happy_dollar_dollar -> cont 21#;+	TokKeyword KwField happy_dollar_dollar -> cont 22#;+	TokKeyword KwInfix happy_dollar_dollar -> cont 23#;+	TokKeyword KwInfixL happy_dollar_dollar -> cont 24#;+	TokKeyword KwInfixR happy_dollar_dollar -> cont 25#;+	TokKeyword KwMutual happy_dollar_dollar -> cont 26#;+	TokKeyword KwAbstract happy_dollar_dollar -> cont 27#;+	TokKeyword KwPrivate happy_dollar_dollar -> cont 28#;+	TokKeyword KwInstance happy_dollar_dollar -> cont 29#;+	TokKeyword KwProp happy_dollar_dollar -> cont 30#;+	TokKeyword KwSet happy_dollar_dollar -> cont 31#;+	TokKeyword KwForall happy_dollar_dollar -> cont 32#;+	TokKeyword KwSyntax happy_dollar_dollar -> cont 33#;+	TokKeyword KwPatternSyn happy_dollar_dollar -> cont 34#;+	TokKeyword KwOPTIONS happy_dollar_dollar -> cont 35#;+	TokKeyword KwBUILTIN happy_dollar_dollar -> cont 36#;+	TokKeyword KwREWRITE happy_dollar_dollar -> cont 37#;+	TokKeyword KwIMPORT happy_dollar_dollar -> cont 38#;+	TokKeyword KwIMPOSSIBLE happy_dollar_dollar -> cont 39#;+	TokKeyword KwETA happy_dollar_dollar -> cont 40#;+	TokKeyword KwNO_TERMINATION_CHECK happy_dollar_dollar -> cont 41#;+	TokKeyword KwNON_TERMINATING happy_dollar_dollar -> cont 42#;+	TokKeyword KwTERMINATING happy_dollar_dollar -> cont 43#;+	TokKeyword KwMEASURE happy_dollar_dollar -> cont 44#;+	TokKeyword KwCOMPILED happy_dollar_dollar -> cont 45#;+	TokKeyword KwCOMPILED_EXPORT happy_dollar_dollar -> cont 46#;+	TokKeyword KwCOMPILED_DATA happy_dollar_dollar -> cont 47#;+	TokKeyword KwCOMPILED_TYPE happy_dollar_dollar -> cont 48#;+	TokKeyword KwCOMPILED_EPIC happy_dollar_dollar -> cont 49#;+	TokKeyword KwCOMPILED_JS happy_dollar_dollar -> cont 50#;+	TokKeyword KwSTATIC happy_dollar_dollar -> cont 51#;+	TokKeyword KwQuoteGoal happy_dollar_dollar -> cont 52#;+	TokKeyword KwQuoteContext happy_dollar_dollar -> cont 53#;+	TokKeyword KwQuote happy_dollar_dollar -> cont 54#;+	TokKeyword KwQuoteTerm happy_dollar_dollar -> cont 55#;+	TokKeyword KwTactic happy_dollar_dollar -> cont 56#;+	TokKeyword KwUnquote happy_dollar_dollar -> cont 57#;+	TokKeyword KwUnquoteDecl happy_dollar_dollar -> cont 58#;+	TokSetN happy_dollar_dollar -> cont 59#;+	TokTeX happy_dollar_dollar -> cont 60#;+	TokComment happy_dollar_dollar -> cont 61#;+	TokSymbol SymEllipsis happy_dollar_dollar -> cont 62#;+	TokSymbol SymDotDot happy_dollar_dollar -> cont 63#;+	TokSymbol SymDot happy_dollar_dollar -> cont 64#;+	TokSymbol SymSemi happy_dollar_dollar -> cont 65#;+	TokSymbol SymColon happy_dollar_dollar -> cont 66#;+	TokSymbol SymEqual happy_dollar_dollar -> cont 67#;+	TokSymbol SymUnderscore happy_dollar_dollar -> cont 68#;+	TokSymbol SymQuestionMark happy_dollar_dollar -> cont 69#;+	TokSymbol SymArrow happy_dollar_dollar -> cont 70#;+	TokSymbol SymLambda happy_dollar_dollar -> cont 71#;+	TokSymbol SymAs happy_dollar_dollar -> cont 72#;+	TokSymbol SymBar happy_dollar_dollar -> cont 73#;+	TokSymbol SymOpenParen happy_dollar_dollar -> cont 74#;+	TokSymbol SymCloseParen happy_dollar_dollar -> cont 75#;+	TokSymbol SymDoubleOpenBrace happy_dollar_dollar -> cont 76#;+	TokSymbol SymDoubleCloseBrace happy_dollar_dollar -> cont 77#;+	TokSymbol SymOpenBrace happy_dollar_dollar -> cont 78#;+	TokSymbol SymCloseBrace happy_dollar_dollar -> cont 79#;+	TokSymbol SymOpenVirtualBrace happy_dollar_dollar -> cont 80#;+	TokSymbol SymCloseVirtualBrace happy_dollar_dollar -> cont 81#;+	TokSymbol SymVirtualSemi happy_dollar_dollar -> cont 82#;+	TokSymbol SymOpenPragma happy_dollar_dollar -> cont 83#;+	TokSymbol SymClosePragma happy_dollar_dollar -> cont 84#;+	TokId happy_dollar_dollar -> cont 85#;+	TokQId happy_dollar_dollar -> cont 86#;+	TokString happy_dollar_dollar -> cont 87#;+	TokLiteral happy_dollar_dollar -> cont 88#;+	_ -> happyError' tk+	})++happyError_ 89# tk = happyError' tk+happyError_ _ tk = happyError' tk++happyThen :: () => Parser a -> (a -> Parser b) -> Parser b+happyThen = (>>=)+happyReturn :: () => a -> Parser a+happyReturn = (return)+happyThen1 = happyThen+happyReturn1 :: () => a -> Parser a+happyReturn1 = happyReturn+happyError' :: () => (Token) -> Parser a+happyError' tk = (\token -> happyError) tk++tokensParser = happySomeParser where+  happySomeParser = happyThen (happyParse 0#) (\x -> happyReturn (happyOut7 x))++exprParser = happySomeParser where+  happySomeParser = happyThen (happyParse 1#) (\x -> happyReturn (happyOut33 x))++moduleParser = happySomeParser where+  happySomeParser = happyThen (happyParse 2#) (\x -> happyReturn (happyOut10 x))++moduleNameParser = happySomeParser where+  happySomeParser = happyThen (happyParse 3#) (\x -> happyReturn (happyOut23 x))++happySeq = happyDontSeq+++{--------------------------------------------------------------------------+    Parsers+ --------------------------------------------------------------------------}++-- | Parse the token stream. Used by the TeX compiler.+tokensParser :: Parser [Token]++-- | Parse an expression. Could be used in interactions.+exprParser :: Parser Expr++-- | Parse a module.+moduleParser :: Parser Module+++{--------------------------------------------------------------------------+    Happy stuff+ --------------------------------------------------------------------------}++-- | Required by Happy.+happyError :: Parser a+happyError = parseError "Parse error"+++{--------------------------------------------------------------------------+    Utility functions+ --------------------------------------------------------------------------}++-- | Grab leading OPTIONS pragmas.+takeOptionsPragmas :: [Declaration] -> ([Pragma], [Declaration])+takeOptionsPragmas = spanJust $ \ d -> case d of+  Pragma p@OptionsPragma{} -> Just p+  _                        -> Nothing++-- | Insert a top-level module if there is none.+figureOutTopLevelModule :: [Declaration] -> [Declaration]+figureOutTopLevelModule ds =+  case span isAllowedBeforeModule ds of+    (ds0, Module r m tel ds1 : ds2) -> ds0 ++ [Module r m tel $ ds1 ++ ds2]+    (ds0, ds1)                      -> ds0 ++ [Module (getRange ds1) (QName noName_) [] ds1]+  where+    isAllowedBeforeModule (Pragma OptionsPragma{}) = True+    isAllowedBeforeModule (Private _ ds) = all isAllowedBeforeModule ds+    isAllowedBeforeModule Import{}       = True+    isAllowedBeforeModule ModuleMacro{}  = True+    isAllowedBeforeModule Open{}         = True+    isAllowedBeforeModule _              = False++-- | Create a name from a string.++mkName :: (Interval, String) -> Parser Name+mkName (i, s) = do+    let xs = C.stringNameParts s+    mapM_ isValidId xs+    unless (alternating xs) $ fail $ "a name cannot contain two consecutive underscores"+    return $ Name (getRange i) xs+    where+        isValidId Hole   = return ()+        isValidId (Id y) = do+          let x = rawNameToString y+          case parse defaultParseFlags [0] (lexer return) x of+            ParseOk _ (TokId _) -> return ()+            _                   -> fail $ "in the name " ++ s ++ ", the part " ++ x ++ " is not valid"++        -- we know that there are no two Ids in a row+        alternating (Hole : Hole : _) = False+        alternating (_ : xs)          = alternating xs+        alternating []                = True++-- | Create a qualified name from a list of strings+mkQName :: [(Interval, String)] -> Parser QName+mkQName ss = do+    xs <- mapM mkName ss+    return $ foldr Qual (QName $ last xs) (init xs)++ensureUnqual :: QName -> Parser Name+ensureUnqual (QName x) = return x+ensureUnqual q@Qual{}  = parseError' (rStart $ getRange q) "Qualified name not allowed here"++-- | Match a particular name.+isName :: String -> (Interval, String) -> Parser ()+isName s (_,s')+    | s == s'   = return ()+    | otherwise = fail $ "expected " ++ s ++ ", found " ++ s'++-- | Build a forall pi (forall x y z -> ...)+forallPi :: [LamBinding] -> Expr -> Expr+forallPi bs e = Pi (map addType bs) e++-- | Build a telescoping let (let Ds)+tLet :: Range -> [Declaration] -> TypedBindings+tLet r = TypedBindings r . Common.Arg defaultArgInfo . TLet r++-- | Converts lambda bindings to typed bindings.+addType :: LamBinding -> TypedBindings+addType (DomainFull b)   = b+addType (DomainFree info x) = TypedBindings r $ Common.Arg info $ TBind r [pure x] $ Underscore r Nothing+  where r = getRange x++mergeImportDirectives :: [ImportDirective] -> Parser ImportDirective+mergeImportDirectives is = do+  i <- foldl merge (return defaultImportDir) is+  verifyImportDirective i+  where+    merge mi i2 = do+      i1 <- mi+      let err = parseError' (rStart $ getRange i2) "Cannot mix using and hiding module directives"+      uh <- case (usingOrHiding i1, usingOrHiding i2) of+            (Hiding [], u)         -> return u+            (u, Hiding [])         -> return u+            (Using{}, Hiding{})    -> err+            (Hiding{}, Using{})    -> err+            (Using xs, Using ys)   -> return $ Using (xs ++ ys)+            (Hiding xs, Hiding ys) -> return $ Hiding (xs ++ ys)+      return $ ImportDirective+        { importDirRange = fuseRange i1 i2+        , usingOrHiding  = uh+        , renaming       = renaming i1 ++ renaming i2+        , publicOpen     = publicOpen i1 || publicOpen i2 }++-- | Check that an import directive doesn't contain repeated names+verifyImportDirective :: ImportDirective -> Parser ImportDirective+verifyImportDirective i =+    case filter ((>1) . length)+         $ group+         $ sort xs+    of+        []  -> return i+        yss -> let Just pos = rStart $ getRange $ head $ concat yss in+               parseErrorAt pos $+                "Repeated name" ++ s ++ " in import directive: " +++                concat (intersperse ", " $ map (show . head) yss)+            where+                s = case yss of+                        [_] -> ""+                        _   -> "s"+    where+        xs = names (usingOrHiding i) ++ map renFrom (renaming i)+        names (Using xs)    = xs+        names (Hiding xs)   = xs++-- | Breaks up a string into substrings. Returns every maximal+-- subsequence of zero or more characters distinct from @'.'@.+--+-- > splitOnDots ""         == [""]+-- > splitOnDots "foo.bar"  == ["foo", "bar"]+-- > splitOnDots ".foo.bar" == ["", "foo", "bar"]+-- > splitOnDots "foo.bar." == ["foo", "bar", ""]+-- > splitOnDots "foo..bar" == ["foo", "", "bar"]+splitOnDots :: String -> [String]+splitOnDots ""        = [""]+splitOnDots ('.' : s) = [] : splitOnDots s+splitOnDots (c   : s) = case splitOnDots s of+  p : ps -> (c : p) : ps++prop_splitOnDots = and+  [ splitOnDots ""         == [""]+  , splitOnDots "foo.bar"  == ["foo", "bar"]+  , splitOnDots ".foo.bar" == ["", "foo", "bar"]+  , splitOnDots "foo.bar." == ["foo", "bar", ""]+  , splitOnDots "foo..bar" == ["foo", "", "bar"]+  ]++-- | Returns 'True' iff the name is a valid Haskell (hierarchical)+-- module name.+validHaskellModuleName :: String -> Bool+validHaskellModuleName = all ok . splitOnDots+  where+  -- Checks if a dot-less module name is well-formed.+  ok :: String -> Bool+  ok []      = False+  ok (c : s) =+    isUpper c &&+    all (\c -> isLower c || c == '_' ||+               isUpper c ||+               generalCategory c == DecimalNumber ||+               c == '\'')+        s++{--------------------------------------------------------------------------+    Patterns+ --------------------------------------------------------------------------}++-- | Turn an expression into a left hand side.+exprToLHS :: Expr -> Parser ([Expr] -> [Expr] -> LHS)+exprToLHS e = case e of+  WithApp r e es -> LHS <$> exprToPattern e <*> mapM exprToPattern es+  _              -> LHS <$> exprToPattern e <*> return []++-- | Turn an expression into a pattern. Fails if the expression is not a+--   valid pattern.+exprToPattern :: Expr -> Parser Pattern+exprToPattern e =+    case e of+        Ident x                 -> return $ IdentP x+        App _ e1 e2             -> AppP <$> exprToPattern e1+                                        <*> T.mapM (T.mapM exprToPattern) e2+        Paren r e               -> ParenP r+                                        <$> exprToPattern e+        Underscore r _          -> return $ WildP r+        Absurd r                -> return $ AbsurdP r+        As r x e                -> AsP r x <$> exprToPattern e+        Dot r (HiddenArg _ e)   -> return $ HiddenP r $ fmap (DotP r) e+        Dot r e                 -> return $ DotP r e+        Lit l                   -> return $ LitP l+        HiddenArg r e           -> HiddenP r <$> T.mapM exprToPattern e+        InstanceArg r e         -> InstanceP r <$> T.mapM exprToPattern e+        RawApp r es             -> RawAppP r <$> mapM exprToPattern es+        Quote r                 -> return $ QuoteP r+        _                       ->+          let Just pos = rStart $ getRange e in+          parseErrorAt pos $ "Not a valid pattern: " ++ show e++opAppExprToPattern :: OpApp Expr -> Parser Pattern+opAppExprToPattern (SyntaxBindingLambda _ _ _) = parseError "Syntax binding lambda cannot appear in a pattern"+opAppExprToPattern (Ordinary e) = exprToPattern e++-- | Turn an expression into a name. Fails if the expression is not a+--   valid identifier.+exprToName :: Expr -> Parser Name+exprToName (Ident (QName x)) = return x+exprToName e =+  let Just pos = rStart $ getRange e in+  parseErrorAt pos $ "Not a valid identifier: " ++ show e++stripSingletonRawApp :: Expr -> Expr+stripSingletonRawApp (RawApp _ [e]) = stripSingletonRawApp e+stripSingletonRawApp e = e++isEqual :: Expr -> Maybe (Expr, Expr)+isEqual e =+  case stripSingletonRawApp e of+    Equal _ a b -> Just (stripSingletonRawApp a, stripSingletonRawApp b)+    _           -> Nothing++maybeNamed :: Expr -> Named_ Expr+maybeNamed e =+  case isEqual e of+    Just (Ident (QName x), b) -> named (Ranged (getRange x) (nameToRawName x)) b+    _                         -> unnamed e++patternSynArgs :: [Either Hiding LamBinding] -> Parser [Arg Name]+patternSynArgs = mapM pSynArg+  where+    pSynArg Left{}                   = parseError "Absurd patterns are not allowed in pattern synonyms"+    pSynArg (Right DomainFull{})     = parseError "Unexpected type signature in pattern synonym argument"+    pSynArg (Right (DomainFree a x))+      | getHiding a `notElem` [Hidden, NotHidden] = parseError $ show (getHiding a) ++ " arguments not allowed to pattern synonyms"+      | getRelevance a /= Relevant                = parseError "Arguments to pattern synonyms must be relevant"+      | otherwise                                 = return $ Common.Arg a (boundName x)++parsePanic s = parseError $ "Internal parser error: " ++ s ++ ". Please report this as a bug."++{- RHS or type signature -}++data RHSOrTypeSigs+ = JustRHS RHS+ | TypeSigsRHS Expr+ deriving Show++patternToNames :: Pattern -> Parser [(C.ArgInfo, Name)]+patternToNames p =+  case p of+    IdentP (QName i)         -> return [(defaultArgInfo, i)]+    WildP r                  -> return [(defaultArgInfo, C.noName r)]+    DotP _ (Ident (QName i)) -> return [(setRelevance Irrelevant defaultArgInfo, i)]+    RawAppP _ ps             -> concat <$> mapM patternToNames ps+    _                        -> parseError $+      "Illegal name in type signature: " ++ prettyShow p++funClauseOrTypeSigs :: LHS -> RHSOrTypeSigs -> WhereClause -> Parser [Declaration]+funClauseOrTypeSigs lhs mrhs wh = do+  -- traceShowM lhs+  case mrhs of+    JustRHS rhs   -> return [FunClause lhs rhs wh]+    TypeSigsRHS e -> case wh of+      NoWhere -> case lhs of+        Ellipsis{}      -> parseError "The ellipsis ... cannot have a type signature"+        LHS _ _ _ (_:_) -> parseError "Illegal: with in type signature"+        LHS _ _ (_:_) _ -> parseError "Illegal: rewrite in type signature"+        LHS _ (_:_) _ _ -> parseError "Illegal: with patterns in type signature"+        LHS p [] [] []  -> map (\ (x, y) -> TypeSig x y e) <$> patternToNames p+      _ -> parseError "A type signature cannot have a where clause"++{--------------------------------------------------------------------------+    Tests+ --------------------------------------------------------------------------}++-- | Test suite.+tests :: IO Bool+tests = runTests "Agda.Syntax.Parser.Parser"+  [ quickCheck' prop_splitOnDots+  ]+{-# LINE 1 "templates/GenericTemplate.hs" #-}+{-# LINE 1 "templates/GenericTemplate.hs" #-}+{-# LINE 1 "<built-in>" #-}+{-# LINE 1 "<command-line>" #-}+{-# LINE 11 "<command-line>" #-}+{-# LINE 1 "/usr/local/stow/ghc-7.10.2/lib/ghc-7.10.2/include/ghcversion.h" #-}++++++++++++++++++{-# LINE 11 "<command-line>" #-} {-# LINE 1 "templates/GenericTemplate.hs" #-} -- Id: GenericTemplate.hs,v 1.26 2005/01/14 14:47:22 simonmar Exp  
src/agda-mode/Main.hs view
@@ -9,6 +9,7 @@ import Control.Monad import Data.Char import Data.List+import Data.Maybe import Data.Version import Numeric import System.Directory@@ -216,15 +217,27 @@   dataDir <- (</> "emacs-mode") <$> getDataDir   let elFiles = map (dataDir </>) emacsLispFiles   elFiles <- filterM doesFileExist elFiles-  exit <- rawSystem "emacs" $-                    [ "--no-init-file", "--no-site-file"-                    , "--directory", dataDir-                    , "--batch"-                    , "--funcall", "batch-byte-compile"-                    ] ++ elFiles-  unless (exit == ExitSuccess) $ do-    informLn "Unable to compile Emacs Lisp files."-    exitFailure+  results <- mapM (compile dataDir) elFiles+  case catMaybes results of+    [] -> return ()+    fs -> do+      informLn "Unable to compile the following Emacs Lisp files:"+      mapM_ (informLn . ("  " ++)) fs+      exitFailure+  where+  compile dataDir f = do+    exit <- rawSystem "emacs" $+                      [ "--no-init-file", "--no-site-file"+                      , "--directory", dataDir+                      , "--batch"+                      , "--eval"+                      , "(progn \+                           \(setq byte-compile-error-on-warn t) \+                           \(byte-compile-disable-warning 'cl-functions) \+                           \(batch-byte-compile))"+                      , f+                      ]+    return $ if exit == ExitSuccess then Nothing else Just f  ------------------------------------------------------------------------ -- Helper functions
src/data/emacs-mode/agda2-mode.el view
@@ -10,7 +10,7 @@  ;;; Code: -(defvar agda2-version "2.4.2.3"+(defvar agda2-version "2.4.2.4"   "The version of the Agda mode. Note that the same version of the Agda executable must be used.") @@ -1573,12 +1573,10 @@   "Go to the definition site of the name clicked on, if any. Otherwise, yank (see `mouse-yank-primary')."   (interactive "e")-  (let ((pos (posn-point (event-end ev))))-    (if (annotation-goto-possible pos)-        (annotation-goto-indirect pos)-      ;; FIXME: Shouldn't we use something like-      ;; (call-interactively (key-binding ev))?  --Stef-      (mouse-yank-primary ev))))+  (unless (annotation-goto-indirect ev)+    ;; FIXME: Shouldn't we use something like+    ;; (call-interactively (key-binding ev))?  --Stef+    (mouse-yank-primary ev)))  (defun agda2-go-back nil   "Go back to the previous position in which
src/data/emacs-mode/annotation.el view
@@ -18,19 +18,48 @@ (defvar annotation-goto-stack nil   "Positions from which `annotation-goto' was invoked.") -(defun annotation-goto-possible (pos)-  "Return t if there's a hyperlink at the buffer position POS, and nil otherwise."-  (if (get-text-property pos 'annotation-goto) t))+(defun annotation-goto-indirect (link &optional other-window)+  "Follow the `annotation-goto' hyperlink pointed to by LINK, if any. -(defun annotation-goto-indirect (pos &optional other-window)-  "Follow the `annotation-goto' hyperlink at position POS, if any.-If OTHER-WINDOW is t, use another window to display the given position."-  (let ((previous-file-name buffer-file-name))-    (if (and (annotation-goto (get-text-property pos 'annotation-goto)-                              other-window)-             (not (eq (point) pos)))-        (push `(,previous-file-name . ,pos) annotation-goto-stack))))+LINK should be a buffer position, or an event object (in which+case the ending position is used). +If the hyperlink exists and the jump is performed successfully,+then `t' is returned, and otherwise `nil' (unless an error is+raised).++If OTHER-WINDOW is non-nil, then another window is used to+display the target position."+  (let (source-pos+        source-window+        source-buffer+        source-file-name+        target)+    (cond ((eventp link)+           (let ((pn (event-end link)))+             (when (not (posn-area pn))+               (setq source-pos (posn-point pn))+               (setq source-window (posn-window pn))+               (setq source-buffer (window-buffer source-window)))))+          ((integerp link)+           (setq source-pos link)+           (setq source-window (selected-window))+           (setq source-buffer (current-buffer)))+          (t (error "Not an integer or event object: %S" link)))+    (when (and source-pos source-buffer)+      (with-current-buffer source-buffer+        (setq source-file-name buffer-file-name)+        (setq target (get-text-property source-pos 'annotation-goto)))+      (when target+        (unless (equal source-window (selected-window))+          (select-window source-window))+        (when (annotation-goto target other-window)+          (unless (and (equal source-buffer (current-buffer))+                       (eq source-pos (point)))+            (push `(,source-file-name . ,source-pos)+                  annotation-goto-stack))+          t)))))+ (defun annotation-go-back nil   "Go back to the previous position in which `annotation-goto' was successfully invoked."@@ -42,8 +71,8 @@   "Go to file position FILEPOS if the file is readable. FILEPOS should have the form (FILE . POS).  Return t if successful. -If OTHER-WINDOW is t, use another window to display the given-position."+If OTHER-WINDOW is non-nil, use another window to display the+given position."   (when (consp filepos)     (let ((file (car filepos)))       (if (file-readable-p file)
src/full/Agda/Auto/Auto.hs view
@@ -115,338 +115,339 @@   let failHints = dispmsg "Hints must be a list of constant names"   caseMaybe (mapM getName ahints) failHints $ \ ehints -> do -  -- Get names for equality reasoning.-  -- @eqstuff == []@ if any of these names is not defined.-  eqstuffExprs <- mapM (parseExprIn ii rng) ["_≡_", "begin_", "_≡⟨_⟩_", "_∎", "sym", "cong"]-    `catchError`-      (\_ -> return [])-  let eqstuff = fromMaybe [] $ mapM getName eqstuffExprs+    -- Get names for equality reasoning.+    -- @eqstuff == []@ if any of these names is not defined.+    eqstuffExprs <- mapM (parseExprIn ii rng) ["_≡_", "begin_", "_≡⟨_⟩_", "_∎", "sym", "cong"]+      `catchError`+        (\_ -> return [])+    let eqstuff = fromMaybe [] $ mapM getName eqstuffExprs -  -- Get the meta variable for the interaction point we are trying to fill.-  -- Add the @autohints@ for that meta to the hints collection.-  mi <- lookupInteractionId ii-  --thisdefinfo <- catchError (liftM Just $ findClause mi) (\_ -> return Nothing)-  thisdefinfo <- findClauseDeep mi-  ehints <- (ehints ++) <$> do autohints hintmode mi $ fmap fst3 thisdefinfo+    -- Get the meta variable for the interaction point we are trying to fill.+    -- Add the @autohints@ for that meta to the hints collection.+    mi <- lookupInteractionId ii+    --thisdefinfo <- catchError (liftM Just $ findClause mi) (\_ -> return Nothing)+    thisdefinfo <- findClauseDeep mi+    ehints <- (ehints ++) <$> do autohints hintmode mi $ fmap fst3 thisdefinfo -  -- If @thisdefinfo /= Nothing@ get the its type (normalized).-  mrectyp <- maybeToList <$> do-    Trav.forM thisdefinfo $ \ (def, _, _) -> do-      normalise =<< do TCM.defType <$> getConstInfo def+    -- If @thisdefinfo /= Nothing@ get the its type (normalized).+    mrectyp <- maybeToList <$> do+      Trav.forM thisdefinfo $ \ (def, _, _) -> do+        normalise =<< do TCM.defType <$> getConstInfo def -  (myhints', mymrectyp, tccons, eqcons, cmap) <- tomy mi (ehints ++ eqstuff) mrectyp+    (myhints', mymrectyp, tccons, eqcons, cmap) <- tomy mi (ehints ++ eqstuff) mrectyp -  let (myhints, c1to6) = splitAt (length myhints' - length eqstuff) myhints'-      meqr = ifNull eqstuff Nothing $ \ _ -> {- else -}-               let [c1, c2, c3, c4, c5, c6] = c1to6-               in  Just $ EqReasoningConsts c1 c2 c3 c4 c5 c6+    let (myhints, c1to6) = splitAt (length myhints' - length eqstuff) myhints'+        meqr = ifNull eqstuff Nothing $ \ _ -> {- else -}+                 let [c1, c2, c3, c4, c5, c6] = c1to6+                 in  Just $ EqReasoningConsts c1 c2 c3 c4 c5 c6  -  let tcSearchSC isdep ctx typ trm = caseMaybe meqr a $ \ eqr ->-        mpret $ Sidecondition (calcEqRState eqr trm) a-        where a = tcSearch isdep ctx typ trm+    let tcSearchSC isdep ctx typ trm = caseMaybe meqr a $ \ eqr ->+          mpret $ Sidecondition (calcEqRState eqr trm) a+          where a = tcSearch isdep ctx typ trm -  let (mainm, _, _, _) = tccons Map.! mi-  case mode of-   MNormal listmode disprove -> do-      let numsols = if listmode then 10 else 1-        -- Andreas, 2015-05-17 Issue 1504:-        -- wish to produce several solutions, as-        -- the first one might be ill-typed.-        -- However, currently changing the 1 to something higher makes Agsy loop.-      sols <- liftIO $ newIORef ([] :: [[I.Term]])-      nsol <- liftIO $ newIORef $ pick + numsols-      let hsol = do-           nsol' <- readIORef nsol-           let cond = nsol' <= numsols-           when cond $ do-             trms <- runExceptT $ mapM (\ (m, _, _, _) -> frommy (Meta m)) $ Map.elems tccons-             case trms of-               Left{}     -> writeIORef nsol $! nsol' + 1-               Right trms -> modifyIORef sols (trms :)-               -- Right trms -> if listmode then modifyIORef sols (trms :)-               --                           else writeIORef sols [trms]-      ticks <- liftIO $ newIORef 0+    let (mainm, _, _, _) = tccons Map.! mi+    case mode of+     MNormal listmode disprove -> do+        let numsols = if listmode then 10 else 1+          -- Andreas, 2015-05-17 Issue 1504:+          -- wish to produce several solutions, as+          -- the first one might be ill-typed.+          -- However, currently changing the 1 to something higher makes Agsy loop.+        sols <- liftIO $ newIORef ([] :: [[I.Term]])+        nsol <- liftIO $ newIORef $ pick + numsols+        let hsol = do+             nsol' <- readIORef nsol+             let cond = nsol' <= numsols+             when cond $ do+               trms <- runExceptT $ mapM (\ (m, _, _, _) -> frommy (Meta m)) $ Map.elems tccons+               case trms of+                 Left{}     -> writeIORef nsol $! nsol' + 1+                 Right trms -> modifyIORef sols (trms :)+                 -- Right trms -> if listmode then modifyIORef sols (trms :)+                 --                           else writeIORef sols [trms]+        ticks <- liftIO $ newIORef 0 -      let exsearch initprop recinfo defdfv =-           liftIO $ System.Timeout.timeout (timeout * 1000000) $ loop 0-           where-             loop d = do-               let rechint x = case recinfo of-                                Nothing -> x-                                Just (_, recdef) -> (recdef, HMRecCall) : x-                   env = RIEnv { rieHints             = rechint $ map (,HMNormal) myhints-                               , rieDefFreeVars       = defdfv-                               , rieEqReasoningConsts = meqr-                               }-               depreached <- topSearch ticks nsol hsol env (initprop) d costIncrease-               nsol' <- readIORef nsol-               if nsol' /= 0 && depreached then loop (d + costIncrease) else return depreached+        let exsearch initprop recinfo defdfv =+             liftIO $ System.Timeout.timeout (timeout * 1000000) $ loop 0+             where+               loop d = do+                 let rechint x = case recinfo of+                                  Nothing -> x+                                  Just (_, recdef) -> (recdef, HMRecCall) : x+                     env = RIEnv { rieHints             = rechint $ map (,HMNormal) myhints+                                 , rieDefFreeVars       = defdfv+                                 , rieEqReasoningConsts = meqr+                                 }+                 depreached <- topSearch ticks nsol hsol env (initprop) d costIncrease+                 nsol' <- readIORef nsol+                 if nsol' /= 0 && depreached then loop (d + costIncrease) else return depreached -      let getsols sol = do-           exprs <- forM (zip (Map.keys tccons) sol) $ \ (mi, e) -> do-             mv   <- lookupMeta mi-             e    <- etaContract e-             expr <- modifyAbstractExpr <$> do withMetaInfo (getMetaInfo mv) $ reify e-             return (mi, expr)+        let getsols sol = do+             exprs <- forM (zip (Map.keys tccons) sol) $ \ (mi, e) -> do+               mv   <- lookupMeta mi+               e    <- etaContract e+               expr <- modifyAbstractExpr <$> do withMetaInfo (getMetaInfo mv) $ reify e+               return (mi, expr) -           let loop :: I.MetaId -> StateT [I.MetaId] TCM [(I.MetaId, A.Expr)]-               loop midx = do-                 let (m, _, _, deps) = tccons Map.! midx-                 asolss <- mapM loop deps-                 dones  <- get-                 asols  <- if midx `elem` dones then return [] else do-                   put (midx : dones)-                   return [(midx, fromMaybe __IMPOSSIBLE__ $ lookup midx exprs)]-                 return $ concat asolss ++ asols-           (asols, _) <- runStateT (loop mi) []-           return asols+             let loop :: I.MetaId -> StateT [I.MetaId] TCM [(I.MetaId, A.Expr)]+                 loop midx = do+                   let (m, _, _, deps) = tccons Map.! midx+                   asolss <- mapM loop deps+                   dones  <- get+                   asols  <- if midx `elem` dones then return [] else do+                     put (midx : dones)+                     return [(midx, fromMaybe __IMPOSSIBLE__ $ lookup midx exprs)]+                   return $ concat asolss ++ asols+             (asols, _) <- runStateT (loop mi) []+             return asols -      if disprove then-        case eqcons of-         [] -> case Map.elems tccons of-          (m, mytype, mylocalVars, _) : [] -> do-              defdfv <- case thisdefinfo of-                         Just (def, _, _) -> getdfv mi def-                         Nothing -> return 0-              ee <- liftIO $ newIORef $ ConstDef {cdname = "T", cdorigin = __IMPOSSIBLE__, cdtype = NotM $ Sort (Set 0), cdcont = Postulate, cddeffreevars = 0}-              let (restargs, modargs) = splitAt (length mylocalVars - defdfv) mylocalVars-                  mytype' = foldl (\x y -> NotM $ Pi Nothing Agda.Auto.Syntax.NotHidden (freeIn 0 y) y (Abs NoId x)) mytype restargs-                  htyp = negtype ee mytype'-                  sctx = (Id "h", closify htyp) : map (\x -> (NoId, closify x)) modargs-                  ntt = closify (NotM $ App Nothing (NotM OKVal) (Const ee) (NotM ALNil))-              res <- exsearch (tcSearchSC False sctx ntt (Meta m)) Nothing defdfv-              rsols <- liftM reverse $ liftIO $ readIORef sols-              if null rsols then do-                nsol' <- liftIO $ readIORef nsol-                dispmsg $ insuffsols (pick + numsols - nsol')-               else do-                aexprss <- mapM getsols rsols-                cexprss <- forM aexprss $ mapM $ \(mi, e) -> do+        if disprove then+          case eqcons of+           [] -> case Map.elems tccons of+            (m, mytype, mylocalVars, _) : [] -> do+                defdfv <- case thisdefinfo of+                           Just (def, _, _) -> getdfv mi def+                           Nothing -> return 0+                ee <- liftIO $ newIORef $ ConstDef {cdname = "T", cdorigin = __IMPOSSIBLE__, cdtype = NotM $ Sort (Set 0), cdcont = Postulate, cddeffreevars = 0}+                let (restargs, modargs) = splitAt (length mylocalVars - defdfv) mylocalVars+                    mytype' = foldl (\x y -> NotM $ Pi Nothing Agda.Auto.Syntax.NotHidden (freeIn 0 y) y (Abs NoId x)) mytype restargs+                    htyp = negtype ee mytype'+                    sctx = (Id "h", closify htyp) : map (\x -> (NoId, closify x)) modargs+                    ntt = closify (NotM $ App Nothing (NotM OKVal) (Const ee) (NotM ALNil))+                res <- exsearch (tcSearchSC False sctx ntt (Meta m)) Nothing defdfv+                rsols <- liftM reverse $ liftIO $ readIORef sols+                if null rsols then do+                  nsol' <- liftIO $ readIORef nsol+                  dispmsg $ insuffsols (pick + numsols - nsol')+                 else do+                  aexprss <- mapM getsols rsols+                  cexprss <- forM aexprss $ mapM $ \(mi, e) -> do+                    mv <- lookupMeta mi+                    withMetaInfo (getMetaInfo mv) $ do+                      (mi,) <$> abstractToConcrete_ e+                  let ss = dropWhile (== ' ') . dropWhile (/= ' ') . show+                      disp [(_, cexpr)] = ss cexpr+                      disp cexprs = concat $ map (\ (mi, cexpr) -> ss cexpr ++ " ") cexprs+                  ticks <- liftIO $ readIORef ticks+                  dispmsg $ unlines $+                    ("Listing disproof(s) " ++ show pick ++ "-" ++ show (pick + length rsols - 1)) :+                    for (zip cexprss [pick..]) (\ (x, y) -> show y ++ "  " ++ disp x)+            _ -> dispmsg "Metavariable dependencies not allowed in disprove mode"+           _ -> dispmsg "Metavariable dependencies not allowed in disprove mode"+         else do+          (recinfo, defdfv) <-+           case thisdefinfo of+            Just (def, clause, _) -> do+             let [rectyp'] = mymrectyp+             defdfv <- getdfv mi def+             myrecdef <- liftIO $ newIORef $ ConstDef {cdname = "", cdorigin = (Nothing, def), cdtype = rectyp', cdcont = Postulate, cddeffreevars = defdfv}+             (_, pats) <- constructPats cmap mi clause+             defdfv <- getdfv mi def+             return $ if contains_constructor pats then+               (Just (pats, myrecdef), defdfv)+              else+               (Nothing, defdfv)+            Nothing -> return (Nothing, 0)+          let tc (m, mytype, mylocalVars) isdep = tcSearchSC isdep (map (\x -> (NoId, closify x)) mylocalVars) (closify mytype) (Meta m)+              initprop =+                foldl (\x (ineq, e, i) -> mpret $ And Nothing x (comp' ineq (closify e) (closify i)))+                 (foldl (\x (m, mt, mlv, _) ->+                   if hequalMetavar m mainm then+                    case recinfo of+                     Just (recpats, recdef) ->+                      mpret $ Sidecondition (localTerminationSidecond (localTerminationEnv recpats) recdef (Meta m))+                                            (tc (m, mt, mlv) False)+                     Nothing -> mpret $ And Nothing x (tc (m, mt, mlv) False)+                   else+                    mpret $ And Nothing x (tc (m, mt, mlv) True)+                  )+                  (mpret OK)+                  (Map.elems tccons)+                 ) eqcons+          res <- exsearch initprop recinfo defdfv+          riis <- map swap <$> getInteractionIdsAndMetas+          let timeoutString | isNothing res = " after timeout (" ++ show timeout ++ "s)"+                            | otherwise     = ""+          if listmode then do+            rsols <- liftM reverse $ liftIO $ readIORef sols+            if null rsols then do+              nsol' <- liftIO $ readIORef nsol+              dispmsg $ insuffsols (pick + numsols - nsol') ++ timeoutString+             else do+              aexprss <- mapM getsols rsols+              -- cexprss <- mapM (mapM (\(mi, e) -> lookupMeta mi >>= \mv -> withMetaInfo (getMetaInfo mv) $ abstractToConcrete_ e >>= \e' -> return (mi, e'))) aexprss+              cexprss <- forM aexprss $ do+                mapM $ \ (mi, e) -> do                   mv <- lookupMeta mi                   withMetaInfo (getMetaInfo mv) $ do-                    (mi,) <$> abstractToConcrete_ e-                let ss = dropWhile (== ' ') . dropWhile (/= ' ') . show-                    disp [(_, cexpr)] = ss cexpr-                    disp cexprs = concat $ map (\ (mi, cexpr) -> ss cexpr ++ " ") cexprs-                ticks <- liftIO $ readIORef ticks-                dispmsg $ unlines $-                  ("Listing disproof(s) " ++ show pick ++ "-" ++ show (pick + length rsols - 1)) :-                  for (zip cexprss [pick..]) (\ (x, y) -> show y ++ "  " ++ disp x)-          _ -> dispmsg "Metavariable dependencies not allowed in disprove mode"-         _ -> dispmsg "Metavariable dependencies not allowed in disprove mode"-       else do-        (recinfo, defdfv) <--         case thisdefinfo of-          Just (def, clause, _) -> do-           let [rectyp'] = mymrectyp-           defdfv <- getdfv mi def-           myrecdef <- liftIO $ newIORef $ ConstDef {cdname = "", cdorigin = (Nothing, def), cdtype = rectyp', cdcont = Postulate, cddeffreevars = defdfv}-           (_, pats) <- constructPats cmap mi clause-           defdfv <- getdfv mi def-           return $ if contains_constructor pats then-             (Just (pats, myrecdef), defdfv)-            else-             (Nothing, defdfv)-          Nothing -> return (Nothing, 0)-        let tc (m, mytype, mylocalVars) isdep = tcSearchSC isdep (map (\x -> (NoId, closify x)) mylocalVars) (closify mytype) (Meta m)-            initprop =-              foldl (\x (ineq, e, i) -> mpret $ And Nothing x (comp' ineq (closify e) (closify i)))-               (foldl (\x (m, mt, mlv, _) ->-                 if hequalMetavar m mainm then-                  case recinfo of-                   Just (recpats, recdef) ->-                    mpret $ Sidecondition (localTerminationSidecond (localTerminationEnv recpats) recdef (Meta m))-                                          (tc (m, mt, mlv) False)-                   Nothing -> mpret $ And Nothing x (tc (m, mt, mlv) False)-                 else-                  mpret $ And Nothing x (tc (m, mt, mlv) True)-                )-                (mpret OK)-                (Map.elems tccons)-               ) eqcons-        res <- exsearch initprop recinfo defdfv-        riis <- map swap <$> getInteractionIdsAndMetas-        let timeoutString | isNothing res = " after timeout (" ++ show timeout ++ "s)"-                          | otherwise     = ""-        if listmode then do-          rsols <- liftM reverse $ liftIO $ readIORef sols-          if null rsols then do-            nsol' <- liftIO $ readIORef nsol-            dispmsg $ insuffsols (pick + numsols - nsol') ++ timeoutString-           else do-            aexprss <- mapM getsols rsols-            -- cexprss <- mapM (mapM (\(mi, e) -> lookupMeta mi >>= \mv -> withMetaInfo (getMetaInfo mv) $ abstractToConcrete_ e >>= \e' -> return (mi, e'))) aexprss-            cexprss <- forM aexprss $ do-              mapM $ \ (mi, e) -> do-                mv <- lookupMeta mi-                withMetaInfo (getMetaInfo mv) $ do-                  e' <- abstractToConcrete_ e-                  return (mi, e')-            let disp [(_, cexpr)] = show cexpr-                disp cexprs = concat $ for cexprs $ \ (mi, cexpr) ->-                  maybe (show mi) show (lookup mi riis)-                    ++ " := " ++ show cexpr ++ " "-            ticks <- liftIO $ readIORef ticks-            dispmsg $ "Listing solution(s) " ++ show pick ++ "-" ++ show (pick + length rsols - 1) ++ timeoutString ++-                      "\n" ++ unlines (map (\(x, y) -> show y ++ "  " ++ disp x) $ zip cexprss [pick..])-         else {- not listmode -}-          case res of-           Nothing -> do-            nsol' <- liftIO $ readIORef nsol-            dispmsg $ insuffsols (pick + numsols - nsol') ++ timeoutString-           Just depthreached -> do-            ticks <- liftIO $ readIORef ticks-            rsols <- liftIO $ readIORef sols-            case rsols of-              [] -> do-                nsol' <- liftIO $ readIORef nsol-                dispmsg $ insuffsols (pick + numsols - nsol')-              terms -> loop terms where-                -- Andreas, 2015-05-17  Issue 1504-                -- If giving a solution failed (e.g. ill-typed)-                -- we could try the next one.-                -- However, currently @terms@ is always a singleton list.-                -- Thus, the following @loop@ is not doing something very-                -- meaningful.-                loop [] = return (Left [], Just "")-                loop (term : terms') = do-                  -- On exception, try next solution-                  flip catchError (const $ loop terms') $ do-                  exprs <- getsols term-                  reportSDoc "auto" 20 $ TCM.text "Trying solution " TCM.<+> TCM.prettyTCM exprs-                  giveress <- forM exprs $ \ (mi, expr) ->-                    case lookup mi riis of-                     Nothing ->-                      -- catchError-                       (giveExpr mi expr >> return (Nothing, Nothing))-                       -- (const retry)-                       -- (\_ -> return (Nothing, Just ("Failed to give expr for side solution of " ++ show mi)))-                     Just ii' -> do ae <- give ii' Nothing expr-                                    mv <- lookupMeta mi-                                    let scope = getMetaScope mv-                                    ce <- abstractToConcreteEnv (makeEnv scope) ae-                                    let cmnt = if ii' == ii then agsyinfo ticks else ""-                                    return (Just (ii', show ce ++ cmnt), Nothing)-                       -- Andreas, 2015-05-17, Issue 1504-                       -- When Agsy produces an ill-typed solution, return nothing.-                       -- TODO: try other solution.-                       -- `catchError` const retry -- (return (Nothing, Nothing))-                  let msg = if length exprs == 1 then-                             Nothing-                            else-                             Just $ "Also gave solution(s) for hole(s)" ++-                                     concatMap (\(mi', _) ->-                                      if mi' == mi then "" else (" " ++ case lookup mi' riis of {Nothing -> show mi'; Just ii -> show ii})-                                     ) exprs-                  let msgs = catMaybes $ msg : map snd giveress-                      msg' = case msgs of-                              [] -> Nothing-                              _ -> Just $ unlines msgs-                  return (Left $ catMaybes $ map fst giveress, msg')+                    e' <- abstractToConcrete_ e+                    return (mi, e')+              let disp [(_, cexpr)] = show cexpr+                  disp cexprs = concat $ for cexprs $ \ (mi, cexpr) ->+                    maybe (show mi) show (lookup mi riis)+                      ++ " := " ++ show cexpr ++ " "+              ticks <- liftIO $ readIORef ticks+              dispmsg $ "Listing solution(s) " ++ show pick ++ "-" ++ show (pick + length rsols - 1) ++ timeoutString +++                        "\n" ++ unlines (map (\(x, y) -> show y ++ "  " ++ disp x) $ zip cexprss [pick..])+           else {- not listmode -}+            case res of+             Nothing -> do+              nsol' <- liftIO $ readIORef nsol+              dispmsg $ insuffsols (pick + numsols - nsol') ++ timeoutString+             Just depthreached -> do+              ticks <- liftIO $ readIORef ticks+              rsols <- liftIO $ readIORef sols+              case rsols of+                [] -> do+                  nsol' <- liftIO $ readIORef nsol+                  dispmsg $ insuffsols (pick + numsols - nsol')+                terms -> loop terms where+                  -- Andreas, 2015-05-17  Issue 1504+                  -- If giving a solution failed (e.g. ill-typed)+                  -- we could try the next one.+                  -- However, currently @terms@ is always a singleton list.+                  -- Thus, the following @loop@ is not doing something very+                  -- meaningful.+                  loop [] = return (Left [], Just "")+                  loop (term : terms') = do+                    -- On exception, try next solution+                    flip catchError (const $ loop terms') $ do+                      exprs <- getsols term+                      reportSDoc "auto" 20 $ TCM.text "Trying solution " TCM.<+> TCM.prettyTCM exprs+                      giveress <- forM exprs $ \ (mi, expr0) -> do+                        let expr = killRange expr0+                        case lookup mi riis of+                         Nothing ->+                          -- catchError+                           (giveExpr mi expr >> return (Nothing, Nothing))+                           -- (const retry)+                           -- (\_ -> return (Nothing, Just ("Failed to give expr for side solution of " ++ show mi)))+                         Just ii' -> do ae <- give ii' Nothing expr+                                        mv <- lookupMeta mi+                                        let scope = getMetaScope mv+                                        ce <- abstractToConcreteEnv (makeEnv scope) ae+                                        let cmnt = if ii' == ii then agsyinfo ticks else ""+                                        return (Just (ii', show ce ++ cmnt), Nothing)+                           -- Andreas, 2015-05-17, Issue 1504+                           -- When Agsy produces an ill-typed solution, return nothing.+                           -- TODO: try other solution.+                           -- `catchError` const retry -- (return (Nothing, Nothing))+                      let msg = if length exprs == 1 then+                                 Nothing+                                else+                                 Just $ "Also gave solution(s) for hole(s)" +++                                         concatMap (\(mi', _) ->+                                          if mi' == mi then "" else (" " ++ case lookup mi' riis of {Nothing -> show mi'; Just ii -> show ii})+                                         ) exprs+                      let msgs = catMaybes $ msg : map snd giveress+                          msg' = case msgs of+                                  [] -> Nothing+                                  _ -> Just $ unlines msgs+                      return (Left $ catMaybes $ map fst giveress, msg') -   MCaseSplit -> do-    case thisdefinfo of-     Just (def, clause, True) ->-      case Map.elems tccons of-       [(m, mytype, mylocalVars, _)] | null eqcons -> do-        (ids, pats) <- constructPats cmap mi clause-        let ctx = map (\((hid, id), t) -> HI hid (id, t)) (zip ids mylocalVars)-        ticks <- liftIO $ newIORef 0-        let [rectyp'] = mymrectyp-        defdfv <- getdfv mi def-        myrecdef <- liftIO $ newIORef $ ConstDef {cdname = "", cdorigin = (Nothing, def), cdtype = rectyp', cdcont = Postulate, cddeffreevars = defdfv}-        sols <- liftIO $ System.Timeout.timeout (timeout * 1000000) (-           let r d = do-                sols <- liftIO $ caseSplitSearch ticks __IMPOSSIBLE__ myhints meqr __IMPOSSIBLE__ d myrecdef ctx mytype pats-                case sols of-                 [] -> r (d + costIncrease)-                 (_:_) -> return sols-           in r 0)-        case sols of-         Just (cls : _) -> withInteractionId ii $ do-          cls' <- liftIO $ runExceptT (mapM frommyClause cls)-          case cls' of-           Left{} -> dispmsg "No solution found"-           Right cls' -> do-            cls'' <- forM cls' $ \ (I.Clause _ tel perm ps body t) -> do-              withCurrentModule (AN.qnameModule def) $ do-               -- Normalise the dot patterns-               ps <- addCtxTel tel $ normalise ps-               body <- etaContractBody body-               liftM modifyAbstractClause $ inContext [] $ reify $ AN.QNamed def $ I.Clause noRange tel perm ps body t-            pcs <- withInteractionId ii $ mapM prettyA cls''-            ticks <- liftIO $ readIORef ticks+     MCaseSplit -> do+      case thisdefinfo of+       Just (def, clause, True) ->+        case Map.elems tccons of+         [(m, mytype, mylocalVars, _)] | null eqcons -> do+          (ids, pats) <- constructPats cmap mi clause+          let ctx = map (\((hid, id), t) -> HI hid (id, t)) (zip ids mylocalVars)+          ticks <- liftIO $ newIORef 0+          let [rectyp'] = mymrectyp+          defdfv <- getdfv mi def+          myrecdef <- liftIO $ newIORef $ ConstDef {cdname = "", cdorigin = (Nothing, def), cdtype = rectyp', cdcont = Postulate, cddeffreevars = defdfv}+          sols <- liftIO $ System.Timeout.timeout (timeout * 1000000) (+             let r d = do+                  sols <- liftIO $ caseSplitSearch ticks __IMPOSSIBLE__ myhints meqr __IMPOSSIBLE__ d myrecdef ctx mytype pats+                  case sols of+                   [] -> r (d + costIncrease)+                   (_:_) -> return sols+             in r 0)+          case sols of+           Just (cls : _) -> withInteractionId ii $ do+            cls' <- liftIO $ runExceptT (mapM frommyClause cls)+            case cls' of+             Left{} -> dispmsg "No solution found"+             Right cls' -> do+              cls'' <- forM cls' $ \ (I.Clause _ tel perm ps body t) -> do+                withCurrentModule (AN.qnameModule def) $ do+                 -- Normalise the dot patterns+                 ps <- addCtxTel tel $ normalise ps+                 body <- etaContractBody body+                 liftM modifyAbstractClause $ inContext [] $ reify $ AN.QNamed def $ I.Clause noRange tel perm ps body t+              pcs <- withInteractionId ii $ mapM prettyA cls''+              ticks <- liftIO $ readIORef ticks  -            return (Right $ Left (map (insertAbsurdPattern . PP.renderStyle (PP.style { PP.mode = PP.OneLineMode })) pcs), Nothing)+              return (Right $ Left (map (insertAbsurdPattern . PP.renderStyle (PP.style { PP.mode = PP.OneLineMode })) pcs), Nothing) -         Just [] -> dispmsg "No solution found" -- case not possible at the moment because case split doesnt care about search exhaustiveness-         Nothing -> dispmsg $ "No solution found at time out (" ++ show timeout ++ "s)"-       _ -> dispmsg "Metavariable dependencies not allowed in case split mode"-     _ -> dispmsg "Metavariable is not at top level of clause RHS"+           Just [] -> dispmsg "No solution found" -- case not possible at the moment because case split doesnt care about search exhaustiveness+           Nothing -> dispmsg $ "No solution found at time out (" ++ show timeout ++ "s)"+         _ -> dispmsg "Metavariable dependencies not allowed in case split mode"+       _ -> dispmsg "Metavariable is not at top level of clause RHS" -   MRefine listmode -> do-    mv <- lookupMeta mi-    let tt = jMetaType $ mvJudgement mv-        minfo = getMetaInfo mv-    targettyp <- withMetaInfo minfo $ do-     vs <- getContextArgs-     let targettype = tt `piApply` permute (takeP (length vs) $ mvPermutation mv) vs-     normalise targettype-    let tctx = length $ envContext $ clEnv minfo+     MRefine listmode -> do+      mv <- lookupMeta mi+      let tt = jMetaType $ mvJudgement mv+          minfo = getMetaInfo mv+      targettyp <- withMetaInfo minfo $ do+       vs <- getContextArgs+       let targettype = tt `piApply` permute (takeP (length vs) $ mvPermutation mv) vs+       normalise targettype+      let tctx = length $ envContext $ clEnv minfo -    hits <- if elem "-a" hints then do-      st <- liftTCM $ join $ pureTCM $ \st _ -> return st-      let defs = sigDefinitions $ st^.stSignature-          idefs = sigDefinitions $ st^.stImports-          alldefs = HMap.keys defs ++ HMap.keys idefs-      liftM catMaybes $ mapM (\n ->-        case thisdefinfo of-         Just (def, _, _) | def == n -> return Nothing-         _ -> do-          cn <- withMetaInfo minfo $ runAbsToCon $ toConcrete n-          if head (show cn) == '.' then -- not in scope-            return Nothing-           else do-            c <- getConstInfo n-            ctyp <- normalise $ defType c-            cdfv <- withMetaInfo minfo $ getDefFreeVars n-            return $ case matchType cdfv tctx ctyp targettyp of-             Nothing -> Nothing-             Just score -> Just (show cn, score)-       ) alldefs-     else do-      let scopeinfo = clScope (getMetaInfo mv)-          namespace = Scope.everythingInScope scopeinfo-          names = Scope.nsNames namespace-          qnames = map (\(x, y) -> (x, Scope.anameName $ head y)) $ Map.toList names-          modnames = case thisdefinfo of-                      Just (def, _, _) -> filter (\(_, n) -> n /= def) qnames-                      Nothing -> qnames-      liftM catMaybes $ mapM (\(cn, n) -> do-        c <- getConstInfo n-        ctyp <- normalise $ defType c-        cdfv <- withMetaInfo minfo $ getDefFreeVars n-        return $ case matchType cdfv tctx ctyp targettyp of-         Nothing -> Nothing-         Just score -> Just (show cn, score)-       ) modnames+      hits <- if elem "-a" hints then do+        st <- liftTCM $ join $ pureTCM $ \st _ -> return st+        let defs = sigDefinitions $ st^.stSignature+            idefs = sigDefinitions $ st^.stImports+            alldefs = HMap.keys defs ++ HMap.keys idefs+        liftM catMaybes $ mapM (\n ->+          case thisdefinfo of+           Just (def, _, _) | def == n -> return Nothing+           _ -> do+            cn <- withMetaInfo minfo $ runAbsToCon $ toConcrete n+            if head (show cn) == '.' then -- not in scope+              return Nothing+             else do+              c <- getConstInfo n+              ctyp <- normalise $ defType c+              cdfv <- withMetaInfo minfo $ getDefFreeVars n+              return $ case matchType cdfv tctx ctyp targettyp of+               Nothing -> Nothing+               Just score -> Just (show cn, score)+         ) alldefs+       else do+        let scopeinfo = clScope (getMetaInfo mv)+            namespace = Scope.everythingInScope scopeinfo+            names = Scope.nsNames namespace+            qnames = map (\(x, y) -> (x, Scope.anameName $ head y)) $ Map.toList names+            modnames = case thisdefinfo of+                        Just (def, _, _) -> filter (\(_, n) -> n /= def) qnames+                        Nothing -> qnames+        liftM catMaybes $ mapM (\(cn, n) -> do+          c <- getConstInfo n+          ctyp <- normalise $ defType c+          cdfv <- withMetaInfo minfo $ getDefFreeVars n+          return $ case matchType cdfv tctx ctyp targettyp of+           Nothing -> Nothing+           Just score -> Just (show cn, score)+         ) modnames -    let sorthits = sortBy (\(_, (pa1, pb1)) (_, (pa2, pb2)) -> case compare pa2 pa1 of {EQ -> compare pb1 pb2; o -> o}) hits-    if listmode || pick == (-1) then-      let pick' = max 0 pick-      in if pick' >= length sorthits then-           dispmsg $ insuffcands $ length sorthits-          else-           let showhits = take 10 $ drop pick' sorthits-           in dispmsg $ "Listing candidate(s) " ++ show pick' ++ "-" ++ show (pick' + length showhits - 1) ++ " (found " ++ show (length sorthits) ++ " in total)\n" ++-                         unlines (map (\(i, (cn, _)) -> show i ++ "  " ++ cn) (zip [pick'..pick' + length showhits - 1] showhits))-     else-      if pick >= length sorthits then-       dispmsg $ insuffcands $ length sorthits-      else-       return (Right $ Right (fst $ sorthits !! pick), Nothing)+      let sorthits = sortBy (\(_, (pa1, pb1)) (_, (pa2, pb2)) -> case compare pa2 pa1 of {EQ -> compare pb1 pb2; o -> o}) hits+      if listmode || pick == (-1) then+        let pick' = max 0 pick+        in if pick' >= length sorthits then+             dispmsg $ insuffcands $ length sorthits+            else+             let showhits = take 10 $ drop pick' sorthits+             in dispmsg $ "Listing candidate(s) " ++ show pick' ++ "-" ++ show (pick' + length showhits - 1) ++ " (found " ++ show (length sorthits) ++ " in total)\n" +++                           unlines (map (\(i, (cn, _)) -> show i ++ "  " ++ cn) (zip [pick'..pick' + length showhits - 1] showhits))+       else+        if pick >= length sorthits then+         dispmsg $ insuffcands $ length sorthits+        else+         return (Right $ Right (fst $ sorthits !! pick), Nothing)   where     agsyinfo ticks = "" 
src/full/Agda/Auto/SearchControl.hs view
@@ -3,6 +3,8 @@ {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE UndecidableInstances #-} +{-# OPTIONS_GHC -fno-warn-orphans #-}+ module Agda.Auto.SearchControl where  import Control.Monad
+ src/full/Agda/Benchmarking.hs view
@@ -0,0 +1,109 @@+{-# LANGUAGE CPP                       #-}+{-# LANGUAGE FunctionalDependencies    #-}+{-# LANGUAGE IncoherentInstances       #-}+{-# LANGUAGE MultiParamTypeClasses     #-}+{-# LANGUAGE NoMonomorphismRestriction #-}++#if __GLASGOW_HASKELL__ <= 708+{-# LANGUAGE OverlappingInstances #-}+#endif++{-# OPTIONS_GHC -fno-warn-orphans #-}++-- | Agda-specific benchmarking structure.++module Agda.Benchmarking where++import Control.Monad.IO.Class+import qualified Control.Exception as E++import Data.IORef++import System.IO.Unsafe++import Agda.Utils.Benchmark (MonadBench(..))+import qualified Agda.Utils.Benchmark as B+import Agda.Utils.Null+import Agda.Utils.Pretty++-- | Phases to allocate CPU time to.+data Phase+  = Parsing+    -- ^ Happy parsing and operator parsing.+  | Import+    -- ^ Import chasing.+  | Deserialization+    -- ^ Reading interface files.+  | Scoping+    -- ^ Scope checking and translation to abstract syntax.+  | Typing+    -- ^ Type checking and translation to internal syntax.+  | Termination+    -- ^ Termination checking.+  | Positivity+    -- ^ Positivity checking and polarity computation.+  | Injectivity+    -- ^ Injectivity checking.+  | ProjectionLikeness+    -- ^ Checking for projection likeness.+  | Coverage+    -- ^ Coverage checking and compilation to case trees.+  | Highlighting+    -- ^ Generating highlighting info.+  | Serialization+    -- ^ Writing interface files.+  | Graph+    -- ^ Subphase for 'Termination'.+  | RecCheck+    -- ^ Subphase for 'Termination'.+  | Reduce+    -- ^ Subphase for 'Termination'.+  | Level+    -- ^ Subphase for 'Termination'.+  | Compare+    -- ^ Subphase for 'Termination'.+  | With+    -- ^ Subphase for 'Termination'.+  | ModuleName+    -- ^ Subphase for 'Import'.+  | Sort+    -- ^ Subphase for 'Serialize'.+  | BinaryEncode+    -- ^ Subphase for 'Serialize'.+  | Compress+    -- ^ Subphase for 'Serialize'.+  | Operators+    -- ^ Subphase for 'Parsing'.+  | Free+    -- ^ Subphase for 'Typing': free variable computation.+  | OccursCheck+    -- ^ Subphase for 'Typing': occurs check for solving metas.+  | InverseScopeLookup+    -- ^ Pretty printing names.+  deriving (Eq, Ord, Show, Enum, Bounded)++instance Pretty Phase where+  pretty = text . show++type Benchmark = B.Benchmark Phase+type Account   = B.Account Phase++-- * Benchmarking in the IO monad.++-- | Global variable to store benchmark statistics.+{-# NOINLINE benchmarks #-}+benchmarks :: IORef Benchmark+benchmarks = unsafePerformIO $ newIORef empty++instance MonadBench Phase IO where+  getBenchmark = readIORef benchmarks+  putBenchmark = writeIORef benchmarks+  finally = E.finally++-- | Benchmark an IO computation and bill it to the given account.+billToIO :: Account -> IO a -> IO a+billToIO = B.billTo++-- | Benchmark a pure computation and bill it to the given account.+billToPure :: Account -> a -> a+billToPure acc a = unsafePerformIO $ billToIO acc $ return a
src/full/Agda/Compiler/Epic/Forcing.hs view
@@ -123,7 +123,7 @@ -}     when (genericLength arg < pars) __IMPOSSIBLE__     -- we deal with absBody to directly since we remove t-    return ( ctele +:+  (S.subst term $ S.raiseFrom 1 (size ctele) (unAbs to))+    return ( ctele +:+  (S.subst 0 term $ S.raiseFrom 1 (size ctele) (unAbs to))            , (ctele, S.raise (size ctele) $ unDom t , ctyp)            )   where
src/full/Agda/Compiler/Epic/FromAgda.hs view
@@ -128,8 +128,8 @@  reverseCCBody :: Int -> CC.CompiledClauses -> CC.CompiledClauses reverseCCBody c cc = case cc of-    CC.Case n (CC.Branches cbr lbr cabr) -> CC.Case (c+n)-        $ CC.Branches (Map.map (fmap $ reverseCCBody c) cbr)+    CC.Case n (CC.Branches cop cbr lbr cabr) -> CC.Case (c+n)+        $ CC.Branches cop (Map.map (fmap $ reverseCCBody c) cbr)           (Map.map (reverseCCBody c) lbr)           (fmap  (reverseCCBody c) cabr)     CC.Done i t -> CC.Done i (S.applySubst
src/full/Agda/Compiler/Epic/Injection.hs view
@@ -1,6 +1,6 @@-{-# LANGUAGE CPP #-}+{-# LANGUAGE CPP               #-} {-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE PatternGuards #-}+{-# LANGUAGE PatternGuards     #-}  module Agda.Compiler.Epic.Injection where 
src/full/Agda/Compiler/Epic/Static.hs view
@@ -44,7 +44,8 @@             Nothing -> return Nothing             Just cc -> Just <$> evaluateCC cc         return $ Case n Branches-            { conBranches    = Map.fromList cbrs+            { projPatterns   = projPatterns brs+            , conBranches    = Map.fromList cbrs             , litBranches    = Map.fromList lbrs             , catchAllBranch = cab             }
src/full/Agda/Compiler/HaskellTypes.hs view
@@ -127,7 +127,7 @@             hsA <- fromType (unDom a)             underAbstraction a b $ \b ->               hsForall <$> getHsVar 0 <*> (hsFun hsA <$> fromType b)-          else hsFun <$> fromType (unDom a) <*> fromType (absApp b __IMPOSSIBLE__)+          else hsFun <$> fromType (unDom a) <*> fromType (noabsApp __IMPOSSIBLE__ b)         Con c args -> hsApp <$> getHsType (conName c) <*> fromArgs args         Lam{}      -> err         Level{}    -> return hsUnit
src/full/Agda/Compiler/MAlonzo/Compiler.hs view
@@ -1,17 +1,27 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE PatternGuards #-}+{-# LANGUAGE ScopedTypeVariables #-}  module Agda.Compiler.MAlonzo.Compiler where +#if __GLASGOW_HASKELL__ <= 708+import Prelude hiding (mapM_, mapM, sequence, concat)+#endif+ import Control.Applicative-import Control.Monad.Reader-import Control.Monad.State+import Control.Monad.Reader hiding (mapM_, forM_, mapM, forM, sequence)+import Control.Monad.State  hiding (mapM_, forM_, mapM, forM, sequence)  import Data.Generics.Geniplate-import Data.List as List-import Data.Map as Map-import Data.Set as Set+import Data.Foldable+import qualified Data.List as List+import Data.Map (Map)+import qualified Data.Map as Map+import Data.Maybe+import Data.Set (Set)+import qualified Data.Set as Set+import Data.Traversable hiding (for)  import qualified Language.Haskell.Exts.Extension as HS import qualified Language.Haskell.Exts.Parser as HS@@ -38,18 +48,27 @@  import Agda.TypeChecking.Monad import Agda.TypeChecking.Monad.Builtin+import Agda.TypeChecking.Datatypes+import Agda.TypeChecking.Records import Agda.TypeChecking.Reduce import Agda.TypeChecking.Pretty import Agda.TypeChecking.Substitute import Agda.TypeChecking.Telescope import Agda.TypeChecking.Level (reallyUnLevelView) +import Agda.TypeChecking.CompiledClause+ import Agda.Utils.FileName+import Agda.Utils.Functor import Agda.Utils.Lens+import Agda.Utils.List+import Agda.Utils.Maybe import Agda.Utils.Monad import Agda.Utils.Pretty (prettyShow) import qualified Agda.Utils.IO.UTF8 as UTF8 import qualified Agda.Utils.HashMap as HMap+import Agda.Utils.Singleton+import Agda.Utils.Tuple  #include "undefined.h" import Agda.Utils.Impossible@@ -118,7 +137,7 @@                 <*> (List.map fst . iImportedModules <$> curIF)    uniq :: [HS.ModuleName] -> [HS.ModuleName]-  uniq = List.map head . group . List.sort+  uniq = List.map head . List.group . List.sort  -------------------------------------------------- -- Main compiling clauses@@ -160,88 +179,102 @@     , nest 2 $ text (show d)     ]   checkTypeOfMain q ty $ do-  (infodecl q :) <$> case d of+    (infodecl q :) <$> case d of -    _ | Just (HsDefn ty hs) <- compiledHaskell compiled ->-      return $ fbWithType ty (fakeExp hs)+      _ | Just (HsDefn ty hs) <- compiledHaskell compiled ->+        return $ fbWithType ty (fakeExp hs) -    -- Special treatment of coinductive builtins.-    Datatype{} | Just q == (nameOfInf <$> kit) -> do-      let infT = unqhname "T" q-          infV = unqhname "d" q-          a    = ihname "a" 0-          b    = ihname "a" 1-          vars = [a, b]-      return [ HS.TypeDecl dummy infT-                           (List.map HS.UnkindedVar vars)-                           (HS.TyVar b)-             , HS.FunBind [HS.Match dummy infV-                                    (List.map HS.PVar vars) Nothing-                                    (HS.UnGuardedRhs HS.unit_con)-                                    (HS.BDecls [])]-             ]-    Constructor{} | Just q == (nameOfSharp <$> kit) -> do-      let sharp = unqhname "d" q-          x     = ihname "x" 0-      return $-        [ HS.TypeSig dummy [sharp] $ fakeType $-            "forall a. a -> a"-        , HS.FunBind [HS.Match dummy sharp-                               [HS.PVar x]-                               Nothing-                               (HS.UnGuardedRhs (HS.Var (HS.UnQual x)))-                               (HS.BDecls [])]-        ]-    Function{} | Just q == (nameOfFlat <$> kit) -> do-      let flat = unqhname "d" q-          x    = ihname "x" 0-      return $-        [ HS.TypeSig dummy [flat] $ fakeType $-            "forall a. a -> a"-        , HS.FunBind [HS.Match dummy flat-                               [HS.PVar x]-                               Nothing-                               (HS.UnGuardedRhs (HS.Var (HS.UnQual x)))-                               (HS.BDecls [])]-        ]+      -- Special treatment of coinductive builtins.+      Datatype{} | Just q == (nameOfInf <$> kit) -> do+        let infT = unqhname "T" q+            infV = unqhname "d" q+            a    = ihname "a" 0+            b    = ihname "a" 1+            vars = [a, b]+        return [ HS.TypeDecl dummy infT+                             (List.map HS.UnkindedVar vars)+                             (HS.TyVar b)+               , HS.FunBind [HS.Match dummy infV+                                      (List.map HS.PVar vars) Nothing+                                      (HS.UnGuardedRhs HS.unit_con)+                                      (HS.BDecls [])]+               ]+      Constructor{} | Just q == (nameOfSharp <$> kit) -> do+        let sharp = unqhname "d" q+            x     = ihname "x" 0+        return $+          [ HS.TypeSig dummy [sharp] $ fakeType $+              "forall a. a -> a"+          , HS.FunBind [HS.Match dummy sharp+                                 [HS.PVar x]+                                 Nothing+                                 (HS.UnGuardedRhs (HS.Var (HS.UnQual x)))+                                 (HS.BDecls [])]+          ]+      Function{} | Just q == (nameOfFlat <$> kit) -> do+        let flat = unqhname "d" q+            x    = ihname "x" 0+        return $+          [ HS.TypeSig dummy [flat] $ fakeType $+              "forall a. a -> a"+          , HS.FunBind [HS.Match dummy flat+                                 [HS.PVar x]+                                 Nothing+                                 (HS.UnGuardedRhs (HS.Var (HS.UnQual x)))+                                 (HS.BDecls [])]+          ] -    Axiom{} -> return $ fb axiomErr-    Primitive{ primClauses = [], primName = s } -> fb <$> primBody s-    Primitive{ primClauses = cls } -> function cls Nothing-    Function{ funClauses =   cls } -> function cls (exportHaskell compiled)-    Datatype{ dataPars = np, dataIxs = ni, dataClause = cl, dataCons = cs }-      | Just (HsType ty) <- compiledHaskell compiled -> do-      ccs <- concat <$> mapM checkConstructorType cs-      cov <- checkCover q ty np cs-      return $ tvaldecl q (dataInduction d) 0 (np + ni) [] (Just __IMPOSSIBLE__) ++ ccs ++ cov-    Datatype{ dataPars = np, dataIxs = ni, dataClause = cl, dataCons = cs } -> do-      (ars, cds) <- unzip <$> mapM condecl cs-      return $ tvaldecl q (dataInduction d) (maximum (np:ars) - np) (np + ni) cds cl-    Constructor{} -> return []-    Record{ recClause = cl, recConHead = con, recFields = flds } -> do-      let c = conName con-      let noFields = genericLength flds-      let ar = arity ty-      cd <- snd <$> condecl c---       cd <- case c of---         Nothing -> return $ cdecl q noFields---         Just c  -> snd <$> condecl c-      return $ tvaldecl q Inductive noFields ar [cd] cl+      Axiom{} -> return $ fb axiomErr+      Primitive{ primClauses = [], primName = s } -> fb <$> primBody s+      Primitive{ primClauses = cls } -> function Nothing $+        functionFromClauses cls++      -- Currently, catchAllBranches cannot be handled properly by casetree+      Function{ funCompiled = Just cc } | not (hasCatchAll cc) ->+        function (exportHaskell compiled) $ functionFromCaseTree q cc+      Function{ funClauses = cls } ->+        function (exportHaskell compiled) $ functionFromClauses cls++      Datatype{ dataPars = np, dataIxs = ni, dataClause = cl, dataCons = cs }+        | Just (HsType ty) <- compiledHaskell compiled -> do+        ccs <- List.concat <$> mapM checkConstructorType cs+        cov <- checkCover q ty np cs+        return $ tvaldecl q (dataInduction d) 0 (np + ni) [] (Just __IMPOSSIBLE__) ++ ccs ++ cov+      Datatype{ dataPars = np, dataIxs = ni, dataClause = cl, dataCons = cs } -> do+        (ars, cds) <- unzip <$> mapM condecl cs+        return $ tvaldecl q (dataInduction d) (List.maximum (np:ars) - np) (np + ni) cds cl+      Constructor{} -> return []+      Record{ recClause = cl, recConHead = con, recFields = flds } -> do+        let c = conName con+        let noFields = length flds+        let ar = I.arity ty+        cd <- snd <$> condecl c+  --       cd <- case c of+  --         Nothing -> return $ cdecl q noFields+  --         Just c  -> snd <$> condecl c+        return $ tvaldecl q Inductive noFields ar [cd] cl   where-  function :: [Clause] -> Maybe HaskellExport -> TCM [HS.Decl]-  function cls (Just (HsExport t name)) =-    do ccls <- functionStdName cls-       let tsig :: HS.Decl-           tsig = HS.TypeSig dummy [HS.Ident name] (fakeType t)+  function :: Maybe HaskellExport -> TCM [HS.Decl] -> TCM [HS.Decl]+  function mhe fun = do+    ccls <- mkwhere <$> fun+    case mhe of+      Nothing -> return ccls+      Just (HsExport t name) -> do+        let tsig :: HS.Decl+            tsig = HS.TypeSig dummy [HS.Ident name] (fakeType t) -           def :: HS.Decl-           def = HS.FunBind [HS.Match dummy (HS.Ident name) [] Nothing (HS.UnGuardedRhs (hsVarUQ $ dsubname q 0)) (HS.BDecls [])]-       return ([tsig,def] ++ ccls)-  function cls Nothing = functionStdName cls+            def :: HS.Decl+            def = HS.FunBind [HS.Match dummy (HS.Ident name) [] Nothing (HS.UnGuardedRhs (hsVarUQ $ dsubname q 0)) (HS.BDecls [])]+        return ([tsig,def] ++ ccls) -  functionStdName :: [Clause] -> TCM [HS.Decl]-  functionStdName cls = mkwhere <$> mapM (clause q Nothing) (tag 0 cls)+  functionFromClauses :: [Clause] -> TCM [HS.Decl]+  functionFromClauses cls = mapM (clause q Nothing) (tag 0 cls) +  functionFromCaseTree :: QName -> CompiledClauses -> TCM [HS.Decl]+  functionFromCaseTree q cc = do+    e <- casetree cc `runReaderT` initCCEnv (Just q)+    return $ [HS.FunBind [HS.Match dummy (dsubname q 0) [] Nothing (HS.UnGuardedRhs e) (HS.BDecls [])]]+   tag :: Nat -> [Clause] -> [(Nat, Bool, Clause)]   tag _ []       = []   tag i [cl]     = (i, True , cl) : []@@ -264,6 +297,170 @@   axiomErr :: HS.Exp   axiomErr = rtmError $ "postulate evaluated: " ++ show (A.qnameToConcrete q) +-- | Environment for naming of local variables.+--   Invariant: @reverse ccCxt ++ ccNameSupply@+data CCEnv = CCEnv+  { ccFunName    :: Maybe QName -- ^ Agda function we are currently compiling.+  , ccNameSupply :: NameSupply  -- ^ Supply of fresh names+  , ccCxt        :: CCContext   -- ^ Names currently in scope+  , ccCatchAll   :: Maybe CompiledClauses  -- ^ Naive catch-all implementation.+      -- If an inner case has no catch-all clause, we use the one from its parent.+  }++type NameSupply = [HS.Name]+type CCContext  = [HS.Name]++mapNameSupply :: (NameSupply -> NameSupply) -> CCEnv -> CCEnv+mapNameSupply f e = e { ccNameSupply = f (ccNameSupply e) }++mapContext :: (CCContext -> CCContext) -> CCEnv -> CCEnv+mapContext f e = e { ccCxt = f (ccCxt e) }++-- | Initial environment for expression generation.+initCCEnv :: Maybe QName -> CCEnv+initCCEnv q = CCEnv+  { ccFunName    = q+  , ccNameSupply = map (ihname "v") [0..]  -- DON'T CHANGE THESE NAMES!+  , ccCxt        = []+  , ccCatchAll   = Nothing+  }++-- | Term variables are de Bruijn indices.+lookupIndex :: Int -> CCContext -> HS.Name+lookupIndex i xs = fromMaybe __IMPOSSIBLE__ $ xs !!! i++-- | Case variables are de Bruijn levels.+lookupLevel :: Int -> CCContext -> HS.Name+lookupLevel l xs = fromMaybe __IMPOSSIBLE__ $ xs !!! (length xs - 1 - l)++type CC = ReaderT CCEnv TCM++-- | Compile a case tree into nested case and record expressions.+casetree :: CompiledClauses -> CC HS.Exp+casetree cc = do+  case cc of+    Fail -> return $ rtmError $ "Impossible Clause Body"+    Done xs v -> lambdasUpTo (length xs) $ hsCast <$> term v+    Case n (Branches True conBrs _ _) -> lambdasUpTo n $ do+      mkRecord =<< mapM casetree (content <$> conBrs)+    Case n (Branches False conBrs litBrs catchAll) -> lambdasUpTo (n + 1) $ do+      x <- lookupLevel n <$> asks ccCxt+      HS.Case (hsCast $ hsVarUQ x) <$> do+        updateCatchAll catchAll $ do+          br1 <- conAlts n conBrs+          br2 <- litAlts litBrs+          br3 <- catchAllAlts =<< asks ccCatchAll+          return (br1 ++ br2 ++ br3)++-- | Replace the current catch-all clause with a new one, if given.+updateCatchAll :: Maybe CompiledClauses -> CC a -> CC a+updateCatchAll Nothing   = id+updateCatchAll (Just cc) = local $ \ e -> e { ccCatchAll = Just cc }++-- -- | Replace de Bruijn index by term in catch-all tree.+-- substCatchAll :: Int -> I.Term -> CC a -> CC a+-- substCatchAll i t = local $ \ e -> e { ccCatchAll = subst i t $ ccCatchAll e }++conAlts :: Int -> Map QName (WithArity CompiledClauses) -> CC [HS.Alt]+conAlts x br = forM (Map.toList br) $ \ (c, WithArity n cc) -> do+  c <- lift $ conhqn c+  -- TODO: substitute in ccCatchAll somehow+  replaceVar x n $ \ xs -> do+    branch (HS.PApp c $ map HS.PVar xs) cc++litAlts :: Map Literal CompiledClauses -> CC [HS.Alt]+litAlts br = forM (Map.toList br) $ \ (l, cc) ->+  -- TODO: substitute in ccCatchAll somehow+  branch (HS.PLit HS.Signless $ hslit l) cc++catchAllAlts :: Maybe CompiledClauses -> CC [HS.Alt]+catchAllAlts (Just cc) = mapM (branch HS.PWildCard) [cc]+catchAllAlts Nothing   = do+  q <- fromMaybe __IMPOSSIBLE__ <$> asks ccFunName+  return [ HS.Alt dummy HS.PWildCard (HS.UnGuardedRhs $ rtmIncompleteMatch q) (HS.BDecls []) ]++branch :: HS.Pat -> CompiledClauses -> CC HS.Alt+branch pat cc = do+  e <- casetree cc+  return $ HS.Alt dummy pat (HS.UnGuardedRhs e) (HS.BDecls [])++-- | Replace de Bruijn Level @x@ by @n@ new variables.+replaceVar :: Int -> Int -> ([HS.Name] -> CC a) -> CC a+replaceVar x n cont = do+  (xs, rest) <- splitAt n <$> asks ccNameSupply+  let upd cxt = ys ++ reverse xs ++ zs -- We reverse xs to get nicer names.+       where+         -- compute the de Bruijn index+         i = length cxt - 1 - x+         -- discard index i+         (ys, _:zs) = splitAt i cxt+  local (mapNameSupply (const rest) . mapContext upd) $+    cont xs++-- | Precondition: Map not empty.+mkRecord :: Map QName HS.Exp -> CC HS.Exp+mkRecord fs = lift $ do+  -- Get the name of the first field+  let p1 = fst $ fromMaybe __IMPOSSIBLE__ $ headMaybe $ Map.toList fs+  -- Use the field name to get the record constructor and the field names.+  ConHead c _ind xs <- recConFromProj p1+  -- Convert the constructor to a Haskell name+  c <- conhqn c+  let (args :: [HS.Exp]) = for xs $ \ x -> fromMaybe __IMPOSSIBLE__ $ Map.lookup x fs+  return $ hsCast $ List.foldl HS.App (HS.Con c) args++-- -- | Precondition: Map not empty.+-- MAlonzo does not translate field names in data decls.+-- mkRecord :: Map QName HS.Exp -> CC HS.Exp+-- mkRecord fs = lift $ do+--   -- Get the list of (field name, expression pairs)+--   let l = Map.toList fs+--   -- Get the name of the first field+--   let p1 = fst $ fromMaybe __IMPOSSIBLE__ $ headMaybe l+--   -- Use the field name to get the record constructor+--   c <- I.conName <$> recConFromProj p1+--   -- Convert it to a Haskell name+--   c <- conhqn c+--   -- Convert the field names into Haskell names+--   fs <- mapM (mapFstM (xhqn "d")) l+--   return $ hsCast $ HS.RecConstr c $ map (uncurry HS.FieldUpdate) fs++recConFromProj :: QName -> TCM I.ConHead+recConFromProj q = do+  caseMaybeM (isProjection q) __IMPOSSIBLE__ $ \ proj -> do+    let d = projFromType proj+    getRecordConstructor d++-- | Introduce lambdas such that @n@ variables are in scope.+lambdasUpTo :: Int -> CC HS.Exp -> CC HS.Exp+lambdasUpTo n cont = do+  diff <- (n -) . length <$> asks ccCxt+  lambdas diff cont++-- | Introduce n lambdas.+lambdas :: Int -> CC HS.Exp -> CC HS.Exp+lambdas diff cont = intros diff $ \ xs -> mkLams xs <$> cont++-- -- | Introduce variables such that @n@ are in scope.+-- introsUpTo :: Int -> ([HS.Name] -> CC HS.Exp) -> CC HS.Exp+-- introsUpTo n cont = do+--   diff <- (n -) . length <$> asks ccCxt+--   intros diff cont++-- | Introduce n variables into the context.+intros :: Int -> ([HS.Name] -> CC HS.Exp) -> CC HS.Exp+intros diff cont = do+  if diff <= 0 then cont [] else do+    -- Need diff lambdas to continue.+    (xs, rest) <- splitAt diff <$> asks ccNameSupply+    local (mapNameSupply (const rest) . mapContext (reverse xs ++)) $+      cont xs++-- | Prefix a Haskell expression with lambda abstractions.+mkLams :: [HS.Name] -> HS.Exp -> HS.Exp+mkLams [] e = e+mkLams xs e = HS.Lambda dummy (map HS.PVar xs) e+ checkConstructorType :: QName -> TCM [HS.Decl] checkConstructorType q = do   Just (HsDefn ty hs) <- compiledHaskell . defCompiledRep <$> getConstInfo q@@ -278,7 +475,7 @@       makeClause c = do         (a, _) <- conArityAndPars c         Just (HsDefn _ hsc) <- compiledHaskell . defCompiledRep <$> getConstInfo c-        let pat = HS.PApp (HS.UnQual $ HS.Ident hsc) $ genericReplicate a HS.PWildCard+        let pat = HS.PApp (HS.UnQual $ HS.Ident hsc) $ replicate a HS.PWildCard         return $ HS.Alt dummy pat (HS.UnGuardedRhs $ HS.unit_con) (HS.BDecls [])    cs <- mapM makeClause cs@@ -297,17 +494,17 @@   def <- getConstInfo q   TelV tel _ <- telView $ defType def   let Constructor{ conPars = np } = theDef def-      n = genericLength (telToList tel)+      n = length (telToList tel)   return (n - np, np)  clause :: QName -> Maybe String -> (Nat, Bool, Clause) -> TCM HS.Decl clause q maybeName (i, isLast, Clause{ namedClausePats = ps, clauseBody = b }) =   HS.FunBind . (: cont) <$> main where   main = match <$> argpatts ps (bvars b (0::Nat)) <*> clausebody b-  cont | isLast && any isCon ps = [match (List.map HS.PVar cvs) failrhs]-       | isLast                 = []-       | otherwise              = [match (List.map HS.PVar cvs) crhs]-  cvs  = List.map (ihname "v") [0 .. genericLength ps - 1]+  cont | isLast && List.any isCon ps = [match (List.map HS.PVar cvs) failrhs]+       | isLast                      = []+       | otherwise                   = [match (List.map HS.PVar cvs) crhs]+  cvs  = List.map (ihname "v") [0 .. length ps - 1]   crhs = hsCast$ List.foldl HS.App (hsVarUQ $ dsubname q (i + 1)) (List.map hsVarUQ cvs)   failrhs = rtmIncompleteMatch q  -- Andreas, 2011-11-16 call to RTE instead of inlined error --  failrhs = rtmError $ "incomplete pattern matching: " ++ show q@@ -324,14 +521,18 @@ -- argpatts aps xs = hps -- xs is alist of haskell *variables* in form of patterns (because of wildcard) argpatts :: [I.NamedArg Pattern] -> [HS.Pat] -> TCM [HS.Pat]-argpatts ps0 bvs = evalStateT (mapM pat' ps0) bvs+argpatts ps0 bvs = evalStateT (List.concat <$> mapM pat' ps0) bvs   where-  pat :: Pattern -> StateT [HS.Pat] TCM HS.Pat-  pat   (ProjP _  ) = lift $ typeError $ NotImplemented $ "Compilation of copatterns"-  pat   (VarP _   ) = do v <- gets head; modify tail; return v+  pat :: Pattern -> StateT [HS.Pat] TCM [HS.Pat]+  pat   (ProjP p  ) = do+    kit <- lift coinductionKit+    -- Sharps and flats are erased from compiled code+    if Just p == fmap nameOfFlat kit then return [] else+      lift $ typeError $ NotImplemented $ "Compilation of copatterns"+  pat   (VarP _   ) = do v <- gets head; modify tail; return [v]   pat   (DotP _   ) = pat (VarP dummy) -- WHY NOT: return HS.PWildCard -- SEE ABOVE-  pat   (LitP (LitQName _ x)) = return $ litqnamepat x-  pat   (LitP l   ) = return $ HS.PLit HS.Signless $ hslit l+  pat   (LitP (LitQName _ x)) = return [ litqnamepat x ]+  pat   (LitP l   ) = return [ HS.PLit HS.Signless $ hslit l ]    pat p@(ConP c _ ps) = do     -- Note that irr is applied once for every subpattern, so in the@@ -342,8 +543,8 @@         tilde = if tildesEnabled && irrefutable                 then HS.PParen . HS.PIrrPat                 else id-    (tilde . HS.PParen) <$>-      (HS.PApp <$> lift (conhqn $ conName c) <*> mapM pat' ps)+    ((:[]) . tilde . HS.PParen) <$>+      (HS.PApp <$> lift (conhqn $ conName c) <*> (List.concat <$> mapM pat' ps))    {- Andreas, 2013-02-15 this triggers Issue 794,      because it fails to count the variables bound in p,@@ -354,7 +555,7 @@   -- do not match against irrelevant stuff   pat' a | isIrrelevant a = return $ HS.PWildCard -}-  pat' :: I.NamedArg Pattern -> StateT [HS.Pat] TCM HS.Pat+  pat' :: I.NamedArg Pattern -> StateT [HS.Pat] TCM [HS.Pat]   pat' a = pat $ namedArg a    tildesEnabled = False@@ -375,24 +576,27 @@   irr' a = irr $ namedArg a  clausebody :: ClauseBody -> TCM HS.Exp-clausebody b0 = runReaderT (go b0) 0 where-  go (Body tm       )   = hsCast <$> term tm-  go (Bind (Abs _ b))   = local (1+) $ go b-  go (Bind (NoAbs _ b)) = go b-  go NoBody             = return $ rtmError $ "Impossible Clause Body"+clausebody b0 = go 0 b0 where+  go n (Body tm       )   = hsCast <$> do+    runReaderT (intros n $ const $ term tm) (initCCEnv Nothing)+  go n (Bind (Abs _ b))   = go (n+1) b+  go n (Bind (NoAbs _ b)) = go n b+  go n NoBody             = return $ rtmError $ "Impossible Clause Body" ++closedTerm :: Term -> TCM HS.Exp+closedTerm v = term v `runReaderT` initCCEnv Nothing+ -- | Extract Agda term to Haskell expression. --   Irrelevant arguments are extracted as @()@. --   Types are extracted as @()@. --   @DontCare@ outside of irrelevant arguments is extracted as @error@.-term :: Term -> ReaderT Nat TCM HS.Exp+term :: Term -> CC HS.Exp term tm0 = case unSpine $ ignoreSharing tm0 of   Var   i es -> do-    let Just as = allApplyElims es-    n <- ask-    apps (hsVarUQ $ ihname "v" (n - i - 1)) as-  Lam   _ at -> do n <- ask; HS.Lambda dummy [HS.PVar $ ihname "v" n] <$>-                              local (1+) (term $ absBody at)+    x <- lookupIndex i <$> asks ccCxt+    apps (hsVarUQ x) $ fromMaybe __IMPOSSIBLE__ $ allApplyElims es+  Lam   _ at -> lambdas 1 $ term $ absBody at   Lit   l    -> lift $ literal l   Def   q es -> do     let Just as = allApplyElims es@@ -411,10 +615,10 @@   DontCare _ -> return $ rtmError $ "hit DontCare"   Shared{}   -> __IMPOSSIBLE__   ExtLam{}   -> __IMPOSSIBLE__-  where apps =  foldM (\h a -> HS.App h <$> term' a)+  where apps =  foldM (\ h a -> HS.App h <$> term' a)  -- | Irrelevant arguments are replaced by Haskells' ().-term' :: I.Arg Term -> ReaderT Nat TCM HS.Exp+term' :: I.Arg Term -> CC HS.Exp term' a | isIrrelevant a = return HS.unit_con term' a = term $ unArg a 
src/full/Agda/Compiler/MAlonzo/Compiler.hs-boot view
@@ -1,10 +1,8 @@ module Agda.Compiler.MAlonzo.Compiler where -import Control.Monad.Reader (ReaderT) import qualified Language.Haskell.Exts.Syntax as HS -import Agda.Syntax.Common (Nat) import Agda.Syntax.Internal (Term) import Agda.TypeChecking.Monad (TCM) -term :: Term -> ReaderT Nat TCM HS.Exp+closedTerm :: Term -> TCM HS.Exp
src/full/Agda/Compiler/MAlonzo/Misc.hs view
@@ -128,7 +128,6 @@ conhqn q = do     cq  <- canonicalName q     def <- getConstInfo cq-    hsr <- compiledHaskell . defCompiledRep <$> getConstInfo cq     case (compiledHaskell (defCompiledRep def), theDef def) of       (Just (HsDefn _ hs), Constructor{}) -> return $ HS.UnQual $ HS.Ident hs       _                                   -> xhqn "C" cq
src/full/Agda/Compiler/MAlonzo/Primitives.hs view
@@ -9,7 +9,7 @@ import Data.Map as M import qualified Language.Haskell.Exts.Syntax as HS -import {-# SOURCE #-} Agda.Compiler.MAlonzo.Compiler (term)+import {-# SOURCE #-} Agda.Compiler.MAlonzo.Compiler (closedTerm) import Agda.Compiler.MAlonzo.Misc import Agda.Compiler.MAlonzo.Pretty import Agda.Syntax.Common@@ -249,8 +249,7 @@   -- Trust me   , ("primTrustMe"       , Right <$> do        refl <- primRefl-       flip runReaderT 0 $-         term $ lam "a" (lam "A" (lam "x" (lam "y" refl))))+       closedTerm $ lam "a" (lam "A" (lam "x" (lam "y" refl))))   ]   where   x |-> s = (x, Left <$> s)
src/full/Agda/Interaction/BasicOps.hs view
@@ -5,6 +5,8 @@ {-# LANGUAGE TupleSections #-} {-# LANGUAGE UndecidableInstances #-} +{-# OPTIONS_GHC -fno-warn-orphans #-}+ module Agda.Interaction.BasicOps where  import Control.Arrow ((***), first, second)@@ -95,30 +97,30 @@       ctx <- getContextArgs       let t' = t `piApply` permute (takeP (length ctx) $ mvPermutation mv) ctx       traceCall (CheckExprCall e t') $ do-      reportSDoc "interaction.give" 20 $-        TP.text "give: instantiated meta type =" TP.<+> prettyTCM t'-      v <- checkExpr e t'-      case mvInstantiation mv of-        InstV xs v' -> unlessM ((Irrelevant ==) <$> asks envRelevance) $ do-          reportSDoc "interaction.give" 20 $ TP.sep-            [ TP.text "meta was already set to value v' = " TP.<+> prettyTCM v'-              TP.<+> TP.text " with free variables " TP.<+> return (fsep $ map pretty xs)-            , TP.text "now comparing it to given value v = " TP.<+> prettyTCM v-            , TP.text "in context " TP.<+> inTopContext (prettyTCM ctx)-            ]-          -- The number of free variables should be at least the size of the context-          -- (Ideally, if we implemented contextual type theory, it should be the same.)-          when (length xs < size ctx) __IMPOSSIBLE__-          -- if there are more free variables than the context has-          -- we need to abstract over the additional ones (xs2)-          let (_xs1, xs2) = splitAt (size ctx) xs-          v' <- return $ foldr (\ (Arg ai x) -> I.Lam ai . I.Abs x) v' xs2-          reportSDoc "interaction.give" 20 $ TP.sep-            [ TP.text "in meta context, v' = " TP.<+> prettyTCM v'-            ]-          equalTerm t' v v'  -- Note: v' now lives in context of meta-        _ -> updateMeta mi v-      reify v+        reportSDoc "interaction.give" 20 $+          TP.text "give: instantiated meta type =" TP.<+> prettyTCM t'+        v <- checkExpr e t'+        case mvInstantiation mv of+          InstV xs v' -> unlessM ((Irrelevant ==) <$> asks envRelevance) $ do+            reportSDoc "interaction.give" 20 $ TP.sep+              [ TP.text "meta was already set to value v' = " TP.<+> prettyTCM v'+                TP.<+> TP.text " with free variables " TP.<+> return (fsep $ map pretty xs)+              , TP.text "now comparing it to given value v = " TP.<+> prettyTCM v+              , TP.text "in context " TP.<+> inTopContext (prettyTCM ctx)+              ]+            -- The number of free variables should be at least the size of the context+            -- (Ideally, if we implemented contextual type theory, it should be the same.)+            when (length xs < size ctx) __IMPOSSIBLE__+            -- if there are more free variables than the context has+            -- we need to abstract over the additional ones (xs2)+            let (_xs1, xs2) = splitAt (size ctx) xs+            v' <- return $ foldr (\ (Arg ai x) -> I.Lam ai . I.Abs x) v' xs2+            reportSDoc "interaction.give" 20 $ TP.sep+              [ TP.text "in meta context, v' = " TP.<+> prettyTCM v'+              ]+            equalTerm t' v v'  -- Note: v' now lives in context of meta+          _ -> updateMeta mi v+        reify v  -- | Try to fill hole by expression. --@@ -230,7 +232,9 @@       | JustSort b | CmpSorts Comparison b b       | Guard (OutputConstraint a b) ProblemId       | Assign b a | TypedAssign b a a | PostponedCheckArgs b [a] a a-      | IsEmptyType a | FindInScopeOF b a [(a,a)]+      | IsEmptyType a+      | SizeLtSat a+      | FindInScopeOF b a [(a,a)]   deriving (Functor)  -- | A subset of 'OutputConstraint'.@@ -258,6 +262,7 @@       TypedAssign i _ _          -> i       PostponedCheckArgs i _ _ _ -> i       IsEmptyType _              -> __IMPOSSIBLE__   -- Should never be used on IsEmpty constraints+      SizeLtSat{}                -> __IMPOSSIBLE__       FindInScopeOF _ _ _        -> __IMPOSSIBLE__  instance Reify ProblemConstraint (Closure (OutputForm Expr Expr)) where@@ -307,6 +312,7 @@       <*> (forM (fromMaybe [] mcands) $ \ (tm, ty) -> do             (,) <$> reify tm <*> reify ty)     reify (IsEmpty r a) = IsEmptyType <$> reify a+    reify (CheckSizeLtSat a) = SizeLtSat  <$> reify a  -- ASR TODO (28 December 2014): This function will be unnecessary when -- using a Pretty instance for OutputConstraint instead of the Show@@ -342,6 +348,7 @@       where paren s | elem ' ' s = "(" ++ s ++ ")"                     | otherwise  = s     show (IsEmptyType a)        = "Is empty: " ++ show a+    show (SizeLtSat a)          = "Not empty type of sizes: " ++ show a     show (FindInScopeOF s t cs) = "Resolve instance argument " ++ showCand (s,t) ++ ".\n  Candidates:\n    [ " ++                                     intercalate "\n    , " (map showCand cs) ++ " ]"       where showCand (tm,ty) = indent 6 $ show tm ++ " : " ++ show ty@@ -376,6 +383,7 @@     toConcrete (PostponedCheckArgs m args t0 t1) =       PostponedCheckArgs <$> toConcrete m <*> toConcrete args <*> toConcrete t0 <*> toConcrete t1     toConcrete (IsEmptyType a) = IsEmptyType <$> toConcreteCtx TopCtx a+    toConcrete (SizeLtSat a) = SizeLtSat <$> toConcreteCtx TopCtx a     toConcrete (FindInScopeOF s t cs) =       FindInScopeOF <$> toConcrete s <*> toConcrete t                     <*> mapM (\(tm,ty) -> (,) <$> toConcrete tm <*> toConcrete ty) cs@@ -387,14 +395,6 @@             ToConcrete (OutputConstraint' a b) (OutputConstraint' c d) where   toConcrete (OfType' e t) = OfType' <$> toConcrete e <*> toConcreteCtx TopCtx t ---ToDo: Move somewhere else-instance ToConcrete InteractionId C.Expr where-    toConcrete (InteractionId i) = return $ C.QuestionMark noRange (Just i)--instance ToConcrete NamedMeta C.Expr where-    toConcrete i = do-      return $ C.Underscore noRange (Just $ prettyShow i)- getConstraints :: TCM [OutputForm C.Expr C.Expr] getConstraints = liftTCM $ do     cs <- M.getAllConstraints@@ -463,6 +463,7 @@           , TP.text "x    =" TP.<+> TP.pretty x           ]         ]+      reportSDoc "interactive.meta.scope" 20 $ TP.text $ show $ getMetaScope mv       OfType x <$> reify (t `piApply` permute (takeP (size vs) $ mvPermutation mv) vs)     rewriteJudg mv (IsSort i t) = do       ms <- getMetaNameSuggestion i@@ -509,7 +510,7 @@       -- Remember the arity of a       TelV atel _ <- telView a       let arity = size atel-          fv = allVars $ freeVars (vs, as)+          fv = allFreeVars (vs, as)           SplitTel delta1 delta2 perm = splitTelescope fv tel           a' = renameP (reverseP perm) a       (vs, as) <- do@@ -803,4 +804,3 @@   return ( lookup x $ map (first C.QName) $ scopeLocals scope          , scopeLookup x scope          , scopeLookup x scope )-
src/full/Agda/Interaction/CommandLine.hs view
@@ -265,8 +265,8 @@     i <- InteractionId <$> readM meta     mi <- lookupMeta =<< lookupInteractionId i     withMetaInfo (getMetaInfo mi) $ do-    ctx <- List.map unDom . telToList <$> getContextTelescope-    zipWithM_ display ctx $ reverse $ zipWith const [1..] ctx+      ctx <- List.map unDom . telToList <$> getContextTelescope+      zipWithM_ display ctx $ reverse $ zipWith const [1..] ctx     where         display (x, t) n = do             t <- case args of
src/full/Agda/Interaction/FindFile.hs view
@@ -31,6 +31,7 @@ import Agda.TypeChecking.Monad.Benchmark (billTo) import qualified Agda.TypeChecking.Monad.Benchmark as Bench import {-# SOURCE #-} Agda.TypeChecking.Monad.Options (getIncludeDirs)+import Agda.Utils.Except import Agda.Utils.FileName import Agda.Utils.Lens @@ -154,11 +155,16 @@ --   Use wisely!  moduleName' :: AbsolutePath -> TCM TopLevelModuleName-moduleName' file = billTo [Bench.ModuleName] $ liftIO $ do-  name <- topLevelModuleName <$> parseFile' moduleParser file+moduleName' file = billTo [Bench.ModuleName] $ do+  name <- topLevelModuleName <$> liftIO (parseFile' moduleParser file)   case name of-    TopLevelModuleName ["_"] -> return $ TopLevelModuleName [defaultName]-    _                        -> return name+    TopLevelModuleName ["_"] -> do+      _ <- liftIO (parse moduleNameParser defaultName)+             `catchError` \_ ->+           typeError $+             GenericError $ "Invalid file name: " ++ show file ++ "."+      return $ TopLevelModuleName [defaultName]+    _ -> return name   where     defaultName = rootName file 
src/full/Agda/Interaction/Highlighting/Generate.hs view
@@ -146,7 +146,7 @@ -- 'stTokens'.  generateAndPrintSyntaxInfo :: A.Declaration -> Level -> TCM ()-generateAndPrintSyntaxInfo decl _ | P.noRange == P.getRange decl = return ()+generateAndPrintSyntaxInfo decl _ | null $ P.getRange decl = return () generateAndPrintSyntaxInfo decl hlLevel = do   file <- fromMaybe __IMPOSSIBLE__ <$> asks envCurrentPath @@ -457,18 +457,18 @@   -- @noRange@ should be impossible, but in case of @noRange@   -- it makes sense to return the empty File.   ifNull (P.getRange decl) (return mempty) $ \ (P.Range is) -> do-  let start = fromIntegral $ P.posPos $ P.iStart $ head is-      end   = fromIntegral $ P.posPos $ P.iEnd   $ last is+    let start = fromIntegral $ P.posPos $ P.iStart $ head is+        end   = fromIntegral $ P.posPos $ P.iEnd   $ last is -  -- Get all disambiguated names that fall within the range of decl.-  m0 <- use stDisambiguatedNames-  let (_, m1) = IntMap.split (pred start) m0-      (m2, _) = IntMap.split end m1-      constrs = IntMap.elems m2+    -- Get all disambiguated names that fall within the range of decl.+    m0 <- use stDisambiguatedNames+    let (_, m1) = IntMap.split (pred start) m0+        (m2, _) = IntMap.split end m1+        constrs = IntMap.elems m2 -  -- Return suitable syntax highlighting information.-  let files = for constrs $ \ q -> generate modMap file kinds $ A.AmbQ [q]-  return $ Fold.fold files+    -- Return suitable syntax highlighting information.+    let files = for constrs $ \ q -> generate modMap file kinds $ A.AmbQ [q]+    return $ Fold.fold files   -- | Prints syntax highlighting info for an error.
src/full/Agda/Interaction/Imports.hs view
@@ -10,8 +10,10 @@ -} module Agda.Interaction.Imports where -import Prelude+import Prelude hiding (null) +import Control.Arrow+import Control.DeepSeq import Control.Monad.Reader import Control.Monad.State import qualified Control.Exception as E@@ -21,7 +23,7 @@ import qualified Data.List as List import qualified Data.Set as Set import qualified Data.Foldable as Fold (toList)-import Data.List+import Data.List hiding (null) import Data.Maybe import Data.Monoid (mempty, mappend) import Data.Map (Map)@@ -32,6 +34,8 @@  import qualified Text.PrettyPrint.Boxes as Boxes +import Agda.Benchmarking+ import qualified Agda.Syntax.Abstract as A import qualified Agda.Syntax.Concrete as C import Agda.Syntax.Abstract.Name@@ -44,7 +48,6 @@ import Agda.TypeChecking.Errors import Agda.TypeChecking.Reduce import Agda.TypeChecking.Monad-import Agda.TypeChecking.Monad.Base.KillRange  -- killRange for Signature import Agda.TypeChecking.Serialise import Agda.TypeChecking.Telescope import Agda.TypeChecking.Primitive@@ -64,7 +67,7 @@ import Agda.Utils.FileName import Agda.Utils.Lens import Agda.Utils.Monad-import Agda.Utils.Null (unlessNullM)+import Agda.Utils.Null import Agda.Utils.IO.Binary import Agda.Utils.Pretty import Agda.Utils.Time@@ -126,16 +129,18 @@  scopeCheckImport :: ModuleName -> TCM (ModuleName, Map ModuleName Scope) scopeCheckImport x = do-    reportSLn "import.scope" 5 $ "Scope checking " ++ show x+    reportSLn "import.scope" 5 $ "Scope checking " ++ prettyShow x     verboseS "import.scope" 10 $ do       visited <- Map.keys <$> getVisitedModules       reportSLn "import.scope" 10 $-        "  visited: " ++ intercalate ", " (map (render . pretty) visited)+        "  visited: " ++ intercalate ", " (map prettyShow visited)     -- Since scopeCheckImport is called from the scope checker,     -- we need to reimburse her account.     i <- Bench.billTo [] $ getInterface x     addImport x-    return (iModuleName i `withRangesOfQ` mnameToConcrete x, iScope i)+    -- let s = publicModules $ iInsideScope i+    let s = iScope i+    return (iModuleName i `withRangesOfQ` mnameToConcrete x, s)  data MaybeWarnings = NoWarnings | SomeWarnings Warnings @@ -157,12 +162,12 @@         -- A module with warnings should never be allowed to be         -- imported from another module.         Just mi | not (miWarnings mi) -> do-          reportSLn "import.visit" 10 $ "  Already visited " ++ render (pretty x)+          reportSLn "import.visit" 10 $ "  Already visited " ++ prettyShow x           return (miInterface mi, NoWarnings)         _ -> do-          reportSLn "import.visit" 5 $ "  Getting interface for " ++ render (pretty x)+          reportSLn "import.visit" 5 $ "  Getting interface for " ++ prettyShow x           r@(i, wt) <- getIface-          reportSLn "import.visit" 5 $ "  Now we've looked at " ++ render (pretty x)+          reportSLn "import.visit" 5 $ "  Now we've looked at " ++ prettyShow x           visitModule $ ModuleInfo             { miInterface  = i             , miWarnings   = hasWarnings wt@@ -178,7 +183,7 @@  typeCheckMain :: AbsolutePath -> TCM (Interface, MaybeWarnings) typeCheckMain f = do-  -- liftIO $ putStrLn $ "This is typeCheckMain " ++ show f+  -- liftIO $ putStrLn $ "This is typeCheckMain " ++ prettyShow f   -- liftIO . putStrLn . show =<< getVerbosity   reportSLn "import.main" 10 $ "Importing the primitive modules."   libdir <- liftIO defaultLibDir@@ -235,64 +240,67 @@   -> TCM (Interface, MaybeWarnings) getInterface' x isMain = do   withIncreasedModuleNestingLevel $ do-  -- Preserve the pragma options unless includeStateChanges is True.-  bracket_ (use stPragmaOptions)-           (unless includeStateChanges . setPragmaOptions) $ do-   -- Forget the pragma options (locally).-   setCommandLineOptions . stPersistentOptions . stPersistentState =<< get+    -- Preserve the pragma options unless includeStateChanges is True.+    bracket_ (use stPragmaOptions)+             (unless includeStateChanges . setPragmaOptions) $ do+     -- Forget the pragma options (locally).+     setCommandLineOptions . stPersistentOptions . stPersistentState =<< get -   alreadyVisited x $ addImportCycleCheck x $ do-    file <- findFile x  -- requires source to exist+     alreadyVisited x $ addImportCycleCheck x $ do+      file <- findFile x  -- requires source to exist -    reportSLn "import.iface" 10 $ "  Check for cycle"-    checkForImportCycle+      reportSLn "import.iface" 10 $ "  Check for cycle"+      checkForImportCycle -    uptodate <- Bench.billTo [Bench.Import] $ do-      ignore <- ignoreInterfaces-      cached <- isCached file -- if it's cached ignoreInterfaces has no effect-                              -- to avoid typechecking a file more than once-      sourceH <- liftIO $ hashFile file-      ifaceH  <--        case cached of-          Nothing -> fmap fst <$> getInterfaceFileHashes (filePath $ toIFile file)-          Just i  -> return $ Just $ iSourceHash i-      let unchanged = Just sourceH == ifaceH-      return $ unchanged && (not ignore || isJust cached)+      uptodate <- Bench.billTo [Bench.Import] $ do+        ignore <- ignoreInterfaces+        cached <- isCached file -- if it's cached ignoreInterfaces has no effect+                                -- to avoid typechecking a file more than once+        sourceH <- liftIO $ hashFile file+        ifaceH  <-+          case cached of+            Nothing -> fmap fst <$> getInterfaceFileHashes (filePath $ toIFile file)+            Just i  -> return $ Just $ iSourceHash i+        let unchanged = Just sourceH == ifaceH+        return $ unchanged && (not ignore || isJust cached) -    reportSLn "import.iface" 5 $-      "  " ++ render (pretty x) ++ " is " ++-      (if uptodate then "" else "not ") ++ "up-to-date."+      reportSLn "import.iface" 5 $+        "  " ++ prettyShow x ++ " is " +++        (if uptodate then "" else "not ") ++ "up-to-date." -    -- Andreas, 2014-10-20 AIM XX:-    -- Always retype-check the main file to get the iInsideScope-    -- which is no longer serialized.-    (stateChangesIncluded, (i, wt)) <--      if uptodate && isMain == NotMainInterface then skip file else typeCheckThe file+      (stateChangesIncluded, (i, wt)) <- do+        -- -- Andreas, 2014-10-20 AIM XX:+        -- -- Always retype-check the main file to get the iInsideScope+        -- -- which is no longer serialized.+        -- let maySkip = isMain == NotMainInterface+        -- Andreas, 2015-07-13: Serialize iInsideScope again.+        let maySkip = True+        if uptodate && maySkip then skip file else typeCheckThe file -    -- Ensure that the given module name matches the one in the file.-    let topLevelName = toTopLevelModuleName $ iModuleName i-    unless (topLevelName == x) $ do-      -- Andreas, 2014-03-27 This check is now done in the scope checker.-      -- checkModuleName topLevelName file-      typeError $ OverlappingProjects file topLevelName x+      -- Ensure that the given module name matches the one in the file.+      let topLevelName = toTopLevelModuleName $ iModuleName i+      unless (topLevelName == x) $ do+        -- Andreas, 2014-03-27 This check is now done in the scope checker.+        -- checkModuleName topLevelName file+        typeError $ OverlappingProjects file topLevelName x -    visited <- isVisited x-    reportSLn "import.iface" 5 $ if visited then "  We've been here. Don't merge."-                                 else "  New module. Let's check it out."-    unless (visited || stateChangesIncluded) $ do-      mergeInterface i-      Bench.billTo [Bench.Highlighting] $-        ifTopLevelAndHighlightingLevelIs NonInteractive $-          highlightFromInterface i file+      visited <- isVisited x+      reportSLn "import.iface" 5 $ if visited then "  We've been here. Don't merge."+                                   else "  New module. Let's check it out."+      unless (visited || stateChangesIncluded) $ do+        mergeInterface i+        Bench.billTo [Bench.Highlighting] $+          ifTopLevelAndHighlightingLevelIs NonInteractive $+            highlightFromInterface i file -    stCurrentModule .= Just (iModuleName i)+      stCurrentModule .= Just (iModuleName i) -    -- Interfaces are only stored if no warnings were encountered.-    case wt of-      SomeWarnings w -> return ()-      NoWarnings     -> storeDecodedModule i+      -- Interfaces are only stored if no warnings were encountered.+      case wt of+        SomeWarnings w -> return ()+        NoWarnings     -> storeDecodedModule i -    return (i, wt)+      return (i, wt)      where       includeStateChanges = isMain == MainInterface@@ -313,7 +321,7 @@       chaseMsg kind file = do         nesting <- envModuleNestingLevel <$> ask         let s = genericReplicate nesting ' ' ++ kind ++-                " " ++ render (pretty x) +++                " " ++ prettyShow x ++                 case file of                   Nothing -> "."                   Just f  -> " (" ++ f ++ ")."@@ -462,7 +470,7 @@ readInterface file = do     -- Decode the interface file     (s, close) <- liftIO $ readBinaryFile' file-    do  i <- liftIO . E.evaluate =<< decodeInterface s+    do  mi <- liftIO . E.evaluate =<< decodeInterface s          -- Close the file. Note         -- ⑴ that evaluate ensures that i is evaluated to WHNF (before@@ -471,7 +479,7 @@         -- so it is safe to close the file here.         liftIO close -        return i+        return $ constructIScope <$> mi       -- Catch exceptions and close       `catchError` \e -> liftIO close >> handler e   -- Catch exceptions@@ -491,10 +499,15 @@ writeInterface :: FilePath -> Interface -> TCM () writeInterface file i = do     reportSLn "import.iface.write" 5  $ "Writing interface file " ++ file ++ "."-    -- Andreas, Makoto, 2014-10-18 AIM XX:-    -- iInsideScope is bloating the interface files, so we do not serialize it?+    -- Andreas, 2015-07-13+    -- After QName memoization (AIM XXI), scope serialization might be cheap enough.+    -- -- Andreas, Makoto, 2014-10-18 AIM XX:+    -- -- iInsideScope is bloating the interface files, so we do not serialize it?+    -- i <- return $+    --   i { iInsideScope  = emptyScopeInfo+    --     }     i <- return $-      i { iInsideScope  = emptyScopeInfo+      i { iInsideScope  = removePrivates $ iInsideScope i         }     encodeFile file i     reportSLn "import.iface.write" 5 $ "Wrote interface file."@@ -506,6 +519,9 @@       whenM (doesFileExist file) $ removeFile file     throwError e +removePrivates :: ScopeInfo -> ScopeInfo+removePrivates si = si { scopeModules = restrictPrivate <$> scopeModules si }+ -- | Tries to type check a module and write out its interface. The -- function only writes out an interface file if it does not encounter -- any warnings.@@ -525,11 +541,11 @@     stTokens .= fileTokenInfo      reportSLn "import.iface.create" 5 $-      "Creating interface for " ++ render (pretty mname) ++ "."+      "Creating interface for " ++ prettyShow mname ++ "."     verboseS "import.iface.create" 10 $ do       visited <- Map.keys <$> getVisitedModules       reportSLn "import.iface.create" 10 $-        "  visited: " ++ intercalate ", " (map (render . pretty) visited)+        "  visited: " ++ intercalate ", " (map prettyShow visited)      previousHsImports <- getHaskellImports @@ -545,20 +561,26 @@     mapM_ setOptionsFromPragma options      -- Scope checking.+    reportSLn "import.iface.create" 7 $ "Starting scope checking."     topLevel <- Bench.billTo [Bench.Scoping] $       concreteToAbstract_ (TopLevel file top)+    reportSLn "import.iface.create" 7 $ "Finished scope checking."      let ds = topLevelDecls topLevel      -- Highlighting from scope checker.+    reportSLn "import.iface.create" 7 $ "Starting highlighting from scope."     Bench.billTo [Bench.Highlighting] $ do       ifTopLevelAndHighlightingLevelIs NonInteractive $ do-      -- Generate and print approximate syntax highlighting info.-      printHighlightingInfo fileTokenInfo-      mapM_ (\ d -> generateAndPrintSyntaxInfo d Partial) ds+        -- Generate and print approximate syntax highlighting info.+        printHighlightingInfo fileTokenInfo+        mapM_ (\ d -> generateAndPrintSyntaxInfo d Partial) ds+    reportSLn "import.iface.create" 7 $ "Finished highlighting from scope."      -- Type checking.+    reportSLn "import.iface.create" 7 $ "Starting type checking."     Bench.billTo [Bench.Typing] $ checkDecls ds+    reportSLn "import.iface.create" 7 $ "Finished type checking."      -- Ulf, 2013-11-09: Since we're rethrowing the error, leave it up to the     -- code that handles that error to reset the state.@@ -576,6 +598,7 @@       tickN "metas" (fromIntegral n)      -- Highlighting from type checker.+    reportSLn "import.iface.create" 7 $ "Starting highlighting from type info."     Bench.billTo [Bench.Highlighting] $ do        -- Move any remaining token highlighting to stSyntaxInfo.@@ -587,15 +610,17 @@       whenM (optGenerateVimFile <$> commandLineOptions) $         -- Generate Vim file.         withScope_ (insideScope topLevel) $ generateVimFile $ filePath file+    reportSLn "import.iface.create" 7 $ "Finished highlighting from type info."      setScope $ outsideScope topLevel-     reportSLn "scope.top" 50 $ "SCOPE " ++ show (insideScope topLevel)      -- Serialization.+    reportSLn "import.iface.create" 7 $ "Starting serialization."     syntaxInfo <- use stSyntaxInfo     i <- Bench.billTo [Bench.Serialization] $ do       buildInterface file topLevel syntaxInfo previousHsImports options+    reportSLn "import.iface.create" 7 $ "Finished serialization."      -- TODO: It would be nice if unsolved things were highlighted     -- after every mutual block.@@ -610,6 +635,7 @@     ifTopLevelAndHighlightingLevelIs NonInteractive $       printUnsolvedInfo +    reportSLn "import.iface.create" 7 $ "Starting writing to interface file."     r <- if and [ null unsolvedMetas, null unsolvedConstraints, null interactionPoints ]      then Bench.billTo [Bench.Serialization] $ do       -- The file was successfully type-checked (and no warnings were@@ -619,6 +645,7 @@       return (i, NoWarnings)      else do       return (i, SomeWarnings $ Warnings unsolvedMetas unsolvedConstraints)+    reportSLn "import.iface.create" 7 $ "Finished writing to interface file."      -- Profiling: Print statistics.     printStatistics 30 (Just mname) =<< getStatistics@@ -630,8 +657,12 @@     verboseS "profile" 1 $ do       reportSLn "import.iface" 5 $ "Accumulated statistics." -    return r+    return $ first constructIScope r +-- constructIScope :: ScopeInfo -> Map ModuleName Scope+constructIScope :: Interface -> Interface+constructIScope i = i{ iScope = billToPure [ Deserialization ] $ publicModules $ iInsideScope i }+ -- | Builds an interface for the current module, which should already -- have been successfully type checked. @@ -672,7 +703,7 @@       { iSourceHash      = h       , iImportedModules = mhs       , iModuleName      = m-      , iScope           = publicModules scope+      , iScope           = empty -- publicModules scope       , iInsideScope     = insideScope topLevel       , iSignature       = sig       , iBuiltin         = builtin'@@ -693,12 +724,6 @@     let hs = decodeHashes s     liftIO $ maybe 0 (uncurry (+)) hs `seq` close     return hs--safeReadInterface :: FilePath -> TCM (Maybe Interface)-safeReadInterface ifile = do-  exist <- liftIO $ doesFileExist ifile-  if exist then readInterface ifile-           else return Nothing  moduleHash :: ModuleName -> TCM Hash moduleHash m = iFullHash <$> getInterface m
src/full/Agda/Interaction/InteractionTop.hs view
@@ -10,6 +10,8 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-} +{-# OPTIONS_GHC -fno-warn-orphans #-}+ module Agda.Interaction.InteractionTop   ( module Agda.Interaction.InteractionTop   )@@ -873,50 +875,50 @@   -- Andreas, 2015-02-26 if string is empty do nothing rather   -- than giving a parse error.   unless (null s) $ do-  let give_ref =-        case giveRefine of-          Give   -> B.give-          Refine -> B.refine-  -- save scope of the interaction point (for printing the given expr. later)-  scope     <- lift $ getInteractionScope ii-  -- parse string and "give", obtaining an abstract expression-  -- and newly created interaction points-  (ae, iis) <- lift $ do-    mis  <- getInteractionPoints-    reportSLn "interaction.give" 30 $ "interaction points before = " ++ show mis-    ae   <- give_ref ii Nothing =<< B.parseExprIn ii rng s-    mis' <- getInteractionPoints-    reportSLn "interaction.give" 30 $ "interaction points after = " ++ show mis'-    return (ae, mis' \\ mis)-  -- favonia: backup the old scope for highlighting-  insertOldInteractionScope ii scope-  -- sort the new interaction points and put them into the state-  -- in replacement of the old interaction point-  iis       <- lift $ sortInteractionPoints iis-  modifyTheInteractionPoints $ replace ii iis-  -- print abstract expr-  ce        <- lift $ abstractToConcreteEnv (makeEnv scope) ae-  lift $ reportSLn "interaction.give" 30 $ "ce = " ++ show ce-  -- if the command was @Give@, use the literal user input;-  -- Andreas, 2014-01-15, see issue 1020:-  -- Refine could solve a goal by introducing the sole constructor-  -- without arguments.  Then there are no interaction metas, but-  -- we still cannot just `give' the user string (which may be empty).-  -- WRONG: also, if no interaction metas were created by @Refine@-  -- WRONG: let literally = (giveRefine == Give || null iis) && rng /= noRange-  let literally = giveRefine == Give && rng /= noRange-  -- Ulf, 2014-01-24: This works for give since we're highlighting the string-  -- that's already in the buffer. Doing it before the give action means that-  -- the highlighting is moved together with the text when the hole goes away.-  -- To make it work for refine we'd have to adjust the ranges.-  when literally $ lift $ do-    printHighlightingInfo =<< generateTokenInfoFromString rng s-    highlightExpr ae-  putResponse $ Resp_GiveAction ii $ mkNewTxt literally ce-  lift $ reportSLn "interaction.give" 30 $ "putResponse GiveAction passed"-  -- display new goal set-  interpret Cmd_metas-  lift $ reportSLn "interaction.give" 30 $ "interpret Cmd_metas passed"+    let give_ref =+          case giveRefine of+            Give   -> B.give+            Refine -> B.refine+    -- save scope of the interaction point (for printing the given expr. later)+    scope     <- lift $ getInteractionScope ii+    -- parse string and "give", obtaining an abstract expression+    -- and newly created interaction points+    (ae, iis) <- lift $ do+      mis  <- getInteractionPoints+      reportSLn "interaction.give" 30 $ "interaction points before = " ++ show mis+      ae   <- give_ref ii Nothing =<< B.parseExprIn ii rng s+      mis' <- getInteractionPoints+      reportSLn "interaction.give" 30 $ "interaction points after = " ++ show mis'+      return (ae, mis' \\ mis)+    -- favonia: backup the old scope for highlighting+    insertOldInteractionScope ii scope+    -- sort the new interaction points and put them into the state+    -- in replacement of the old interaction point+    iis       <- lift $ sortInteractionPoints iis+    modifyTheInteractionPoints $ replace ii iis+    -- print abstract expr+    ce        <- lift $ abstractToConcreteEnv (makeEnv scope) ae+    lift $ reportSLn "interaction.give" 30 $ "ce = " ++ show ce+    -- if the command was @Give@, use the literal user input;+    -- Andreas, 2014-01-15, see issue 1020:+    -- Refine could solve a goal by introducing the sole constructor+    -- without arguments.  Then there are no interaction metas, but+    -- we still cannot just `give' the user string (which may be empty).+    -- WRONG: also, if no interaction metas were created by @Refine@+    -- WRONG: let literally = (giveRefine == Give || null iis) && rng /= noRange+    let literally = giveRefine == Give && rng /= noRange+    -- Ulf, 2014-01-24: This works for give since we're highlighting the string+    -- that's already in the buffer. Doing it before the give action means that+    -- the highlighting is moved together with the text when the hole goes away.+    -- To make it work for refine we'd have to adjust the ranges.+    when literally $ lift $ do+      printHighlightingInfo =<< generateTokenInfoFromString rng s+      highlightExpr ae+    putResponse $ Resp_GiveAction ii $ mkNewTxt literally ce+    lift $ reportSLn "interaction.give" 30 $ "putResponse GiveAction passed"+    -- display new goal set+    interpret Cmd_metas+    lift $ reportSLn "interaction.give" 30 $ "interpret Cmd_metas passed"   where     -- Substitutes xs for x in ys.     replace x xs ys = concatMap (\ y -> if y == x then xs else [y]) ys
src/full/Agda/Interaction/MakeCase.hs view
@@ -4,8 +4,8 @@  module Agda.Interaction.MakeCase where -import Prelude hiding (mapM, mapM_)-import Control.Applicative+import Prelude hiding (mapM, mapM_, null)+import Control.Applicative hiding (empty) import Control.Monad hiding (mapM, mapM_, forM) import Data.Maybe import Data.Traversable@@ -23,9 +23,11 @@ import Agda.TypeChecking.Monad import Agda.TypeChecking.Coverage import Agda.TypeChecking.Pretty+import Agda.TypeChecking.RecordPatterns import Agda.TypeChecking.Reduce import Agda.TypeChecking.Substitute import Agda.TypeChecking.Irrelevance+import Agda.TypeChecking.Rules.LHS.Implicit import Agda.TheTypeChecker  import Agda.Interaction.Options@@ -34,7 +36,9 @@ import Agda.Utils.Functor import Agda.Utils.List import Agda.Utils.Monad+import Agda.Utils.Null import qualified Agda.Utils.Pretty as P+import Agda.Utils.Singleton import Agda.Utils.Size import qualified Agda.Utils.HashMap as HMap @@ -103,48 +107,48 @@   mi  <- getMetaInfo <$> lookupMeta mId   enterClosure mi $ \ r -> do -  -- Get printed representation of variables in context.-  n  <- getContextSize-  xs <- forM (downFrom n) $ \ i -> do-    (,i) . P.render <$> prettyTCM (var i)+    -- Get printed representation of variables in context.+    n  <- getContextSize+    xs <- forM (downFrom n) $ \ i -> do+      (,i) . P.render <$> prettyTCM (var i) -  -- Get number of module parameters.  These cannot be split on.-  fv <- getModuleFreeVars =<< currentModule-  let numSplittableVars = n - fv+    -- Get number of module parameters.  These cannot be split on.+    fv <- getModuleFreeVars =<< currentModule+    let numSplittableVars = n - fv -  -- Resolve each string to a variable.-  forM ss $ \ s -> do-    let failNotVar = typeError $ GenericError $ "Not a (splittable) variable: " ++ s-        done i-          | i < numSplittableVars = return i-          | otherwise             = failNotVar+    -- Resolve each string to a variable.+    forM ss $ \ s -> do+      let failNotVar = typeError $ GenericError $ "Not a (splittable) variable: " ++ s+          done i+            | i < numSplittableVars = return i+            | otherwise             = failNotVar -    -- Note: the range in the concrete name is only approximate.-    resName <- resolveName $ C.QName $ C.Name r $ C.stringNameParts s-    case resName of+      -- Note: the range in the concrete name is only approximate.+      resName <- resolveName $ C.QName $ C.Name r $ C.stringNameParts s+      case resName of -      -- Fail if s is a name, but not of a variable.-      DefinedName{}       -> failNotVar-      FieldName{}         -> failNotVar-      ConstructorName{}   -> failNotVar-      PatternSynResName{} -> failNotVar+        -- Fail if s is a name, but not of a variable.+        DefinedName{}       -> failNotVar+        FieldName{}         -> failNotVar+        ConstructorName{}   -> failNotVar+        PatternSynResName{} -> failNotVar -      -- If s is a variable name in scope, get its de Bruijn index-      -- via the type checker.-      VarName x -> do-        (v, _) <- getVarInfo x-        case ignoreSharing v of-          Var i [] -> done i-          _        -> failNotVar+        -- If s is a variable name in scope, get its de Bruijn index+        -- via the type checker.+        VarName x -> do+          (v, _) <- getVarInfo x+          case ignoreSharing v of+            Var i [] -> done i+            _        -> failNotVar -      -- If s is not a name, compare it to the printed variable representation.-      -- This fallback is to enable splitting on hidden variables.-      UnknownName -> do-        case filter ((s ==) . fst) xs of-          []      -> typeError $ GenericError $ "Unbound variable " ++ s-          [(_,i)] -> done i-          -- Issue 1325: Variable names in context can be ambiguous.-          _       -> typeError $ GenericError $ "Ambiguous variable " ++ s+        -- If s is not a name, compare it to the printed variable representation.+        -- This fallback is to enable splitting on hidden variables.+        UnknownName -> do+          case filter ((s ==) . fst) xs of+            []      -> typeError $ GenericError $ "Unbound variable " ++ s+            [(_,i)] -> done i+            -- Issue 1325: Variable names in context can be ambiguous.+            _       -> typeError $ GenericError $ "Ambiguous variable " ++ s   -- | Entry point for case splitting tactic.@@ -165,10 +169,18 @@   let vars = words s   if null vars then do     -- split result-    (newPats, sc) <- fixTarget $ clauseToSplitClause clause+    (piTel, sc) <- fixTarget $ clauseToSplitClause clause     -- Andreas, 2015-05-05 If we introduced new function arguments     -- do not split on result.  This might be more what the user wants.     -- To split on result, he can then C-c C-c again.+    -- Andreas, 2015-05-21 Issue 1516:  However, if only hidden+    -- arguments are introduced, C-c C-c virtually does nothing+    -- (as they are not shown and get lost on the way to emacs and back).+    newPats <- if null piTel then return False else do+      -- If there were any pattern introduce, they will only have effect+      -- if any of them is shown by the printer+      imp <- optShowImplicit <$> pragmaOptions+      return $ imp || any visible (telToList piTel)     scs <- if newPats then return [sc] else do       res <- splitResult f sc       case res of@@ -179,13 +191,14 @@   else do     -- split on variables     vars <- parseVariables hole rng vars-    (casectxt,) <$> split f vars clause+    (casectxt,) <$> do split f vars $ clauseToSplitClause clause   where+   failNoCop = typeError $ GenericError $     "OPTION --copatterns needed to split on result here"-  split :: QName -> [Nat] -> Clause -> TCM [A.Clause]-  split f [] clause =-    (:[]) <$> makeAbstractClause f (clauseToSplitClause clause)++  split :: QName -> [Nat] -> SplitClause -> TCM [A.Clause]+  split f [] clause = singleton <$> makeAbstractClause f clause   split f (var : vars) clause = do     z <- splitClauseWithAbsurd clause var     case z of@@ -195,19 +208,7 @@         | null vars -> mapM (makeAbstractClause f) $ splitClauses cov         | otherwise -> concat <$> do             forM (splitClauses cov) $ \ cl ->-              split f (mapMaybe (newVar cl) vars) $ splitClauseToClause cl-    where-    -- Note that the body of the created clause is the body of the-    -- argument to split.-    splitClauseToClause :: SplitClause -> Clause-    splitClauseToClause c = Clause-      { clauseRange     = noRange-      , clauseTel       = scTel c-      , clausePerm      = scPerm c-      , namedClausePats = scPats c-      , clauseBody      = clauseBody clause-      , clauseType      = scTarget c-      }+              split f (mapMaybe (newVar cl) vars) cl    -- Finds the new variable corresponding to an old one, if any.   newVar :: SplitClause -> Nat -> Maybe Nat@@ -215,7 +216,6 @@     Var y [] -> Just y     _        -> Nothing -  -- NOTE: clauseToSplitClause moved to Coverage.hs  makeAbsurdClause :: QName -> SplitClause -> TCM A.Clause makeAbsurdClause f (SClause tel perm ps _ t) = do@@ -229,9 +229,12 @@       ]     ]   withCurrentModule (qnameModule f) $ do+    -- Andreas, 2015-05-29 Issue 635+    -- Contract implicit record patterns before printing.+    c <- translateRecordPatterns $ Clause noRange tel perm ps NoBody t     -- Normalise the dot patterns-    ps <- addCtxTel tel $ normalise ps-    inContext [] $ reify $ QNamed f $ Clause noRange tel perm ps NoBody t+    ps <- addCtxTel tel $ normalise $ namedClausePats c+    inTopContext $ reify $ QNamed f $ c { namedClausePats = ps }  -- | Make a clause with a question mark as rhs. makeAbstractClause :: QName -> SplitClause -> TCM A.Clause
src/full/Agda/Interaction/Monad.hs view
@@ -1,28 +1,12 @@-{-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE MultiParamTypeClasses #-}--module Agda.Interaction.Monad where--import Agda.TypeChecking.Monad+module Agda.Interaction.Monad (IM, runIM, readline) where  import Control.Monad.Trans import System.Console.Haskeline -import Agda.Utils.Except ( MonadError(catchError, throwError) )---- | Interaction monad.--type IM = TCMT (InputT IO)--instance MonadError TCErr IM where-  throwError = liftIO . throwIO-  catchError m h = mapTCMT liftIO $ runIM m `catchError` (runIM . h)+import Agda.TypeChecking.Monad  -- | Line reader. The line reader history is not stored between -- sessions.  readline :: String -> IM (Maybe String) readline s = lift (getInputLine s)--runIM :: IM a -> TCM a-runIM = mapTCMT (runInputT defaultSettings)
src/full/Agda/Interaction/Options.hs view
@@ -128,6 +128,7 @@   , optWithoutK                  :: Bool   , optCopatterns                :: Bool  -- ^ Allow definitions by copattern matching?   , optPatternMatching           :: Bool  -- ^ Is pattern matching allowed in the current file?+  , optRewriting                 :: Bool  -- ^ Can rewrite rules be added and used?   }   deriving Show @@ -198,8 +199,9 @@   , optGuardingTypeConstructors  = False   , optUniversePolymorphism      = True   , optWithoutK                  = False-  , optCopatterns                = False+  , optCopatterns                = True   , optPatternMatching           = True+  , optRewriting                 = False   }  -- | The default termination depth.@@ -261,7 +263,7 @@    interactive = [optInteractive, optGHCiInteraction] --- Check for unsafe pramas. Gives a list of used unsafe flags.+-- | Check for unsafe pramas. Gives a list of used unsafe flags.  unsafePragmaOptions :: PragmaOptions -> [String] unsafePragmaOptions opts =@@ -274,9 +276,10 @@   [ "--injective-type-constructors"              | optInjectiveTypeConstructors opts ] ++   [ "--guardedness-preserving-type-constructors" | optGuardingTypeConstructors opts  ] ++   [ "--experimental-irrelevance"                 | optExperimentalIrrelevance opts   ] ++-  [ "--copatterns"                               | optCopatterns opts   ]+  [ "--rewriting"                                | optRewriting opts                 ] +++  [] --- The default pragma options should be considered safe+-- | The default pragma options should be considered safe.  defaultPragmaOptionsSafe :: IO Bool defaultPragmaOptionsSafe@@ -381,9 +384,15 @@ copatternsFlag :: Flag PragmaOptions copatternsFlag o = return $ o { optCopatterns = True } +noCopatternsFlag :: Flag PragmaOptions+noCopatternsFlag o = return $ o { optCopatterns = False }+ noPatternMatchingFlag :: Flag PragmaOptions noPatternMatchingFlag o = return $ o { optPatternMatching = False } +rewritingFlag :: Flag PragmaOptions+rewritingFlag o = return $ o { optRewriting = True }+ interactiveFlag :: Flag CommandLineOptions interactiveFlag  o = return $ o { optInteractive    = True                                 , optPragmaOptions  = (optPragmaOptions o)@@ -396,7 +405,7 @@ compileFlagNoMain :: Flag CommandLineOptions compileFlagNoMain o = return $ o { optCompileNoMain = True } --- The Epic backend has been disabled. See Issue 1481.+-- The Epic backend has been removed. See Issue 1481. compileEpicFlag :: Flag CommandLineOptions -- compileEpicFlag o = return $ o { optEpicCompile = True} compileEpicFlag o = throwError "the Epic backend has been disabled"@@ -412,7 +421,7 @@ ghcFlag f o = return $ o { optGhcFlags = optGhcFlags o ++ [f] }  -- NOTE: Quadratic in number of flags.--- The Epic backend has been disabled. See Issue 1481.+-- The Epic backend has been removed. See Issue 1481. epicFlagsFlag :: String -> Flag CommandLineOptions -- epicFlagsFlag s o = return $ o { optEpicFlags = optEpicFlags o ++ [s] } epicFlagsFlag s o = throwError "the Epic backend has been disabled"@@ -470,10 +479,10 @@     , Option []     ["no-main"] (NoArg compileFlagNoMain)                     "when compiling using the MAlonzo backend (experimental), do not treat the requested module as the main module of a program" -    -- The Epic backend has been disabled. See Issue 1481.+    -- The Epic backend has been removed. See Issue 1481.     , Option []     ["epic"] (NoArg compileEpicFlag)     --                "compile program using the Epic backend"-                    "the Epic backend has been disabled"+                    "the Epic backend has been removed"      , Option []     ["js"] (NoArg compileJSFlag) "compile program using the JS backend"     , Option []     ["compile-dir"] (ReqArg compileDirFlag "DIR")@@ -481,10 +490,10 @@     , Option []     ["ghc-flag"] (ReqArg ghcFlag "GHC-FLAG")                     "give the flag GHC-FLAG to GHC when compiling using MAlonzo" -    -- The Epic backend has been disabled. See Issue 1481.+    -- The Epic backend has been removed. See Issue 1481.     , Option []     ["epic-flag"] (ReqArg epicFlagsFlag "EPIC-FLAG")     --                "give the flag EPIC-FLAG to Epic when compiling using Epic"-                    "the Epic backend has been disabled"+                    "the Epic backend has been removed"      , Option []     ["test"] (NoArg runTestsFlag)                     "run internal test suite"@@ -562,9 +571,13 @@     , Option []     ["without-K"] (NoArg withoutKFlag)                     "disable the K rule in pattern matching"     , Option []     ["copatterns"] (NoArg copatternsFlag)-                    "enable definitions by copattern matching"+                    "enable definitions by copattern matching (default)"+    , Option []     ["no-copatterns"] (NoArg noCopatternsFlag)+                    "disable definitions by copattern matching"     , Option []     ["no-pattern-matching"] (NoArg noPatternMatchingFlag)                     "disable pattern matching completely"+    , Option []     ["rewriting"] (NoArg rewritingFlag)+                    "enable declaration and use of REWRITE rules"     ]  -- | Used for printing usage info.
src/full/Agda/Interaction/Response.hs view
@@ -16,7 +16,7 @@   ) where  import Agda.Interaction.Highlighting.Precise-import Agda.TypeChecking.Monad.Base+import {-# SOURCE #-} Agda.TypeChecking.Monad.Base import Agda.Syntax.Common   (InteractionId(..)) import Agda.Syntax.Concrete (Expr) import Agda.Utils.Pretty
− src/full/Agda/Interaction/Response.hs-boot
@@ -1,12 +0,0 @@-module Agda.Interaction.Response-  ( InteractionOutputCallback-  , defaultInteractionOutputCallback-  , Response-  ) where--import {-# SOURCE #-} Agda.TypeChecking.Monad.Base--data Response--type InteractionOutputCallback = Response -> TCM ()-defaultInteractionOutputCallback :: InteractionOutputCallback
src/full/Agda/Main.hs view
@@ -28,6 +28,7 @@ import Agda.TypeChecking.Monad import qualified Agda.TypeChecking.Monad.Benchmark as Bench import Agda.TypeChecking.Errors+import Agda.TypeChecking.Pretty  import Agda.Compiler.MAlonzo.Compiler as MAlonzo import Agda.Compiler.Epic.Compiler as Epic@@ -137,6 +138,8 @@             -- automatically.  (See Issue 1296).             SomeWarnings (Warnings _ _)        -> return Nothing             NoWarnings                         -> return $ Just i++          reportSDoc "main" 50 $ pretty i            whenM (optGenerateHTML <$> commandLineOptions) $             generateHTML
src/full/Agda/Syntax/Abstract.hs view
@@ -1,12 +1,11 @@--- GHC 7.4.2 requires this layout for the pragmas. See Issue 1460.-{-# LANGUAGE CPP,-             DeriveDataTypeable,-             DeriveFoldable,-             DeriveFunctor,-             DeriveTraversable,-             FlexibleInstances,-             MultiParamTypeClasses,-             TemplateHaskell #-}+{-# LANGUAGE CPP                   #-}+{-# LANGUAGE DeriveDataTypeable    #-}+{-# LANGUAGE DeriveFoldable        #-}+{-# LANGUAGE DeriveFunctor         #-}+{-# LANGUAGE DeriveTraversable     #-}+{-# LANGUAGE FlexibleInstances     #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE TemplateHaskell       #-}  {-| The abstract syntax. This is what you get after desugaring and scope     analysis of the concrete syntax. The type checker works on abstract syntax,@@ -296,7 +295,7 @@              , lhsPatsRight  :: [NamedArg (Pattern' e)]                -- ^ Further applied to patterns.              }-  deriving (Typeable, Show, Functor, Foldable, Traversable)+  deriving (Eq, Typeable, Show, Functor, Foldable, Traversable)  type LHSCore = LHSCore' Expr @@ -377,12 +376,11 @@     -- ^ Defined pattern: function definition @f ps@ or destructor pattern @d p ps@.   | WildP PatInfo     -- ^ Underscore pattern entered by user.+    --   Or generated at type checking for implicit arguments.   | AsP PatInfo Name (Pattern' e)   | DotP PatInfo e   | AbsurdP PatInfo   | LitP Literal-  | ImplicitP PatInfo-    -- ^ Generated at type checking for implicit arguments.   | PatternSynP PatInfo QName [NamedArg (Pattern' e)]   deriving (Typeable, Show, Functor, Foldable, Traversable) @@ -407,6 +405,31 @@     Instances  --------------------------------------------------------------------------} +-- | Literal equality of patterns, ignoring dot patterns+instance Eq (Pattern' e) where+  p == p' =+    case (p,p') of+      ((VarP x)             , (VarP x')             ) -> x === x'+      ((ConP _ x ps)        , (ConP _ x' ps')       ) -> x == x' && ps == ps'+      ((DefP _ x ps)        , (DefP _ x' ps')       ) -> x == x' && ps == ps'+      ((WildP _)            , (WildP _)             ) -> True+      ((AsP _ x p)          , (AsP _ x' p')         ) -> x === x' && p == p'+      ((DotP _ _)           , (DotP _ _)            ) -> True+      (AbsurdP{}            , AbsurdP{}             ) -> True+      ((LitP l)             , (LitP l')             ) -> l == l'+      ((PatternSynP _ x ps) , (PatternSynP _ x' ps')) -> x == x' && ps == ps'+      (_                    , _                     ) -> False+    where (Name _ (C.Name _ x) _ _) === (Name _ (C.Name _ x') _ _) = True+          (Name _ C.NoName{}   _ _) === (Name _ C.NoName{}    _ _) = True+          _                         === _                          = False++instance Eq LHS where+  (LHS _ core wps) == (LHS _ core' wps') = core == core' && wps == wps'++instance Underscore Expr where+  underscore   = Underscore emptyMetaInfo+  isUnderscore = __IMPOSSIBLE__+ instance LensHiding TypedBindings where   getHiding   (TypedBindings _ a) = getHiding a   mapHiding f (TypedBindings r a) = TypedBindings r $ mapHiding f a@@ -482,7 +505,6 @@     getRange (ConP i _ _)        = getRange i     getRange (DefP i _ _)        = getRange i     getRange (WildP i)           = getRange i-    getRange (ImplicitP i)       = getRange i     getRange (AsP i _ _)         = getRange i     getRange (DotP i _)          = getRange i     getRange (AbsurdP i)         = getRange i@@ -520,7 +542,6 @@     setRange r (ConP i ns as)       = ConP (setRange r i) ns as     setRange r (DefP _ n as)        = DefP (PatRange r) (setRange r n) as     setRange r (WildP _)            = WildP (PatRange r)-    setRange r (ImplicitP _)        = ImplicitP (PatRange r)     setRange r (AsP _ n p)          = AsP (PatRange r) (setRange r n) p     setRange r (DotP _ e)           = DotP (PatRange r) e     setRange r (AbsurdP _)          = AbsurdP (PatRange r)@@ -592,15 +613,11 @@   killRange (SectionApp a b c  ) = killRange3 SectionApp a b c   killRange (RecordModuleIFS a ) = killRange1 RecordModuleIFS a -instance KillRange x => KillRange (ThingWithFixity x) where-  killRange (ThingWithFixity c f) = ThingWithFixity (killRange c) f- instance KillRange e => KillRange (Pattern' e) where   killRange (VarP x)            = killRange1 VarP x   killRange (ConP i a b)        = killRange3 ConP i a b   killRange (DefP i a b)        = killRange3 DefP i a b   killRange (WildP i)           = killRange1 WildP i-  killRange (ImplicitP i)       = killRange1 ImplicitP i   killRange (AsP i a b)         = killRange3 AsP i a b   killRange (DotP i a)          = killRange2 DotP i a   killRange (AbsurdP i)         = killRange1 AbsurdP i@@ -799,7 +816,6 @@ patternToExpr (DotP _ e)          = e patternToExpr (AbsurdP _)         = Underscore emptyMetaInfo  -- TODO: could this happen? patternToExpr (LitP l)            = Lit l-patternToExpr (ImplicitP _)       = Underscore emptyMetaInfo patternToExpr (PatternSynP _ _ _) = __IMPOSSIBLE__  type PatternSynDefn = ([Arg Name], Pattern)@@ -818,8 +834,7 @@   DotP i e    -> DotP i (substExpr (map (fmap patternToExpr) s) e)   AbsurdP i   -> p   LitP l      -> p-  _           -> __IMPOSSIBLE__ -- Implicits (generated at TC time),-                                -- pattern synonyms (already gone), and+  _           -> __IMPOSSIBLE__ -- pattern synonyms (already gone) and                                 -- @-patterns (not supported anyways).  class SubstExpr a where
src/full/Agda/Syntax/Abstract/Copatterns.hs view
@@ -378,15 +378,12 @@       ((DotP _ _)           , (DotP _ _)            ) -> return ()       (AbsurdP{}            , AbsurdP{}             ) -> return ()       ((LitP l)             , (LitP l')             ) -> guard (l == l')-      (ImplicitP{}          , ImplicitP{}           ) -> return ()       ((PatternSynP _ x ps) , (PatternSynP _ x' ps')) -> guard (x == x') >> alpha' ps ps'       (_                    , _                     ) -> fail "not alpha equivalent"  tell1 :: (MonadWriter [a] m) => a -> m () tell1 a = tell [a] -deriving instance Eq AmbiguousQName- instance Alpha (LHSCore' e) where   alpha' (LHSHead f ps) (LHSHead f' ps') = guard (f == f') >> alpha' ps ps'   alpha' (LHSProj d ps1 lhs ps2) (LHSProj d' ps1' lhs' ps2') =@@ -404,27 +401,3 @@  instance Alpha a => Alpha [a] where   alpha' l l' = guard (length l == length l') >> zipWithM_ alpha' l l'---- | Literal equality of patterns, ignoring dot patterns-instance Eq (Pattern' e) where-  p == p' =-    case (p,p') of-      ((VarP x)             , (VarP x')             ) -> x === x'-      ((ConP _ x ps)        , (ConP _ x' ps')       ) -> x == x' && ps == ps'-      ((DefP _ x ps)        , (DefP _ x' ps')       ) -> x == x' && ps == ps'-      ((WildP _)            , (WildP _)             ) -> True-      ((AsP _ x p)          , (AsP _ x' p')         ) -> x === x' && p == p'-      ((DotP _ _)           , (DotP _ _)            ) -> True-      (AbsurdP{}            , AbsurdP{}             ) -> True-      ((LitP l)             , (LitP l')             ) -> l == l'-      (ImplicitP{}          , ImplicitP{}           ) -> True-      ((PatternSynP _ x ps) , (PatternSynP _ x' ps')) -> x == x' && ps == ps'-      (_                    , _                     ) -> False-    where (A.Name _ (C.Name _ x) _ _) === (A.Name _ (C.Name _ x') _ _) = True-          (A.Name _ C.NoName{}   _ _) === (A.Name _ C.NoName{}    _ _) = True-          _                           === _                            = False--deriving instance Eq (LHSCore' e)--instance Eq LHS where-  (LHS _ core wps) == (LHS _ core' wps') = core == core' && wps == wps'
src/full/Agda/Syntax/Abstract/Name.hs view
@@ -6,6 +6,7 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE StandaloneDeriving #-}  {-| Abstract names carry unique identifiers and stuff. -}@@ -23,13 +24,15 @@ import Data.Function import Data.Hashable +import Test.QuickCheck+ import Agda.Syntax.Position import Agda.Syntax.Common-import Agda.Syntax.Fixity+import {-# SOURCE #-} Agda.Syntax.Fixity import Agda.Syntax.Concrete.Name (IsNoName(..)) import qualified Agda.Syntax.Concrete.Name as C --- import Agda.Utils.Function+import Agda.Utils.Monad import Agda.Utils.Pretty import Agda.Utils.Size import Agda.Utils.Suffix@@ -63,7 +66,7 @@   { qname  :: QName   , qnamed :: a   }-  deriving (Typeable, Show, Functor, Foldable, Traversable)+  deriving (Typeable, Functor, Foldable, Traversable)  -- | A module name is just a qualified name. --@@ -77,7 +80,7 @@ -- Invariant: All the names in the list must have the same concrete, -- unqualified name.  (This implies that they all have the same 'Range'). newtype AmbiguousQName = AmbQ { unAmbQ :: [QName] }-  deriving (Typeable, Show)+  deriving (Eq, Typeable)  -- | A module is anonymous if the qualification path ends in an underscore. isAnonymousModuleName :: ModuleName -> Bool@@ -102,12 +105,11 @@ -- least as large as the length of the list.  withRangesOf :: ModuleName -> [C.Name] -> ModuleName-MName ms `withRangesOf` ns-  | length ms < length ns  = __IMPOSSIBLE__-  | otherwise              = MName $-      reverse $ zipWith setRange-                        (reverse (map getRange ns) ++ repeat noRange)-                        (reverse ms)+MName ms `withRangesOf` ns = if m < n then __IMPOSSIBLE__ else MName $+      zipWith setRange (replicate (m - n) noRange ++ map getRange ns) ms+  where+    m = length ms+    n = length ns  -- | Like 'withRangesOf', but uses the name parts (qualifier + name) -- of the qualified name as the list of concrete names.@@ -253,6 +255,12 @@ -- * Show instances ------------------------------------------------------------------------ +-- deriving instance Show Name+-- deriving instance Show ModuleName+-- deriving instance Show QName+deriving instance Show a => Show (QNamed a)+deriving instance Show AmbiguousQName+ -- | Only use this @show@ function in debugging!  To convert an --   abstract 'Name' into a string use @prettyShow@. instance Show Name where@@ -260,19 +268,17 @@   -- Reason: I do not have time just now to properly fix the   -- use of Show Name for pretty printing everywhere, e.g. in   -- the Epic backend.  But I want to push the fix for Issue 836 now.-  show n = show (nameConcrete n)-  -- show n = show (nameConcrete n) ++ "^" ++ show (nameId n)-  -- show n = applyWhen (isNoName n) (++ show (nameId n)) $ show (nameConcrete n)+  show = prettyShow  -- | Only use this @show@ function in debugging!  To convert an --   abstract 'ModuleName' into a string use @prettyShow@. instance Show ModuleName where-  show m = concat $ intersperse "." $ map show $ mnameToList m+  show = prettyShow  -- | Only use this @show@ function in debugging!  To convert an --   abstract 'QName' into a string use @prettyShow@. instance Show QName where-  show q = concat $ intersperse "." $ map show $ qnameToList q+  show = prettyShow  ------------------------------------------------------------------------ -- * Pretty instances@@ -290,6 +296,9 @@ instance Pretty AmbiguousQName where   pretty (AmbQ qs) = hcat $ punctuate (text " | ") $ map pretty qs +instance Pretty a => Pretty (QNamed a) where+  pretty (QNamed a b) = pretty a <> text "." <> pretty b+ ------------------------------------------------------------------------ -- * Range instances ------------------------------------------------------------------------@@ -360,3 +369,26 @@  instance Sized ModuleName where   size = size . mnameToList++------------------------------------------------------------------------+-- * Arbitrary instances+------------------------------------------------------------------------++-- | The generated names all have the same 'Fixity'': 'noFixity''.++instance Arbitrary Name where+  arbitrary =+    Name <$> arbitrary <*> arbitrary <*> arbitrary+         <*> return noFixity'++instance CoArbitrary Name where+  coarbitrary = coarbitrary . nameId++instance Arbitrary QName where+  arbitrary = do+    ms <- arbitrary+    n  <- arbitrary+    return (QName (MName ms) n)++instance CoArbitrary QName where+  coarbitrary = coarbitrary . qnameName
− src/full/Agda/Syntax/Abstract/Name.hs-boot
@@ -1,10 +0,0 @@-module Agda.Syntax.Abstract.Name where--import {-# SOURCE #-} Agda.Syntax.Fixity (Fixity')--data Name--instance Show Name-instance Ord  Name--nameFixity :: Name -> Fixity'
src/full/Agda/Syntax/Abstract/Views.hs view
@@ -1,6 +1,7 @@+{-# LANGUAGE DefaultSignatures         #-} {-# LANGUAGE NoMonomorphismRestriction #-}-{-# LANGUAGE PatternGuards #-}-{-# LANGUAGE TupleSections #-}+{-# LANGUAGE PatternGuards             #-}+{-# LANGUAGE TupleSections             #-}  module Agda.Syntax.Abstract.Views where @@ -61,12 +62,54 @@ -- | Apply an expression rewriting to every subexpression, inside-out. --   See "Agda.Syntax.Internal.Generic". class ExprLike a where+  -- | The first expression is pre-traversal, the second one post-traversal.+  recurseExpr :: (Applicative m) => (Expr -> m Expr -> m Expr) -> a -> m a+  default recurseExpr :: (ExprLike a, Traversable f, Applicative m)+                                 => (Expr -> m Expr -> m Expr) -> f a -> m (f a)+  recurseExpr = traverse . recurseExpr+   foldExpr :: Monoid m => (Expr -> m) -> a -> m+  foldExpr f = getConst . recurseExpr (\ pre post -> Const $ f pre)+   traverseExpr :: (Monad m, Applicative m) => (Expr -> m Expr) -> a -> m a+  traverseExpr f = recurseExpr (\ pre post -> f =<< post)+   mapExpr :: (Expr -> Expr) -> (a -> a)   mapExpr f e = runIdentity $ traverseExpr (Identity . f) e  instance ExprLike Expr where+  recurseExpr f e0 = f e0 $ do+    let recurse e = recurseExpr f e+    case e0 of+      Var{}                   -> pure e0+      Def{}                   -> pure e0+      Proj{}                  -> pure e0+      Con{}                   -> pure e0+      Lit{}                   -> pure e0+      QuestionMark{}          -> pure e0+      Underscore{}            -> pure e0+      App ei e arg            -> App ei <$> recurse e <*> recurse arg+      WithApp ei e es         -> WithApp ei <$> recurse e <*> recurse es+      Lam ei b e              -> Lam ei <$> recurse b <*> recurse e+      AbsurdLam{}             -> pure e0+      ExtendedLam ei di x cls -> ExtendedLam ei di x <$> recurse cls+      Pi ei tel e             -> Pi ei <$> recurse tel <*> recurse e+      Fun ei arg e            -> Fun ei <$> recurse arg <*> recurse e+      Set{}                   -> pure e0+      Prop{}                  -> pure e0+      Let ei bs e             -> Let ei <$> recurse bs <*> recurse e+      ETel tel                -> ETel <$> recurse tel+      Rec ei bs               -> Rec ei <$> recurse bs+      RecUpdate ei e bs       -> RecUpdate ei <$> recurse e <*> recurse bs+      ScopedExpr sc e         -> ScopedExpr sc <$> recurse e+      QuoteGoal ei n e        -> QuoteGoal ei n <$> recurse e+      QuoteContext ei n e     -> QuoteContext ei n <$> recurse e+      Quote{}                 -> pure e0+      QuoteTerm{}             -> pure e0+      Unquote{}               -> pure e0+      DontCare e              -> DontCare <$> recurse e+      PatternSyn{}            -> pure e0+   foldExpr f e =     case e of       Var{}                -> m@@ -151,20 +194,29 @@   traverseExpr f (x, e) = (x,) <$> traverseExpr f e  instance ExprLike LamBinding where+  recurseExpr f e =+    case e of+      DomainFree{}  -> pure e+      DomainFull bs -> DomainFull <$> recurseExpr f bs   foldExpr f e =     case e of       DomainFree{}  -> mempty       DomainFull bs -> foldExpr f bs   traverseExpr f e =     case e of-      DomainFree{}  -> return e+      DomainFree{}  -> pure e       DomainFull bs -> DomainFull <$> traverseExpr f bs  instance ExprLike TypedBindings where+  recurseExpr  f (TypedBindings r b) = TypedBindings r <$> recurseExpr f b   foldExpr     f (TypedBindings r b) = foldExpr f b   traverseExpr f (TypedBindings r b) = TypedBindings r <$> traverseExpr f b  instance ExprLike TypedBinding where+  recurseExpr f e =+    case e of+      TBind r xs e -> TBind r xs <$> recurseExpr f e+      TLet r ds    -> TLet r <$> recurseExpr f ds   foldExpr f e =     case e of       TBind _ _ e  -> foldExpr f e@@ -175,6 +227,14 @@       TLet r ds    -> TLet r <$> traverseExpr f ds  instance ExprLike LetBinding where+  recurseExpr f e = do+    let recurse e = recurseExpr f e+    case e of+      LetBind li ai x e e' -> LetBind li ai x <$> recurse e <*> recurse e'+      LetPatBind li p e    -> LetPatBind li <$> recurse p <*> recurse e+      LetApply{}           -> pure e+      LetOpen{}            -> pure e+   foldExpr f e =     case e of       LetBind _ _ _ e e' -> fold e `mappend` fold e'@@ -188,18 +248,16 @@     case e of       LetBind li ai x e e' -> LetBind li ai x <$> trav e <*> trav e'       LetPatBind li p e    -> LetPatBind li <$> trav p <*> trav e-      LetApply{}           -> return e-      LetOpen{}            -> return e+      LetApply{}           -> pure e+      LetOpen{}            -> pure e --- | TODO: currently does not go into patterns.-instance ExprLike (Pattern' a) where-  foldExpr     f _ = mempty-  traverseExpr f e = return e+instance ExprLike a => ExprLike (Pattern' a) where  -- | TODO: currently does not go into clauses. instance ExprLike (Clause' a) where+  recurseExpr  f e = pure e   foldExpr     f _ = mempty-  traverseExpr f e = return e+  traverseExpr f e = pure e  {- TODO: finish instance ExprLike (Clause' a) where
src/full/Agda/Syntax/Common.hs view
@@ -2,6 +2,7 @@ {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveFunctor #-}+{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-}@@ -20,6 +21,8 @@ import Data.Traversable import Data.Typeable (Typeable) +import GHC.Generics (Generic)+ import Test.QuickCheck hiding (Small)  import Agda.Syntax.Position@@ -257,6 +260,71 @@     -- remaining case     (NonStrict,NonStrict) -> True +irrelevantOrUnused :: Relevance -> Bool+irrelevantOrUnused r =+  case r of+    Irrelevant -> True+    UnusedArg  -> True+    NonStrict  -> False+    Relevant   -> False+    Forced{}   -> False++-- | @unusableRelevance rel == True@ iff we cannot use a variable of @rel@.+unusableRelevance :: Relevance -> Bool+unusableRelevance rel = NonStrict `moreRelevant` rel++-- | 'Relevance' composition.+--   'Irrelevant' is dominant, 'Relevant' is neutral.+composeRelevance :: Relevance -> Relevance -> Relevance+composeRelevance r r' =+  case (r, r') of+    (Irrelevant, _) -> Irrelevant+    (_, Irrelevant) -> Irrelevant+    (NonStrict, _)  -> NonStrict+    (_, NonStrict)  -> NonStrict+    (Forced b, Forced b') -> Forced (max b b')  -- prefer Big over Small+    (Forced b, _)     -> Forced b+    (_, Forced b)     -> Forced b+    (UnusedArg, _)  -> UnusedArg+    (_, UnusedArg)  -> UnusedArg+    (Relevant, Relevant) -> Relevant++-- | @inverseComposeRelevance r x@ returns the most irrelevant @y@+--   such that forall @x@, @y@ we have+--   @x \`moreRelevant\` (r \`composeRelevance\` y)@+--   iff+--   @(r \`inverseComposeRelevance\` x) \`moreRelevant\` y@ (Galois connection).+inverseComposeRelevance :: Relevance -> Relevance -> Relevance+inverseComposeRelevance r x =+  case (r, x) of+    (Relevant, x)        -> x          -- going to relevant arg.: nothing changes+    _ | r == x           -> Relevant   -- because Relevant is comp.-neutral+    (Forced{}, Forced{}) -> Relevant   -- same, but (==) does not ignore Big+    (UnusedArg, x)       -> x+    (Forced{}, UnusedArg)  -> Relevant+    (Forced{}, x)          -> x+    (Irrelevant, x)      -> Relevant   -- going irrelevant: every thing usable+    (_, Irrelevant)      -> Irrelevant -- otherwise: irrelevant things remain unusable+    (NonStrict, _)       -> Relevant   -- but @NonStrict@s become usable++-- | For comparing @Relevance@ ignoring @Forced@ and @UnusedArg@.+ignoreForced :: Relevance -> Relevance+ignoreForced Forced{}   = Relevant+ignoreForced UnusedArg  = Relevant+ignoreForced Relevant   = Relevant+ignoreForced NonStrict  = NonStrict+ignoreForced Irrelevant = Irrelevant++-- | Irrelevant function arguments may appear non-strictly in the codomain type.+irrToNonStrict :: Relevance -> Relevance+irrToNonStrict Irrelevant = NonStrict+-- irrToNonStrict NonStrict  = Relevant -- TODO: is that what we want (OR: NonStrict)  -- better be more conservative+irrToNonStrict rel        = rel++nonStrictToIrr :: Relevance -> Relevance+nonStrictToIrr NonStrict = Irrelevant+nonStrictToIrr rel       = rel+ --------------------------------------------------------------------------- -- * Argument decoration ---------------------------------------------------------------------------@@ -587,6 +655,17 @@ type RString = Ranged RawName  ---------------------------------------------------------------------------+-- * Constructor pattern info+---------------------------------------------------------------------------++-- | Where does the 'ConP' of come from?+data ConPOrigin+  = ConPImplicit  -- ^ Expanded from an implicit pattern.+  | ConPCon       -- ^ User wrote a constructor pattern.+  | ConPRec       -- ^ User wrote a record pattern.+  deriving (Typeable, Show, Eq, Ord, Enum, Bounded)++--------------------------------------------------------------------------- -- * Infixity, access, abstract, etc. --------------------------------------------------------------------------- @@ -618,7 +697,7 @@ -- | The unique identifier of a name. Second argument is the top-level module --   identifier. data NameId = NameId Integer Integer-    deriving (Eq, Ord, Typeable)+    deriving (Eq, Ord, Typeable, Generic)  instance KillRange NameId where   killRange = id@@ -636,6 +715,11 @@   {-# INLINE hashWithSalt #-}   hashWithSalt salt (NameId n m) = hashWithSalt salt (n, m) +instance Arbitrary NameId where+  arbitrary = elements [ NameId x y | x <- [-1, 1], y <- [-1, 1] ]++instance CoArbitrary NameId+ newtype Constr a = Constr a  ---------------------------------------------------------------------------@@ -671,4 +755,3 @@ instance KillRange m => KillRange (TerminationCheck m) where   killRange (TerminationMeasure _ m) = TerminationMeasure noRange (killRange m)   killRange t                        = t-
src/full/Agda/Syntax/Concrete.hs view
@@ -1,10 +1,9 @@--- GHC 7.4.2 requires this layout for the pragmas. See Issue 1460.-{-# LANGUAGE CPP,-             DeriveDataTypeable,-             DeriveFoldable,-             DeriveFunctor,-             DeriveTraversable,-             FlexibleInstances #-}+{-# LANGUAGE CPP                #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveFoldable     #-}+{-# LANGUAGE DeriveFunctor      #-}+{-# LANGUAGE DeriveTraversable  #-}+{-# LANGUAGE FlexibleInstances  #-}  {-| The concrete syntax is a raw representation of the program text     without any desugaring at all.  This is what the parser produces.@@ -45,7 +44,7 @@   , ThingWithFixity(..)   , topLevelModuleName     -- * Pattern tools-  , patternHead, patternNames+  , patternNames, patternQNames     -- * Lenses   , mapLhsOriginalPattern     -- * Concrete instances@@ -442,44 +441,27 @@     Patterns  --------------------------------------------------------------------------} --- | Get the leftmost symbol in a pattern.-patternHead :: Pattern -> Maybe Name-patternHead p =-  case p of-    IdentP x               -> return $ unqualify x-    AppP p p'              -> patternHead p-    RawAppP _ []           -> __IMPOSSIBLE__-    RawAppP _ (p:_)        -> patternHead p-    OpAppP _ name _ ps     -> return $ unqualify name-    HiddenP _ (namedPat)   -> patternHead (namedThing namedPat)-    ParenP _ p             -> patternHead p-    WildP _                -> Nothing-    AbsurdP _              -> Nothing-    AsP _ x p              -> patternHead p-    DotP{}                 -> Nothing-    LitP (LitQName _ x)    -> Nothing -- return $ unqualify x -- does not compile-    LitP _                 -> Nothing-    QuoteP _               -> Nothing-    InstanceP _ (namedPat) -> patternHead (namedThing namedPat)-- -- | Get all the identifiers in a pattern in left-to-right order.-patternNames :: Pattern -> [Name]-patternNames p =+patternQNames :: Pattern -> [QName]+patternQNames p =   case p of-    IdentP x               -> [unqualify x]-    AppP p p'              -> concatMap patternNames [p, namedArg p']-    RawAppP _ ps           -> concatMap patternNames  ps-    OpAppP _ name _ ps     -> unqualify name : concatMap (patternNames . namedArg) ps-    HiddenP _ (namedPat)   -> patternNames (namedThing namedPat)-    ParenP _ p             -> patternNames p+    IdentP x               -> [x]+    AppP p p'              -> concatMap patternQNames [p, namedArg p']+    RawAppP _ ps           -> concatMap patternQNames  ps+    OpAppP _ x _ ps        -> x : concatMap (patternQNames . namedArg) ps+    HiddenP _ (namedPat)   -> patternQNames (namedThing namedPat)+    ParenP _ p             -> patternQNames p     WildP _                -> []     AbsurdP _              -> []-    AsP _ x p              -> patternNames p+    AsP _ x p              -> patternQNames p     DotP{}                 -> []     LitP _                 -> []     QuoteP _               -> []-    InstanceP _ (namedPat) -> patternNames (namedThing namedPat)+    InstanceP _ (namedPat) -> patternQNames (namedThing namedPat)++-- | Get all the identifiers in a pattern in left-to-right order.+patternNames :: Pattern -> [Name]+patternNames = map unqualify . patternQNames  {--------------------------------------------------------------------------     Instances
src/full/Agda/Syntax/Concrete/Definitions.hs view
@@ -1,9 +1,8 @@--- GHC 7.4.2 requires this layout for the pragmas. See Issue 1460.-{-# LANGUAGE CPP,-             DeriveDataTypeable,-             FlexibleInstances,-             PatternGuards,-             TupleSections #-}+{-# LANGUAGE CPP                #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE FlexibleInstances  #-}+{-# LANGUAGE PatternGuards      #-}+{-# LANGUAGE TupleSections      #-}  #if __GLASGOW_HASKELL__ >= 710 {-# LANGUAGE FlexibleContexts #-}@@ -213,7 +212,6 @@   getRange (NiceUnquoteDecl r _ _ _ _ _ _ _) = r  instance Error DeclarationException where-  noMsg  = strMsg ""   strMsg = DeclarationPanic  -- These error messages can (should) be terminated by a dot ".",@@ -423,7 +421,7 @@ getFixity :: Name -> Nice Fixity' getFixity x = do   when (isUnderscore x) $ throwError $ InvalidName x-  gets $ Map.findWithDefault defaultFixity' x . fixs+  Map.findWithDefault defaultFixity' x <$> gets fixs  runNice :: Nice a -> Either DeclarationException a runNice nice = nice `evalStateT` initNiceEnv@@ -1028,10 +1026,7 @@ --   the first error. instance Monoid (Nice Fixities) where   mempty        = return $ Map.empty-  mappend c1 c2 = do-    m1 <- c1-    m2 <- c2-    plusFixities m1 m2+  mappend c1 c2 = plusFixities ==<< (c1, c2)  -- | Get the fixities from the current block. --   Doesn't go inside modules and where blocks.
src/full/Agda/Syntax/Concrete/Generic.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE CPP #-}+{-# LANGUAGE CPP               #-} {-# LANGUAGE FlexibleInstances #-}  -- | Generic traversal and reduce for concrete syntax,
src/full/Agda/Syntax/Concrete/Name.hs view
@@ -1,7 +1,9 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE PatternGuards #-}+{-# LANGUAGE StandaloneDeriving #-}  {-| Names in the concrete syntax are just strings (or lists of strings for     qualified names).@@ -16,6 +18,8 @@ import Data.List import Data.Typeable (Typeable) +import GHC.Generics (Generic)+ import System.FilePath  import Test.QuickCheck@@ -54,7 +58,7 @@ data NamePart   = Hole       -- ^ @_@ part.   | Id RawName  -- ^ Identifier part.-  deriving (Typeable)+  deriving (Typeable, Generic)  -- | Define equality on @Name@ to ignore range so same names in different --   locations are equal.@@ -117,7 +121,7 @@ ------------------------------------------------------------------------  nameToRawName :: Name -> RawName-nameToRawName = show+nameToRawName = prettyShow  nameParts :: Name -> [NamePart] nameParts (Name _ ps)  = ps@@ -180,7 +184,7 @@ -- name is assumed to represent a top-level module name.  toTopLevelModuleName :: QName -> TopLevelModuleName-toTopLevelModuleName = TopLevelModuleName . map show . qnameParts+toTopLevelModuleName = TopLevelModuleName . map prettyShow . qnameParts  -- | Turns a top-level module name into a file name with the given -- suffix.@@ -243,21 +247,22 @@ -- * Showing names ------------------------------------------------------------------------ +-- deriving instance Show Name+-- deriving instance Show NamePart+-- deriving instance Show QName+ -- TODO: 'Show' should output Haskell-parseable representations. -- The following instances are deprecated, and Pretty should be used -- instead.  Later, simply derive Show for these types:  instance Show Name where-  show (Name _ xs)  = concatMap show xs-  show (NoName _ _) = "_"+  show = prettyShow  instance Show NamePart where-  show Hole   = "_"-  show (Id s) = rawNameToString s+  show = prettyShow  instance Show QName where-  show (Qual m x) = show m ++ "." ++ show x-  show (QName x)  = show x+  show = prettyShow  ------------------------------------------------------------------------ -- * Printing names@@ -287,6 +292,27 @@  instance CoArbitrary TopLevelModuleName where   coarbitrary (TopLevelModuleName m) = coarbitrary m++instance Arbitrary Name where+  arbitrary = oneof+    [ Name   <$> arbitrary <*> parts+    , NoName <$> arbitrary <*> arbitrary+    ]+    where+    parts = do+      parts         <- listOf1 (elements ["x", "y", "z"])+      startWithHole <- arbitrary+      endWithHole   <- arbitrary+      return $+        (if startWithHole then (Hole :)    else id) $+        (if endWithHole   then (++ [Hole]) else id) $+        intersperse Hole (map Id parts)++instance CoArbitrary NamePart++instance CoArbitrary Name where+  coarbitrary (Name _ ns)  = variant 0 . coarbitrary ns+  coarbitrary (NoName _ i) = variant 1 . coarbitrary i  ------------------------------------------------------------------------ -- * Range instances
src/full/Agda/Syntax/Concrete/Operators.hs view
@@ -222,58 +222,7 @@                         []  -> []                         ops -> [ f $ choice $ map (opP p0) ops ] - ------------------------------------------------------------------------------ * Expression instances------------------------------------------------------------------------------instance IsExpr Expr where-    exprView e = case e of-        Ident x         -> LocalV x-        App _ e1 e2     -> AppV e1 e2-        OpApp r d ns es -> OpAppV d ns es-        HiddenArg _ e   -> HiddenArgV e-        InstanceArg _ e -> InstanceArgV e-        Paren _ e       -> ParenV e-        Lam _ bs    e   -> LamV bs e-        Underscore{}    -> WildV e-        _               -> OtherV e-    unExprView e = case e of-        LocalV x       -> Ident x-        AppV e1 e2     -> App (fuseRange e1 e2) e1 e2-        OpAppV d ns es -> OpApp (fuseRange d es) d ns es-        HiddenArgV e   -> HiddenArg (getRange e) e-        InstanceArgV e -> InstanceArg (getRange e) e-        ParenV e       -> Paren (getRange e) e-        LamV bs e      -> Lam (fuseRange bs e) bs e-        WildV e        -> e-        OtherV e       -> e---instance IsExpr Pattern where-    exprView e = case e of-        IdentP x         -> LocalV x-        AppP e1 e2       -> AppV e1 e2-        OpAppP r d ns es -> OpAppV d ns ((map . fmap . fmap) Ordinary es)-        HiddenP _ e      -> HiddenArgV e-        InstanceP _ e    -> InstanceArgV e-        ParenP _ e       -> ParenV e-        WildP{}          -> WildV e-        _                -> OtherV e-    unExprView e = case e of-        LocalV x       -> IdentP x-        AppV e1 e2     -> AppP e1 e2-        OpAppV d ns es -> let ess :: [NamedArg Pattern]-                              ess = (map . fmap . fmap) (fromOrdinary __IMPOSSIBLE__) es-                          in OpAppP (fuseRange d es) d ns ess-        HiddenArgV e   -> HiddenP (getRange e) e-        InstanceArgV e -> InstanceP (getRange e) e-        ParenV e       -> ParenP (getRange e) e-        LamV _ _       -> __IMPOSSIBLE__-        WildV e        -> e-        OtherV e       -> e----------------------------------------------------------------------------- -- * Helpers for pattern and lhs parsing --------------------------------------------------------------------------- @@ -473,23 +422,6 @@     HiddenP _ _      -> __IMPOSSIBLE__     InstanceP _ _    -> __IMPOSSIBLE__     _                -> [p]---- | Collect all names in a pattern into a list of qualified names.-patternQNames :: Pattern -> [QName]-patternQNames p = case p of-  RawAppP _ ps     -> concatMap patternQNames ps-  IdentP q         -> [q]-  ParenP _ p       -> patternQNames p-  HiddenP _ p      -> patternQNames (namedThing p)-  InstanceP _ p    -> patternQNames (namedThing p)-  OpAppP r d _ ps  -> __IMPOSSIBLE__-  AppP{}           -> __IMPOSSIBLE__-  AsP r x p        -> patternQNames p-  AbsurdP{}        -> []-  WildP{}          -> []-  DotP{}           -> []-  LitP{}           -> []-  QuoteP{}         -> []  -- | Return all qualifiers occuring in a list of 'QName's. --   Each qualifier is returned as a list of names, e.g.
src/full/Agda/Syntax/Concrete/Operators/Parser.hs view
@@ -45,6 +45,51 @@ instance IsExpr e => HasRange (ExprView e) where   getRange = getRange . unExprView +instance IsExpr Expr where+    exprView e = case e of+        Ident x         -> LocalV x+        App _ e1 e2     -> AppV e1 e2+        OpApp r d ns es -> OpAppV d ns es+        HiddenArg _ e   -> HiddenArgV e+        InstanceArg _ e -> InstanceArgV e+        Paren _ e       -> ParenV e+        Lam _ bs    e   -> LamV bs e+        Underscore{}    -> WildV e+        _               -> OtherV e+    unExprView e = case e of+        LocalV x       -> Ident x+        AppV e1 e2     -> App (fuseRange e1 e2) e1 e2+        OpAppV d ns es -> OpApp (fuseRange d es) d ns es+        HiddenArgV e   -> HiddenArg (getRange e) e+        InstanceArgV e -> InstanceArg (getRange e) e+        ParenV e       -> Paren (getRange e) e+        LamV bs e      -> Lam (fuseRange bs e) bs e+        WildV e        -> e+        OtherV e       -> e++instance IsExpr Pattern where+    exprView e = case e of+        IdentP x         -> LocalV x+        AppP e1 e2       -> AppV e1 e2+        OpAppP r d ns es -> OpAppV d ns ((map . fmap . fmap) Ordinary es)+        HiddenP _ e      -> HiddenArgV e+        InstanceP _ e    -> InstanceArgV e+        ParenP _ e       -> ParenV e+        WildP{}          -> WildV e+        _                -> OtherV e+    unExprView e = case e of+        LocalV x       -> IdentP x+        AppV e1 e2     -> AppP e1 e2+        OpAppV d ns es -> let ess :: [NamedArg Pattern]+                              ess = (map . fmap . fmap) (fromOrdinary __IMPOSSIBLE__) es+                          in OpAppP (fuseRange d es) d ns ess+        HiddenArgV e   -> HiddenP (getRange e) e+        InstanceArgV e -> InstanceP (getRange e) e+        ParenV e       -> ParenP (getRange e) e+        LamV _ _       -> __IMPOSSIBLE__+        WildV e        -> e+        OtherV e       -> e+ --------------------------------------------------------------------------- -- * Parser combinators ---------------------------------------------------------------------------
src/full/Agda/Syntax/Fixity.hs view
@@ -18,7 +18,7 @@  import Agda.Syntax.Position import Agda.Syntax.Common-import {-# SOURCE #-} qualified Agda.Syntax.Abstract.Name as A+import qualified Agda.Syntax.Abstract.Name as A import Agda.Syntax.Concrete.Name import Agda.Syntax.Notation @@ -99,6 +99,9 @@ defaultFixity' :: Fixity' defaultFixity' = Fixity' defaultFixity defaultNotation +noFixity' :: Fixity'+noFixity' = Fixity' noFixity noNotation+ -- | Merges all 'NewNotation's that have the same notation. -- -- If all 'NewNotation's with a given notation have the same fixity,@@ -238,3 +241,12 @@  instance KillRange Fixity' where   killRange (Fixity' f n) = killRange2 Fixity' f n++instance KillRange x => KillRange (ThingWithFixity x) where+  killRange (ThingWithFixity c f) = ThingWithFixity (killRange c) f++------------------------------------------------------------------------+-- * Printing+------------------------------------------------------------------------++-- deriving instance Show Fixity'
src/full/Agda/Syntax/Fixity.hs-boot view
@@ -1,3 +1,10 @@ module Agda.Syntax.Fixity where +import Agda.Syntax.Position ( KillRange )+ data Fixity'++instance KillRange Fixity'+instance Show Fixity'++noFixity', defaultFixity' :: Fixity'
src/full/Agda/Syntax/Info.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE UndecidableInstances #-} @@ -11,6 +12,8 @@  module Agda.Syntax.Info where +import Prelude hiding (null)+ import Data.Typeable (Typeable)  import qualified Agda.Syntax.Concrete.Name as C@@ -20,6 +23,9 @@ import Agda.Syntax.Fixity import Agda.Syntax.Scope.Base (ScopeInfo, emptyScopeInfo) +import Agda.Utils.Function+import Agda.Utils.Null+ {--------------------------------------------------------------------------     Meta information  --------------------------------------------------------------------------}@@ -51,7 +57,7 @@  --------------------------------------------------------------------------}  newtype ExprInfo = ExprRange Range-  deriving (Typeable, Show)+  deriving (Typeable, Show, Null)  exprNoRange :: ExprInfo exprNoRange = ExprRange noRange@@ -95,7 +101,7 @@ ---------------------------------------------------------------------------  newtype LetInfo = LetRange Range-  deriving (Typeable, Show)+  deriving (Typeable, Show, Null)  instance HasRange LetInfo where   getRange (LetRange r)   = r@@ -172,7 +178,7 @@  --------------------------------------------------------------------------}  newtype LHSInfo = LHSRange Range-  deriving (Typeable, Show)+  deriving (Typeable, Show, Null)  instance HasRange LHSInfo where   getRange (LHSRange r) = r@@ -184,26 +190,10 @@     Pattern information  --------------------------------------------------------------------------} --- | For a general pattern we can either remember just the source code---   position or the entire concrete pattern it came from.-data PatInfo+-- | For a general pattern we remember the source code position.+newtype PatInfo   = PatRange Range-  | PatSource Range (Precedence -> Pattern)-      -- ^ Even if we store the original pattern we have to know-      --   whether to put parenthesis around it.-  deriving (Typeable)--instance Show PatInfo where-  show (PatRange r) = "PatRange " ++ show r-  show (PatSource r _) = "PatSource " ++ show r--instance HasRange PatInfo where-  getRange (PatRange r)    = r-  getRange (PatSource r _) = r--instance KillRange PatInfo where-  killRange (PatRange r)    = PatRange noRange-  killRange (PatSource r f) = PatSource noRange f+  deriving (Typeable, Eq, Null, Show, HasRange, KillRange)  -- | Empty range for patterns. patNoRange :: PatInfo@@ -211,13 +201,15 @@  -- | Constructor pattern info. data ConPatInfo = ConPatInfo-  { patImplicit :: Bool+  { patOrigin   :: ConPOrigin     -- ^ Does this pattern come form the eta-expansion of an implicit pattern?+    ---  Or from a user written constructor or record pattern?   , patInfo     :: PatInfo   }+  deriving (Typeable)  instance Show ConPatInfo where-  show (ConPatInfo b i) = (if b then ("implicit " ++) else id) $ show i+  show (ConPatInfo po i) = applyWhen (po == ConPImplicit) ("implicit " ++) $ show i  instance HasRange ConPatInfo where   getRange = getRange . patInfo
src/full/Agda/Syntax/Internal.hs view
@@ -1,14 +1,14 @@--- GHC 7.4.2 requires this layout for the pragmas. See Issue 1460.-{-# LANGUAGE CPP,-             DeriveDataTypeable,-             DeriveFoldable,-             DeriveFunctor,-             DeriveTraversable,-             FlexibleInstances,-             GeneralizedNewtypeDeriving,-             MultiParamTypeClasses,-             StandaloneDeriving,-             TemplateHaskell #-}+{-# LANGUAGE BangPatterns               #-}+{-# LANGUAGE CPP                        #-}+{-# LANGUAGE DeriveDataTypeable         #-}+{-# LANGUAGE DeriveFoldable             #-}+{-# LANGUAGE DeriveFunctor              #-}+{-# LANGUAGE DeriveTraversable          #-}+{-# LANGUAGE FlexibleInstances          #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE MultiParamTypeClasses      #-}+{-# LANGUAGE StandaloneDeriving         #-}+{-# LANGUAGE TemplateHaskell            #-}  module Agda.Syntax.Internal     ( module Agda.Syntax.Internal@@ -42,9 +42,16 @@ import Agda.Syntax.Common hiding (Arg, Dom, NamedArg, ArgInfo) import qualified Agda.Syntax.Common as Common import Agda.Syntax.Literal+import Agda.Syntax.Abstract (IsProjP(..)) import Agda.Syntax.Abstract.Name  import Agda.Utils.Empty++-- See Issue 1593.+#if !MIN_VERSION_transformers(0,4,1)+import Agda.Utils.Except ( Error(noMsg) )+#endif+ import Agda.Utils.Functor import Agda.Utils.Geniplate import Agda.Utils.Lens@@ -274,7 +281,7 @@ --   for another reason. data NotBlocked   = StuckOn Elim-    -- ^ The 'Elim' is neutral and block a pattern match.+    -- ^ The 'Elim' is neutral and blocks a pattern match.   | Underapplied     -- ^ Not enough arguments were supplied to complete the matching.   | AbsurdMatch@@ -329,19 +336,16 @@  instance Monoid Blocked_ where   mempty = notBlocked ()-  -- ReallyNotBlocked is neutral-  NotBlocked ReallyNotBlocked _ `mappend` b = b-  b `mappend` NotBlocked ReallyNotBlocked _ = b-  -- StuckOn is strongest-  b@(NotBlocked StuckOn{} _) `mappend` _ = b-  _ `mappend` b@(NotBlocked StuckOn{} _) = b-  -- Blocked is weakest-  b@Blocked{} `mappend` Blocked{} = b-  Blocked{} `mappend` b = b-  b `mappend` Blocked{} = b-  -- For the other cases, we take the left-  b `mappend` _ = b+  b@Blocked{}    `mappend` _              = b+  _              `mappend` b@Blocked{}    = b+  NotBlocked x _ `mappend` NotBlocked y _ = NotBlocked (x `mappend` y) () +-- See Issue 1573.+#if !MIN_VERSION_transformers(0,4,1)+instance Error Blocked_ where+  noMsg = __IMPOSSIBLE__+#endif+ -- | When trying to reduce @f es@, on match failed on one --   elimination @e ∈ es@ that came with info @r :: NotBlocked@. --   @stuckOn e r@ produces the new @NotBlocked@ info.@@ -414,25 +418,6 @@ clausePats :: Clause -> [Arg Pattern] clausePats = map (fmap namedThing) . namedClausePats --- MOVED to Agda. Syntax.Internal.Patterns--- -- | Translate the clause patterns to terms with free variables bound by the--- --   clause telescope.--- clauseArgs :: Clause -> Args--- clauseArgs cl = evalState (argsToTerms $ namedClausePats cl) xs---   where---     perm = clausePerm cl---     xs   = permute (invertP __IMPOSSIBLE__ perm) $ downFrom (size perm)------     next = do x : xs <- get; put xs; return x------     argsToTerms = traverse $ traverse $ patToTerm . namedThing---     patToTerm p = case p of---       VarP _      -> flip Var [] <$> next---       DotP v      -> v <$ next   -- dot patterns count as variables---       ConP c _ ps -> Con c <$> argsToTerms ps---       LitP l      -> pure $ Lit l---       ProjP{}     -> __IMPOSSIBLE__   -- TODO- data ClauseBodyF a = Body a                    | Bind (Abs (ClauseBodyF a))                    | NoBody    -- ^ for absurd clauses.@@ -440,6 +425,13 @@  type ClauseBody = ClauseBodyF Term +imapClauseBody :: (Nat -> a -> b) -> ClauseBodyF a -> ClauseBodyF b+imapClauseBody f b = go 0 b+  where+    go i  (Body x)  = Body (f i x)+    go _   NoBody   = NoBody+    go !i (Bind b)  = Bind $ go (i + 1) <$> b+ instance HasRange Clause where   getRange = clauseRange @@ -490,10 +482,9 @@ --   The scope used for the type is given by any outer scope --   plus the clause's telescope ('clauseTel'). data ConPatternInfo = ConPatternInfo-  { conPRecord :: Maybe Bool+  { conPRecord :: Maybe ConPOrigin     -- ^ @Nothing@ if data constructor.-    --   @Just@ if record constructor, then @True@ if pattern-    --   was expanded from an implicit pattern.+    --   @Just@ if record constructor.   , conPType   :: Maybe (Arg Type)     -- ^ The type of the whole constructor pattern.     --   Should be present (@Just@) if constructor pattern is@@ -525,6 +516,10 @@   List.any (properlyMatching . namedArg) ps  -- or one of subpatterns is a proper m properlyMatching ProjP{} = True +instance IsProjP Pattern where+  isProjP (ProjP d) = Just d+  isProjP _         = Nothing+ ----------------------------------------------------------------------------- -- * Explicit substitutions -----------------------------------------------------------------------------@@ -688,14 +683,11 @@ topSort :: Type topSort = El Inf (Sort Inf) -prop :: Type-prop = sort Prop- sort :: Sort -> Type sort s = El (sSuc s) $ Sort s  varSort :: Int -> Sort-varSort n = Type $ Max [Plus 0 $ NeutralLevel mempty $ Var n []]+varSort n = Type $ Max [Plus 0 $ NeutralLevel mempty $ var n]  -- | Get the next higher sort. sSuc :: Sort -> Sort@@ -730,6 +722,9 @@ instance SgTel (Dom (ArgName, Type)) where   sgTel (Common.Dom ai (x, t)) = ExtendTel (Common.Dom ai t) $ Abs x EmptyTel +instance SgTel (Dom Type) where+  sgTel dom = sgTel (stringToArgName "_", dom)+ hackReifyToMeta :: Term hackReifyToMeta = DontCare $ Lit $ LitInt noRange (-42) @@ -767,12 +762,9 @@   Pi  _ b -> 1 + arity (unAbs b)   _       -> 0 --- | Suggest a name for the first argument of a function of the given type.-argName :: Type -> String-argName = argN . ignoreSharing . unEl-    where-        argN (Pi _ b)  = "." ++ argNameToString (absName b)-        argN _    = __IMPOSSIBLE__+-- | Make a name that is not in scope.+notInScopeName :: ArgName -> ArgName+notInScopeName = stringToArgName . ("." ++) . argNameToString  -- | Pick the better name suggestion, i.e., the one that is not just underscore. class Suggest a b where@@ -1015,14 +1007,14 @@     Def c vs    -> killRange2 Def c vs     Con c vs    -> killRange2 Con c vs     MetaV m vs  -> killRange1 (MetaV m) vs-    Lam i f     -> killRange1 Lam i f+    Lam i f     -> killRange2 Lam i f     Lit l       -> killRange1 Lit l     Level l     -> killRange1 Level l     Pi a b      -> killRange2 Pi a b     Sort s      -> killRange1 Sort s     DontCare mv -> killRange1 DontCare mv     Shared p    -> Shared $ updatePtr killRange p-    ExtLam{}    -> __IMPOSSIBLE__+    ExtLam c vs -> killRange2 ExtLam c vs  instance KillRange Level where   killRange (Max as) = killRange1 Max as@@ -1037,7 +1029,7 @@   killRange (NeutralLevel r v) = killRange1 (NeutralLevel r) v   killRange (UnreducedLevel v) = killRange1 UnreducedLevel v -instance KillRange Type where+instance (KillRange a) => KillRange (Type' a) where   killRange (El s v) = killRange2 El s v  instance KillRange Sort where@@ -1067,9 +1059,6 @@       ConP con info ps -> killRange3 ConP con info ps       LitP l           -> killRange1 LitP l       ProjP q          -> killRange1 ProjP q--instance KillRange Permutation where-  killRange = id  instance KillRange Clause where   killRange (Clause r tel perm ps body t) = killRange6 Clause r tel perm ps body t
src/full/Agda/Syntax/Internal/Generic.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE CPP #-}+{-# LANGUAGE CPP               #-} {-# LANGUAGE FlexibleInstances #-}  module Agda.Syntax.Internal.Generic where
src/full/Agda/Syntax/Internal/Pattern.hs view
@@ -1,10 +1,10 @@-{-# LANGUAGE CPP #-}-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE CPP                    #-}+{-# LANGUAGE FlexibleContexts       #-}+{-# LANGUAGE FlexibleInstances      #-} {-# LANGUAGE FunctionalDependencies #-}-{-# LANGUAGE MultiParamTypeClasses #-}-{-# LANGUAGE TupleSections #-}-{-# LANGUAGE UndecidableInstances #-}  -- because of func. deps.+{-# LANGUAGE MultiParamTypeClasses  #-}+{-# LANGUAGE TupleSections          #-}+{-# LANGUAGE UndecidableInstances   #-}  -- because of func. deps.  #if __GLASGOW_HASKELL__ <= 708 {-# LANGUAGE OverlappingInstances #-}@@ -103,13 +103,23 @@ -- | Augment pattern variables with their de Bruijn index. {-# SPECIALIZE numberPatVars :: Permutation -> [NamedArg (Pattern' x)] -> [NamedArg (Pattern' (Int, x))] #-} {-# SPECIALIZE numberPatVars :: Permutation -> [NamedArg Pattern] -> [NamedArg DeBruijnPattern] #-}+--+--  Example:+--  @+--    f : (A : Set) (n : Nat) (v : Vec A n) -> ...+--    f A .(suc n) (cons n x xs)+--+--    clauseTel = (A : Set) (n : Nat) (x : A) (xs : Vec A n)+--    perm      = Perm 5 [0,2,3,4]+--    invertP __IMPOSSIBLE__ perm = Perm 4 [0,__IMPOSSIBLE__,1,2,3]+--    flipP ... = Perm 4 [3,__IMPOSSIBLE__,2,1,0]+--    pats      = A .(suc 2) (cons n x xs)+--    dBpats    = 3 .(suc 2) (cons 2 1 0 )+--  @+-- numberPatVars :: LabelPatVars a b Int => Permutation -> a -> b numberPatVars perm ps = evalState (labelPatVars ps) $-  permute (invertP __IMPOSSIBLE__ perm) $ downFrom $ size perm--instance IsProjP Pattern where-  isProjP (ProjP d) = Just d-  isProjP _         = Nothing+  permPicks $ flipP $ invertP __IMPOSSIBLE__ perm  patternsToElims :: Permutation -> [I.NamedArg Pattern] -> [Elim] patternsToElims perm ps = map build' $ numberPatVars perm ps
src/full/Agda/Syntax/Literal.hs view
@@ -87,4 +87,4 @@   killRange (LitFloat  r x) = LitFloat  (killRange r) x   killRange (LitString r x) = LitString (killRange r) x   killRange (LitChar   r x) = LitChar   (killRange r) x-  killRange (LitQName  r x) = LitQName  (killRange r) x+  killRange (LitQName  r x) = killRange2 LitQName r x
src/full/Agda/Syntax/Notation.hs view
@@ -1,7 +1,6 @@--- GHC 7.4.2 requires this layout for the pragmas. See Issue 1460.-{-# LANGUAGE CPP,-             DeriveDataTypeable,-             ScopedTypeVariables #-}+{-# LANGUAGE CPP                 #-}+{-# LANGUAGE DeriveDataTypeable  #-}+{-# LANGUAGE ScopedTypeVariables #-}  {-| As a concrete name, a notation is a non-empty list of alternating 'IdPart's and holes.     In contrast to concrete names, holes can be binders.
src/full/Agda/Syntax/Parser.hs view
@@ -9,6 +9,7 @@     , parseFile'       -- * Parsers     , moduleParser+    , moduleNameParser     , exprParser     , tokensParser       -- * Parse errors@@ -85,6 +86,12 @@ moduleParser :: Parser Module moduleParser = Parser { parser = P.moduleParser                       , parseFlags = withoutComments }++-- | Parses a module name.++moduleNameParser :: Parser QName+moduleNameParser = Parser { parser = P.moduleNameParser+                          , parseFlags = withoutComments }  -- | Parses an expression. 
src/full/Agda/Syntax/Parser/Parser.y view
@@ -16,6 +16,7 @@  -} module Agda.Syntax.Parser.Parser (       moduleParser+    , moduleNameParser     , exprParser     , tokensParser     , tests@@ -29,6 +30,8 @@ import Data.Maybe import qualified Data.Traversable as T +import Debug.Trace+ import Agda.Syntax.Position hiding (tests) import Agda.Syntax.Parser.Monad import Agda.Syntax.Parser.Lexer@@ -44,6 +47,7 @@ import Agda.Utils.Hash import Agda.Utils.List (spanJust) import Agda.Utils.Monad+import Agda.Utils.Pretty import Agda.Utils.QuickCheck import Agda.Utils.Singleton import Agda.Utils.TestHelpers@@ -54,6 +58,7 @@ %name tokensParser Tokens %name exprParser Expr %name moduleParser File+%name moduleNameParser ModuleName %tokentype { Token } %monad { Parser } %lexer { lexer } { TokEOF }@@ -553,7 +558,6 @@ Expr :: { Expr } Expr   : TeleArrow Expr                      { Pi $1 $2 }-  | 'forall' ForallBindings Expr        { forallPi $2 $3 }   | Application3 '->' Expr              { Fun (getRange ($1,$2,$3))                                               (RawApp (getRange $1) $1)                                               $3 }@@ -582,6 +586,7 @@ Expr2     : '\\' LamBindings Expr        { Lam (getRange ($1,$2,$3)) $2 $3 }     | ExtendedOrAbsurdLam          { $1 }+    | 'forall' ForallBindings Expr        { forallPi $2 $3 }     | 'let' Declarations 'in' Expr { Let (getRange ($1,$2,$3,$4)) $2 $4 }     | Expr3                        { $1 }     | 'quoteGoal' Id 'in' Expr     { QuoteGoal (getRange ($1,$2,$3,$4)) $2 $4 }@@ -1702,23 +1707,34 @@  {- RHS or type signature -} -data RHSOrTypeSigs = JustRHS RHS-                   | TypeSigsRHS Expr+data RHSOrTypeSigs+ = JustRHS RHS+ | TypeSigsRHS Expr+ deriving Show -namesOfPattern :: Pattern -> Maybe [(C.ArgInfo, Name)]-namesOfPattern (IdentP (QName i))         = Just [(defaultArgInfo, i)]-namesOfPattern (WildP r)                  = Just [(defaultArgInfo, C.noName r)]-namesOfPattern (DotP _ (Ident (QName i))) = Just [(setRelevance Irrelevant defaultArgInfo, i)]-namesOfPattern (RawAppP _ ps)             = fmap concat $ mapM namesOfPattern ps-namesOfPattern _                          = Nothing+patternToNames :: Pattern -> Parser [(C.ArgInfo, Name)]+patternToNames p =+  case p of+    IdentP (QName i)         -> return [(defaultArgInfo, i)]+    WildP r                  -> return [(defaultArgInfo, C.noName r)]+    DotP _ (Ident (QName i)) -> return [(setRelevance Irrelevant defaultArgInfo, i)]+    RawAppP _ ps             -> concat <$> mapM patternToNames ps+    _                        -> parseError $+      "Illegal name in type signature: " ++ prettyShow p  funClauseOrTypeSigs :: LHS -> RHSOrTypeSigs -> WhereClause -> Parser [Declaration]-funClauseOrTypeSigs lhs (JustRHS   rhs) wh = return [FunClause lhs rhs wh]-funClauseOrTypeSigs lhs (TypeSigsRHS e) wh-  | NoWhere <- wh,-    LHS p [] [] [] <- lhs,-    Just names <- namesOfPattern p = return $ map (\(x,y) -> TypeSig x y e) names-  | otherwise                      = parseError "Illegal function clause or type signature"+funClauseOrTypeSigs lhs mrhs wh = do+  -- traceShowM lhs+  case mrhs of+    JustRHS rhs   -> return [FunClause lhs rhs wh]+    TypeSigsRHS e -> case wh of+      NoWhere -> case lhs of+        Ellipsis{}      -> parseError "The ellipsis ... cannot have a type signature"+        LHS _ _ _ (_:_) -> parseError "Illegal: with in type signature"+        LHS _ _ (_:_) _ -> parseError "Illegal: rewrite in type signature"+        LHS _ (_:_) _ _ -> parseError "Illegal: with patterns in type signature"+        LHS p [] [] []  -> map (\ (x, y) -> TypeSig x y e) <$> patternToNames p+      _ -> parseError "A type signature cannot have a where clause"  {--------------------------------------------------------------------------     Tests
src/full/Agda/Syntax/Position.hs view
@@ -1,15 +1,18 @@--- GHC 7.4.2 requires this layout for the pragmas. See Issue 1460.-{-# LANGUAGE CPP,-             DeriveDataTypeable,-             DeriveFoldable,-             DeriveFunctor,-             DeriveTraversable,-             FlexibleInstances,-             GeneralizedNewtypeDeriving,-             NoMonomorphismRestriction,-             ScopedTypeVariables,-             TemplateHaskell #-}+{-# LANGUAGE CPP                        #-}+{-# LANGUAGE DeriveDataTypeable         #-}+{-# LANGUAGE DeriveFoldable             #-}+{-# LANGUAGE DeriveFunctor              #-}+{-# LANGUAGE DeriveTraversable          #-}+{-# LANGUAGE FlexibleInstances          #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE NoMonomorphismRestriction  #-}+{-# LANGUAGE ScopedTypeVariables        #-}+{-# LANGUAGE TemplateHaskell            #-} +#if __GLASGOW_HASKELL__ <= 708+{-# LANGUAGE OverlappingInstances #-}+#endif+ {-| Position information for syntax. Crucial for giving good error messages. -} @@ -47,6 +50,7 @@   , SetRange(..)   , KillRange(..)   , KillRangeT+  , killRangeMap   , killRange1, killRange2, killRange3, killRange4, killRange5, killRange6, killRange7   , killRange8, killRange9, killRange10, killRange11, killRange12, killRange13, killRange14   , killRange15, killRange16, killRange17, killRange18, killRange19@@ -79,6 +83,7 @@ import Test.QuickCheck.All  import Agda.Utils.FileName hiding (tests)+import Agda.Utils.List hiding (tests) import Agda.Utils.Maybe import Agda.Utils.Null import Agda.Utils.Pretty@@ -226,6 +231,10 @@  type KillRangeT a = a -> a +-- | Remove ranges in keys and values of a map.+killRangeMap :: (KillRange k, KillRange v) => KillRangeT (Map k v)+killRangeMap = Map.mapKeysMonotonic killRange . Map.map killRange+ killRange1 :: KillRange a => (a -> b) -> a -> b  killRange2 :: (KillRange a, KillRange b) => (a -> b -> c) -> a -> b -> c@@ -371,7 +380,15 @@ #endif   killRange = map killRange +-- | Overlaps with @KillRange [a]@. #if __GLASGOW_HASKELL__ >= 710+instance {-# OVERLAPPING #-} KillRange String where+#else+instance KillRange String where+#endif+  killRange = id++#if __GLASGOW_HASKELL__ >= 710 instance {-# OVERLAPPABLE #-} KillRange a => KillRange (Map k a) where #else instance KillRange a => KillRange (Map k a) where@@ -664,6 +681,22 @@   rangeInvariant cr &&   rPositions cr == makeInterval (rPositions r)   where cr = continuous r++prop_continuousPerLine :: Range -> Bool+prop_continuousPerLine r =+  rangeInvariant r'+    &&+  distinct lineNumbers+  where+  r'@(Range is') = continuousPerLine r++  lineNumbers = concatMap lines is'+    where+    lines i | s == e    = [s]+            | otherwise = [s, e]+      where+      s = posLine (iStart i)+      e = posLine (iEnd   i)  prop_fuseIntervals :: Interval' Integer -> Property prop_fuseIntervals i1 =
src/full/Agda/Syntax/Scope/Base.hs view
@@ -22,6 +22,8 @@  -- import Debug.Trace (trace) +import Agda.Benchmarking+ import Agda.Syntax.Position import Agda.Syntax.Common import Agda.Syntax.Fixity@@ -521,7 +523,7 @@ -- | Remove private name space of a scope. -- --   Should be a right identity for 'exportedNamesInScope'.---   @exportedNamesInScope . restrictPrivate == exportedNamesInscope@.+--   @exportedNamesInScope . restrictPrivate == exportedNamesInScope@. restrictPrivate :: Scope -> Scope restrictPrivate s   = setNameSpace PrivateNS  emptyNameSpace@@ -555,11 +557,10 @@  everythingInScope :: ScopeInfo -> NameSpace everythingInScope scope = allThingsInScope $ mergeScopes $-    [ s | (m, s) <- Map.toList (scopeModules scope), m `elem` current ]+    (s0 :) $ map look $ scopeParents s0   where-    this    = scopeCurrent scope-    parents = maybe __IMPOSSIBLE__ scopeParents $ Map.lookup this $ scopeModules scope-    current = this : parents+    look m = fromMaybe __IMPOSSIBLE__ $ Map.lookup m $ scopeModules scope+    s0     = look $ scopeCurrent scope  -- | Compute a flattened scope. Only include unqualified names or names -- qualified by modules in the first argument.@@ -575,8 +576,8 @@     imported = Map.unionsWith (++)                [ qual c (build ms' exportedNamesInScope $ moduleScope a)                | (c, a) <- Map.toList $ scopeImports root-               , let m   = C.qnameParts c-                     ms' = map (drop (length m)) $ filter (m `isPrefixOf`) ms+               , let -- get the suffixes of c in ms+                     ms' = mapMaybe (maybePrefixMatch $ C.qnameParts c) ms                , not $ null ms' ]     qual c = Map.mapKeys (q c)       where@@ -584,11 +585,10 @@         q (C.Qual m x) = C.Qual m . q x      build :: [[C.Name]] -> (forall a. InScope a => Scope -> ThingsInScope a) -> Scope -> Map C.QName [AbstractName]-    build ms getNames s =-      Map.unionWith (++)-        (Map.mapKeys (\x -> C.QName x) (getNames s))-        $ Map.unionsWith (++) $-          [ Map.mapKeys (\y -> C.Qual x y) $ build ms' exportedNamesInScope $ moduleScope m+    build ms getNames s = Map.unionsWith (++) $+        (Map.mapKeysMonotonic C.QName $ getNames s) :+          [ Map.mapKeysMonotonic (\ y -> C.Qual x y) $+              build ms' exportedNamesInScope $ moduleScope m           | (x, mods) <- Map.toList (getNames s)           , let ms' = [ tl | hd:tl <- ms, hd == x ]           , not $ null ms'@@ -602,7 +602,7 @@ scopeLookup q scope = map fst $ scopeLookup' q scope  scopeLookup' :: forall a. InScope a => C.QName -> ScopeInfo -> [(a, Access)]-scopeLookup' q scope = nubBy ((==) `on` fst) $ findName q root ++ topImports ++ imports+scopeLookup' q scope = nubBy ((==) `on` fst) $ findName q root ++ maybeToList topImports ++ imports   where      -- 1. Finding a name in the current scope and its parents.@@ -638,11 +638,11 @@         -- trace ("mods ++ defs = " ++ show (mods ++ defs)) $ do         m <- nub $ mods ++ defs -- record types will appear both as a mod and a def         -- Get the scope of module m, if any, and remove its private definitions.-        let ss  = maybeToList $ Map.lookup m $ scopeModules scope+        let ss  = Map.lookup m $ scopeModules scope             ss' = restrictPrivate <$> ss         -- trace ("ss  = " ++ show ss ) $ do         -- trace ("ss' = " ++ show ss') $ do-        s' <- ss'+        s' <- maybeToList ss'         findName q s'       where         lookupName :: forall a. InScope a => C.Name -> Scope -> [(a, Access)]@@ -650,21 +650,21 @@      -- 2. Finding a name in the top imports. -    topImports :: [(a, Access)]+    topImports :: Maybe (a, Access)     topImports = case (inScopeTag :: InScopeTag a) of-      NameTag   -> []-      ModuleTag -> map (first (`AbsModule` Defined)) (imported q)+      NameTag   -> Nothing+      ModuleTag -> first (`AbsModule` Defined) <$> imported q -    imported :: C.QName -> [(A.ModuleName, Access)]-    imported q = map (,PublicAccess) $ maybeToList $ Map.lookup q $ scopeImports root+    imported :: C.QName -> Maybe (A.ModuleName, Access)+    imported q = fmap (,PublicAccess) $ Map.lookup q $ scopeImports root      -- 3. Finding a name in the imports belonging to an initial part of the qualifier.      imports :: [(a, Access)]     imports = do       (m, x) <- splitName q-      m <- fst <$> imported m-      findName x (restrictPrivate $ moduleScope m)+      m <- maybeToList $ fst <$> imported m+      findName x $ restrictPrivate $ moduleScope m      -- return all possible splittings, e.g.     -- splitName X.Y.Z = [(X, Y.Z), (X.Y, Z)]@@ -679,15 +679,19 @@ data AllowAmbiguousConstructors = AllowAmbiguousConstructors | NoAmbiguousConstructors   deriving (Eq) --- | Find the shortest concrete name that maps (uniquely) to a given abstract---   name.-inverseScopeLookup :: Either A.ModuleName A.QName -> ScopeInfo -> Maybe C.QName+-- | Find the concrete names that map (uniquely) to a given abstract name.+--   Sort by length, shortest first.++inverseScopeLookup :: Either A.ModuleName A.QName -> ScopeInfo -> [C.QName] inverseScopeLookup = inverseScopeLookup' AllowAmbiguousConstructors -inverseScopeLookup' :: AllowAmbiguousConstructors -> Either A.ModuleName A.QName -> ScopeInfo -> Maybe C.QName-inverseScopeLookup' ambCon name scope = case name of-  Left  m -> best $ filter unambiguousModule $ findModule m-  Right q -> best $ filter unambiguousName   $ findName nameMap q+inverseScopeLookup' :: AllowAmbiguousConstructors -> Either A.ModuleName A.QName -> ScopeInfo -> [C.QName]+inverseScopeLookup' ambCon name scope = billToPure [ Scoping , InverseScopeLookup ] $+  -- trace ("importMap = " ++ show importMap) $+  -- trace ("moduleMap = " ++ show moduleMap) $+  case name of+    Left  m -> best $ filter unambiguousModule $ findModule m+    Right q -> best $ filter unambiguousName   $ findName nameMap q   where     this = scopeCurrent scope     current = this : scopeParents (moduleScope this)@@ -703,9 +707,16 @@     len (C.QName _)  = 1     len (C.Qual _ x) = 1 + len x -    best :: [C.QName] -> Maybe C.QName-    best xs = headMaybe $ sortBy (compare `on` len) xs+    best :: [C.QName] -> [C.QName]+    best = sortBy (compare `on` len) . filter (not . internalName) +    internalName :: C.QName -> Bool+    internalName C.QName{} = False+    internalName (C.Qual m n) = intern m || internalName n+      where+      -- Recognize fresh names created Parser.y+      intern (C.Name _ [ C.Id ('.' : '#' : _) ]) = True+      intern _ = False     unique :: forall a . [a] -> Bool     unique []      = __IMPOSSIBLE__     unique [_]     = True@@ -728,32 +739,34 @@     findModule q = findName moduleMap q ++                    fromMaybe [] (Map.lookup q importMap) -    importMap = Map.unionsWith (++) $ do+    importMap = Map.fromListWith (++) $ do       (m, s) <- scopes       (x, y) <- Map.toList $ scopeImports s-      return $ Map.singleton y [x]+      return (y, [x]) -    moduleMap = Map.unionsWith (++) $ do+    moduleMap = Map.fromListWith (++) $ do       (m, s)  <- scopes       (x, ms) <- Map.toList (allNamesInScope s)       q       <- amodName <$> ms-      return $ Map.singleton q [(m, x)]+      return (q, [(m, x)]) -    nameMap = Map.unionsWith (++) $ do+    nameMap = Map.fromListWith (++) $ do       (m, s)  <- scopes       (x, ms) <- Map.toList (allNamesInScope s)       q       <- anameName <$> ms-      return $ Map.singleton q [(m, x)]+      return (q, [(m, x)]) --- | Takes the first component of 'inverseScopeLookup'.-inverseScopeLookupName :: A.QName -> ScopeInfo -> Maybe C.QName+-- | Find the concrete names that map (uniquely) to a given abstract qualified name.+--   Sort by length, shortest first.+inverseScopeLookupName :: A.QName -> ScopeInfo -> [C.QName] inverseScopeLookupName x = inverseScopeLookup (Right x) -inverseScopeLookupName' :: AllowAmbiguousConstructors -> A.QName -> ScopeInfo -> Maybe C.QName+inverseScopeLookupName' :: AllowAmbiguousConstructors -> A.QName -> ScopeInfo -> [C.QName] inverseScopeLookupName' ambCon x = inverseScopeLookup' ambCon (Right x) --- | Takes the second component of 'inverseScopeLookup'.-inverseScopeLookupModule :: A.ModuleName -> ScopeInfo -> Maybe C.QName+-- | Find the concrete names that map (uniquely) to a given abstract module name.+--   Sort by length, shortest first.+inverseScopeLookupModule :: A.ModuleName -> ScopeInfo -> [C.QName] inverseScopeLookupModule x = inverseScopeLookup (Left x)  ------------------------------------------------------------------------@@ -785,7 +798,7 @@ instance Show Scope where   show (scope@Scope{ scopeName = name, scopeParents = parents, scopeImports = imps }) =     unlines $-      [ "* scope " ++ show name ] ++ ind (+      [ "scope " ++ show name ] ++ ind (         concat [ blockOfLines (show nsid) (lines $ show $ scopeNameSpace nsid scope)                | nsid <- [minBound..maxBound] ]       ++ blockOfLines "imports"  (case Map.keys imps of
src/full/Agda/Syntax/Scope/Monad.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE CPP #-}+{-# LANGUAGE NondecreasingIndentation #-}  #if __GLASGOW_HASKELL__ >= 710 {-# LANGUAGE FlexibleContexts #-}@@ -42,6 +43,7 @@ import Agda.Utils.Maybe import Agda.Utils.Null (unlessNull) import Agda.Utils.Size+import Agda.Utils.Pretty import Agda.Utils.Tuple  #include "undefined.h"@@ -99,11 +101,14 @@ -- | Create a new module with an empty scope (Bool is True if it is a datatype module) createModule :: Bool -> A.ModuleName -> ScopeM () createModule b m = do+  reportSLn "scope.createModule" 10 $ "createModule " ++ prettyShow m   s <- getCurrentScope   let parents = scopeName s : scopeParents s-  modifyScopes $ Map.insert m emptyScope { scopeName           = m-                                         , scopeParents        = parents-                                         , scopeDatatypeModule = b }+      sm = emptyScope { scopeName           = m+                      , scopeParents        = parents+                      , scopeDatatypeModule = b }+  -- Andreas, 2015-07-02: internall error if module is not new.+  modifyScopes $ Map.insertWith __IMPOSSIBLE__ m sm  -- | Apply a function to the scope info. modifyScopeInfo :: (ScopeInfo -> ScopeInfo) -> ScopeM ()@@ -235,24 +240,32 @@       shadowed ys =         typeError $ AmbiguousName x $ A.qualify_ y : map anameName ys     -- Case: we do not have a local variable x.-    Nothing -> case filter (\y -> anameKind (fst y) `elem` kinds-                                    &&-                                  maybe True (Set.member (aName (fst y)))-                                        names)-                           (scopeLookup' x scope) of-      [] -> return UnknownName-      ds | all ((==ConName) . anameKind . fst) ds ->-        return $ ConstructorName-               $ map (\ (d, _) -> updateConcreteName d $ unqualify x) ds-      [(d, a)] | anameKind d == FldName -> return $ FieldName $ updateConcreteName d (unqualify x)-      [(d, a)] | anameKind d == PatternSynName ->-                  return $ PatternSynResName (updateConcreteName d $ unqualify x)-      [(d, a)] -> return $ DefinedName a $ updateConcreteName d (unqualify x)-      ds  -> typeError $ AmbiguousName x (map (anameName . fst) ds)+    Nothing -> do+      -- Consider only names of one of the given kinds+      let filtKind = filter $ \ y -> anameKind (fst y) `elem` kinds+      -- Consider only names in the given set of names+          filtName = filter $ \ y -> maybe True (Set.member (aName (fst y))) names+      case filtKind $ filtName $ scopeLookup' x scope of+        [] -> return UnknownName++        ds       | all ((==ConName) . anameKind . fst) ds ->+          return $ ConstructorName $ map (upd . fst) ds++        [(d, a)] | anameKind d == FldName ->+          return $ FieldName $ upd d++        [(d, a)] | anameKind d == PatternSynName ->+          return $ PatternSynResName $ upd d++        [(d, a)] ->+          return $ DefinedName a $ upd d++        ds -> typeError $ AmbiguousName x (map (anameName . fst) ds)   where+  upd d = updateConcreteName d $ unqualify x   updateConcreteName :: AbstractName -> C.Name -> AbstractName-  updateConcreteName d@(AbsName { anameName = an@(A.QName { qnameName = qn }) }) x =-    d { anameName = an { qnameName = qn { nameConcrete = x } } }+  updateConcreteName d@(AbsName { anameName = A.QName qm qn }) x =+    d { anameName = A.QName (setRange (getRange x) qm) (qn { nameConcrete = x }) }  -- | Look up a module in the scope. resolveModule :: C.QName -> ScopeM AbstractModule@@ -360,6 +373,7 @@                   , scopeParents = scopeParents s0                   }       where+        rnew = getRange new         new' = killRange new         newL = A.mnameToList new'         old  = scopeName s@@ -394,19 +408,40 @@             i <- lift fresh             return $ A.qualify new' $ (qnameName x) { nameId = i }           lift $ reportSLn "scope.copy" 50 $ "  Copying " ++ show x ++ " to " ++ show y+          -- Andreas, 2015-08-11 Issue 1619:+          -- Names copied by a module macro should get the module macro's+          -- range as declaration range+          -- (maybe rather the one of the open statement).+          -- For now, we just set their range+          -- to the new module name's one, which fixes issue 1619.+          y <- return $ setRange rnew y           addName x y           return y          -- Change a binding M.x -> old.M'.y to M.x -> new.M'.y         renMod :: A.ModuleName -> WSM A.ModuleName         renMod x = do+          -- Andreas, issue 1607:+          -- If we have already copied this module, return the copy.+          ifJustM (findMod x) return $ {- else -} do+           -- Check whether we have seen it already, yet as  name.           -- If yes, use its copy as @y@.           y <- ifJustM (findName $ mnameToQName x) (return . qnameToMName) $ {- else -} do-             return $ A.mnameFromList $ (newL ++) $ drop (size old) $ A.mnameToList x+             -- Andreas, Jesper, 2015-07-02: Issue 1597+             -- Don't blindly drop a prefix of length of the old qualifier.+             -- If things are imported by open public they do not have the old qualifier+             -- as prefix.  Those need just to be linked, not copied.+             -- return $ A.mnameFromList $ (newL ++) $ drop (size old) $ A.mnameToList x+             caseMaybe (maybePrefixMatch (A.mnameToList old) (A.mnameToList x)) (return x) $ \ suffix -> do+               return $ A.mnameFromList $ newL ++ suffix+          -- Andreas, Jesper, 2015-07-02: Issue 1597+          -- Don't copy a module over itself, it will just be emptied of its contents.+          if (x == y) then return x else do           addMod x y           -- We need to copy the contents of included modules recursively-          s0 <- lift $ createModule False y >> getNamedScope x+          lift $ createModule False y+          s0 <- lift $ getNamedScope x           s  <- withCurrentModule' y $ copy y s0           lift $ modifyNamedScope y (const s)           return y@@ -446,7 +481,9 @@ openModule_ cm dir = do   current <- getCurrentModule   m <- amodName <$> resolveModule cm-  let acc = namespace current m+  let acc | not (publicOpen dir)      = PrivateNS+          | m `isSubModuleOf` current = PublicNS+          | otherwise                 = ImportedNS   -- Get the scope exported by module to be opened.   s <- setScopeAccess acc <$>         (applyImportDirectiveM cm dir . inScopeBecause (Opened cm) . removeOnlyQualified . restrictPrivate =<< getNamedScope m)@@ -464,11 +501,6 @@       Nothing -> x       Just ys -> shadowLocal ys x   where-    namespace m0 m1-      | not (publicOpen dir)  = PrivateNS-      | m1 `isSubModuleOf` m0 = PublicNS-      | otherwise             = ImportedNS-     -- Only checks for clashes that would lead to the same     -- name being exported twice from the module.     checkForClashes new = when (publicOpen dir) $ do
src/full/Agda/Syntax/Translation/AbstractToConcrete.hs view
@@ -130,8 +130,7 @@ --   cases we just throw away the qualified part. It's just for pretty printing --   anyway... unsafeQNameToName :: C.QName -> C.Name-unsafeQNameToName (C.QName x) = x-unsafeQNameToName (C.Qual _ x) = unsafeQNameToName x+unsafeQNameToName = C.unqualify  lookupName :: A.Name -> AbsToCon C.Name lookupName x = do@@ -142,10 +141,12 @@  lookupQName :: AllowAmbiguousConstructors -> A.QName -> AbsToCon C.QName lookupQName ambCon x = do-  my <- inverseScopeLookupName' ambCon x <$> asks currentScope-  case my of-    Just y  -> return y-    Nothing -> do+  ys <- inverseScopeLookupName' ambCon x <$> asks currentScope+  lift $ reportSLn "scope.inverse" 100 $+    "inverse looking up abstract name " ++ show x ++ " yields " ++ show ys+  case ys of+    (y : _) -> return y+    [] -> do       let y = qnameToConcrete x       if isUnderscore y         then return y@@ -156,8 +157,8 @@ lookupModule x =     do  scope <- asks currentScope         case inverseScopeLookupModule x scope of-            Just y  -> return y-            Nothing -> return $ mnameToConcrete x+            (y : _) -> return y+            []      -> return $ mnameToConcrete x                 -- this is what happens for names that are not in scope (private names)  bindName :: A.Name -> (C.Name -> AbsToCon a) -> AbsToCon a@@ -764,8 +765,8 @@     x  <- unsafeQNameToName <$> toConcrete x     modapp <- toConcrete modapp     let r = getRange modapp-        open = maybe DontOpen id $ minfoOpenShort i-        dir  = maybe defaultImportDir{ importDirRange = r } id $ minfoDirective i+        open = fromMaybe DontOpen $ minfoOpenShort i+        dir  = fromMaybe defaultImportDir{ importDirRange = r } $ minfoDirective i     return [ C.ModuleMacro (getRange i) x modapp open dir ]    toConcrete (A.Import i x) = do@@ -830,8 +831,8 @@ noImplicitPats = filter noImplicit  noImplicit :: A.Pattern -> Bool-noImplicit (A.ImplicitP _) = False-noImplicit _               = True+noImplicit (A.WildP _) = False+noImplicit _           = True  instance ToConcrete A.SpineLHS C.LHS where   bindToConcrete lhs = bindToConcrete (A.spineToLhs lhs :: A.LHS)@@ -878,8 +879,6 @@     toConcrete (A.DotP i e)  = do         e <- toConcreteCtx DotPatternCtx e         return $ C.DotP (getRange i) e-    -- just for debugging purposes (shouldn't show up in practise)-    toConcrete (A.ImplicitP i) = return $ C.IdentP (C.QName $ C.Name noRange [C.Id $ stringToRawName "(implicit)"])     toConcrete (A.PatternSynP i n _) = IdentP <$> toConcrete n  @@ -997,3 +996,12 @@     es <- mapM (toConcreteCtx InsideOperandCtx) as     bracket roundFixBrackets       $ return $ opApp (getRange x) x n es++-- Some instances that are related to interaction with users -----------++instance ToConcrete InteractionId C.Expr where+    toConcrete (InteractionId i) = return $ C.QuestionMark noRange (Just i)++instance ToConcrete NamedMeta C.Expr where+    toConcrete i = do+      return $ C.Underscore noRange (Just $ prettyShow i)
src/full/Agda/Syntax/Translation/ConcreteToAbstract.hs view
@@ -58,6 +58,7 @@ import Agda.Syntax.Notation import Agda.Syntax.Scope.Base import Agda.Syntax.Scope.Monad+import Agda.Syntax.Translation.AbstractToConcrete (ToConcrete)  import Agda.TypeChecking.Monad.Base   ( TypeError(..) , Call(..) , typeError , genericError , TCErr(..)@@ -71,6 +72,8 @@ import Agda.TypeChecking.Monad.Options import Agda.TypeChecking.Monad.Env (insideDotPattern, isInsideDotPattern) +import Agda.TypeChecking.Pretty hiding (pretty, prettyA)+ import Agda.Interaction.FindFile (checkModuleName) -- import Agda.Interaction.Imports  -- for type-checking in ghci import {-# SOURCE #-} Agda.Interaction.Imports (scopeCheckImport)@@ -80,9 +83,11 @@ import Agda.Utils.FileName import Agda.Utils.Functor import Agda.Utils.List+import Agda.Utils.Maybe import Agda.Utils.Monad import Agda.Utils.Null-import Agda.Utils.Pretty+import qualified Agda.Utils.Pretty as P+import Agda.Utils.Pretty (render, Pretty, pretty, prettyShow)  #include "undefined.h" import Agda.Utils.Impossible@@ -150,7 +155,6 @@       A.DefP _ _ args        -> concatMap (vars . namedArg) args         -- Projection pattern, @args@ should be empty unless we have         -- indexed records.-      A.ImplicitP _          -> __IMPOSSIBLE__       A.PatternSynP _ _ args -> concatMap (vars . namedArg) args  -- | Compute the type of the record constructor (with bogus target type)@@ -191,7 +195,11 @@   -> ImportDirective   -> ScopeM (A.ModuleApplication, Ren A.QName, Ren ModuleName) -checkModuleApplication (C.SectionApp _ tel e) m0 x dir' =+checkModuleApplication (C.SectionApp _ tel e) m0 x dir' = do+  reportSDoc "scope.decl" 70 $ vcat $+    [ text $ "scope checking ModuleApplication " ++ prettyShow x+    ]+   -- For the following, set the current module to be m0.   withCurrentModule m0 $ do     -- Check that expression @e@ is of the form @m args@.@@ -211,7 +219,14 @@     modifyCurrentScope $ const s'     printScope "mod.inst" 20 "copied source module"     reportSLn "scope.mod.inst" 30 $ "renamings:\n  " ++ show renD ++ "\n  " ++ show renM-    return ((A.SectionApp tel' m1 args'), renD, renM)+    let amodapp = A.SectionApp tel' m1 args'+    reportSDoc "scope.decl" 70 $ vcat $+      [ text $ "scope checked ModuleApplication " ++ prettyShow x+      ]+    reportSDoc "scope.decl" 70 $ vcat $+      [ nest 2 $ prettyA amodapp+      ]+    return (amodapp, renD, renM)  checkModuleApplication (C.RecordModuleIFS _ recN) m0 x dir' =   withCurrentModule m0 $ do@@ -229,7 +244,8 @@ --   Preserves local variables.  checkModuleMacro-  :: (ModuleInfo -> ModuleName -> A.ModuleApplication -> Ren A.QName -> Ren ModuleName -> a)+  :: (Pretty c, ToConcrete a c)+  => (ModuleInfo -> ModuleName -> A.ModuleApplication -> Ren A.QName -> Ren ModuleName -> a)   -> Range   -> Access   -> C.Name@@ -238,9 +254,13 @@   -> ImportDirective   -> ScopeM [a] checkModuleMacro apply r p x modapp open dir = do+    reportSDoc "scope.decl" 70 $ vcat $+      [ text $ "scope checking ModuleMacro " ++ prettyShow x+      ]     notPublicWithoutOpen open dir      m0 <- toAbstract (NewModuleName x)+    reportSDoc "scope.decl" 90 $ text "NewModuleName: m0 =" <+> prettyA m0      printScope "mod.inst" 20 "module macro" @@ -252,15 +272,39 @@      -- Restore the locals after module application has been checked.     (modapp', renD, renM) <- withLocalVars $ checkModuleApplication modapp m0 x dir'+    printScope "mod.inst.app" 20 "checkModuleMacro, after checkModuleApplication"++    reportSDoc "scope.decl" 90 $ text "after mod app: trying to print m0 ..."+    reportSDoc "scope.decl" 90 $ text "after mod app: m0 =" <+> prettyA m0+     bindModule p x m0+    reportSDoc "scope.decl" 90 $ text "after bindMod: m0 =" <+> prettyA m0+     printScope "mod.inst.copy.after" 20 "after copying"     -- Andreas, 2014-09-02 openModule_ might shadow some locals!     when (open == DoOpen) $       openModule_ (C.QName x) dir     printScope "mod.inst" 20 $ show open+    reportSDoc "scope.decl" 90 $ text "after open   : m0 =" <+> prettyA m0+     stripNoNames     printScope "mod.inst" 10 $ "after stripping"-    return [ apply info (m0 `withRangesOf` [x]) modapp' renD renM ]+    reportSDoc "scope.decl" 90 $ text "after stripNo: m0 =" <+> prettyA m0++    let m      = m0 `withRangesOf` [x]+        adecls = [ apply info m modapp' renD renM ]++    reportSDoc "scope.decl" 70 $ vcat $+      [ text $ "scope checked ModuleMacro " ++ prettyShow x+      ]+    reportSLn  "scope.decl" 90 $ "info    = " ++ show info+    reportSLn  "scope.decl" 90 $ "m       = " ++ show m+    reportSLn  "scope.decl" 90 $ "modapp' = " ++ show modapp'+    reportSLn  "scope.decl" 90 $ "renD    = " ++ show renD+    reportSLn  "scope.decl" 90 $ "renM    = " ++ show renM+    reportSDoc "scope.decl" 70 $ vcat $+      map (nest 2 . prettyA) adecls+    return adecls   where     info = ModuleInfo              { minfoRange  = r@@ -903,8 +947,8 @@     toAbstract (TopLevel file ds) =       -- A file is a bunch of preliminary decls (imports etc.)       -- plus a single module decl.-      case splitAt (length ds - 1) ds of-        (outsideDecls, [C.Module r m0 tel insideDecls]) -> do+      caseMaybe (initLast ds) __IMPOSSIBLE__ $+        \ (outsideDecls, C.Module r m0 tel insideDecls) -> do           -- If the module name is _ compute the name from the file path           m <- if isNoName m0                 then return $ C.QName $ C.Name noRange [Id $ stringToRawName $ rootName file]@@ -923,7 +967,6 @@              toAbstract insideDecls           outsideScope <- getScope           return $ TopLevelInfo (outsideDecls ++ insideDecls) outsideScope insideScope-        _ -> __IMPOSSIBLE__  -- | runs Syntax.Concrete.Definitions.niceDeclarations on main module niceDecls :: [C.Declaration] -> ScopeM [NiceDeclaration]@@ -964,9 +1007,17 @@                       genericError $ "abstract not allowed in let expressions"                     when (instanc == InstanceDef) $ do                       genericError $ "Using instance is useless here, let expressions are always eligible for instance search."-                    e <- letToAbstract cl+                    (x', e) <- letToAbstract cl                     t <- toAbstract t-                    x <- toAbstract (NewName $ mkBoundName x fx)+                    -- Andreas, 2015-08-27 keeping both the range of x and x' solves Issue 1618.+                    -- The situation is+                    -- @+                    --    let y : t+                    --        y = e+                    -- @+                    -- and we need to store the ranges of both occurences of y in order+                    -- for the highlighter to do the right thing.+                    x <- setRange (fuseRange x x') <$> toAbstract (NewName $ mkBoundName x fx)                     info <- toAbstract info                     return [ A.LetBind (LetRange $ getRange d) info x t e ] @@ -1040,9 +1091,10 @@                     C.LHSHead x args -> return (x, args)                     C.LHSProj{} -> genericError $ "copatterns not allowed in let bindings" -                localToAbstract args $ \args ->+                e <- localToAbstract args $ \args ->                     do  rhs <- toAbstract rhs                         foldM lambda rhs (reverse args)  -- just reverse because these DomainFree+                return (x, e)             letToAbstract _ = notAValidLetBinding d              -- Named patterns not allowed in let definitions@@ -1201,17 +1253,39 @@         printScope "rec" 15 "record complete"         return [ A.RecDef (mkDefInfo x f PublicAccess a r) x' ind cm' pars contel afields ] -    NiceModule r p a x@(C.QName name) tel ds ->-      traceCall (ScopeCheckDeclaration $ NiceModule r p a x tel []) $ do+    NiceModule r p a x@(C.QName name) tel ds -> do+      reportSDoc "scope.decl" 70 $ vcat $+        [ text $ "scope checking NiceModule " ++ prettyShow x+        ]++      adecls <- traceCall (ScopeCheckDeclaration $ NiceModule r p a x tel []) $ do         scopeCheckNiceModule r p name tel $ toAbstract ds +      reportSDoc "scope.decl" 70 $ vcat $+        [ text $ "scope checked NiceModule " ++ prettyShow x+        ] ++ map (nest 2 . prettyA) adecls+      return adecls+     NiceModule _ _ _ m@C.Qual{} _ _ ->       genericError $ "Local modules cannot have qualified names" -    NiceModuleMacro r p x modapp open dir ->-      checkModuleMacro Apply r p x modapp open dir+    NiceModuleMacro r p x modapp open dir -> do+      reportSDoc "scope.decl" 70 $ vcat $+        [ text $ "scope checking NiceModuleMacro " ++ prettyShow x+        ] +      adecls <- checkModuleMacro Apply r p x modapp open dir++      reportSDoc "scope.decl" 70 $ vcat $+        [ text $ "scope checked NiceModuleMacro " ++ prettyShow x+        ] ++ map (nest 2 . prettyA) adecls+      return adecls+     NiceOpen r x dir -> do+      reportSDoc "scope.decl" 70 $ vcat $+        [ text $ "scope checking NiceOpen " ++ prettyShow x+        ]+       m <- toAbstract (OldModuleName x)       printScope "open" 20 $ "opening " ++ show x       openModule_ x dir@@ -1223,7 +1297,11 @@             , minfoOpenShort = Nothing             , minfoDirective = Just dir             }-      return [A.Open minfo m]+      let adecls = [A.Open minfo m]+      reportSDoc "scope.decl" 70 $ vcat $+        [ text $ "scope checked NiceOpen " ++ prettyShow x+        ] ++ map (nest 2 . prettyA) adecls+      return adecls      NicePragma r p -> do       ps <- toAbstract p@@ -1333,16 +1411,19 @@             _                -> PublicAccess  instance ToAbstract ConstrDecl A.Declaration where-  toAbstract (ConstrDecl record m a p (C.Axiom r f _ i info x t)) = do -- rel==Relevant-    t' <- toAbstractCtx TopCtx t-    -- The abstract name is the qualified one-    -- Bind it twice, once unqualified and once qualified-    y <- bindConstructorName m x f a p record-    info <- toAbstract info-    printScope "con" 15 "bound constructor"-    return $ A.Axiom NoFunSig (mkDefInfoInstance x f p ConcreteDef i r) info y t'--  toAbstract _ = __IMPOSSIBLE__    -- a constructor is always an axiom+  toAbstract (ConstrDecl record m a p d) = do+    case d of+      C.Axiom r f _ i info x t -> do -- rel==Relevant+        t' <- toAbstractCtx TopCtx t+        -- The abstract name is the qualified one+        -- Bind it twice, once unqualified and once qualified+        y <- bindConstructorName m x f a p record+        info <- toAbstract info+        printScope "con" 15 "bound constructor"+        return $ A.Axiom NoFunSig (mkDefInfoInstance x f p ConcreteDef i r) info y t'+      _ -> typeError . GenericDocError $+        P.text "Illegal declaration in data type definition " P.$$+        P.nest 2 (pretty (notSoNiceDeclaration d))  instance ToAbstract C.Pragma [A.Pragma] where     toAbstract (C.ImpossiblePragma _) = impossibleTest@@ -1546,12 +1627,11 @@         lhscore <- parseLHS top lhs         reportSLn "scope.lhs" 5 $ "parsed lhs: " ++ show lhscore         printLocals 10 "before lhs:"-        -- error if copattern parsed but no --copatterns option-        haveCoPats <- optCopatterns <$> pragmaOptions-        unless haveCoPats $+        -- error if copattern parsed but --no-copatterns option+        unlessM (optCopatterns <$> pragmaOptions) $           case lhscore of-            C.LHSHead x ps -> return ()             C.LHSProj{} -> typeError $ NeedOptionCopatterns+            C.LHSHead{} -> return ()         -- scope check patterns except for dot patterns         lhscore <- toAbstract lhscore         reportSLn "scope.lhs" 5 $ "parsed lhs patterns: " ++ show lhscore@@ -1624,7 +1704,6 @@     toAbstract (A.DotP i e)           = A.DotP i <$> insideDotPattern (toAbstract e)     toAbstract (A.AbsurdP i)          = return $ A.AbsurdP i     toAbstract (A.LitP l)             = return $ A.LitP l-    toAbstract (A.ImplicitP i)        = return $ A.ImplicitP i     toAbstract (A.PatternSynP i x as) = A.PatternSynP i x <$> mapM toAbstract as  resolvePatternIdentifier ::@@ -1633,7 +1712,7 @@   px <- toAbstract (PatName x ns)   case px of     VarPatName y        -> return $ VarP y-    ConPatName ds       -> return $ ConP (ConPatInfo False $ PatRange r)+    ConPatName ds       -> return $ ConP (ConPatInfo ConPCon $ PatRange r)                                          (AmbQ $ map anameName ds)                                          []     PatternSynPatName d -> return $ PatternSynP (PatRange r)@@ -1668,7 +1747,7 @@             _                  -> typeError $ InvalidPattern p0         where             r = getRange p0-            info = PatSource r $ \pr -> if appBrackets pr then ParenP r p0 else p0+            info = PatRange r      toAbstract p0@(OpAppP r op ns ps) = do         p  <- resolvePatternIdentifier (getRange op) op (Just ns)@@ -1679,14 +1758,16 @@           PatternSynP _ x as -> return $ PatternSynP        info   x (as ++ ps)           _                  -> __IMPOSSIBLE__         where-        info = PatSource r $ \pr -> if appBrackets pr then ParenP r p0 else p0+        info = PatRange r      -- Removed when parsing     toAbstract (HiddenP _ _)   = __IMPOSSIBLE__     toAbstract (InstanceP _ _) = __IMPOSSIBLE__     toAbstract (RawAppP _ _)   = __IMPOSSIBLE__ -    toAbstract p@(C.WildP r)    = return $ A.WildP (PatSource r $ const p)+    toAbstract p@(C.WildP r)    = return $ A.WildP (PatRange r)+    -- Andreas, 2015-05-28 futile attempt to fix issue 819: repeated variable on lhs "_"+    -- toAbstract p@(C.WildP r)    = A.VarP <$> freshName r "_"     toAbstract (C.ParenP _ p)   = toAbstract p     toAbstract (C.LitP l)       = return $ A.LitP l     toAbstract p0@(C.AsP r x p) = typeError $ NotSupported "@-patterns"@@ -1695,13 +1776,13 @@         p <- toAbstract p         return $ A.AsP info x p         where-            info = PatSource r $ \_ -> p0+            info = PatRange r       -}     -- we have to do dot patterns at the end     toAbstract p0@(C.DotP r e) = return $ A.DotP info e-        where info = PatSource r $ \_ -> p0+        where info = PatRange r     toAbstract p0@(C.AbsurdP r) = return $ A.AbsurdP info-        where info = PatSource r $ \_ -> p0+        where info = PatRange r  -- | Turn an operator application into abstract syntax. Make sure to record the -- right precedences for the various arguments.
src/full/Agda/Syntax/Translation/InternalToAbstract.hs view
@@ -1,11 +1,11 @@-{-# LANGUAGE CPP #-}-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE CPP                    #-}+{-# LANGUAGE FlexibleContexts       #-}+{-# LANGUAGE FlexibleInstances      #-} {-# LANGUAGE FunctionalDependencies #-}-{-# LANGUAGE MultiParamTypeClasses #-}-{-# LANGUAGE ScopedTypeVariables #-}-{-# LANGUAGE TupleSections #-}-{-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE MultiParamTypeClasses  #-}+{-# LANGUAGE ScopedTypeVariables    #-}+{-# LANGUAGE TupleSections          #-}+{-# LANGUAGE UndecidableInstances   #-}  {-|     Translating from internal syntax to abstract syntax. Enables nice@@ -47,7 +47,6 @@ import Agda.Syntax.Info as Info import Agda.Syntax.Abstract as A import Agda.Syntax.Internal as I-import qualified Agda.Utils.VarSet as VSet  import Agda.TypeChecking.Monad as M hiding (MetaInfo) import Agda.TypeChecking.Monad.Builtin@@ -63,6 +62,7 @@ import Agda.TypeChecking.DropArgs  import Agda.Utils.Except ( MonadError(catchError) )+import Agda.Utils.List import Agda.Utils.Maybe import Agda.Utils.Monad import Agda.Utils.Permutation@@ -120,10 +120,6 @@ exprInfo :: ExprInfo exprInfo = ExprRange noRange -instance Underscore Expr where-  underscore   = A.Underscore $ Info.emptyMetaInfo-  isUnderscore = __IMPOSSIBLE__- -- Conditional reification to omit terms that are not shown --------------  reifyWhenE :: Reify i Expr => Bool -> i -> TCM Expr@@ -263,7 +259,7 @@         vs <- reifyIArgs' vs         return $ SpineLHS i f vs (ds ++ wps)       where-        ci   = ConPatInfo False patNoRange+        ci   = ConPatInfo ConPCon patNoRange          argToPat arg = fmap unnamed <$> traverse termToPat arg         elimToPat (I.Apply arg) = argToPat arg@@ -271,7 +267,9 @@          termToPat :: DisplayTerm -> TCM A.Pattern -        termToPat (DTerm (I.Var n [])) = return $ ps !! n+        termToPat (DTerm (I.Var n [])) = return $ case ps !!! n of+                                           Nothing -> __IMPOSSIBLE__+                                           Just p  -> p          termToPat (DCon c vs)          = A.ConP ci (AmbQ [conName c]) <$> do           mapM argToPat =<< reifyIArgs' vs@@ -430,7 +428,7 @@         -- and it's mentioned in the target type.         domainFree a b = do           df <- asks envPrintDomainFreePi-          return $ and [df, freeIn 0 b, VSet.null $ allVars $ freeVars a]+          return $ and [df, freeIn 0 b, closed a]      I.Sort s     -> reify s     I.MetaV x es -> do@@ -623,7 +621,6 @@       A.WildP{}            -> mempty       A.AbsurdP{}          -> mempty       A.LitP{}             -> mempty-      A.ImplicitP{}        -> mempty       A.AsP{}              -> __IMPOSSIBLE__      shouldBind x = do@@ -654,7 +651,6 @@       A.WildP{}            -> pure p       A.AbsurdP{}          -> pure p       A.LitP{}             -> pure p-      A.ImplicitP{}        -> pure p       A.AsP{}              -> __IMPOSSIBLE__      redotVar p x = do@@ -696,7 +692,6 @@         A.WildP _     -> Set.empty         A.AbsurdP _   -> Set.empty         A.LitP _      -> Set.empty-        A.ImplicitP _ -> Set.empty         A.AsP _ _ p   -> patVars p         A.PatternSynP _ _ _ -> __IMPOSSIBLE__ -- Set.empty @@ -747,7 +742,6 @@             A.WildP _     -> p             A.AbsurdP _   -> p             A.LitP _      -> p-            A.ImplicitP _ -> p             A.AsP i x p   -> A.AsP i x $ stripPat p             A.PatternSynP _ _ _ -> __IMPOSSIBLE__ -- p @@ -757,7 +751,6 @@           varOrDot A.VarP{}      = True           varOrDot A.WildP{}     = True           varOrDot A.DotP{}      = True-          varOrDot A.ImplicitP{} = True           varOrDot _             = False  -- | @dotVars ps@ gives all the variables inside of dot patterns of @ps@@@ -798,7 +791,6 @@     A.WildP _     -> Set.empty     A.AbsurdP _   -> Set.empty     A.LitP _      -> Set.empty-    A.ImplicitP _ -> Set.empty     A.AsP _ _ p   -> dotVars p     A.PatternSynP _ _ _ -> __IMPOSSIBLE__ -- Set.empty   isConPat A.ConP{} = True@@ -852,6 +844,8 @@   dotVars (TBind _ _ e) = dotVars e   dotVars (TLet _ _)    = __IMPOSSIBLE__ -- Since the internal syntax has no let bindings left ++-- TODO: implement reifyPatterns on de Bruijn patterns ( numberPatVars ) reifyPatterns :: I.Telescope -> Permutation -> [I.NamedArg I.Pattern] -> TCM [A.NamedArg A.Pattern] reifyPatterns tel perm ps = evalStateT (reifyArgs ps) 0   where@@ -868,9 +862,9 @@      tick = do i <- get; put (i + 1); return i -    translate = (vars !!)+    translate n = fromMaybe __IMPOSSIBLE__ $ vars !!! n       where-        vars = permute (invertP __IMPOSSIBLE__ perm) [0..]+        vars = permPicks $ invertP __IMPOSSIBLE__ perm      reifyPat :: I.Pattern -> StateT Nat TCM A.Pattern     reifyPat p = case p of@@ -888,7 +882,7 @@       I.LitP l  -> return $ A.LitP l       I.ProjP d -> return $ A.DefP patNoRange d []       I.ConP c cpi ps -> A.ConP ci (AmbQ [conName c]) <$> reifyArgs ps-        where ci = flip ConPatInfo patNoRange $ fromMaybe False $ I.conPRecord cpi+        where ci = flip ConPatInfo patNoRange $ fromMaybe ConPCon $ I.conPRecord cpi  instance Reify NamedClause A.Clause where   reify (QNamed f (I.Clause _ tel perm ps body _)) = addCtxTel tel $ do
src/full/Agda/Termination/CallGraph.hs view
@@ -1,8 +1,6 @@ {-# LANGUAGE CPP #-}-{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE ImplicitParams #-}-{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TupleSections #-} @@ -100,20 +98,6 @@ mkCall' :: Monoid cinfo => Node -> Node -> CallMatrix -> Call cinfo mkCall' s t m = mkCall s t m mempty --- | 'Call' combination.------   @f --(c1)--> g --(c2)--> h@  is combined to @f --(c1 >*< c2)--> h@------   Precondition: @source c1 == target c2@--instance Monoid cinfo => CallComb (Call cinfo) where-  c1 >*< c2 | g == g' = Edge f h (label c1 >*< label c2)-    where f  = source c2-          g  = target c2-          g' = source c1-          h  = target c1-  c1 >*< c2 = __IMPOSSIBLE__- ------------------------------------------------------------------------ -- Call graphs @@ -304,4 +288,3 @@   -- , quickCheck' prop_ensureCompletePrecondition   -- ]   where ?cutoff = DontCutOff -- CutOff 2  -- don't cut off in tests!-
src/full/Agda/Termination/Inlining.hs view
@@ -238,7 +238,20 @@  expandWithFunctionCall :: QName -> Elims -> TCM Term expandWithFunctionCall f es = do-  Just disp <- displayForm f vs-  return $ dtermToTerm disp `applyE` es'+  as <- displayFormArities f+  case as of+    [a] | length vs >= a -> do+      Just disp <- displayForm f vs+      return $ dtermToTerm disp `applyE` es'+    -- We might get an underapplied with function application (issue1598), in+    -- which case we have to eta expand. The resulting term is only used for+    -- termination checking, so we don't have to worry about getting hiding+    -- information right.+    [a] | null es' -> do+      let pad = a - length vs+          vs' = raise pad vs ++ [defaultArg (Var i []) | i <- reverse [0..pad - 1]]+      Just disp <- displayForm f vs'+      return $ foldr (\_ -> Lam defaultArgInfo . Abs "") (dtermToTerm disp) (replicate pad ())+    _ -> __IMPOSSIBLE__   where     (vs, es') = splitApplyElims es
src/full/Agda/Termination/Monad.hs view
@@ -39,6 +39,7 @@ import Agda.Termination.RecCheck (anyDefs)  import Agda.TypeChecking.Monad+import Agda.TypeChecking.Monad.Benchmark import Agda.TypeChecking.Monad.Builtin import Agda.TypeChecking.Pretty import Agda.TypeChecking.Records@@ -185,7 +186,7 @@ -- | Termination monad.  newtype TerM a = TerM { terM :: ReaderT TerEnv TCM a }-  deriving (Functor, Applicative, Monad)+  deriving (Functor, Applicative, Monad, MonadBench Phase)  instance MonadTer TerM where   terAsk     = TerM $ ask@@ -617,7 +618,7 @@   n <- liftTCM $ sum <$> do     forM (telToList tel) $ \ dom -> do       a <- reduce $ snd $ unDom dom-      ifM (isJust <$> isSizeType a) (return 1) {- else -} $ do+      ifM (isJust <$> isSizeType a) (return 1) {- else -} $         case ignoreSharing $ unEl a of           MetaV{} -> return 1           _       -> return 0
src/full/Agda/Termination/Order.hs view
@@ -92,25 +92,6 @@     (Mat{}  , _      ) -> __IMPOSSIBLE__     (_      , Mat{}  ) -> __IMPOSSIBLE__ --- | Pointwise comparison.---   Only matrices with the same dimension are comparable.-instance (Ord i, PartialOrd a) => PartialOrd (Matrix i a) where-  comparable m n-    | size m /= size n = POAny-    | otherwise        = Fold.fold $-                           zipMatrices onlym onlyn both trivial m n-    where-      -- If an element is only in @m@, then its 'Unknown' in @n@-      -- so it gotten better at best, in any case, not worse.-      onlym o = POGT-      -- If an element is only in @n@, then its 'Unknown' in @m@-      -- so we have strictly less information.-      onlyn o = POLT-      both    = comparable-      -- The zero element of the result sparse matrix is the-      -- neutral element of the monoid.-      trivial = (==mempty)- -- | A partial order, aimed at deciding whether a call graph gets --   worse during the completion. --
src/full/Agda/Termination/Semiring.hs view
@@ -1,5 +1,3 @@--- {-# LANGUAGE UndecidableInstances #-}- -- | Semirings.  module Agda.Termination.Semiring@@ -70,13 +68,6 @@ instance HasZero Integer where   zeroElement = 0 -instance Monoid Integer where-  mempty = 0-  mappend = (+)--instance SemiRing Integer where-  multiply = (*)- integerSemiring :: Semiring Integer integerSemiring = Semiring { add = (+), mul = (*), zero = 0 } -- , one = 1 } @@ -87,13 +78,6 @@  instance HasZero Int where   zeroElement = 0--instance Monoid Int where-  mempty = 0-  mappend = (+)--instance SemiRing Int where-  multiply = (*)  intSemiring :: Semiring Int intSemiring = Semiring { add = (+), mul = (*), zero = 0 } -- , one = 1 }
src/full/Agda/Termination/SparseMatrix.hs view
@@ -60,8 +60,10 @@ import Data.Function import qualified Data.List as List import Data.Maybe+import Data.Monoid  import Data.Foldable (Foldable)+import qualified Data.Foldable as Fold import Data.Traversable (Traversable)  import qualified Text.PrettyPrint.Boxes as Boxes@@ -73,6 +75,7 @@ import Agda.Utils.List import Agda.Utils.Maybe import Agda.Utils.Monad+import Agda.Utils.PartialOrd import Agda.Utils.Pretty hiding (isEmpty) import Agda.Utils.QuickCheck import Agda.Utils.TestHelpers@@ -146,7 +149,7 @@   Size (min r1 r2) (min c1 c2)  --------------------------------------------------------------------------- * Creating matrices and converging to lists.+-- * Creating matrices and converting to lists. ------------------------------------------------------------------------  -- | Constructs a matrix from a list of @(index, value)@-pairs.@@ -412,6 +415,25 @@      times = Semiring.mul  semiring      inner v w = List.foldl' plus zero $                    map snd $ interAssocWith times v w++-- | Pointwise comparison.+--   Only matrices with the same dimension are comparable.+instance (Ord i, PartialOrd a) => PartialOrd (Matrix i a) where+  comparable m n+    | size m /= size n = POAny+    | otherwise        = Fold.fold $+                           zipMatrices onlym onlyn both trivial m n+    where+      -- If an element is only in @m@, then its 'Unknown' in @n@+      -- so it gotten better at best, in any case, not worse.+      onlym o = POGT+      -- If an element is only in @n@, then its 'Unknown' in @m@+      -- so we have strictly less information.+      onlyn o = POLT+      both    = comparable+      -- The zero element of the result sparse matrix is the+      -- neutral element of the monoid.+      trivial = (==mempty)  ------------------------------------------------------------------------ -- Modifying matrices
src/full/Agda/Termination/TermCheck.hs view
@@ -37,6 +37,7 @@ import Agda.Syntax.Abstract (IsProjP(..), AllNames(..)) import qualified Agda.Syntax.Abstract as A import Agda.Syntax.Internal as I+import Agda.Syntax.Internal.Generic import qualified Agda.Syntax.Info as Info import Agda.Syntax.Position import Agda.Syntax.Common as Common@@ -64,8 +65,9 @@ import Agda.TypeChecking.Substitute import Agda.TypeChecking.SizedTypes import Agda.TypeChecking.Datatypes+import Agda.TypeChecking.Positivity.Occurrence -import qualified Agda.TypeChecking.Monad.Base.Benchmark as Benchmark+import qualified Agda.Benchmarking as Benchmark import Agda.TypeChecking.Monad.Benchmark (billTo, billPureTo)  import Agda.Interaction.Options@@ -167,6 +169,8 @@       skip = not <$> do         billTo [Benchmark.Termination, Benchmark.RecCheck] $ recursive allNames +  reportSLn "term.mutual" 10 $ "Termination checking " ++ show allNames+   -- NO_TERMINATION_CHECK   if (Info.mutualTermCheck i `elem` [ NoTerminationCheck, Terminating ]) then do       reportSLn "term.warn.yes" 2 $ "Skipping termination check for " ++ show names@@ -196,8 +200,9 @@            terLocal setNames cont       -- New check currently only makes a difference for copatterns.-     -- Since it is slow, only invoke it if --copatterns.-     res <- ifM (optCopatterns <$> pragmaOptions)+     -- Since it is slow, only invoke it if+     -- any of the definitions uses copatterns.+     res <- ifM (orM $ map usesCopatterns allNames)          -- Then: New check, one after another.          (runTerm $ forM' allNames $ termFunction)          -- Else: Old check, all at once.@@ -268,7 +273,7 @@ -- -- @Either a b -> TerM (Either a b)@. billToTerGraph :: a -> TerM a-billToTerGraph = billPureTo [Benchmark.Termination, Benchmark.Graph]+billToTerGraph a = liftTCM $ billPureTo [Benchmark.Termination, Benchmark.Graph] a  -- | @reportCalls@ for debug printing. --@@ -282,50 +287,50 @@   -- We work in TCM exclusively.   liftTCM $ do -  reportS "term.lex" 20 $ unlines-    [ "Calls (" ++ no ++ "dot patterns): " ++ show calls-    ]+    reportS "term.lex" 20 $ unlines+      [ "Calls (" ++ no ++ "dot patterns): " ++ show calls+      ] -  -- Print the whole completion phase.-  verboseS "term.matrices" 40 $ do-    let header s = unlines-          [ replicate n '='-          , replicate k '=' ++ s ++ replicate k' '='-          , replicate n '='-          ]-          where n  = 70-                r  = n - length s-                k  = r `div` 2-                k' = r - k-    let report s cs = reportSDoc "term.matrices" 40 $ vcat-          [ text   $ header s-          , nest 2 $ pretty cs-          ]-        cs0     = calls-        step cs = do-          let (new, cs') = completionStep cs0 cs-          report " New call matrices " new-          return $ if null new then Left () else Right cs'-    report " Initial call matrices " cs0-    trampolineM step cs0+    -- Print the whole completion phase.+    verboseS "term.matrices" 40 $ do+      let header s = unlines+            [ replicate n '='+            , replicate k '=' ++ s ++ replicate k' '='+            , replicate n '='+            ]+            where n  = 70+                  r  = n - length s+                  k  = r `div` 2+                  k' = r - k+      let report s cs = reportSDoc "term.matrices" 40 $ vcat+            [ text   $ header s+            , nest 2 $ pretty cs+            ]+          cs0     = calls+          step cs = do+            let (new, cs') = completionStep cs0 cs+            report " New call matrices " new+            return $ if null new then Left () else Right cs'+      report " Initial call matrices " cs0+      trampolineM step cs0 -  -- Print the result of completion.-  let calls' = CallGraph.complete calls-      idems = filter idempotent $ endos $ CallGraph.toList calls'-  -- TODO-  -- reportSDoc "term.behaviours" 20 $ vcat-  --   [ text $ "Recursion behaviours (" ++ no ++ "dot patterns):"-  --   , nest 2 $ return $ Term.prettyBehaviour calls'-  --   ]-  reportSDoc "term.matrices" 30 $ vcat-    [ text $ "Idempotent call matrices (" ++ no ++ "dot patterns):\n"-    , nest 2 $ vcat $ punctuate (text "\n") $ map pretty idems-    ]-  -- reportSDoc "term.matrices" 30 $ vcat-  --   [ text $ "Other call matrices (" ++ no ++ "dot patterns):"-  --   , nest 2 $ pretty $ CallGraph.fromList others-  --   ]-  return ()+    -- Print the result of completion.+    let calls' = CallGraph.complete calls+        idems = filter idempotent $ endos $ CallGraph.toList calls'+    -- TODO+    -- reportSDoc "term.behaviours" 20 $ vcat+    --   [ text $ "Recursion behaviours (" ++ no ++ "dot patterns):"+    --   , nest 2 $ return $ Term.prettyBehaviour calls'+    --   ]+    reportSDoc "term.matrices" 30 $ vcat+      [ text $ "Idempotent call matrices (" ++ no ++ "dot patterns):\n"+      , nest 2 $ vcat $ punctuate (text "\n") $ map pretty idems+      ]+    -- reportSDoc "term.matrices" 30 $ vcat+    --   [ text $ "Other call matrices (" ++ no ++ "dot patterns):"+    --   , nest 2 $ pretty $ CallGraph.fromList others+    --   ]+    return ()  -- | @termFunction name@ checks @name@ for termination. @@ -344,51 +349,51 @@   reportTarget target   terSetTarget target $ do -  -- Collect the recursive calls in the block which (transitively)-  -- involve @name@,-  -- taking the target of @name@ into account for computing guardedness.+    -- Collect the recursive calls in the block which (transitively)+    -- involve @name@,+    -- taking the target of @name@ into account for computing guardedness. -  let collect = (`trampolineM` (Set.singleton index, mempty, mempty)) $ \ (todo, done, calls) -> do-        if null todo then return $ Left calls else do-        -- Extract calls originating from indices in @todo@.-        new <- forM' todo $ \ i ->-          termDef $ fromMaybe __IMPOSSIBLE__ $ allNames !!! i-        -- Mark those functions as processed and add the calls to the result.-        let done'  = done `mappend` todo-            calls' = new  `mappend` calls-        -- Compute the new todo list:-            todo' = CallGraph.targetNodes new Set.\\ done'-        -- Jump the trampoline.-        return $ Right (todo', done', calls')+    let collect = (`trampolineM` (Set.singleton index, mempty, mempty)) $ \ (todo, done, calls) -> do+          if null todo then return $ Left calls else do+            -- Extract calls originating from indices in @todo@.+            new <- forM' todo $ \ i ->+              termDef $ fromMaybe __IMPOSSIBLE__ $ allNames !!! i+            -- Mark those functions as processed and add the calls to the result.+            let done'  = done `mappend` todo+                calls' = new  `mappend` calls+            -- Compute the new todo list:+                todo' = CallGraph.targetNodes new Set.\\ done'+            -- Jump the trampoline.+            return $ Right (todo', done', calls') -  -- First try to termination check ignoring the dot patterns-  calls1 <- terSetUseDotPatterns False $ collect-  reportCalls "no " calls1+    -- First try to termination check ignoring the dot patterns+    calls1 <- terSetUseDotPatterns False $ collect+    reportCalls "no " calls1 -  r <- do-   cutoff <- terGetCutOff-   let ?cutoff = cutoff-   r <- billToTerGraph $ Term.terminatesFilter (== index) calls1-   case r of-     Right () -> return $ Right ()-     Left{}    -> do-       -- Try again, but include the dot patterns this time.-       calls2 <- terSetUseDotPatterns True $ collect-       reportCalls "" calls2-       billToTerGraph $ mapLeft callInfos $ Term.terminatesFilter (== index) calls2+    r <- do+     cutoff <- terGetCutOff+     let ?cutoff = cutoff+     r <- billToTerGraph $ Term.terminatesFilter (== index) calls1+     case r of+       Right () -> return $ Right ()+       Left{}    -> do+         -- Try again, but include the dot patterns this time.+         calls2 <- terSetUseDotPatterns True $ collect+         reportCalls "" calls2+         billToTerGraph $ mapLeft callInfos $ Term.terminatesFilter (== index) calls2 -  names <- terGetUserNames-  case r of-    Left calls -> return $ singleton $ terminationError ([name] `intersect` names) calls-    Right () -> do-      liftTCM $ reportSLn "term.warn.yes" 2 $-        show name ++ " does termination check"-      return mempty- where-   reportTarget r = liftTCM $-     reportSLn "term.target" 20 $ "  target type " ++-       caseMaybe r "not recognized" (\ q ->-         "ends in " ++ show q)+    names <- terGetUserNames+    case r of+      Left calls -> return $ singleton $ terminationError ([name] `intersect` names) calls+      Right () -> do+        liftTCM $ reportSLn "term.warn.yes" 2 $+          show name ++ " does termination check"+        return mempty+   where+     reportTarget r = liftTCM $+       reportSLn "term.target" 20 $ "  target type " +++         caseMaybe r "not recognized" (\ q ->+           "ends in " ++ show q)  -- | To process the target type. typeEndsInDef :: MonadTCM tcm => Type -> tcm (Maybe QName)@@ -426,14 +431,14 @@   withoutKEnabled <- liftTCM $ optWithoutK <$> pragmaOptions   applyWhen withoutKEnabled (setMasks t) $ do -  -- If the result should be disregarded, set all calls to unguarded.-  applyWhenM terGetMaskResult terUnguarded $ do+    -- If the result should be disregarded, set all calls to unguarded.+    applyWhenM terGetMaskResult terUnguarded $ do -  case theDef def of-    Function{ funClauses = cls, funDelayed = delayed } ->-      terSetDelayed delayed $ forM' cls $ termClause+      case theDef def of+        Function{ funClauses = cls, funDelayed = delayed } ->+          terSetDelayed delayed $ forM' cls $ termClause -    _ -> return empty+        _ -> return empty  -- | Mask arguments and result for termination checking --   according to type of function.@@ -559,10 +564,11 @@     Body v -> Just v     _      -> __IMPOSSIBLE__   where+    -- TODO: express build using numberPatVars     -- length of the telescope     n    = size perm     -- the variables as a map from the body variables to the clause telescope-    xs   = permute (invertP __IMPOSSIBLE__ perm) $ downFrom (size perm)+    xs   = permPicks $ flipP $ invertP __IMPOSSIBLE__ perm      tick = do x : xs <- get; put xs; return x @@ -578,8 +584,8 @@ termClause clause = do   ifNotM (terGetInlineWithFunctions) (termClause' clause) $ {- else -} do     name <- terGetCurrent-    ifM (isJust <$> do isWithFunction name) (return mempty) $ do-    mapM' termClause' =<< do liftTCM $ inlineWithClauses name clause+    ifM (isJust <$> do isWithFunction name) (return mempty) $+      mapM' termClause' =<< do liftTCM $ inlineWithClauses name clause  termClause' :: Clause -> TerM Calls termClause' clause = do@@ -603,8 +609,9 @@         dbpats <- mapM stripCoConstructors dbpats         mdbpats <- maskNonDataArgs dbpats         terSetPatterns mdbpats $ do-        terSetSizeDepth tel $ do-        reportBody v+          terSetSizeDepth tel $ do+            reportBody v+            extract v   {-   -- if we are checking a delayed definition, we treat it as if there were   -- a guarding coconstructor (sharp)@@ -612,7 +619,7 @@         Delayed    -> Order.lt         NotDelayed -> Order.le) $ do   -}-        extract v+   where     reportBody :: Term -> TerM ()     reportBody v = verboseS "term.check.clause" 6 $ do@@ -629,8 +636,9 @@             ]  -- | Rewrite a clause @f ps =tel= \ {xs} -> v@ to @f ps {xs} =(tel {xs})= v@.---   The pupose is to move hidden bounded size quantifications {j : Size< i}+--   The pupose is to move hidden size quantifications --   to the lhs such that the termination checker can make use of them.+--   See, e.g., test/succeed/SizedTypesExtendedLambda.agda. introHiddenLambdas :: MonadTCM tcm => Clause -> tcm Clause introHiddenLambdas clause = liftTCM $ do   case clause of@@ -816,7 +824,10 @@     -- First, look for calls in the arguments of the call gArgs.      -- We have to reduce constructors in case they're reexported.-    let reduceCon t = case ignoreSharing t of+    -- Andreas, Issue 1530: constructors have to be reduced deep inside terms,+    -- thus, we need to use traverseTermM.  Sharing is handled by traverseTermM,+    -- so no ignoreSharing needed here.+    let reduceCon = traverseTermM $ \ t -> case t of            Con c vs -> (`apply` vs) <$> reduce (Con c [])  -- make sure we don't reduce the arguments            _        -> return t @@ -860,7 +871,8 @@           -- Andreas, 2014-03-26 only 6% of termination time for library test          -- spent on call matrix generation-         (nrows, ncols, matrix) <- billTo [Benchmark.Termination, Benchmark.Compare] $ compareArgs es+         (nrows, ncols, matrix) <- billTo [Benchmark.Termination, Benchmark.Compare] $+           compareArgs es          -- only a delayed definition can be guarded          let ifDelayed o | Order.decreasing o && delayed == NotDelayed = Order.le                          | otherwise                                  = o
src/full/Agda/Tests.hs view
@@ -19,7 +19,10 @@ import Agda.Termination.Semiring              as TermRing   (tests) import Agda.Termination.SparseMatrix          as TermSparse (tests) import Agda.Termination.Termination           as TermTerm   (tests)+import Agda.TypeChecking.Free.Tests           as Free       (tests) import Agda.TypeChecking.Irrelevance          as Irrel      (tests)+import Agda.TypeChecking.Positivity.Tests     as Positivity (tests)+import Agda.TypeChecking.Positivity.Occurrence as Occurrence (tests) import Agda.TypeChecking.Tests                as TypeChck   (tests) import Agda.TypeChecking.SizedTypes.Tests     as SizedTypes (tests) import Agda.Utils.Bag                         as UtilBag    (tests)@@ -28,8 +31,7 @@ import Agda.Utils.Either                      as UtilEith   (tests) import Agda.Utils.Favorites                   as UtilFav    (tests) import Agda.Utils.FileName                    as UtilFile   (tests)-import Agda.Utils.Graph.AdjacencyMap          as UtilGrap   (tests)-import Agda.Utils.Graph.AdjacencyMap.Unidirectional as UtilGraphUni (tests)+import Agda.Utils.Graph.AdjacencyMap.Unidirectional.Tests as UtilGraphUni (tests) import Agda.Utils.List                        as UtilList   (tests) import Agda.Utils.ListT.Tests                 as UtilListT  (tests) import Agda.Utils.PartialOrd                  as UtilPOrd   (tests)@@ -38,7 +40,8 @@  testSuite :: IO Bool testSuite = runTests "QuickCheck test suite:"-  [ Irrel.tests+  [ Free.tests+  , Irrel.tests   , SizedTypes.tests   , UtilFav.tests   , UtilListT.tests@@ -60,13 +63,14 @@   , TermRing.tests   , TermSparse.tests   , TermTerm.tests+  , Positivity.tests+  , Occurrence.tests   , TypeChck.tests   , UtilBag.tests   , UtilBiMap.tests   , UtilClust.tests   , UtilEith.tests   , UtilFile.tests-  , UtilGrap.tests   , UtilGraphUni.tests   , UtilList.tests   , UtilWarsh.tests
src/full/Agda/TypeChecking/CheckInternal.hs view
@@ -12,6 +12,7 @@ module Agda.TypeChecking.CheckInternal   ( checkType   , checkInternal+  , infer   ) where  import Control.Monad@@ -220,8 +221,6 @@ checkColor     c c' = unless (c == c') $ typeError $ ColorMismatch c c'   -- TODO guilhem -{- THIS WAS TO HELP with projection-like functions, but illusional...- -- | Infer type of a neutral term. infer :: Term -> TCM Type infer v = do@@ -253,8 +252,8 @@       b <- infer self       inferSpine b self (Proj f : es)     _ -> inferDef f (Apply a : es)--} + -- | @inferSpine t self es@ checks that spine @es@ eliminates --   value @self@ of type @t@ and returns the remaining type --   (target of elimination).@@ -282,11 +281,7 @@     -- TODO: more accurate error that makes sense also for proj.-like funs.  shouldBePi :: Type -> TCM (I.Dom Type, Abs Type)-shouldBePi t = do-  t <- reduce t-  case ignoreSharing $ unEl t of-    Pi a b -> return (a, b)-    _      -> typeError $ ShouldBePi t+shouldBePi t = ifPiType t (\ a b -> return (a, b)) $ const $ typeError $ ShouldBePi t  -- | Result is in reduced form. shouldBeSort :: Type -> TCM Sort
src/full/Agda/TypeChecking/CheckInternal.hs-boot view
@@ -5,3 +5,4 @@  checkType :: Type -> TCM () checkInternal :: Term -> Type -> TCM ()+infer :: Term -> TCM Type
src/full/Agda/TypeChecking/CompiledClause.hs view
@@ -1,9 +1,8 @@--- GHC 7.4.2 requires this layout for the pragmas. See Issue 1460.-{-# LANGUAGE CPP,-             DeriveDataTypeable,-             DeriveFoldable,-             DeriveFunctor,-             DeriveTraversable #-}+{-# LANGUAGE CPP                #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveFoldable     #-}+{-# LANGUAGE DeriveFunctor      #-}+{-# LANGUAGE DeriveTraversable  #-}  -- | Case trees. --@@ -13,16 +12,21 @@  module Agda.TypeChecking.CompiledClause where +import Prelude hiding (null)+ import qualified Data.Map as Map import Data.Map (Map) import Data.Monoid import Data.Typeable (Typeable)-import Data.Foldable (Foldable)+import Data.Foldable (Foldable, foldMap) import Data.Traversable (Traversable)  import Agda.Syntax.Internal import Agda.Syntax.Literal+import Agda.Syntax.Position +import Agda.Utils.Maybe+import Agda.Utils.Null import Agda.Utils.Pretty  #include "undefined.h"@@ -34,7 +38,10 @@ -- | Branches in a case tree.  data Case c = Branches-  { conBranches    :: Map QName (WithArity c)+  { projPatterns   :: Bool+    -- ^ We are constructing a record here (copatterns).+    --   'conBranches' lists projections.+  , conBranches    :: Map QName (WithArity c)     -- ^ Map from constructor (or projection) names to their arity     --   and the case subtree.  (Projections have arity 0.)   , litBranches    :: Map Literal c@@ -50,7 +57,7 @@   = Case Int (Case CompiledClauses)     -- ^ @Case n bs@ stands for a match on the @n@-th argument     -- (counting from zero) with @bs@ as the case branches.-    -- If the @n@-th argument is a projection, we have only 'conBranches'.+    -- If the @n@-th argument is a projection, we have only 'conBranches'     -- with arity 0.   | Done [Arg ArgName] Term     -- ^ @Done xs b@ stands for the body @b@ where the @xs@ contains hiding@@ -61,18 +68,27 @@     -- ^ Absurd case.   deriving (Typeable) -emptyBranches :: Case CompiledClauses-emptyBranches = Branches Map.empty Map.empty Nothing- litCase :: Literal -> c -> Case c-litCase l x = Branches Map.empty (Map.singleton l x) Nothing+litCase l x = Branches False Map.empty (Map.singleton l x) Nothing  conCase :: QName -> WithArity c -> Case c-conCase c x = Branches (Map.singleton c x) Map.empty Nothing+conCase c x = Branches False (Map.singleton c x) Map.empty Nothing +projCase :: QName -> c -> Case c+projCase c x = Branches True (Map.singleton c $ WithArity 0 x) Map.empty Nothing+ catchAll :: c -> Case c-catchAll x = Branches Map.empty Map.empty (Just x)+catchAll x = Branches False Map.empty Map.empty (Just x) +-- | Check whether a case tree has a catch-all clause.+hasCatchAll :: CompiledClauses -> Bool+hasCatchAll = getAny . loop+  where+  loop cc = case cc of+    Fail{}    -> mempty+    Done{}    -> mempty+    Case _ br -> maybe (foldMap loop br) (const $ Any True) $ catchAllBranch br+ instance Monoid c => Monoid (WithArity c) where   mempty = WithArity __IMPOSSIBLE__ mempty   mappend (WithArity n1 c1) (WithArity n2 c2)@@ -80,13 +96,18 @@     | otherwise = __IMPOSSIBLE__   -- arity must match!  instance Monoid m => Monoid (Case m) where-  mempty = Branches Map.empty Map.empty Nothing-  mappend (Branches cs  ls  m)-          (Branches cs' ls' m') =-    Branches (Map.unionWith mappend cs cs')+  mempty = empty+  mappend (Branches cop  cs  ls  m)+          (Branches cop' cs' ls' m') =+    Branches (cop || cop') -- for @projCase <> mempty@+             (Map.unionWith mappend cs cs')              (Map.unionWith mappend ls ls')              (mappend m m') +instance Null (Case m) where+  empty = Branches False Map.empty Map.empty Nothing+  null (Branches _cop cs ls mcatch) = null cs && null ls && null mcatch+ -- * Pretty instances.  instance Pretty a => Show (Case a) where@@ -99,7 +120,7 @@   pretty = pretty . content  instance Pretty a => Pretty (Case a) where-  prettyPrec p (Branches cs ls m) =+  prettyPrec p (Branches _cop cs ls m) =     mparens (p > 0) $ vcat $       prettyMap cs ++ prettyMap ls ++ prC m     where@@ -114,7 +135,27 @@ instance Pretty CompiledClauses where   pretty (Done hs t) = text ("done" ++ show hs) <+> text (show t)   pretty Fail        = text "fail"+  pretty (Case n bs) | projPatterns bs =+    sep [ text "record"+        , nest 2 $ pretty bs+        ]   pretty (Case n bs) =     sep [ text ("case " ++ show n ++ " of")         , nest 2 $ pretty bs         ]++-- * KillRange instances.++instance KillRange c => KillRange (WithArity c) where+  killRange = fmap killRange++instance KillRange c => KillRange (Case c) where+  killRange (Branches cop con lit all) = Branches cop+    (killRangeMap con)+    (killRangeMap lit)+    (killRange all)++instance KillRange CompiledClauses where+  killRange (Case i br) = killRange2 Case i br+  killRange (Done xs v) = killRange2 Done xs v+  killRange Fail        = Fail
src/full/Agda/TypeChecking/CompiledClause/Compile.hs view
@@ -1,13 +1,18 @@ {-# LANGUAGE CPP #-}+{-# LANGUAGE TupleSections #-}  module Agda.TypeChecking.CompiledClause.Compile where +import Prelude hiding (null)+ import Data.Maybe import Data.Monoid import qualified Data.Map as Map import Data.List (genericReplicate, nubBy, findIndex) import Data.Function +import Debug.Trace+ import Agda.Syntax.Common import Agda.Syntax.Internal as I import Agda.TypeChecking.CompiledClause@@ -18,7 +23,8 @@ import Agda.TypeChecking.Substitute import Agda.TypeChecking.Pretty -import Agda.Utils.Functor (($>))+import Agda.Utils.Functor+import Agda.Utils.Null import Agda.Utils.List  #include "undefined.h"@@ -74,15 +80,16 @@    where     compiles :: SplitTrees -> Case Cls -> Case CompiledClauses-    compiles ts br@Branches{ conBranches = cons+    compiles ts br@Branches{ projPatterns = cop+                           , conBranches = cons                            , litBranches = lits                            , catchAllBranch = Nothing }-      | Map.null lits = emptyBranches { conBranches = updCons cons }+      | Map.null lits = empty { projPatterns = cop, conBranches = updCons cons }       where-        updCons = Map.mapWithKey $ \ c cl -> case lookup c ts of-                    Nothing -> __IMPOSSIBLE__-                    Just t  -> fmap (compileWithSplitTree t) cl-    compiles ts br    = fmap compile br+        updCons = Map.mapWithKey $ \ c cl ->+                    let t = fromMaybe __IMPOSSIBLE__ $ lookup c ts+                    in  compileWithSplitTree t <$> cl+    compiles ts br    = compile <$> br      -- increase split index by number of dot patterns we have skipped     countInDotPatterns :: Int -> [Cl] -> Int@@ -96,7 +103,7 @@  compile :: Cls -> CompiledClauses compile cs = case nextSplit cs of-  Just n  -> Case n $ fmap compile $ splitOn False n cs+  Just (isRecP, n)-> Case n $ fmap compile $ splitOn isRecP n cs   Nothing -> case map (getBody . snd) cs of     -- It's possible to get more than one clause here due to     -- catch-all expansion.@@ -112,11 +119,23 @@  -- | Get the index of the next argument we need to split on. --   This the number of the first pattern that does a match in the first clause.-nextSplit :: Cls -> Maybe Int+nextSplit :: Cls -> Maybe (Bool, Int) nextSplit []          = __IMPOSSIBLE__-nextSplit ((ps, _):_) = findIndex (not . isVar . unArg) ps+nextSplit ((ps, _):_) = headMaybe $ catMaybes $+  zipWith (\ p n -> (,n) <$> properSplit (unArg p)) ps [0..] +-- | Is is not a variable pattern?+--   And if yes, is it a record pattern?+properSplit :: Pattern -> Maybe Bool+properSplit (ConP _ cpi _) = Just $ isJust $ conPRecord cpi+properSplit LitP{}  = Just False+properSplit ProjP{} = Just False+properSplit VarP{}  = Nothing+properSplit DotP{}  = Nothing+ -- | Is this a variable pattern?+--+--   Maintain invariant: @isVar = isNothing . properSplit@! isVar :: Pattern -> Bool isVar VarP{}  = True isVar DotP{}  = True@@ -127,11 +146,13 @@ -- | @splitOn single n cs@ will force expansion of catch-alls --   if @single@. splitOn :: Bool -> Int -> Cls -> Case Cls-splitOn single n cs = mconcat $ map (fmap (:[]) . splitC n) $ expandCatchAlls single n cs+splitOn single n cs = mconcat $ map (fmap (:[]) . splitC n) $+  -- (\ cs -> trace ("splitting on " ++ show n ++ " after expandCatchAlls " ++ show single ++ ": " ++ show cs) cs) $+    expandCatchAlls single n cs  splitC :: Int -> Cl -> Case Cl splitC n (ps, b) = case unArg p of-  ProjP d     -> conCase d $ WithArity 0 (ps0 ++ ps1, b)+  ProjP d     -> projCase d (ps0 ++ ps1, b)   ConP c _ qs -> conCase (conName c) $ WithArity (length qs) (ps0 ++ map (fmap namedThing) qs ++ ps1, b)   LitP l      -> litCase l (ps0 ++ ps1, b)   VarP{}      -> catchAll (ps, b)@@ -155,6 +176,27 @@ -- they come before/after a record pattern, otherwise we get into -- trouble when we want to eliminate splits on records later. --+-- Another example (see Issue 1650):+-- @+--   f (x, (y, z)) true  = a+--   f _           false = b+-- @+-- Split tree:+-- @+--   0 (first argument of f)+--    \- 1 (second component of the pair)+--        \- 3 (last argument of f)+--            \-- true  -> a+--             \- false -> b+-- @+-- We would like to get the following case tree:+-- @+--   case 0 of+--   _,_ -> case 1 of+--          _,_ -> case 3 of true  -> a; false -> b+--          _   -> case 3 of true  -> a; false -> b+--   _          -> case 3 of true  -> a; false -> b+-- @ expandCatchAlls :: Bool -> Int -> Cls -> Cls expandCatchAlls single n cs =   -- Andreas, 2013-03-22@@ -216,7 +258,7 @@ substBody :: Int -> Int -> Term -> ClauseBody -> ClauseBody substBody _ _ _ NoBody = NoBody substBody 0 m v b = case b of-  Bind   b -> foldr (.) id (replicate m (Bind . Abs underscore)) $ subst v (absBody $ raise m b)+  Bind   b -> foldr (.) id (replicate m (Bind . Abs underscore)) $ subst 0 v (absBody $ raise m b)   _        -> __IMPOSSIBLE__ substBody n m v b = case b of   Bind b   -> Bind $ fmap (substBody (n - 1) m v) b
src/full/Agda/TypeChecking/CompiledClause/Match.hs view
@@ -183,22 +183,8 @@               NotBlocked blocked e -> no (NotBlocked $ stuckOn e blocked) es'  -- If we reach the empty stack, then pattern matching was incomplete-match' [] = do  {- new line here since __IMPOSSIBLE__ does not like the ' in match' -}+match' [] = {- new line here since __IMPOSSIBLE__ does not like the ' in match' -}   caseMaybeM (asks envAppDef) __IMPOSSIBLE__ $ \ f -> do-    error $ "Incomplete pattern matching when applying " ++ show f----- Andreas, 2013-03-20 recursive invokations of unfoldCorecursion--- need also to instantiate metas, see Issue 826.-unfoldCorecursionE :: Elim -> ReduceM (Blocked Elim)-unfoldCorecursionE e@(Proj f)           = return $ notBlocked e-unfoldCorecursionE (Apply (Arg info v)) = fmap (Apply . Arg info) <$>-  unfoldCorecursion v--unfoldCorecursion :: Term -> ReduceM (Blocked Term)-unfoldCorecursion v = do-  v <- instantiate' v-  case v of-    Def f es -> unfoldDefinitionE True unfoldCorecursion (Def f []) f es-    Shared{} -> fmap shared <$> unfoldCorecursion (ignoreSharing v) -- don't update when unfolding corecursion!-    _          -> reduceB' v+    traceSLn "impossible" 10+      ("Incomplete pattern matching when applying " ++ show f)+      __IMPOSSIBLE__
src/full/Agda/TypeChecking/Constraints.hs view
@@ -15,6 +15,7 @@ import Agda.TypeChecking.Reduce import Agda.TypeChecking.Substitute import Agda.TypeChecking.LevelConstraints+import Agda.TypeChecking.SizedTypes  import {-# SOURCE #-} Agda.TypeChecking.Rules.Term import {-# SOURCE #-} Agda.TypeChecking.Conversion@@ -166,6 +167,7 @@   ifM (isProblemSolved pid) (solveConstraint_ c)                             (addConstraint c0) solveConstraint_ (IsEmpty r t)              = isEmptyType r t+solveConstraint_ (CheckSizeLtSat t)         = checkSizeLtSat t solveConstraint_ (UnBlock m)                =   ifM (isFrozen m) (addConstraint $ UnBlock m) $ do     inst <- mvInstantiation <$> lookupMeta m
src/full/Agda/TypeChecking/Constraints.hs-boot view
@@ -3,6 +3,7 @@ import Agda.TypeChecking.Monad.Base  addConstraint          :: Constraint -> TCM ()+catchConstraint        :: Constraint -> TCM () -> TCM () solveConstraint        :: Constraint -> TCM () solveAwakeConstraints' :: Bool -> TCM () noConstraints          :: TCM a -> TCM a
src/full/Agda/TypeChecking/Conversion.hs view
@@ -1,7 +1,11 @@-{-# LANGUAGE CPP #-}+{-# LANGUAGE CPP               #-} {-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE PatternGuards #-}+{-# LANGUAGE PatternGuards     #-} +#if __GLASGOW_HASKELL__ >= 710+{-# LANGUAGE FlexibleContexts #-}+#endif+ module Agda.TypeChecking.Conversion where  import Control.Applicative@@ -25,9 +29,10 @@ import Agda.TypeChecking.MetaVars.Occurs (killArgs,PruneResult(..)) import Agda.TypeChecking.Reduce import Agda.TypeChecking.Substitute-import Agda.TypeChecking.SyntacticEquality+import qualified Agda.TypeChecking.SyntacticEquality as SynEq import Agda.TypeChecking.Telescope import Agda.TypeChecking.Constraints+import {-# SOURCE #-} Agda.TypeChecking.CheckInternal (infer) import Agda.TypeChecking.Errors import Agda.TypeChecking.Free import Agda.TypeChecking.Datatypes (getConType)@@ -123,49 +128,48 @@     , nest 2 $ text ":" <+> prettyTCM a     ]   -- Check syntactic equality first. This actually saves us quite a bit of work.-  ((u, v), equal) <- checkSyntacticEquality u v-{- OLD CODE, traverses the *full* terms u v at each step, even if they-   are different somewhere.  Leads to infeasibility in issue 854.-  (u, v) <- instantiateFull (u, v)-  let equal = u == v--}+  ((u, v), equal) <- SynEq.checkSyntacticEquality u v+  -- OLD CODE, traverses the *full* terms u v at each step, even if they+  -- are different somewhere.  Leads to infeasibility in issue 854.+  -- (u, v) <- instantiateFull (u, v)+  -- let equal = u == v   if equal then unifyPointers cmp u v $ verboseS "profile.sharing" 20 $ tick "equal terms" else do-  verboseS "profile.sharing" 20 $ tick "unequal terms"-  let checkPointerEquality def | not $ null $ List.intersect (pointerChain u) (pointerChain v) = do-        verboseS "profile.sharing" 10 $ tick "pointer equality"-        return ()-      checkPointerEquality def = def-  checkPointerEquality $ do-  reportSDoc "tc.conv.term" 15 $ sep-    [ text "compareTerm (not syntactically equal)"-    , nest 2 $ prettyTCM u <+> prettyTCM cmp <+> prettyTCM v-    , nest 2 $ text ":" <+> prettyTCM a-    ]-  -- If we are at type Size, we cannot short-cut comparison-  -- against metas by assignment.-  -- Andreas, 2014-04-12: this looks incomplete.-  -- It seems to assume we are never comparing-  -- at function types into Size.-  let fallback = compareTerm' cmp a u v-      unlessSubtyping cont =-          if cmp == CmpEq then cont else do-            -- Andreas, 2014-04-12 do not short cut if type is blocked.-            ifBlockedType a (\ _ _ -> fallback) {-else-} $ \ a -> do-            -- do not short circuit size comparison!-            caseMaybeM (isSizeTypeTest <*> return a) cont (\ _ -> fallback)+    verboseS "profile.sharing" 20 $ tick "unequal terms"+    let checkPointerEquality def | not $ null $ List.intersect (pointerChain u) (pointerChain v) = do+          verboseS "profile.sharing" 10 $ tick "pointer equality"+          return ()+        checkPointerEquality def = def+    checkPointerEquality $ do+      reportSDoc "tc.conv.term" 15 $ sep+        [ text "compareTerm (not syntactically equal)"+        , nest 2 $ prettyTCM u <+> prettyTCM cmp <+> prettyTCM v+        , nest 2 $ text ":" <+> prettyTCM a+        ]+      -- If we are at type Size, we cannot short-cut comparison+      -- against metas by assignment.+      -- Andreas, 2014-04-12: this looks incomplete.+      -- It seems to assume we are never comparing+      -- at function types into Size.+      let fallback = compareTerm' cmp a u v+          unlessSubtyping cont =+            if cmp == CmpEq then cont else do+                -- Andreas, 2014-04-12 do not short cut if type is blocked.+                ifBlockedType a (\ _ _ -> fallback) {-else-} $ \ a -> do+                  -- do not short circuit size comparison!+                  caseMaybeM (isSizeType a) cont (\ _ -> fallback) -      dir = fromCmp cmp-      rid = flipCmp dir     -- The reverse direction.  Bad name, I know.-  case (ignoreSharing u, ignoreSharing v) of-    (MetaV x us, MetaV y vs)-      | x /= y    -> unlessSubtyping $ solve1 `orelse` solve2 `orelse` compareTerm' cmp a u v-      | otherwise -> fallback-      where-        (solve1, solve2) | x > y     = (assign dir x us v, assign rid y vs u)-                         | otherwise = (assign rid y vs u, assign dir x us v)-    (MetaV x us, _) -> unlessSubtyping $ assign dir x us v `orelse` fallback-    (_, MetaV y vs) -> unlessSubtyping $ assign rid y vs u `orelse` fallback-    _               -> fallback+          dir = fromCmp cmp+          rid = flipCmp dir     -- The reverse direction.  Bad name, I know.+      case (ignoreSharing u, ignoreSharing v) of+        (MetaV x us, MetaV y vs)+          | x /= y    -> unlessSubtyping $ solve1 `orelse` solve2 `orelse` compareTerm' cmp a u v+          | otherwise -> fallback+          where+            (solve1, solve2) | x > y     = (assign dir x us v, assign rid y vs u)+                             | otherwise = (assign rid y vs u, assign dir x us v)+        (MetaV x us, _) -> unlessSubtyping $ assign dir x us v `orelse` fallback+        (_, MetaV y vs) -> unlessSubtyping $ assign rid y vs u `orelse` fallback+        _               -> fallback   where     assign dir x es v = do       -- Andreas, 2013-10-19 can only solve if no projections@@ -257,13 +261,11 @@                   isNeutral = isNeutral' . fmap ignoreSharing                   isMeta    = isMeta'    . fmap ignoreSharing                   isNeutral' (NotBlocked _ Con{}) = return False-              -- Andreas, 2013-09-18: this is expensive:-              -- should only do this when copatterns are on+              -- Andreas, 2013-09-18 / 2015-06-29: a Def by copatterns is+              -- not neutral if it is blocked (there can be missing projections+              -- to trigger a reduction.                   isNeutral' (NotBlocked r (Def q _)) = do    -- Andreas, 2014-12-06 optimize this using r !!-                    d <- getConstInfo q-                    return $ case d of-                      Defn {theDef = Function {funCopatternLHS = True}} -> False -- a def by copattern can reduce if projected-                      _                                                 -> True+                    not <$> usesCopatterns q -- a def by copattern can reduce if projected                   isNeutral' _                   = return True                   isMeta' (NotBlocked _ MetaV{}) = True                   isMeta' _                      = False@@ -291,13 +293,8 @@                   (_  , n') <- etaExpandRecord r ps $ ignoreBlocking n                   -- No subtyping on record terms                   c <- getRecordConstructor r-{- We reduce later (in compareAtom)-                  -- In the presence of copatterns, we need to reduce,-                  -- because an added projection can trigger a rewrite rule.-                  (m', n') <- if dontHaveCopatterns then return (m', n')-                               else reduce (m', n')--}-                  compareArgs [] (telePi_ tel $ sort Prop) (Con c []) m' n'+                  -- Record constructors are covariant (see test/succeed/CovariantConstructors).+                  compareArgs (repeat $ polFromCmp cmp) (telePi_ tel $ sort Prop) (Con c []) m' n'              else compareAtom cmp a' m n         _ -> compareAtom cmp a' m n@@ -306,15 +303,10 @@     equalFun :: Term -> Term -> Term -> TCM ()     equalFun (Shared p) m n = equalFun (derefPtr p) m n     equalFun (Pi dom@(Dom info _) b) m n = do-        -- name <- freshName_ $ properName $ absName b         name <- freshName_ $ suggest (absName b) "x"         addContext (name, dom) $ compareTerm cmp (absBody b) m' n'       where         (m',n') = raise 1 (m,n) `apply` [Arg info $ var 0]-{--        properName "_" = "x"-        properName  x  =  x--}     equalFun _ _ _ = __IMPOSSIBLE__  -- | @compareTel t1 t2 cmp tel1 tel1@ checks whether pointwise@@ -396,48 +388,48 @@ -- compareAtom :: Comparison -> Type -> Term -> Term -> TCM () compareAtom cmp t m n =-    verboseBracket "tc.conv.atom" 20 "compareAtom" $-    -- if a PatternErr is thrown, rebuild constraint!-    catchConstraint (ValueCmp cmp t m n) $ do-      reportSDoc "tc.conv.atom" 50 $-        text "compareAtom" <+> fsep [ prettyTCM m <+> prettyTCM cmp-                                    , prettyTCM n-                                    , text ":" <+> prettyTCM t ]-      -- Andreas: what happens if I cut out the eta expansion here?-      -- Answer: Triggers issue 245, does not resolve 348-      (mb',nb') <- ifM (asks envCompareBlocked) ((notBlocked -*- notBlocked) <$> reduce (m,n)) $ do-        mb' <- etaExpandBlocked =<< reduceB m-        nb' <- etaExpandBlocked =<< reduceB n-        return (mb', nb')+  verboseBracket "tc.conv.atom" 20 "compareAtom" $+  -- if a PatternErr is thrown, rebuild constraint!+  catchConstraint (ValueCmp cmp t m n) $ do+    reportSDoc "tc.conv.atom" 50 $+      text "compareAtom" <+> fsep [ prettyTCM m <+> prettyTCM cmp+                                  , prettyTCM n+                                  , text ":" <+> prettyTCM t ]+    -- Andreas: what happens if I cut out the eta expansion here?+    -- Answer: Triggers issue 245, does not resolve 348+    (mb',nb') <- ifM (asks envCompareBlocked) ((notBlocked -*- notBlocked) <$> reduce (m,n)) $ do+      mb' <- etaExpandBlocked =<< reduceB m+      nb' <- etaExpandBlocked =<< reduceB n+      return (mb', nb') -      -- constructorForm changes literal to constructors-      -- only needed if the other side is not a literal-      (mb'', nb'') <- case (ignoreSharing $ ignoreBlocking mb', ignoreSharing $ ignoreBlocking nb') of-        (Lit _, Lit _) -> return (mb', nb')-        _ -> (,) <$> traverse constructorForm mb'-                 <*> traverse constructorForm nb'+    -- constructorForm changes literal to constructors+    -- only needed if the other side is not a literal+    (mb'', nb'') <- case (ignoreSharing $ ignoreBlocking mb', ignoreSharing $ ignoreBlocking nb') of+      (Lit _, Lit _) -> return (mb', nb')+      _ -> (,) <$> traverse constructorForm mb'+               <*> traverse constructorForm nb' -      mb <- traverse unLevel mb''-      nb <- traverse unLevel nb''+    mb <- traverse unLevel mb''+    nb <- traverse unLevel nb'' -      let m = ignoreBlocking mb-          n = ignoreBlocking nb+    let m = ignoreBlocking mb+        n = ignoreBlocking nb -          postpone = addConstraint $ ValueCmp cmp t m n+        postpone = addConstraint $ ValueCmp cmp t m n -          checkSyntacticEquality = do-            n <- normalise n    -- is this what we want?-            m <- normalise m-            if m == n-                then return ()  -- Check syntactic equality for blocked terms-                else postpone+        checkSyntacticEquality = do+          n <- normalise n    -- is this what we want?+          m <- normalise m+          if m == n+              then return ()  -- Check syntactic equality for blocked terms+              else postpone -          dir = fromCmp cmp-          rid = flipCmp dir     -- The reverse direction.  Bad name, I know.+        dir = fromCmp cmp+        rid = flipCmp dir     -- The reverse direction.  Bad name, I know. -          assign dir x es v = assignE dir x es v $ compareAtomDir dir t+        assign dir x es v = assignE dir x es v $ compareAtomDir dir t -      unifyPointers cmp (ignoreBlocking mb') (ignoreBlocking nb') $ do    -- this needs to go after eta expansion to avoid creating infinite terms+    unifyPointers cmp (ignoreBlocking mb') (ignoreBlocking nb') $ do    -- this needs to go after eta expansion to avoid creating infinite terms        reportSDoc "tc.conv.atom" 30 $         text "compareAtom" <+> fsep [ prettyTCM mb <+> prettyTCM cmp@@ -486,12 +478,15 @@         (Blocked{}, _)    -> useInjectivity cmp t m n         (_,Blocked{})     -> useInjectivity cmp t m n         _ -> do-          -- Andreas, 2013-10-20 put projection-like function-          -- into the spine, to make compareElims work.-          -- 'False' means: leave (Def f []) unchanged even for-          -- proj-like funs.-          m <- elimView False m-          n <- elimView False n+          -- -- Andreas, 2013-10-20 put projection-like function+          -- -- into the spine, to make compareElims work.+          -- -- 'False' means: leave (Def f []) unchanged even for+          -- -- proj-like funs.+          -- m <- elimView False m+          -- n <- elimView False n+          -- Andreas, 2015-07-01, actually, don't put them into the spine.+          -- Polarity cannot be communicated properly if projection-like+          -- functions are post-fix.           case (ignoreSharing m, ignoreSharing n) of             (Pi{}, Pi{}) -> equalFun m n @@ -503,71 +498,36 @@                 a <- typeOfBV i                 -- Variables are invariant in their arguments                 compareElims [] a (var i) es es'+            (Def f [], Def f' []) | f == f' -> return ()             (Def f es, Def f' es') | f == f' -> do-                a   <- defType <$> getConstInfo f+                def <- getConstInfo f+                -- To compute the type @a@ of a projection-like @f@,+                -- we have to infer the type of its first argument.+                a <- if projectionArgs (theDef def) <= 0 then return $ defType def else do+                  -- Find an first argument to @f@.+                  let arg = case (es, es') of+                            (Apply arg : _, _) -> arg+                            (_, Apply arg : _) -> arg+                            _ -> __IMPOSSIBLE__+                  -- Infer its type.+                  targ <- infer $ unArg arg+                  -- getDefType wants the argument type reduced.+                  fromMaybeM __IMPOSSIBLE__ $ getDefType f =<< reduce targ+                -- The polarity vector of projection-like functions+                -- does not include the parameters.                 pol <- getPolarity' cmp f                 compareElims pol a (Def f []) es es'             (Def f es, Def f' es') ->               unlessM (bothAbsurd f f') $ do                 trySizeUniv cmp t m n f es f' es'-{- RETIRED-            (Def{}, Def{}) -> do-              ev1 <- elimView m-              ev2 <- elimView n-              reportSDoc "tc.conv.atom" 50 $-                sep [ text $ "ev1 = " ++ show ev1-                    , text $ "ev2 = " ++ show ev2 ]-              case (ev1, ev2) of-                (VarElim x els1, VarElim y els2) | x == y -> cmpElim (typeOfBV x) (Var x []) els1 els2-                (ConElim x args1, ConElim y args2) | x == y -> do-                  a <- conType x t-                  compareArgs [] a (Con x []) args1 args2-                  -- Andreas, 2013-05-23 Ok, if there cannot be-                  -- any projection eliminations from constructors,-                  -- let's be explicit about it!---                (ConElim x els1, ConElim y els2) | x == y ->---                  cmpElim (conType x t) (Con x []) els1 els2-                  -- Andreas 2012-01-17 careful!  In the presence of-                  -- projection eliminations, t is NOT the datatype x belongs to-                  -- Ulf 2012-07-12: actually projection likeness is carefully-                  -- set up so that there can't be any projections from-                  -- constructor applications at this point, so t really is the-                  -- datatype of x. See issue 676 for an example where it-                  -- failed.-                (DefElim x els1, DefElim y els2) | x == y ->-                  cmpElim (defType <$> getConstInfo x) (Def x []) els1 els2-                (DefElim x els1, DefElim y els2) ->-                  unlessM (bothAbsurd x y) $ do-                    trySizeUniv cmp t m n x els1 y els2-                (MetaElim{}, _) -> __IMPOSSIBLE__   -- projections from metas should have been eta expanded-                (_, MetaElim{}) -> __IMPOSSIBLE__-                _ -> typeError $ UnequalTerms cmp m n t-                where-                  polarities (Def x _) = getPolarity' cmp x-                  polarities _         = return []-                  cmpElim t v els1 els2 = do-                    a   <- t-                    pol <- polarities v-                    reportSDoc "tc.conv.elim" 10 $-                      text "compareElim" <+> vcat-                        [ text "pol  =" <+> text (show pol)-                        , text "a    =" <+> prettyTCM a-                        , text "v    =" <+> prettyTCM v-                        , text "els1 =" <+> prettyTCM els1-                        , text "els2 =" <+> prettyTCM els2-                        ]-                    reportSLn "tc.conv.elim" 50 $ "v (raw) = " ++ show v-                    compareElims pol a v els1 els2--}             (Con x xArgs, Con y yArgs)                 | x == y -> do                     -- Get the type of the constructor instantiated to the datatype parameters.                     a' <- conType x t-                    -- Constructors are invariant in their arguments-                    -- (could be covariant).-                    compareArgs [] a' (Con x []) xArgs yArgs+                    -- Constructors are covariant in their arguments+                    -- (see test/succeed/CovariantConstructors).+                    compareArgs (repeat $ polFromCmp cmp) a' (Con x []) xArgs yArgs             _ -> etaInequal cmp t m n -- fixes issue 856 (unsound conversion error)---            _ -> typeError $ UnequalTerms cmp m n t     where         -- Andreas, 2013-05-15 due to new postponement strategy, type can now be blocked         conType c t = ifBlockedType t (\ _ _ -> patternViolation) $ \ t -> do@@ -583,19 +543,6 @@                 -- Thus, instead of crashing, just give up gracefully.                 patternViolation           maybe impossible return =<< getConType c t-{- FACTORED OUT into Datatypes.hs-          case ignoreSharing $ unEl t of-            Def d es -> do-              args  <- maybe impossible return $ allApplyElims es-              npars <- do-                def <- theDef <$> getConstInfo d-                case def of Datatype{dataPars = n} -> return n-                            Record{recPars = n}    -> return n-                            _                      -> impossible-              a <- defType <$> getConInfo c-              return $ piApply a (genericTake npars args)-            _ -> impossible--}         equalFun t1 t2 = case (ignoreSharing t1, ignoreSharing t2) of           (Pi dom1@(Dom i1 a1@(El a1s a1t)) b1, Pi (Dom i2 a2) b2)             | argInfoHiding i1 /= argInfoHiding i2 -> typeError $ UnequalHiding t1 t2@@ -648,6 +595,15 @@       failure = typeError $ UnequalTerms CmpEq v1 v2 a         -- Andreas, 2013-03-15 since one of the spines is empty, @a@         -- is the correct type here.+  unless (null els01) $ do+    reportSDoc "tc.conv.elim" 25 $ text "compareElims" $$ do+     nest 2 $ vcat+      [ text "a     =" <+> prettyTCM a+      , text "pols0 (truncated to 10) =" <+> sep (map prettyTCM $ take 10 pols0)+      , text "v     =" <+> prettyTCM v+      , text "els01 =" <+> prettyTCM els01+      , text "els02 =" <+> prettyTCM els02+      ]   case (els01, els02) of     ([]         , []         ) -> return ()     ([]         , Proj{}:_   ) -> failure -- not impossible, see issue 821@@ -672,38 +628,38 @@         ]       let (pol, pols) = nextPolarity pols0       ifBlockedType a (\ m t -> patternViolation) $ \ a -> do-      case ignoreSharing . unEl $ a of-        (Pi (Dom info b) codom) -> do-          mlvl <- mlevel-          let freeInCoDom (Abs _ c) = 0 `freeInIgnoringSorts` c-              freeInCoDom _         = False-              dependent = (Just (unEl b) /= mlvl) && freeInCoDom codom-                -- Level-polymorphism (x : Level) -> ... does not count as dependency here-                   -- NB: we could drop the free variable test and still be sound.-                   -- It is a trade-off between the administrative effort of-                   -- creating a blocking and traversing a term for free variables.-                   -- Apparently, it is believed that checking free vars is cheaper.-                   -- Andreas, 2013-05-15-              r = getRelevance info+        case ignoreSharing . unEl $ a of+          (Pi (Dom info b) codom) -> do+            mlvl <- mlevel+            let freeInCoDom (Abs _ c) = 0 `freeInIgnoringSorts` c+                freeInCoDom _         = False+                dependent = (Just (unEl b) /= mlvl) && freeInCoDom codom+                  -- Level-polymorphism (x : Level) -> ... does not count as dependency here+                     -- NB: we could drop the free variable test and still be sound.+                     -- It is a trade-off between the administrative effort of+                     -- creating a blocking and traversing a term for free variables.+                     -- Apparently, it is believed that checking free vars is cheaper.+                     -- Andreas, 2013-05-15+                r = getRelevance info  -- NEW, Andreas, 2013-05-15 -          -- compare arg1 and arg2-          pid <- newProblem_ $ applyRelevanceToContext r $-              case r of-                Forced{}   -> return ()-                r | irrelevantOrUnused r ->-                              compareIrrelevant b (unArg arg1) (unArg arg2)-                _          -> compareWithPol pol (flip compareTerm b)-                                (unArg arg1) (unArg arg2)-          -- if comparison got stuck and function type is dependent, block arg-          arg <- if dependent-                 then (arg1 $>) <$> blockTermOnProblem b (unArg arg1) pid-                 else return arg1-          -- continue, possibly with blocked instantiation-          compareElims pols (piApply a [arg]) (apply v [arg]) els1 els2-          -- any left over constraints of arg are associatd to the comparison-          stealConstraints pid+            -- compare arg1 and arg2+            pid <- newProblem_ $ applyRelevanceToContext r $+                case r of+                  Forced{}   -> return ()+                  r | irrelevantOrUnused r ->+                                compareIrrelevant b (unArg arg1) (unArg arg2)+                  _          -> compareWithPol pol (flip compareTerm b)+                                  (unArg arg1) (unArg arg2)+            -- if comparison got stuck and function type is dependent, block arg+            arg <- if dependent+                   then (arg1 $>) <$> blockTermOnProblem b (unArg arg1) pid+                   else return arg1+            -- continue, possibly with blocked instantiation+            compareElims pols (piApply a [arg]) (apply v [arg]) els1 els2+            -- any left over constraints of arg are associatd to the comparison+            stealConstraints pid  {- Stealing solves this issue: @@ -715,35 +671,52 @@  {- OLD, before 2013-05-15 -          let checkArg = applyRelevanceToContext r $-                             case r of-                Forced     -> return ()-                r | irrelevantOrUnused r ->-                              compareIrrelevant b (unArg arg1) (unArg arg2)-                _          -> compareWithPol pol (flip compareTerm b)-                                (unArg arg1) (unArg arg2)+            let checkArg = applyRelevanceToContext r $+                               case r of+                  Forced     -> return ()+                  r | irrelevantOrUnused r ->+                                compareIrrelevant b (unArg arg1) (unArg arg2)+                  _          -> compareWithPol pol (flip compareTerm b)+                                  (unArg arg1) (unArg arg2) -              theRest = ElimCmp pols (piApply a [arg1]) (apply v [arg1]) els1 els2+                theRest = ElimCmp pols (piApply a [arg1]) (apply v [arg1]) els1 els2 -          if dependent-            then guardConstraint theRest checkArg-            else checkArg >> solveConstraint_ theRest+            if dependent+              then guardConstraint theRest checkArg+              else checkArg >> solveConstraint_ theRest -} -        a -> do-          reportSDoc "impossible" 10 $-            text "unexpected type when comparing apply eliminations " <+> prettyTCM a-          reportSLn "impossible" 50 $ "raw type: " ++ show a-          patternViolation-          -- Andreas, 2013-10-22-          -- in case of disabled reductions (due to failing termination check)-          -- we might get stuck, so do not crash, but fail gently.-          -- __IMPOSSIBLE__+          a -> do+            reportSDoc "impossible" 10 $+              text "unexpected type when comparing apply eliminations " <+> prettyTCM a+            reportSLn "impossible" 50 $ "raw type: " ++ show a+            patternViolation+            -- Andreas, 2013-10-22+            -- in case of disabled reductions (due to failing termination check)+            -- we might get stuck, so do not crash, but fail gently.+            -- __IMPOSSIBLE__ -    -- case: f == f' are projection (like) functions+    -- case: f == f' are projections     (Proj f : els1, Proj f' : els2)       | f /= f'   -> typeError . GenericError . show =<< prettyTCM f <+> text "/=" <+> prettyTCM f'       | otherwise -> ifBlockedType a (\ m t -> patternViolation) $ \ a -> do+        res <- projectTyped v a f -- fails only if f is proj.like but parameters cannot be retrieved+        case res of+          Just (u, t) -> do+            -- Andreas, 2015-07-01:+            -- The arguments following the principal argument of a projection+            -- are invariant.  (At least as long as we have no explicit polarity+            -- annotations.)+            compareElims [] t u els1 els2+          Nothing -> do+            reportSDoc "tc.conv.elims" 30 $ sep+              [ text $ "projection " ++ show f+              , text   "applied to value " <+> prettyTCM v+              , text   "of unexpected type " <+> prettyTCM a+              ]+            patternViolation++{-         res <- getDefType f a -- get type of projection (like) function         case res of           Just ft -> do@@ -766,27 +739,6 @@               ]             patternViolation             -- __IMPOSSIBLE__-{--        case ignoreSharing $ unEl a of-          Def _ es -> do-            let us = fromMaybe __IMPOSSIBLE__ $ allApplyElims es-            ft <- defType <$> getConstInfo f  -- get type of projection(like) function-            let c = piApply ft (us ++ [defaultArg v]) -- TODO: not necessarily relevant?-            let (pol, _) = nextPolarity pols0-            (cmp, els1, els2) <- return $ case pol of-                  Invariant     -> (CmpEq, els1, els2)-                  Covariant     -> (CmpLeq, els1, els2)-                  Contravariant -> (CmpLeq, els2, els1)-                  Nonvariant    -> __IMPOSSIBLE__ -- the polarity should be Invariant-            pols' <- getPolarity' cmp f-            compareElims pols' c (v `applyE` [Proj f]) els1 els2-          _ -> do-            reportSDoc "impossible" 10 $ sep-              [ text $ "projection " ++ show f-              , text   "applied to value " <+> prettyTCM v-              , text   "of unexpected type " <+> prettyTCM a-              ]-            __IMPOSSIBLE__ -}  -- | "Compare" two terms in irrelevant position.  This always succeeds.@@ -834,6 +786,10 @@ compareWithPol Contravariant cmp x y = cmp CmpLeq y x compareWithPol Nonvariant    cmp x y = return () +polFromCmp :: Comparison -> Polarity+polFromCmp CmpLeq = Covariant+polFromCmp CmpEq  = Invariant+ -- | Type-directed equality on argument lists -- compareArgs :: [Polarity] -> Type -> Term -> Args -> Args -> TCM ()@@ -935,32 +891,35 @@ --   For now, we do a cheap heuristics. coerceSize :: Term -> Type -> Type -> TCM Term coerceSize v t1 t2 = workOnTypes $ do-  let fallback = v <$ leqType t1 t2-  caseMaybeM (isSizeType t1) fallback $ \ b1 -> do-  caseMaybeM (isSizeType t2) fallback $ \ b2 -> do-    -- Andreas, 2015-02-11 do not instantiate metas here (triggers issue 1203).-    ifM (tryConversion $ dontAssignMetas $ leqType t1 t2) (return v) $ {- else -} do-    -- A (most probably weaker) alternative is to just check syn.eq.-    -- ifM (snd <$> checkSyntacticEquality t1 t2) (return v) $ {- else -} do-    case b2 of-      -- @t2 = Size@.  We are done!-      BoundedNo -> return v-      -- @t2 = Size< v2@-      BoundedLt v2 -> do-        sv2 <- sizeView v2-        case sv2 of-          SizeInf     -> fallback-          OtherSize{} -> do-            -- Andreas, 2014-06-16:-            -- Issue 1203: For now, just treat v < v2 as suc v <= v2-            -- TODO: Need proper < comparison-            vinc <- sizeSuc 1 v-            compareSizes CmpLeq vinc v2-            return v-          -- @v2 = a2 + 1@: In this case, we can try @v <= a2@-          SizeSuc a2 -> do-            compareSizes CmpLeq v a2-            return v+    let fallback = v <$ leqType t1 t2+        done = caseMaybeM (isSizeType t1) fallback $ \ b1 -> return v+    -- Andreas, 2015-07-22, Issue 1615:+    -- If t1 is a meta and t2 a type like Size< v2, we need to make sure we do not miss+    -- the constraint v < v2!+    caseMaybeM (isSizeType t2) fallback $ \ b2 -> do+      -- Andreas, 2015-02-11 do not instantiate metas here (triggers issue 1203).+      ifM (tryConversion $ dontAssignMetas $ leqType t1 t2) (return v) $ {- else -} do+        -- A (most probably weaker) alternative is to just check syn.eq.+        -- ifM (snd <$> checkSyntacticEquality t1 t2) (return v) $ {- else -} do+        case b2 of+          -- @t2 = Size@.  We are done!+          BoundedNo -> done+          -- @t2 = Size< v2@+          BoundedLt v2 -> do+            sv2 <- sizeView v2+            case sv2 of+              SizeInf     -> done+              OtherSize{} -> do+                -- Andreas, 2014-06-16:+                -- Issue 1203: For now, just treat v < v2 as suc v <= v2+                -- TODO: Need proper < comparison+                vinc <- sizeSuc 1 v+                compareSizes CmpLeq vinc v2+                done+              -- @v2 = a2 + 1@: In this case, we can try @v <= a2@+              SizeSuc a2 -> do+                compareSizes CmpLeq v a2+                done  -- to pass Issue 1136  --------------------------------------------------------------------------- -- * Sorts and levels@@ -1374,18 +1333,3 @@          Function{ funCompiled = Just Fail}) -> return True         _ -> return False   | otherwise = return False--{---- | Structural equality for definitions.---   Rudimentary implementation, only works for absurd lambdas now.-equalDef :: QName -> QName -> TCM Bool-equalDef f f'-  | f == f'   = return True-  | otherwise =  do-      def  <- getConstInfo f-      def' <- getConstInfo f'-      case (theDef def, theDef def') of-        (Function{ funCompiled = Fail},-         Function{ funCompiled = Fail}) -> return True-        _ -> return False--}
src/full/Agda/TypeChecking/Coverage.hs view
@@ -37,13 +37,8 @@ import Agda.Syntax.Internal as I import Agda.Syntax.Internal.Pattern -import Agda.TypeChecking.Monad.Base-import Agda.TypeChecking.Monad.Closure-import Agda.TypeChecking.Monad.Trace-import Agda.TypeChecking.Monad.Signature-import Agda.TypeChecking.Monad.Options+import Agda.TypeChecking.Monad import Agda.TypeChecking.Monad.Exception-import Agda.TypeChecking.Monad.Context  import Agda.TypeChecking.Rules.LHS.Problem (flexibleVarFromHiding) import Agda.TypeChecking.Rules.LHS.Unify@@ -59,7 +54,6 @@ import Agda.TypeChecking.Reduce import Agda.TypeChecking.Records (isRecordType) import Agda.TypeChecking.Telescope-import Agda.TypeChecking.Irrelevance  import Agda.Interaction.Options @@ -282,10 +276,10 @@  -- | Update the target type, add more patterns to split clause --   if target becomes a function type.---   Returns @True@ if new patterns were added.-fixTarget :: SplitClause -> TCM (Bool, SplitClause)+--   Returns the domains of the function type (if any).+fixTarget :: SplitClause -> TCM (Telescope, SplitClause) fixTarget sc@SClause{ scTel = sctel, scPerm = perm, scPats = ps, scSubst = sigma, scTarget = target } =-  caseMaybe target (return (False, sc)) $ \ a -> do+  caseMaybe target (return (empty, sc)) $ \ a -> do     reportSDoc "tc.cover.target" 20 $ sep       [ text "split clause telescope: " <+> prettyTCM sctel       , text "old permutation       : " <+> prettyTCM perm@@ -340,7 +334,7 @@       [ text "new split clause"       , prettyTCM sc'       ]-    return $ if n == 0 then (False, sc { scTarget = newTarget }) else (True, sc')+    return $ if n == 0 then (empty, sc { scTarget = newTarget }) else (tel, sc')  -- | @computeNeighbourhood delta1 delta2 perm d pars ixs hix hps con@ --@@ -427,11 +421,14 @@        -- Substitute the constructor for x in Δ₂: Δ₂' = Δ₂[conv/x]       let conv    = Con con  $ teleArgs gamma   -- Θ Γ ⊢ conv (for any Θ)-          delta2' = subst conv $ raiseFrom 1 (size gamma) delta2+          rho0    = consS conv $ raiseS (size gamma)+          -- Andreas, 2015-06-13 share substitution rho0+          delta2' = applySubst rho0 delta2+          -- delta2' = subst 0 conv $ raiseFrom 1 (size gamma) delta2       debugTel "delta2'" delta2'        -- Compute a substitution ρ : Δ₁ΓΔ₂' → Δ₁(x:D)Δ₂'-      let rho = liftS (size delta2') $ consS conv $ raiseS (size gamma)+      let rho = liftS (size delta2') $ rho0              --    [ Var i [] | i <- [0..size delta2' - 1] ]              -- ++ [ raise (size delta2') conv ]              -- ++ [ Var i [] | i <- [size delta2' + size gamma ..] ]@@ -534,8 +531,8 @@         ]  -- | Entry point from @Interaction.MakeCase@.-splitClauseWithAbsurd :: Clause -> Nat -> TCM (Either SplitError (Either SplitClause Covering))-splitClauseWithAbsurd c x = split' Inductive (clauseToSplitClause c) (BlockingVar x Nothing)+splitClauseWithAbsurd :: SplitClause -> Nat -> TCM (Either SplitError (Either SplitClause Covering))+splitClauseWithAbsurd c x = split' Inductive c (BlockingVar x Nothing)  -- | Entry point from @TypeChecking.Empty@ and @Interaction.BasicOps@. --   @splitLast CoInductive@ is used in the @refine@ tactics.@@ -577,7 +574,11 @@ --   to split at (dot patterns included!). dbIndexToLevel :: Telescope -> Permutation -> Int -> Nat dbIndexToLevel tel perm x = if n < 0 then __IMPOSSIBLE__ else n-  where n = if k < 0 then __IMPOSSIBLE__ else permute perm [0..] !! k+  where n = if k < 0+            then __IMPOSSIBLE__+            else case permute perm [0..] !!! k of+                   Nothing -> __IMPOSSIBLE__+                   Just n  -> n         k = size tel - x - 1  -- | @split' ind splitClause x = return res@@@ -617,7 +618,9 @@       fail "split: bad holes or tel"      -- There is always a variable at the given hole.-    let (hix, (VarP s, hps)) = holes !! x+    let (hix, (VarP s, hps)) = case holes !!! x of+                                 Nothing -> __IMPOSSIBLE__+                                 Just p  -> p     debugHoleAndType delta1 delta2 s hps t      return (hps, hix)
src/full/Agda/TypeChecking/Coverage/Match.hs view
@@ -1,7 +1,6 @@--- GHC 7.4.2 requires this layout for the pragmas. See Issue 1460.-{-# LANGUAGE CPP,-             DeriveFunctor,-             PatternGuards #-}+{-# LANGUAGE CPP           #-}+{-# LANGUAGE DeriveFunctor #-}+{-# LANGUAGE PatternGuards #-}  module Agda.TypeChecking.Coverage.Match where @@ -75,7 +74,7 @@ buildMPatterns :: Permutation -> [Arg Pattern] -> [Arg MPat] buildMPatterns perm ps = evalState (mapM (traverse build) ps) xs   where-    xs   = permute (invertP __IMPOSSIBLE__ perm) $ downFrom (size perm)+    xs   = permPicks $ flipP $ invertP __IMPOSSIBLE__ perm     tick = do x : xs <- get; put xs; return x      build (VarP _)        = VarMP <$> tick
src/full/Agda/TypeChecking/DisplayForm.hs view
@@ -13,6 +13,7 @@  import Agda.Syntax.Common hiding (Arg, Dom, NamedArg, ArgInfo) import Agda.Syntax.Internal+import Agda.Syntax.Scope.Base (inverseScopeLookupName)  import Agda.TypeChecking.Monad import Agda.TypeChecking.Substitute@@ -33,6 +34,10 @@   DDot v           -> v   DTerm v          -> v +-- | Get the arities of all display forms for a name.+displayFormArities :: QName -> TCM [Int]+displayFormArities q = map (length . dfPats . openThing) . defDisplay <$> getConstInfo q+ -- | Find a matching display form for @q vs@. --   In essence this tries to reqwrite @q vs@ with any --   display form @q ps --> dt@ and returns the instantiated@@ -61,7 +66,7 @@       , "displayForms: " ++ show dfs       , "arguments   : " ++ show vs       , "matches     : " ++ show ms-      , "result      : " ++ show (foldr (const . Just) Nothing ms)+      , "result      : " ++ show (headMaybe ms)       ]     -- Return the first display form that matches.     return $ headMaybe ms@@ -72,16 +77,20 @@ --  `catchError` \_ -> return Nothing    where-    inScope _ _ = True  -- TODO: distinguish between with display forms and other display forms---     inScope scope d = case hd d of---       Just h  -> isJust $ inverseScopeLookupName h scope---       Nothing -> __IMPOSSIBLE__ -- TODO: currently all display forms have heads     -- 'hd' is only used in the commented-out code for 'inScope' above.-    -- hd (DTerm (Def x _))    = Just x-    -- hd (DTerm (Con x _))    = Just $ conName x-    -- hd (DTerm (Shared p))   = hd (DTerm $ derefPtr p)-    -- hd (DWithApp d _ _) = hd d-    -- hd _                 = Nothing+    inScope _ d | isWithDisplay d = True+    inScope scope d = case hd d of+      Just h  -> not . null $ inverseScopeLookupName h scope+      Nothing -> __IMPOSSIBLE__ -- TODO: currently all display forms have heads++    isWithDisplay DWithApp{} = True+    isWithDisplay _          = False++    hd (DTerm (Def x _))    = Just x+    hd (DTerm (Con x _))    = Just $ conName x+    hd (DTerm (Shared p))   = hd (DTerm $ derefPtr p)+    hd (DWithApp d _ _) = hd d+    hd _                 = Nothing  -- | Match a 'DisplayForm' @q ps = v@ against @q vs@. --   Return the 'DisplayTerm' @v[us]@ if the match was successful,
src/full/Agda/TypeChecking/Errors.hs view
@@ -2,6 +2,8 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TupleSections #-} +{-# OPTIONS_GHC -fno-warn-orphans #-}+ module Agda.TypeChecking.Errors   ( prettyError   , tcErrString@@ -175,6 +177,7 @@   ModuleDoesntExport{}                     -> "ModuleDoesntExport"   ModuleNameDoesntMatchFileName {}         -> "ModuleNameDoesntMatchFileName"   NeedOptionCopatterns{}                   -> "NeedOptionCopatterns"+  NeedOptionRewriting{}                    -> "NeedOptionRewriting"   NoBindingForBuiltin{}                    -> "NoBindingForBuiltin"   NoParseForApplication{}                  -> "NoParseForApplication"   NoParseForLHS{}                          -> "NoParseForLHS"@@ -467,7 +470,7 @@       pwords "is not parameterized, but is being applied to arguments"      ModuleArityMismatch m tel@(ExtendTel _ _) args -> fsep $-      pwords "The arguments to " ++ [prettyTCM m] ++ pwords "does not fit the telescope" +++      pwords "The arguments to " ++ [prettyTCM m] ++ pwords "do not fit the telescope" ++       [prettyTCM tel]      ShouldBeEmpty t [] -> fsep $@@ -996,6 +999,8 @@      NeedOptionCopatterns -> fsep $       pwords "Option --copatterns needed to enable destructor patterns"+    NeedOptionRewriting  -> fsep $+      pwords "Option --rewriting needed to add and use rewrite rules"      where     mpar n args@@ -1088,97 +1093,97 @@  instance PrettyTCM Call where   prettyTCM c = case c of-    CheckClause t cl _  -> fsep $+    CheckClause t cl -> fsep $       pwords "when checking that the clause"       ++ [AP.prettyA cl] ++ pwords "has type" ++ [prettyTCM t] -    CheckPattern p tel t _ -> addCtxTel tel $ fsep $+    CheckPattern p tel t -> addCtxTel tel $ fsep $       pwords "when checking that the pattern"       ++ [prettyA p] ++ pwords "has type" ++ [prettyTCM t] -    CheckLetBinding b _ -> fsep $+    CheckLetBinding b -> fsep $       pwords "when checking the let binding" ++ [AP.prettyA b] -    InferExpr e _ -> fsep $ pwords "when inferring the type of" ++ [prettyA e]+    InferExpr e -> fsep $ pwords "when inferring the type of" ++ [prettyA e] -    CheckExprCall e t _ -> fsep $+    CheckExprCall e t -> fsep $       pwords "when checking that the expression"       ++ [prettyA e] ++ pwords "has type" ++ [prettyTCM t] -    IsTypeCall e s _ -> fsep $+    IsTypeCall e s -> fsep $       pwords "when checking that the expression"       ++ [prettyA e] ++ pwords "is a type of sort" ++ [prettyTCM s] -    IsType_ e _ -> fsep $+    IsType_ e -> fsep $       pwords "when checking that the expression"       ++ [prettyA e] ++ pwords "is a type" -    CheckArguments r es t0 t1 _ -> fsep $+    CheckArguments r es t0 t1 -> fsep $       pwords "when checking that" ++       map hPretty es ++       pwords (singPlural es "is a valid argument" "are valid arguments") ++       pwords "to a function of type" ++       [prettyTCM t0] -    CheckRecDef _ x ps cs _ ->+    CheckRecDef _ x ps cs ->       fsep $ pwords "when checking the definition of" ++ [prettyTCM x] -    CheckDataDef _ x ps cs _ ->+    CheckDataDef _ x ps cs ->       fsep $ pwords "when checking the definition of" ++ [prettyTCM x] -    CheckConstructor d _ _ (A.Axiom _ _ _ c _) _ -> fsep $+    CheckConstructor d _ _ (A.Axiom _ _ _ c _) -> fsep $       pwords "when checking the constructor" ++ [prettyTCM c] ++       pwords "in the declaration of" ++ [prettyTCM d]      CheckConstructor{} -> __IMPOSSIBLE__ -    CheckFunDef _ f _ _ ->+    CheckFunDef _ f _ ->       fsep $ pwords "when checking the definition of" ++ [prettyTCM f] -    CheckPragma _ p _ ->+    CheckPragma _ p ->       fsep $ pwords "when checking the pragma"              ++ [prettyA $ RangeAndPragma noRange p] -    CheckPrimitive _ x e _ -> fsep $+    CheckPrimitive _ x e -> fsep $       pwords "when checking that the type of the primitive function" ++       [prettyTCM x] ++ pwords "is" ++ [prettyA e] -    CheckWithFunctionType e _ -> fsep $+    CheckWithFunctionType e -> fsep $       pwords "when checking that the type" ++       [prettyA e] ++ pwords "of the generated with function is well-formed" -    CheckDotPattern e v _ -> fsep $+    CheckDotPattern e v -> fsep $       pwords "when checking that the given dot pattern" ++ [prettyA e] ++       pwords "matches the inferred value" ++ [prettyTCM v] -    CheckPatternShadowing c _ -> fsep $+    CheckPatternShadowing c -> fsep $       pwords "when checking the clause" ++ [AP.prettyA c] -    InferVar x _ ->+    InferVar x ->       fsep $ pwords "when inferring the type of" ++ [prettyTCM x] -    InferDef _ x _ ->+    InferDef _ x ->       fsep $ pwords "when inferring the type of" ++ [prettyTCM x] -    CheckIsEmpty r t _ ->+    CheckIsEmpty r t ->       fsep $ pwords "when checking that" ++ [prettyTCM t] ++              pwords "has no constructors" -    ScopeCheckExpr e _ -> fsep $ pwords "when scope checking" ++ [pretty e]+    ScopeCheckExpr e -> fsep $ pwords "when scope checking" ++ [pretty e] -    ScopeCheckDeclaration d _ ->+    ScopeCheckDeclaration d ->       fwords "when scope checking the declaration" $$       nest 2 (pretty $ simpleDecl d) -    ScopeCheckLHS x p _ ->+    ScopeCheckLHS x p ->       fsep $ pwords "when scope checking the left-hand side" ++ [pretty p] ++              pwords "in the definition of" ++ [pretty x] -    NoHighlighting _ -> empty+    NoHighlighting -> empty -    SetRange r _ -> fsep (pwords "when doing something at") <+> prettyTCM r+    SetRange r -> fsep (pwords "when doing something at") <+> prettyTCM r -    CheckSectionApplication _ m1 modapp _ -> fsep $+    CheckSectionApplication _ m1 modapp -> fsep $       pwords "when checking the module application" ++       [prettyA $ A.Apply info m1 modapp empty empty]       where
src/full/Agda/TypeChecking/Free.hs view
@@ -1,5 +1,8 @@ {-# LANGUAGE CPP #-}+{-# LANGUAGE ConstraintKinds #-}+{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE MultiParamTypeClasses #-}  -- | Computing the free variables of a term. --@@ -20,18 +23,15 @@  module Agda.TypeChecking.Free     ( FreeVars(..)-    , Free+    , Free, FreeV, FreeVS     , IgnoreSorts(..)-    , freeVars-    , freeVarsIgnore-    , allVars-    , relevantVars-    , rigidVars-    , freeIn, isBinderUsed-    , freeInIgnoringSorts, freeInIgnoringSortAnn+    , allFreeVars, allRelevantVars, allRelevantVarsIgnoring+    , freeIn, freeInIgnoringSorts, isBinderUsed     , relevantIn, relevantInIgnoringSortAnn     , Occurrence(..)     , occurrence+    , closed+    , freeVars -- only for testing     ) where  import Control.Applicative hiding (empty)@@ -39,19 +39,30 @@  import Data.Foldable (foldMap) import Data.Monoid+import Data.IntSet (IntSet)+import qualified Data.IntSet as Set +import qualified Agda.Benchmarking as Bench+ import Agda.Syntax.Common hiding (Arg, Dom, NamedArg) import Agda.Syntax.Internal +import Agda.TypeChecking.Free.Lazy+  ( Free'(..) , FreeEnv(..), initFreeEnv+  , VarOcc(..), IgnoreSorts(..), Variable, SingleVar+  )+import qualified Agda.TypeChecking.Free.Lazy as Free+ import Agda.Utils.Function import Agda.Utils.Functor import Agda.Utils.Monad-import Agda.Utils.VarSet (VarSet)-import qualified Agda.Utils.VarSet as Set+import Agda.Utils.Singleton  #include "undefined.h" import Agda.Utils.Impossible +type VarSet = IntSet+ -- | Free variables of a term, (disjointly) partitioned into strongly and --   and weakly rigid variables, flexible variables and irrelevant variables. data FreeVars = FV@@ -73,8 +84,17 @@     --   in irrelevant positions.   , unusedVars        :: VarSet     -- ^ Variables in 'UnusedArg'uments.-  }+  } deriving (Eq, Show) +mapSRV, mapUGV, mapWRV, mapFXV, mapIRV, mapUUV+  :: (VarSet -> VarSet) -> FreeVars -> FreeVars+mapSRV f fv = fv { stronglyRigidVars = f $ stronglyRigidVars fv }+mapUGV f fv = fv { unguardedVars     = f $ unguardedVars     fv }+mapWRV f fv = fv { weaklyRigidVars   = f $ weaklyRigidVars   fv }+mapFXV f fv = fv { flexibleVars      = f $ flexibleVars      fv }+mapIRV f fv = fv { irrelevantVars    = f $ irrelevantVars    fv }+mapUUV f fv = fv { unusedVars        = f $ unusedVars        fv }+ -- | Rigid variables: either strongly rigid, unguarded, or weakly rigid. rigidVars :: FreeVars -> VarSet rigidVars fv = Set.unions@@ -101,11 +121,13 @@   | Unused   deriving (Eq,Show) -{- NO LONGER--- | @occurrence x fv@ ignores irrelevant variables in @fv@--}-occurrence :: Nat -> FreeVars -> Occurrence-occurrence x fv+-- | Compute an occurrence of a single variable in a piece of internal syntax.+occurrence :: FreeV a => Nat -> a -> Occurrence+occurrence x v = occurrenceFV x $ freeVars v++-- | Extract occurrence of a single variable from computed free variables.+occurrenceFV :: Nat -> FreeVars -> Occurrence+occurrenceFV x fv   | x `Set.member` stronglyRigidVars fv = StronglyRigid   | x `Set.member` unguardedVars     fv = Unguarded   | x `Set.member` weaklyRigidVars   fv = WeaklyRigid@@ -123,7 +145,7 @@        , flexibleVars      = relevantVars fv        } --- | Mark rigid variables as non-strongly.  Useful when traversion arguments of variables.+-- | Mark rigid variables as non-strongly.  Useful when traversing arguments of variables. weakly :: FreeVars -> FreeVars weakly fv = fv   { stronglyRigidVars = Set.empty@@ -131,7 +153,7 @@   , weaklyRigidVars   = rigidVars fv   } --- | Mark unguarded variables as strongly rigid.  Useful when traversion arguments of inductive constructors.+-- | Mark unguarded variables as strongly rigid.  Useful when traversing arguments of inductive constructors. strongly :: FreeVars -> FreeVars strongly fv = fv   { stronglyRigidVars = stronglyRigidVars fv `Set.union` unguardedVars fv@@ -183,10 +205,100 @@ delete :: Nat -> FreeVars -> FreeVars delete n (FV sv gv rv fv iv uv) = FV (Set.delete n sv) (Set.delete n gv) (Set.delete n rv) (Set.delete n fv) (Set.delete n iv) (Set.delete n uv) --- | @subtractFV n fv@ subtracts $n$ from each free variable in @fv@.-subtractFV :: Nat -> FreeVars -> FreeVars-subtractFV n (FV sv gv rv fv iv uv) = FV (Set.subtract n sv) (Set.subtract n gv) (Set.subtract n rv) (Set.subtract n fv) (Set.subtract n iv) (Set.subtract n uv)+instance Singleton Variable FreeVars where+  singleton (i, VarOcc o r) = mod (Set.insert i) empty where+    mod :: (VarSet -> VarSet) -> FreeVars -> FreeVars+    mod = case (o, r) of+      (_, Irrelevant) -> mapIRV+      (_, UnusedArg ) -> mapUUV+      (Free.StronglyRigid, _) -> mapSRV+      (Free.Unguarded    , _) -> mapUGV+      (Free.WeaklyRigid  , _) -> mapWRV+      (Free.Flexible     , _) -> mapFXV +-- * Collecting free variables.++bench :: a -> a+bench = Bench.billToPure [ Bench.Typing , Bench.Free ]++type Free a = Free' a Any+type FreeV a = Free' a FreeVars+type FreeVS a = Free' a VarSet++-- | Doesn't go inside solved metas, but collects the variables from a+-- metavariable application @X ts@ as @flexibleVars@.+{-# SPECIALIZE freeVars :: FreeV a => a -> FreeVars #-}+freeVars :: (Monoid c, Singleton Variable c, Free' a c) => a -> c+freeVars = freeVarsIgnore IgnoreNot++{-# SPECIALIZE freeVarsIgnore :: FreeV a => IgnoreSorts -> a -> FreeVars #-}+freeVarsIgnore :: (Monoid c, Singleton Variable c, Free' a c) => IgnoreSorts -> a -> c+freeVarsIgnore = runFree singleton++-- Specialization to typical monoids+{-# SPECIALIZE runFree :: Free' a Any      => SingleVar Any      -> IgnoreSorts -> a -> Any #-}+{-# SPECIALIZE runFree :: Free' a All      => SingleVar All      -> IgnoreSorts -> a -> All #-}+{-# SPECIALIZE runFree :: Free' a VarSet   => SingleVar VarSet   -> IgnoreSorts -> a -> VarSet #-}+{-# SPECIALIZE runFree :: Free' a FreeVars => SingleVar FreeVars -> IgnoreSorts -> a -> FreeVars #-}+-- Specialization to Term+{-# SPECIALIZE runFree :: SingleVar Any      -> IgnoreSorts -> Term -> Any #-}+{-# SPECIALIZE runFree :: SingleVar All      -> IgnoreSorts -> Term -> All #-}+{-# SPECIALIZE runFree :: SingleVar VarSet   -> IgnoreSorts -> Term -> VarSet #-}+{-# SPECIALIZE runFree :: SingleVar FreeVars -> IgnoreSorts -> Term -> FreeVars #-}+runFree :: (Monoid c, Free' a c) => SingleVar c -> IgnoreSorts -> a -> c+runFree singleton i t = -- bench $  -- Benchmarking is expensive (4% on std-lib)+  freeVars' t `runReader` (initFreeEnv singleton) { feIgnoreSorts = i }++freeIn'' :: Free a => (VarOcc -> Bool) -> IgnoreSorts -> Nat -> a -> Bool+freeIn'' test ig x t =+  getAny $ runFree (\ (y, o) -> Any $ x == y && test o) ig t++-- | @freeIn' = freeIn'' (const True)@+freeIn' :: Free a => IgnoreSorts -> Nat -> a -> Bool+freeIn' ig x t =+  getAny $ runFree (Any . (x ==) . fst) ig t++{-# SPECIALIZE freeIn :: Nat -> Term -> Bool #-}+freeIn :: Free a => Nat -> a -> Bool+freeIn = freeIn' IgnoreNot++freeInIgnoringSorts :: Free a => Nat -> a -> Bool+freeInIgnoringSorts = freeIn' IgnoreAll++freeInIgnoringSortAnn :: Free a => Nat -> a -> Bool+freeInIgnoringSortAnn = freeIn' IgnoreInAnnotations++relevantInIgnoringSortAnn :: Free a => Nat -> a -> Bool+relevantInIgnoringSortAnn = freeIn'' (not . irrelevantOrUnused . varRelevance) IgnoreInAnnotations++relevantIn :: Free a => Nat -> a -> Bool+relevantIn = freeIn'' (not . irrelevantOrUnused . varRelevance) IgnoreAll++-- | Is the variable bound by the abstraction actually used?+isBinderUsed :: Free a => Abs a -> Bool+isBinderUsed NoAbs{}   = False+isBinderUsed (Abs _ x) = 0 `freeIn` x++-- | Is the term entirely closed (no free variables)?+closed :: Free' a All => a -> Bool+closed t = getAll $ runFree (const $ All False) IgnoreNot t++-- | Collect all free variables.+allFreeVars :: Free' a VarSet => a -> VarSet+allFreeVars = runFree (Set.singleton . fst) IgnoreNot++-- | Collect all relevant free variables, possibly ignoring sorts.+allRelevantVarsIgnoring :: Free' a VarSet => IgnoreSorts -> a -> VarSet+allRelevantVarsIgnoring = runFree sg+  where sg (i, VarOcc _ r) = if irrelevantOrUnused r then Set.empty else Set.singleton i++-- | Collect all relevant free variables.+allRelevantVars :: Free' a VarSet => a -> VarSet+allRelevantVars = allRelevantVarsIgnoring IgnoreNot+++{- OLD+ -- | A single unguarded variable. singleton :: Nat -> FreeVars singleton x = empty { unguardedVars = Set.singleton x }@@ -213,14 +325,6 @@   , fcContext     = 0   } --- | Doesn't go inside solved metas, but collects the variables from a--- metavariable application @X ts@ as @flexibleVars@.-freeVars :: Free a => a -> FreeVars-freeVars t = freeVars' t `runReader` initFreeConf--freeVarsIgnore :: Free a => IgnoreSorts -> a -> FreeVars-freeVarsIgnore i t = freeVars' t `runReader` initFreeConf{ fcIgnoreSorts = i }- -- | Return type of fold over syntax. type FreeT = Reader FreeConf FreeVars @@ -336,25 +440,44 @@ instance Free Clause where   freeVars' = freeVars' . clauseBody +bench :: a -> a+bench = Bench.billToPure [ Bench.Typing , Bench.Free ]++-- | Doesn't go inside solved metas, but collects the variables from a+-- metavariable application @X ts@ as @flexibleVars@.+freeVars :: Free a => a -> FreeVars+freeVars t =+  freeVars' t `runReader` initFreeConf++freeVarsIgnore :: Free a => IgnoreSorts -> a -> FreeVars+freeVarsIgnore i t =+  freeVars' t `runReader` initFreeConf{ fcIgnoreSorts = i }+ freeIn :: Free a => Nat -> a -> Bool-freeIn v t = v `Set.member` allVars (freeVars t)+freeIn v t = bench $+  v `Set.member` allVars (freeVars t)  freeInIgnoringSorts :: Free a => Nat -> a -> Bool-freeInIgnoringSorts v t =+freeInIgnoringSorts v t = bench $   v `Set.member` allVars (freeVarsIgnore IgnoreAll t)  freeInIgnoringSortAnn :: Free a => Nat -> a -> Bool-freeInIgnoringSortAnn v t =+freeInIgnoringSortAnn v t = bench $   v `Set.member` allVars (freeVarsIgnore IgnoreInAnnotations t)  relevantInIgnoringSortAnn :: Free a => Nat -> a -> Bool-relevantInIgnoringSortAnn v t =+relevantInIgnoringSortAnn v t = bench $   v `Set.member` relevantVars (freeVarsIgnore IgnoreInAnnotations t)  relevantIn :: Free a => Nat -> a -> Bool-relevantIn v t = v `Set.member` relevantVars (freeVarsIgnore IgnoreAll t)+relevantIn v t = bench $+  v `Set.member` relevantVars (freeVarsIgnore IgnoreAll t)  -- | Is the variable bound by the abstraction actually used? isBinderUsed :: Free a => Abs a -> Bool isBinderUsed NoAbs{}   = False isBinderUsed (Abs _ x) = 0 `freeIn` x++-- -}+-- -}+-- -}
+ src/full/Agda/TypeChecking/Free/Lazy.hs view
@@ -0,0 +1,390 @@+{-# LANGUAGE CPP #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE UndecidableInstances #-}++-- | Computing the free variables of a term lazily.+--+-- We implement a reduce (traversal into monoid) over internal syntax+-- for a generic collection (monoid with singletons).  This should allow+-- a more efficient test for the presence of a particular variable.+--+-- Worst-case complexity does not change (i.e. the case when a variable+-- does not occur), but best case-complexity does matter.  For instance,+-- see 'Agda.TypeChecking.Substitute.mkAbs': each time we construct+-- a dependent function type, we check it is actually dependent.+--+-- The distinction between rigid and strongly rigid occurrences comes from:+--   Jason C. Reed, PhD thesis, 2009, page 96 (see also his LFMTP 2009 paper)+--+-- The main idea is that x = t(x) is unsolvable if x occurs strongly rigidly+-- in t.  It might have a solution if the occurrence is not strongly rigid, e.g.+--+--   x = \f -> suc (f (x (\ y -> k)))  has  x = \f -> suc (f (suc k))+--+-- [Jason C. Reed, PhD thesis, page 106]+--+-- Under coinductive constructors, occurrences are never strongly rigid.+-- Also, function types and lambdas do not establish strong rigidity.+-- Only inductive constructors do so.+-- (See issue 1271).++module Agda.TypeChecking.Free.Lazy where++import Control.Applicative hiding (empty)+import Control.Monad.Reader++import Data.Foldable (foldMap)+import Data.IntMap (IntMap)+import Data.Monoid++import Test.QuickCheck++import qualified Agda.Benchmarking as Bench++import Agda.Syntax.Common hiding (Arg, Dom, NamedArg)+import Agda.Syntax.Internal++-- import Agda.TypeChecking.Irrelevance++import Agda.Utils.Function+import Agda.Utils.Functor+import Agda.Utils.Monad+import Agda.Utils.Singleton+import Agda.Utils.VarSet (VarSet)++#include "undefined.h"+import Agda.Utils.Impossible++-- | Depending on the surrounding context of a variable,+--   it's occurrence can be classified as flexible or rigid,+--   with finer distinctions.+--+--   The constructors are listed in increasing order (wrt. information content).+data FlexRig+  = Flexible      -- ^ In arguments of metas.+  | WeaklyRigid   -- ^ In arguments to variables and definitions.+  | Unguarded     -- ^ In top position, or only under inductive record constructors.+  | StronglyRigid -- ^ Under at least one and only inductive constructors.+  deriving (Eq, Ord, Show, Enum, Bounded)++-- | 'FlexRig' composition.  For accumulating the context of a variable.+--+--   'Flexible' is dominant.  Once we are under a meta, we are flexible+--   regardless what else comes.+--+--   'WeaklyRigid' is next in strength.  Destroys strong rigidity.+--+--   'StronglyRigid' is still dominant over 'Unguarded'.+--+--   'Unguarded' is the unit.  It is the top (identity) context.+composeFlexRig :: FlexRig -> FlexRig -> FlexRig+composeFlexRig o o' =+  case (o, o') of+    (Flexible, _) -> Flexible+    (_, Flexible) -> Flexible+    (WeaklyRigid, _) -> WeaklyRigid+    (_, WeaklyRigid) -> WeaklyRigid+    (StronglyRigid, _) -> StronglyRigid+    (_, StronglyRigid) -> StronglyRigid+    (Unguarded, Unguarded) -> Unguarded++-- -- | 'FlexRig' supremum.  Extract the most information about a variable.+-- --+-- --   We make this the default 'Monoid' for 'FlexRig'.+-- instance Monoid FlexRig where+--   mempty  = minBound+--   mappend = max++-- | Occurrence of free variables is classified by several dimensions.+--   Currently, we have 'FlexRig' and 'Relevance'.+data VarOcc = VarOcc+  { varFlexRig   :: FlexRig+  , varRelevance :: Relevance+  }+  deriving (Eq, Show)++-- | When we extract information about occurrence, we care most about+--   about 'StronglyRigid' 'Relevant' occurrences.+maxVarOcc :: VarOcc -> VarOcc -> VarOcc+maxVarOcc (VarOcc o r) (VarOcc o' r') = VarOcc (max o o') (min r r')++topVarOcc :: VarOcc+topVarOcc = VarOcc StronglyRigid Relevant++botVarOcc :: VarOcc+botVarOcc = VarOcc Flexible Irrelevant++type VarMap = IntMap VarOcc++-- * Collecting free variables.++-- | Where should we skip sorts in free variable analysis?++data IgnoreSorts+  = IgnoreNot            -- ^ Do not skip.+  | IgnoreInAnnotations  -- ^ Skip when annotation to a type.+  | IgnoreAll            -- ^ Skip unconditionally.+  deriving (Eq, Show)++-- | The current context.++data FreeEnv c = FreeEnv+  { feIgnoreSorts   :: !IgnoreSorts+    -- ^ Ignore free variables in sorts.+  , feBinders       :: !Int+    -- ^ Under how many binders have we stepped?+  , feFlexRig       :: !FlexRig+    -- ^ Are we flexible or rigid?+  , feRelevance     :: !Relevance+    -- ^ What is the current relevance?+  , feSingleton     :: SingleVar c+    -- ^ Method to return a single variable.+  }++type Variable    = (Int, VarOcc)+type SingleVar c = Variable -> c++-- | The initial context.++initFreeEnv :: SingleVar c -> FreeEnv c+initFreeEnv sing = FreeEnv+  { feIgnoreSorts = IgnoreNot+  , feBinders     = 0+  , feFlexRig     = Unguarded+  , feRelevance   = Relevant+  , feSingleton   = sing+  }++type FreeM c = Reader (FreeEnv c) c++instance Monoid c => Monoid (FreeM c) where+  mempty  = pure mempty+  mappend = liftA2 mappend+  mconcat = mconcat <.> sequence++-- instance Singleton a c => Singleton a (FreeM c) where+--   singleton = pure . singleton++-- | Base case: a variable.+variable :: (Monoid c) => Int -> FreeM c+variable n = do+  m <- (n -) <$> asks feBinders+  if m < 0 then mempty else do+    o <- asks feFlexRig+    r <- asks feRelevance+    s <- asks feSingleton+    pure $ s (m, VarOcc o r)++-- | Going under a binder.+bind :: FreeM a -> FreeM a+bind = local $ \ e -> e { feBinders = 1 + feBinders e }++-- | Changing the 'FlexRig' context.+go :: FlexRig -> FreeM a -> FreeM a+go o = local $ \ e -> e { feFlexRig = composeFlexRig o $ feFlexRig e }++-- | Changing the 'Relevance'.+goRel :: Relevance-> FreeM a -> FreeM a+goRel r = local $ \ e -> e { feRelevance = composeRelevance r $ feRelevance e }++-- | What happens to the variables occurring under a constructor?+underConstructor :: ConHead -> FreeM a -> FreeM a+underConstructor (ConHead c i fs) =+  case (i,fs) of+    -- Coinductive (record) constructors admit infinite cycles:+    (CoInductive, _)   -> go WeaklyRigid+    -- Inductive data constructors do not admit infinite cycles:+    (Inductive, [])    -> go StronglyRigid+    -- Inductive record constructors do not admit infinite cycles,+    -- but this cannot be proven inside Agda.+    -- Thus, unification should not prove it either.+    (Inductive, (_:_)) -> id++-- | Gather free variables in a collection.+class Free' a c where+  -- Misplaced SPECIALIZE pragma:+  -- {-# SPECIALIZE freeVars' :: a -> FreeM Any #-}+  -- So you cannot specialize all instances in one go. :(+  freeVars' :: (Monoid c) => a -> FreeM c++instance Free' Term c where+  -- SPECIALIZE instance does not work as well, see+  -- https://ghc.haskell.org/trac/ghc/ticket/10434#ticket+  -- {-# SPECIALIZE instance Free' Term All #-}+  -- {-# SPECIALIZE freeVars' :: Term -> FreeM Any #-}+  -- {-# SPECIALIZE freeVars' :: Term -> FreeM All #-}+  -- {-# SPECIALIZE freeVars' :: Term -> FreeM VarSet #-}+  freeVars' t = case t of+    Var n ts     -> variable n `mappend` do go WeaklyRigid $ freeVars' ts+    -- λ is not considered guarding, as+    -- we cannot prove that x ≡ λy.x is impossible.+    Lam _ t      -> freeVars' t+    Lit _        -> mempty+    Def _ ts     -> go WeaklyRigid $ freeVars' ts  -- because we are not in TCM+      -- we cannot query whether we are dealing with a data/record (strongly r.)+      -- or a definition by pattern matching (weakly rigid)+      -- thus, we approximate, losing that x = List x is unsolvable+    Con c ts     -> underConstructor c $ freeVars' ts+    -- Pi is not guarding, since we cannot prove that A ≡ B → A is impossible.+    -- Even as we do not permit infinite type expressions,+    -- we cannot prove their absence (as Set is not inductive).+    -- Also, this is incompatible with univalence (HoTT).+    Pi a b       -> freeVars' (a,b)+    Sort s       -> freeVars' s+    Level l      -> freeVars' l+    MetaV _ ts   -> go Flexible $ freeVars' ts+    DontCare mt  -> goRel Irrelevant $ freeVars' mt+    Shared p     -> freeVars' (derefPtr p)+    ExtLam cs ts -> freeVars' (cs, ts)++instance Free' Type c where+  -- {-# SPECIALIZE instance Free' Type All #-}+  -- {-# SPECIALIZE freeVars' :: Type -> FreeM Any #-}+  -- {-# SPECIALIZE freeVars' :: Type -> FreeM All #-}+  -- {-# SPECIALIZE freeVars' :: Type -> FreeM VarSet #-}+  -- {-# SPECIALIZE freeVars' :: Type -> FreeM VarMap #-}+  freeVars' (El s t) =+    ifM ((IgnoreNot ==) <$> asks feIgnoreSorts)+      {- then -} (freeVars' (s, t))+      {- else -} (freeVars' t)++instance Free' Sort c where+  -- {-# SPECIALIZE instance Free' Sort All #-}+  -- {-# SPECIALIZE freeVars' :: Sort -> FreeM Any #-}+  -- {-# SPECIALIZE freeVars' :: Sort -> FreeM All #-}+  -- {-# SPECIALIZE freeVars' :: Sort -> FreeM VarSet #-}+  -- {-# SPECIALIZE freeVars' :: Sort -> FreeM VarMap #-}+  freeVars' s =+    ifM ((IgnoreAll ==) <$> asks feIgnoreSorts) mempty $ {- else -}+    case s of+      Type a     -> freeVars' a+      Prop       -> mempty+      Inf        -> mempty+      SizeUniv   -> mempty+      DLub s1 s2 -> go WeaklyRigid $ freeVars' (s1, s2)++instance Free' Level c where+  -- {-# SPECIALIZE instance Free' Level All #-}+  -- {-# SPECIALIZE freeVars' :: Level -> FreeM Any #-}+  -- {-# SPECIALIZE freeVars' :: Level -> FreeM All #-}+  -- {-# SPECIALIZE freeVars' :: Level -> FreeM VarSet #-}+  -- {-# SPECIALIZE freeVars' :: Level -> FreeM VarMap #-}+  freeVars' (Max as) = freeVars' as++instance Free' PlusLevel c where+  -- {-# SPECIALIZE instance Free' PlusLevel All #-}+  -- {-# SPECIALIZE freeVars' :: PlusLevel -> FreeM Any #-}+  -- {-# SPECIALIZE freeVars' :: PlusLevel -> FreeM All #-}+  -- {-# SPECIALIZE freeVars' :: PlusLevel -> FreeM VarSet #-}+  -- {-# SPECIALIZE freeVars' :: PlusLevel -> FreeM VarMap #-}+  freeVars' ClosedLevel{} = mempty+  freeVars' (Plus _ l)    = freeVars' l++instance Free' LevelAtom c where+  -- {-# SPECIALIZE instance Free' LevelAtom All #-}+  -- {-# SPECIALIZE freeVars' :: LevelAtom -> FreeM Any #-}+  -- {-# SPECIALIZE freeVars' :: LevelAtom -> FreeM All #-}+  -- {-# SPECIALIZE freeVars' :: LevelAtom -> FreeM VarSet #-}+  -- {-# SPECIALIZE freeVars' :: LevelAtom -> FreeM VarMap #-}+  freeVars' l = case l of+    MetaLevel _ vs   -> go Flexible $ freeVars' vs+    NeutralLevel _ v -> freeVars' v+    BlockedLevel _ v -> freeVars' v+    UnreducedLevel v -> freeVars' v++instance Free' a c => Free' [a] c where+  -- {-# SPECIALIZE instance Free' a All => Free' [a] All #-}+  -- {-# SPECIALIZE freeVars' :: Free' a Any => [a] -> FreeM Any #-}+  -- {-# SPECIALIZE freeVars' :: Free' a All => [a] -> FreeM All #-}+  -- {-# SPECIALIZE freeVars' :: Free' a VarSet => [a] -> FreeM VarSet #-}+  -- {-# SPECIALIZE freeVars' :: Free' a VarMap => [a] -> FreeM VarMap #-}+  freeVars' = foldMap freeVars'++instance Free' a c => Free' (Maybe a) c where+  -- {-# SPECIALIZE instance Free' a All => Free' (Maybe a) All #-}+  -- {-# SPECIALIZE freeVars' :: Free' a Any => Maybe a -> FreeM Any #-}+  -- {-# SPECIALIZE freeVars' :: Free' a All => Maybe a -> FreeM All #-}+  -- {-# SPECIALIZE freeVars' :: Free' a VarSet => Maybe a -> FreeM VarSet #-}+  -- {-# SPECIALIZE freeVars' :: Free' a VarMap => Maybe a -> FreeM VarMap #-}+  freeVars' = foldMap freeVars'++instance (Free' a c, Free' b c) => Free' (a,b) c where+  -- {-# SPECIALIZE instance (Free' a All, Free' b All) => Free' (a,b) All #-}+  -- {-# SPECIALIZE freeVars' :: (Free' a Any, Free' b Any) => (a,b) -> FreeM Any #-}+  -- {-# SPECIALIZE freeVars' :: (Free' a All, Free' b All) => (a,b) -> FreeM All #-}+  -- {-# SPECIALIZE freeVars' :: (Free' a VarSet, Free' b VarSet) => (a,b) -> FreeM VarSet #-}+  -- {-# SPECIALIZE freeVars' :: (Free' a VarMap, Free' b VarMap) => (a,b) -> FreeM VarMap #-}+  freeVars' (x,y) = freeVars' x `mappend` freeVars' y++instance Free' a c => Free' (Elim' a) c where+  -- {-# SPECIALIZE instance Free' a All => Free' (Elim' a) All #-}+  -- {-# SPECIALIZE freeVars' :: Free' a Any => Elim' a -> FreeM Any #-}+  -- {-# SPECIALIZE freeVars' :: Free' a All => Elim' a -> FreeM All #-}+  -- {-# SPECIALIZE freeVars' :: Free' a VarSet => Elim' a -> FreeM VarSet #-}+  -- {-# SPECIALIZE freeVars' :: Free' a VarMap => Elim' a -> FreeM VarMap #-}+  freeVars' (Apply a) = freeVars' a+  freeVars' (Proj{} ) = mempty++instance Free' a c => Free' (Arg a) c where+  -- {-# SPECIALIZE instance Free' a All => Free' (Arg a) All #-}+  -- {-# SPECIALIZE freeVars' :: Free' a Any => Arg a -> FreeM Any #-}+  -- {-# SPECIALIZE freeVars' :: Free' a All => Arg a -> FreeM All #-}+  -- {-# SPECIALIZE freeVars' :: Free' a VarSet => Arg a -> FreeM VarSet #-}+  -- {-# SPECIALIZE freeVars' :: Free' a VarMap => Arg a -> FreeM VarMap #-}+  freeVars' a = goRel (getRelevance a) $ freeVars' $ unArg a++instance Free' a c => Free' (Dom a) c where+  -- {-# SPECIALIZE instance Free' a All => Free' (Dom a) All #-}+  -- {-# SPECIALIZE freeVars' :: Free' a Any => Dom a -> FreeM Any #-}+  -- {-# SPECIALIZE freeVars' :: Free' a All => Dom a -> FreeM All #-}+  -- {-# SPECIALIZE freeVars' :: Free' a VarSet => Dom a -> FreeM VarSet #-}+  -- {-# SPECIALIZE freeVars' :: Free' a VarMap => Dom a -> FreeM VarMap #-}+  freeVars' = freeVars' . unDom++instance Free' a c => Free' (Abs a) c where+  -- {-# SPECIALIZE instance Free' a All => Free' (Abs a) All #-}+  -- {-# SPECIALIZE freeVars' :: Free' a Any => Abs a -> FreeM Any #-}+  -- {-# SPECIALIZE freeVars' :: Free' a All => Abs a -> FreeM All #-}+  -- {-# SPECIALIZE freeVars' :: Free' a VarSet => Abs a -> FreeM VarSet #-}+  -- {-# SPECIALIZE freeVars' :: Free' a VarMap => Abs a -> FreeM VarMap #-}+  freeVars' (Abs   _ b) = bind $ freeVars' b+  freeVars' (NoAbs _ b) = freeVars' b++instance Free' a c => Free' (Tele a) c where+  -- {-# SPECIALIZE instance Free' a All => Free' (Tele a) All #-}+  -- {-# SPECIALIZE freeVars' :: Free' a Any => Tele a -> FreeM Any #-}+  -- {-# SPECIALIZE freeVars' :: Free' a All => Tele a -> FreeM All #-}+  -- {-# SPECIALIZE freeVars' :: Free' a VarSet => Tele a -> FreeM VarSet #-}+  -- {-# SPECIALIZE freeVars' :: Free' a VarMap => Tele a -> FreeM VarMap #-}+  freeVars' EmptyTel          = mempty+  freeVars' (ExtendTel a tel) = freeVars' (a, tel)++instance Free' ClauseBody c where+  -- {-# SPECIALIZE instance Free' ClauseBody All #-}+  -- {-# SPECIALIZE freeVars' :: ClauseBody -> FreeM Any #-}+  -- {-# SPECIALIZE freeVars' :: ClauseBody -> FreeM All #-}+  -- {-# SPECIALIZE freeVars' :: ClauseBody -> FreeM VarSet #-}+  -- {-# SPECIALIZE freeVars' :: ClauseBody -> FreeM VarMap #-}+  freeVars' (Body t)   = freeVars' t+  freeVars' (Bind b)   = freeVars' b+  freeVars'  NoBody    = mempty++instance Free' Clause c where+  -- {-# SPECIALIZE instance Free' Clause All #-}+  -- {-# SPECIALIZE freeVars' :: Clause -> FreeM Any #-}+  -- {-# SPECIALIZE freeVars' :: Clause -> FreeM All #-}+  -- {-# SPECIALIZE freeVars' :: Clause -> FreeM VarSet #-}+  -- {-# SPECIALIZE freeVars' :: Clause -> FreeM VarMap #-}+  freeVars' = freeVars' . clauseBody++-- Generators++instance Arbitrary FlexRig where+  arbitrary = arbitraryBoundedEnum++instance Arbitrary VarOcc where+  arbitrary = VarOcc <$> arbitrary <*> arbitrary++-- -}
+ src/full/Agda/TypeChecking/Free/Old.hs view
@@ -0,0 +1,364 @@+{-# LANGUAGE CPP #-}+{-# LANGUAGE FlexibleInstances #-}++-- | Computing the free variables of a term.+--+-- This is the old version of ''Agda.TypeChecking.Free'', using+-- 'IntSet's for the separate variable categories.+-- We keep it as a specification.+--+-- The distinction between rigid and strongly rigid occurrences comes from:+--   Jason C. Reed, PhD thesis, 2009, page 96 (see also his LFMTP 2009 paper)+--+-- The main idea is that x = t(x) is unsolvable if x occurs strongly rigidly+-- in t.  It might have a solution if the occurrence is not strongly rigid, e.g.+--+--   x = \f -> suc (f (x (\ y -> k)))  has  x = \f -> suc (f (suc k))+--+-- [Jason C. Reed, PhD thesis, page 106]+--+-- Under coinductive constructors, occurrences are never strongly rigid.+-- Also, function types and lambdas do not establish strong rigidity.+-- Only inductive constructors do so.+-- (See issue 1271).++module Agda.TypeChecking.Free.Old+    ( FreeVars(..)+    , Free+    , IgnoreSorts(..)+    , freeVars+    , freeVarsIgnore+    , allVars+    , relevantVars+    , rigidVars+    , freeIn, isBinderUsed+    , freeInIgnoringSorts, freeInIgnoringSortAnn+    , relevantIn, relevantInIgnoringSortAnn+    , Occurrence(..)+    , occurrence+    ) where++import Control.Applicative hiding (empty)+import Control.Monad.Reader++import Data.Foldable (foldMap)+import Data.Monoid++import Agda.Syntax.Common hiding (Arg, Dom, NamedArg)+import Agda.Syntax.Internal++import Agda.Utils.Function+import Agda.Utils.Functor+import Agda.Utils.Monad+import Agda.Utils.VarSet (VarSet)+import qualified Agda.Utils.VarSet as Set++#include "undefined.h"+import Agda.Utils.Impossible++-- | Free variables of a term, (disjointly) partitioned into strongly and+--   and weakly rigid variables, flexible variables and irrelevant variables.+data FreeVars = FV+  { stronglyRigidVars :: VarSet+    -- ^ Variables under only and at least one inductive constructor(s).+  , unguardedVars     :: VarSet+    -- ^ Variables at top or only under inductive record constructors+    --   λs and Πs.+    --   The purpose of recording these separately is that they+    --   can still become strongly rigid if put under a constructor+    --   whereas weakly rigid ones stay weakly rigid.+  , weaklyRigidVars   :: VarSet+    -- ^ Ordinary rigid variables, e.g., in arguments of variables.+  , flexibleVars      :: VarSet+    -- ^ Variables occuring in arguments of metas.+    --   These are only potentially free, depending how the meta variable is instantiated.+  , irrelevantVars    :: VarSet+    -- ^ Variables in irrelevant arguments and under a @DontCare@, i.e.,+    --   in irrelevant positions.+  , unusedVars        :: VarSet+    -- ^ Variables in 'UnusedArg'uments.+  } deriving (Eq, Show)++-- | Rigid variables: either strongly rigid, unguarded, or weakly rigid.+rigidVars :: FreeVars -> VarSet+rigidVars fv = Set.unions+  [ stronglyRigidVars fv+  ,     unguardedVars fv+  ,   weaklyRigidVars fv+  ]++-- | All but the irrelevant variables.+relevantVars :: FreeVars -> VarSet+relevantVars fv = Set.unions [rigidVars fv, flexibleVars fv]++-- | @allVars fv@ includes irrelevant variables.+allVars :: FreeVars -> VarSet+allVars fv = Set.unions [relevantVars fv, irrelevantVars fv, unusedVars fv]++data Occurrence+  = NoOccurrence+  | Irrelevantly+  | StronglyRigid -- ^ Under at least one and only inductive constructors.+  | Unguarded     -- ^ In top position, or only under inductive record constructors.+  | WeaklyRigid   -- ^ In arguments to variables and definitions.+  | Flexible      -- ^ In arguments of metas.+  | Unused+  deriving (Eq,Show)++{- NO LONGER+-- | @occurrence x fv@ ignores irrelevant variables in @fv@+-}+occurrence :: Nat -> FreeVars -> Occurrence+occurrence x fv+  | x `Set.member` stronglyRigidVars fv = StronglyRigid+  | x `Set.member` unguardedVars     fv = Unguarded+  | x `Set.member` weaklyRigidVars   fv = WeaklyRigid+  | x `Set.member` flexibleVars      fv = Flexible+  | x `Set.member` irrelevantVars    fv = Irrelevantly+  | x `Set.member` unusedVars        fv = Unused+  | otherwise                           = NoOccurrence++-- | Mark variables as flexible.  Useful when traversing arguments of metas.+flexible :: FreeVars -> FreeVars+flexible fv =+    fv { stronglyRigidVars = Set.empty+       , unguardedVars     = Set.empty+       , weaklyRigidVars   = Set.empty+       , flexibleVars      = relevantVars fv+       }++-- | Mark rigid variables as non-strongly.  Useful when traversion arguments of variables.+weakly :: FreeVars -> FreeVars+weakly fv = fv+  { stronglyRigidVars = Set.empty+  , unguardedVars     = Set.empty+  , weaklyRigidVars   = rigidVars fv+  }++-- | Mark unguarded variables as strongly rigid.  Useful when traversion arguments of inductive constructors.+strongly :: FreeVars -> FreeVars+strongly fv = fv+  { stronglyRigidVars = stronglyRigidVars fv `Set.union` unguardedVars fv+  , unguardedVars     = Set.empty+  }++-- | What happens to the variables occurring under a constructor?+underConstructor :: ConHead -> FreeVars -> FreeVars+underConstructor (ConHead c i fs) =+  case (i,fs) of+    -- Coinductive (record) constructors admit infinite cycles:+    (CoInductive, _)   -> weakly+    -- Inductive data constructors do not admit infinite cycles:+    (Inductive, [])    -> strongly+    -- Inductive record constructors do not admit infinite cycles,+    -- but this cannot be proven inside Agda.+    -- Thus, unification should not prove it either.+    (Inductive, (_:_)) -> id++-- | Mark all free variables as irrelevant.+irrelevantly :: FreeVars -> FreeVars+irrelevantly fv = empty { irrelevantVars = allVars fv }++-- | Mark all free variables as unused, except for irrelevant vars.+unused :: FreeVars -> FreeVars+unused fv = empty+  { irrelevantVars = irrelevantVars fv+  , unusedVars     = Set.unions [ rigidVars fv, flexibleVars fv, unusedVars fv ]+  }++-- | Pointwise union.+union :: FreeVars -> FreeVars -> FreeVars+union (FV sv1 gv1 rv1 fv1 iv1 uv1) (FV sv2 gv2 rv2 fv2 iv2 uv2) =+  FV (Set.union sv1 sv2) (Set.union gv1 gv2) (Set.union rv1 rv2) (Set.union fv1 fv2) (Set.union iv1 iv2) (Set.union uv1 uv2)++unions :: [FreeVars] -> FreeVars+unions = foldr union empty++empty :: FreeVars+empty = FV Set.empty Set.empty Set.empty Set.empty Set.empty Set.empty++-- | Free variable sets form a monoid under 'union'.+instance Monoid FreeVars where+  mempty  = empty+  mappend = union+  mconcat = unions++-- | @delete x fv@ deletes variable @x@ from variable set @fv@.+delete :: Nat -> FreeVars -> FreeVars+delete n (FV sv gv rv fv iv uv) = FV (Set.delete n sv) (Set.delete n gv) (Set.delete n rv) (Set.delete n fv) (Set.delete n iv) (Set.delete n uv)++-- | @subtractFV n fv@ subtracts $n$ from each free variable in @fv@.+subtractFV :: Nat -> FreeVars -> FreeVars+subtractFV n (FV sv gv rv fv iv uv) = FV (Set.subtract n sv) (Set.subtract n gv) (Set.subtract n rv) (Set.subtract n fv) (Set.subtract n iv) (Set.subtract n uv)++-- | A single unguarded variable.+singleton :: Nat -> FreeVars+singleton x = empty { unguardedVars = Set.singleton x }++-- * Collecting free variables.++-- | Where should we skip sorts in free variable analysis?+data IgnoreSorts+  = IgnoreNot            -- ^ Do not skip.+  | IgnoreInAnnotations  -- ^ Skip when annotation to a type.+  | IgnoreAll            -- ^ Skip unconditionally.+  deriving (Eq, Show)++data FreeConf = FreeConf+  { fcIgnoreSorts   :: !IgnoreSorts+    -- ^ Ignore free variables in sorts.+  , fcContext       :: !Int+    -- ^ Under how many binders have we stepped?+  }++initFreeConf :: FreeConf+initFreeConf = FreeConf+  { fcIgnoreSorts = IgnoreNot+  , fcContext     = 0+  }++-- | Doesn't go inside solved metas, but collects the variables from a+-- metavariable application @X ts@ as @flexibleVars@.+freeVars :: Free a => a -> FreeVars+freeVars t = freeVars' t `runReader` initFreeConf++freeVarsIgnore :: Free a => IgnoreSorts -> a -> FreeVars+freeVarsIgnore i t = freeVars' t `runReader` initFreeConf{ fcIgnoreSorts = i }++-- | Return type of fold over syntax.+type FreeT = Reader FreeConf FreeVars++instance Monoid FreeT where+  mempty  = pure mempty+  mappend = liftA2 mappend+  mconcat = mconcat <.> sequence++-- | Base case: a variable.+variable :: Int -> FreeT+variable n = do+  m <- (n -) <$> asks fcContext+  if m >= 0 then pure $ singleton m else mempty++-- | Going under a binder.+bind :: FreeT -> FreeT+bind = local $ \ e -> e { fcContext = 1 + fcContext e }++class Free a where+  freeVars'   :: a -> FreeT++instance Free Term where+  freeVars' t = case t of+    Var n ts   -> variable n `mappend` do weakly <$> freeVars' ts+    -- λ is not considered guarding, as+    -- we cannot prove that x ≡ λy.x is impossible.+    Lam _ t    -> freeVars' t+    Lit _      -> mempty+    Def _ ts   -> weakly <$> freeVars' ts  -- because we are not in TCM+      -- we cannot query whether we are dealing with a data/record (strongly r.)+      -- or a definition by pattern matching (weakly rigid)+      -- thus, we approximate, losing that x = List x is unsolvable+    Con c ts   -> underConstructor c <$> freeVars' ts+    -- Pi is not guarding, since we cannot prove that A ≡ B → A is impossible.+    -- Even as we do not permit infinite type expressions,+    -- we cannot prove their absence (as Set is not inductive).+    -- Also, this is incompatible with univalence (HoTT).+    Pi a b     -> freeVars' (a,b)+    Sort s     -> freeVars' s+    Level l    -> freeVars' l+    MetaV _ ts -> flexible <$> freeVars' ts+    DontCare mt -> irrelevantly <$> freeVars' mt+    Shared p    -> freeVars' (derefPtr p)+    ExtLam cs ts -> freeVars' (cs, ts)++instance Free Type where+  freeVars' (El s t) =+    ifM ((IgnoreNot ==) <$> asks fcIgnoreSorts)+      {- then -} (freeVars' (s, t))+      {- else -} (freeVars' t)++instance Free Sort where+  freeVars' s =+    ifM ((IgnoreAll ==) <$> asks fcIgnoreSorts) mempty $ {- else -}+    case s of+      Type a     -> freeVars' a+      Prop       -> mempty+      Inf        -> mempty+      SizeUniv   -> mempty+      DLub s1 s2 -> weakly <$> freeVars' (s1, s2)++instance Free Level where+  freeVars' (Max as) = freeVars' as++instance Free PlusLevel where+  freeVars' ClosedLevel{} = mempty+  freeVars' (Plus _ l)    = freeVars' l++instance Free LevelAtom where+  freeVars' l = case l of+    MetaLevel _ vs   -> flexible <$> freeVars' vs+    NeutralLevel _ v -> freeVars' v+    BlockedLevel _ v -> freeVars' v+    UnreducedLevel v -> freeVars' v++instance Free a => Free [a] where+  freeVars' = foldMap freeVars'++instance Free a => Free (Maybe a) where+  freeVars' = foldMap freeVars'++instance (Free a, Free b) => Free (a,b) where+  freeVars' (x,y) = freeVars' x `mappend` freeVars' y++instance Free a => Free (Elim' a) where+  freeVars' (Apply a) = freeVars' a+  freeVars' (Proj{} ) = mempty++instance Free a => Free (Arg a) where+  freeVars' a = f <$> freeVars' (unArg a)+    where f = case getRelevance a of+               Irrelevant -> irrelevantly+               UnusedArg  -> unused+               _          -> id+++instance Free a => Free (Dom a) where+  freeVars' = freeVars' . unDom++instance Free a => Free (Abs a) where+  freeVars' (Abs   _ b) = bind $ freeVars' b+  freeVars' (NoAbs _ b) = freeVars' b++instance Free a => Free (Tele a) where+  freeVars' EmptyTel          = mempty+  freeVars' (ExtendTel a tel) = freeVars' (a, tel)++instance Free ClauseBody where+  freeVars' (Body t)   = freeVars' t+  freeVars' (Bind b)   = freeVars' b+  freeVars'  NoBody    = mempty++instance Free Clause where+  freeVars' = freeVars' . clauseBody++freeIn :: Free a => Nat -> a -> Bool+freeIn v t = v `Set.member` allVars (freeVars t)++freeInIgnoringSorts :: Free a => Nat -> a -> Bool+freeInIgnoringSorts v t =+  v `Set.member` allVars (freeVarsIgnore IgnoreAll t)++freeInIgnoringSortAnn :: Free a => Nat -> a -> Bool+freeInIgnoringSortAnn v t =+  v `Set.member` allVars (freeVarsIgnore IgnoreInAnnotations t)++relevantInIgnoringSortAnn :: Free a => Nat -> a -> Bool+relevantInIgnoringSortAnn v t =+  v `Set.member` relevantVars (freeVarsIgnore IgnoreInAnnotations t)++relevantIn :: Free a => Nat -> a -> Bool+relevantIn v t = v `Set.member` relevantVars (freeVarsIgnore IgnoreAll t)++-- | Is the variable bound by the abstraction actually used?+isBinderUsed :: Free a => Abs a -> Bool+isBinderUsed NoAbs{}   = False+isBinderUsed (Abs _ x) = 0 `freeIn` x
+ src/full/Agda/TypeChecking/Free/Tests.hs view
@@ -0,0 +1,125 @@+{-# LANGUAGE CPP                       #-}+{-# LANGUAGE DeriveDataTypeable        #-}+{-# LANGUAGE DeriveFoldable            #-}+{-# LANGUAGE DeriveFunctor             #-}+{-# LANGUAGE DeriveTraversable         #-}+{-# LANGUAGE NoMonomorphismRestriction #-}+{-# LANGUAGE ScopedTypeVariables       #-}+{-# LANGUAGE TemplateHaskell           #-}++#if __GLASGOW_HASKELL__ >= 710+{-# LANGUAGE FlexibleContexts #-}+#endif++{-# OPTIONS_GHC -fno-warn-missing-signatures #-}++-- | Tests for free variable computations.++module Agda.TypeChecking.Free.Tests (tests) where++import Control.Applicative ((<*>))++import Data.Functor+import Data.List as List+import Data.Maybe+import Data.Monoid++import Test.QuickCheck+import Test.QuickCheck.All++import Agda.Syntax.Common+import Agda.Syntax.Internal++import Agda.TypeChecking.Free.Lazy hiding (FlexRig(..))+import Agda.TypeChecking.Free.Lazy (FlexRig)+import qualified Agda.TypeChecking.Free.Lazy as Free++import qualified Agda.TypeChecking.Free.Old as Old++import Agda.TypeChecking.Free (freeIn)+import qualified Agda.TypeChecking.Free as New++import Agda.TypeChecking.Test.Generators+import Agda.Utils.TestHelpers++-- * Properties of 'FlexRig'++-- | Ensure the correct linear order is derived.++prop_FlexRig_min = minBound == Free.Flexible++prop_FlexRig_order = strictlyAscending+  [ Free.Flexible, Free.WeaklyRigid, Free.Unguarded, Free.StronglyRigid ]++strictlyAscending l = and $ zipWith (<) l $ tail l++-- ** 'composeFlexRig' forms an idempotent commutative monoid with+-- unit 'Unguarded' and zero 'Flexible'++prop_composeFlexRig_associative = associative composeFlexRig+prop_composeFlexRig_commutative = commutative composeFlexRig+prop_composeFlexRig_idempotent  = idempotent  composeFlexRig+prop_composeFlexRig_zero = isZero   Free.Flexible  composeFlexRig+prop_composeFlexRig_unit = identity Free.Unguarded composeFlexRig++prop_FlexRig_distributive = distributive composeFlexRig max++-- Not true (I did not expect it to be true, just for sanity I checked):+-- prop_FlexRig_distributive' = distributive max composeFlexRig++-- ** 'maxVarOcc'++prop_maxVarOcc_top = isZero   topVarOcc maxVarOcc+prop_maxVarOcc_bot = identity botVarOcc maxVarOcc++-- * Unit tests++prop_freeIn = all (0 `freeIn`)+  [ var 0+  , Lam defaultArgInfo $ Abs "x" $ var 1+  , Sort $ varSort 0+  ]++-- * Conformance with old implementation++prop_old_freeVars_Pi = same_freeVars ty++same_freeVars t = new_to_old_FV (New.freeVars t) == Old.freeVars t++old_to_new_FV (Old.FV a b c d e f) = New.FV a b c d e f+new_to_old_FV (New.FV a b c d e f) = Old.FV a b c d e f++ty = Pi (defaultDom ab) $ Abs "x" $ El (Type $ Max []) $ var 5+  where+    a  = El Prop $+           var 4+    b  = El (Type $ Max []) $+           Sort $ Type $ Max []+    ab = El (Type $ Max [ClosedLevel 1]) $+           Pi (defaultDom a) (Abs "x" b)++new_fv_ty :: New.FreeVars+new_fv_ty = New.freeVars ty++old_fv_ty :: Old.FreeVars+old_fv_ty = Old.freeVars ty+++prop_old_freeVars_Term conf x = forAll (genC conf) $ \ (t :: Term) ->+   same_freeVars t++prop_old_freeIn_Term conf x = forAll (genC conf) $ \ (t :: Term) ->+   New.freeIn x t == Old.freeIn x t+prop_old_freeIn_Type conf x = forAll (genC conf) $ \ (t :: Type) ->+   New.freeIn x t == Old.freeIn x t+++-- Template Haskell hack to make the following $quickCheckAll work+-- under ghc-7.8.+return [] -- KEEP!++-- | All tests as collected by 'quickCheckAll'.+tests :: IO Bool+tests = do+  putStrLn "Agda.TypeChecking.Free.Tests"+  $quickCheckAll
src/full/Agda/TypeChecking/InstanceArguments.hs view
@@ -250,6 +250,7 @@         UnBlock{}     -> return Nothing         Guarded{}     -> return Nothing  -- don't look inside Guarded, since the inner constraint might not fire         IsEmpty{}     -> return Nothing+        CheckSizeLtSat{} -> return Nothing         FindInScope{} -> return Nothing  -- | Given a meta @m@ of type @t@ and a list of candidates @cands@,
src/full/Agda/TypeChecking/Irrelevance.hs view
@@ -22,69 +22,6 @@ -- | data 'Relevance' --   see "Agda.Syntax.Common". -irrelevantOrUnused :: Relevance -> Bool-irrelevantOrUnused Irrelevant = True-irrelevantOrUnused UnusedArg  = True-irrelevantOrUnused NonStrict  = False-irrelevantOrUnused Relevant   = False-irrelevantOrUnused Forced{}   = False---- | @unusableRelevance rel == True@ iff we cannot use a variable of @rel@.-unusableRelevance :: Relevance -> Bool-unusableRelevance rel = NonStrict `moreRelevant` rel---- | 'Relevance' composition.---   'Irrelevant' is dominant, 'Relevant' is neutral.-composeRelevance :: Relevance -> Relevance -> Relevance-composeRelevance r r' =-  case (r, r') of-    (Irrelevant, _) -> Irrelevant-    (_, Irrelevant) -> Irrelevant-    (NonStrict, _)  -> NonStrict-    (_, NonStrict)  -> NonStrict-    (Forced b, Forced b') -> Forced (max b b')  -- prefer Big over Small-    (Forced b, _)     -> Forced b-    (_, Forced b)     -> Forced b-    (UnusedArg, _)  -> UnusedArg-    (_, UnusedArg)  -> UnusedArg-    (Relevant, Relevant) -> Relevant---- | @inverseComposeRelevance r x@ returns the most irrelevant @y@---   such that forall @x@, @y@ we have---   @x \`moreRelevant\` (r \`composeRelevance\` y)@---   iff---   @(r \`inverseComposeRelevance\` x) \`moreRelevant\` y@ (Galois connection).-inverseComposeRelevance :: Relevance -> Relevance -> Relevance-inverseComposeRelevance r x =-  case (r, x) of-    (Relevant, x)        -> x          -- going to relevant arg.: nothing changes-    _ | r == x           -> Relevant   -- because Relevant is comp.-neutral-    (Forced{}, Forced{}) -> Relevant   -- same, but (==) does not ignore Big-    (UnusedArg, x)       -> x-    (Forced{}, UnusedArg)  -> Relevant-    (Forced{}, x)          -> x-    (Irrelevant, x)      -> Relevant   -- going irrelevant: every thing usable-    (_, Irrelevant)      -> Irrelevant -- otherwise: irrelevant things remain unusable-    (NonStrict, _)       -> Relevant   -- but @NonStrict@s become usable---- | For comparing @Relevance@ ignoring @Forced@ and @UnusedArg@.-ignoreForced :: Relevance -> Relevance-ignoreForced Forced{}   = Relevant-ignoreForced UnusedArg  = Relevant-ignoreForced Relevant   = Relevant-ignoreForced NonStrict  = NonStrict-ignoreForced Irrelevant = Irrelevant---- | Irrelevant function arguments may appear non-strictly in the codomain type.-irrToNonStrict :: Relevance -> Relevance-irrToNonStrict Irrelevant = NonStrict--- irrToNonStrict NonStrict  = Relevant -- TODO: is that what we want (OR: NonStrict)  -- better be more conservative-irrToNonStrict rel        = rel--nonStrictToIrr :: Relevance -> Relevance-nonStrictToIrr NonStrict = Irrelevant-nonStrictToIrr rel       = rel- -- * Operations on 'Dom'.  -- | Prepare parts of a parameter telescope for abstraction in constructors
src/full/Agda/TypeChecking/MetaVars.hs view
@@ -41,8 +41,10 @@ import Agda.TypeChecking.MetaVars.Occurs  import Agda.Utils.Except-  ( Error(noMsg)-  , ExceptT+  ( ExceptT+#if !MIN_VERSION_transformers(0,4,1)+  , Error(noMsg)+#endif   , MonadError(throwError)   , runExceptT   )@@ -250,7 +252,7 @@   return u  newTelMeta :: Telescope -> TCM Args-newTelMeta tel = newArgsMeta (abstract tel $ El Prop $ Sort Prop)+newTelMeta tel = newArgsMeta (abstract tel $ typeDontCare)  type Condition = I.Dom Type -> Abs Type -> Bool @@ -339,6 +341,7 @@         -- that we compare against the blocked term once it's unblocked. This way         -- blocked terms can be instantiated before they are unblocked, thus making         -- constraint solving a bit more robust against instantiation order.+        -- Andreas, 2015-05-22: DontRunMetaOccursCheck to avoid Issue585-17.         v   <- newValueMeta DontRunMetaOccursCheck t         i   <- liftTCM fresh         -- This constraint is woken up when unblocking, so it doesn't need a problem id.@@ -441,61 +444,61 @@ etaExpandMeta :: [MetaKind] -> MetaId -> TCM () etaExpandMeta kinds m = whenM (isEtaExpandable m) $ do   verboseBracket "tc.meta.eta" 20 ("etaExpandMeta " ++ prettyShow m) $ do-  let waitFor x = do-        reportSDoc "tc.meta.eta" 20 $ do-          text "postponing eta-expansion of meta variable" <+>-            prettyTCM m <+>-            text "which is blocked by" <+> prettyTCM x-        listenToMeta (EtaExpand m) x-      dontExpand = do-        reportSDoc "tc.meta.eta" 20 $ do-          text "we do not expand meta variable" <+> prettyTCM m <+>-            text ("(requested was expansion of " ++ show kinds ++ ")")-  meta           <- lookupMeta m-  let HasType _ a = mvJudgement meta-  TelV tel b     <- telView a-  -- if the target type @b@ of @m@ is a meta variable @x@ itself-  -- (@NonBlocked (MetaV{})@),-  -- or it is blocked by a meta-variable @x@ (@Blocked@), we cannot-  -- eta expand now, we have to postpone this.  Once @x@ is-  -- instantiated, we can continue eta-expanding m.  This is realized-  -- by adding @m@ to the listeners of @x@.-  ifBlocked (unEl b) (\ x _ -> waitFor x) $ \ t -> case ignoreSharing t of-    lvl@(Def r es) ->-      ifM (isEtaRecord r) {- then -} (do-        let ps = fromMaybe __IMPOSSIBLE__ $ allApplyElims es-        let expand = do-              u <- withMetaInfo' meta $ newRecordMetaCtx r ps tel $ teleArgs tel-              inTopContext $ do-                verboseS "tc.meta.eta" 15 $ do-                  du <- prettyTCM u-                  reportSDoc "tc.meta.eta" 15 $ sep-                    [ text "eta expanding: " <+> pretty m <+> text " --> "-                    , nest 2 $ prettyTCM u-                    ]-                -- Andreas, 2012-03-29: No need for occurrence check etc.-                -- we directly assign the solution for the meta-                -- 2012-05-23: We also bypass the check for frozen.-                noConstraints $ assignTerm' m (telToArgs tel) u  -- should never produce any constraints-        if Records `elem` kinds then-          expand-         else if (SingletonRecords `elem` kinds) then do-           singleton <- isSingletonRecord r ps-           case singleton of-             Left x      -> waitFor x-             Right False -> dontExpand-             Right True  -> expand-          else dontExpand-      ) $ {- else -} ifM (andM [ return $ Levels `elem` kinds-                      , typeInType-                      , (Just lvl ==) <$> getBuiltin' builtinLevel-                      ]) (do-        reportSLn "tc.meta.eta" 20 $ "Expanding level meta to 0 (type-in-type)"-        -- Andreas, 2012-03-30: No need for occurrence check etc.-        -- we directly assign the solution for the meta-        noConstraints $ assignTerm m (telToArgs tel) (Level $ Max [])-     ) $ {- else -} dontExpand-    _ -> dontExpand+    let waitFor x = do+          reportSDoc "tc.meta.eta" 20 $ do+            text "postponing eta-expansion of meta variable" <+>+              prettyTCM m <+>+              text "which is blocked by" <+> prettyTCM x+          listenToMeta (EtaExpand m) x+        dontExpand = do+          reportSDoc "tc.meta.eta" 20 $ do+            text "we do not expand meta variable" <+> prettyTCM m <+>+              text ("(requested was expansion of " ++ show kinds ++ ")")+    meta           <- lookupMeta m+    let HasType _ a = mvJudgement meta+    TelV tel b     <- telView a+    -- if the target type @b@ of @m@ is a meta variable @x@ itself+    -- (@NonBlocked (MetaV{})@),+    -- or it is blocked by a meta-variable @x@ (@Blocked@), we cannot+    -- eta expand now, we have to postpone this.  Once @x@ is+    -- instantiated, we can continue eta-expanding m.  This is realized+    -- by adding @m@ to the listeners of @x@.+    ifBlocked (unEl b) (\ x _ -> waitFor x) $ \ t -> case ignoreSharing t of+      lvl@(Def r es) ->+        ifM (isEtaRecord r) {- then -} (do+          let ps = fromMaybe __IMPOSSIBLE__ $ allApplyElims es+          let expand = do+                u <- withMetaInfo' meta $ newRecordMetaCtx r ps tel $ teleArgs tel+                inTopContext $ do+                  verboseS "tc.meta.eta" 15 $ do+                    du <- prettyTCM u+                    reportSDoc "tc.meta.eta" 15 $ sep+                      [ text "eta expanding: " <+> pretty m <+> text " --> "+                      , nest 2 $ prettyTCM u+                      ]+                  -- Andreas, 2012-03-29: No need for occurrence check etc.+                  -- we directly assign the solution for the meta+                  -- 2012-05-23: We also bypass the check for frozen.+                  noConstraints $ assignTerm' m (telToArgs tel) u  -- should never produce any constraints+          if Records `elem` kinds then+            expand+           else if (SingletonRecords `elem` kinds) then do+             singleton <- isSingletonRecord r ps+             case singleton of+               Left x      -> waitFor x+               Right False -> dontExpand+               Right True  -> expand+            else dontExpand+        ) $ {- else -} ifM (andM [ return $ Levels `elem` kinds+                        , typeInType+                        , (Just lvl ==) <$> getBuiltin' builtinLevel+                        ]) (do+          reportSLn "tc.meta.eta" 20 $ "Expanding level meta to 0 (type-in-type)"+          -- Andreas, 2012-03-30: No need for occurrence check etc.+          -- we directly assign the solution for the meta+          noConstraints $ assignTerm m (telToArgs tel) (Level $ Max [])+       ) $ {- else -} dontExpand+      _ -> dontExpand  -- | Eta expand blocking metavariables of record type, and reduce the -- blocked thing.@@ -550,160 +553,159 @@ assign :: CompareDirection -> MetaId -> Args -> Term -> TCM () assign dir x args v = do -        mvar <- lookupMeta x  -- information associated with meta x-        let t = jMetaType $ mvJudgement mvar+  mvar <- lookupMeta x  -- information associated with meta x+  let t = jMetaType $ mvJudgement mvar -        -- Andreas, 2011-05-20 TODO!-        -- full normalization  (which also happens during occurs check)-        -- is too expensive! (see Issue 415)-        -- need to do something cheaper, especially if-        -- we are dealing with a Miller pattern that can be solved-        -- immediately!-        -- Ulf, 2011-08-25 DONE!-        -- Just instantiating the top-level meta, which is cheaper. The occurs-        -- check will first try without unfolding any definitions (treating-        -- arguments to definitions as flexible), if that fails it tries again-        -- with full unfolding.-        v <- instantiate v-        reportSLn "tc.meta.assign" 50 $ "MetaVars.assign: assigning to " ++ show v+  -- Andreas, 2011-05-20 TODO!+  -- full normalization  (which also happens during occurs check)+  -- is too expensive! (see Issue 415)+  -- need to do something cheaper, especially if+  -- we are dealing with a Miller pattern that can be solved+  -- immediately!+  -- Ulf, 2011-08-25 DONE!+  -- Just instantiating the top-level meta, which is cheaper. The occurs+  -- check will first try without unfolding any definitions (treating+  -- arguments to definitions as flexible), if that fails it tries again+  -- with full unfolding.+  v <- instantiate v+  reportSLn "tc.meta.assign" 50 $ "MetaVars.assign: assigning to " ++ show v -        case (ignoreSharing v, mvJudgement mvar) of-            (Sort Inf, HasType{}) -> typeError SetOmegaNotValidType-            _                     -> return ()+  case (ignoreSharing v, mvJudgement mvar) of+      (Sort Inf, HasType{}) -> typeError SetOmegaNotValidType+      _                     -> return () -        -- We don't instantiate frozen mvars-        when (mvFrozen mvar == Frozen) $ do-          reportSLn "tc.meta.assign" 25 $ "aborting: meta is frozen!"-          patternViolation+  -- We don't instantiate frozen mvars+  when (mvFrozen mvar == Frozen) $ do+    reportSLn "tc.meta.assign" 25 $ "aborting: meta is frozen!"+    patternViolation -        -- We never get blocked terms here anymore. TODO: we actually do. why?-        whenM (isBlockedTerm x) patternViolation+  -- We never get blocked terms here anymore. TODO: we actually do. why?+  whenM (isBlockedTerm x) patternViolation -        -- Andreas, 2010-10-15 I want to see whether rhs is blocked-        reportSLn "tc.meta.assign" 50 $ "MetaVars.assign: I want to see whether rhs is blocked"-        reportSDoc "tc.meta.assign" 25 $ do-          v0 <- reduceB v-          case v0 of-            Blocked m0 _ -> text "r.h.s. blocked on:" <+> prettyTCM m0-            NotBlocked{} -> text "r.h.s. not blocked"+  -- Andreas, 2010-10-15 I want to see whether rhs is blocked+  reportSLn "tc.meta.assign" 50 $ "MetaVars.assign: I want to see whether rhs is blocked"+  reportSDoc "tc.meta.assign" 25 $ do+    v0 <- reduceB v+    case v0 of+      Blocked m0 _ -> text "r.h.s. blocked on:" <+> prettyTCM m0+      NotBlocked{} -> text "r.h.s. not blocked" -        -- Turn the assignment problem @_X args >= SizeLt u@ into-        -- @_X args = SizeLt (_Y args@ and constraint-        -- @_Y args >= u@.-        subtypingForSizeLt dir x mvar t args v $ \ v -> do+  -- Turn the assignment problem @_X args >= SizeLt u@ into+  -- @_X args = SizeLt (_Y args@ and constraint+  -- @_Y args >= u@.+  subtypingForSizeLt dir x mvar t args v $ \ v -> do -        -- Normalise and eta contract the arguments to the meta. These are-        -- usually small, and simplifying might let us instantiate more metas.+    -- Normalise and eta contract the arguments to the meta. These are+    -- usually small, and simplifying might let us instantiate more metas. -        -- MOVED TO expandProjectedVars:-        -- args <- etaContract =<< normalise args+    -- MOVED TO expandProjectedVars:+    -- args <- etaContract =<< normalise args -        -- Also, try to expand away projected vars in meta args.-        expandProjectedVars args v $ \ args v -> do+    -- Also, try to expand away projected vars in meta args.+    expandProjectedVars args v $ \ args v -> do -        -- If we had the type here we could save the work we put-        -- into expanding projected variables.-        -- catchConstraint (ValueCmp CmpEq ? (MetaV m $ map Apply args) v) $ do+      -- If we had the type here we could save the work we put+      -- into expanding projected variables.+      -- catchConstraint (ValueCmp CmpEq ? (MetaV m $ map Apply args) v) $ do -        -- Andreas, 2011-04-21 do the occurs check first-        -- e.g. _1 x (suc x) = suc (_2 x y)-        -- even though the lhs is not a pattern, we can prune the y from _2-        let varsL = freeVars args-        let relVL = Set.toList $ relevantVars varsL+      -- Andreas, 2011-04-21 do the occurs check first+      -- e.g. _1 x (suc x) = suc (_2 x y)+      -- even though the lhs is not a pattern, we can prune the y from _2+      let relVL = Set.toList $ allRelevantVars args {- Andreas, 2012-04-02: DontCare no longer present-        -- take away top-level DontCare constructors-        args <- return $ map (fmap stripDontCare) args+      -- take away top-level DontCare constructors+      args <- return $ map (fmap stripDontCare) args -}-        -- Andreas, 2011-10-06 only irrelevant vars that are direct-        -- arguments to the meta, hence, can be abstracted over, may-        -- appear on the rhs.  (test/fail/Issue483b)-        -- Update 2011-03-27: Also irr. vars under record constructors.-        let fromIrrVar (Var i [])   = return [i]-            fromIrrVar (Con c vs)   =-              ifM (isNothing <$> isRecordConstructor (conName c)) (return []) $-                concat <$> mapM (fromIrrVar . {- stripDontCare .-} unArg) vs-            fromIrrVar (Shared p)   = fromIrrVar (derefPtr p)-            fromIrrVar _ = return []-        irrVL <- concat <$> mapM fromIrrVar-                   [ v | Arg info v <- args, irrelevantOrUnused (getRelevance info) ]-        reportSDoc "tc.meta.assign" 20 $-            let pr (Var n []) = text (show n)-                pr (Def c []) = prettyTCM c-                pr _          = text ".."-            in vcat-                 [ text "mvar args:" <+> sep (map (pr . unArg) args)-                 , text "fvars lhs (rel):" <+> sep (map (text . show) relVL)-                 , text "fvars lhs (irr):" <+> sep (map (text . show) irrVL)-                 ]+      -- Andreas, 2011-10-06 only irrelevant vars that are direct+      -- arguments to the meta, hence, can be abstracted over, may+      -- appear on the rhs.  (test/fail/Issue483b)+      -- Update 2011-03-27: Also irr. vars under record constructors.+      let fromIrrVar (Var i [])   = return [i]+          fromIrrVar (Con c vs)   =+            ifM (isNothing <$> isRecordConstructor (conName c)) (return []) $+              concat <$> mapM (fromIrrVar . {- stripDontCare .-} unArg) vs+          fromIrrVar (Shared p)   = fromIrrVar (derefPtr p)+          fromIrrVar _ = return []+      irrVL <- concat <$> mapM fromIrrVar+                 [ v | Arg info v <- args, irrelevantOrUnused (getRelevance info) ]+      reportSDoc "tc.meta.assign" 20 $+          let pr (Var n []) = text (show n)+              pr (Def c []) = prettyTCM c+              pr _          = text ".."+          in vcat+               [ text "mvar args:" <+> sep (map (pr . unArg) args)+               , text "fvars lhs (rel):" <+> sep (map (text . show) relVL)+               , text "fvars lhs (irr):" <+> sep (map (text . show) irrVL)+               ] -        -- Check that the x doesn't occur in the right hand side.-        -- Prune mvars on rhs such that they can only depend on varsL.-        -- Herein, distinguish relevant and irrelevant vars,-        -- since when abstracting irrelevant lhs vars, they may only occur-        -- irrelevantly on rhs.-        v <- liftTCM $ occursCheck x (relVL, irrVL) v+      -- Check that the x doesn't occur in the right hand side.+      -- Prune mvars on rhs such that they can only depend on lhs vars.+      -- Herein, distinguish relevant and irrelevant vars,+      -- since when abstracting irrelevant lhs vars, they may only occur+      -- irrelevantly on rhs.+      v <- liftTCM $ occursCheck x (relVL, irrVL) v -        reportSLn "tc.meta.assign" 15 "passed occursCheck"-        verboseS "tc.meta.assign" 30 $ do-          let n = termSize v-          when (n > 200) $ reportSDoc "tc.meta.assign" 30 $-            sep [ text "size" <+> text (show n)---                , nest 2 $ text "type" <+> prettyTCM t-                , nest 2 $ text "term" <+> prettyTCM v-                ]+      reportSLn "tc.meta.assign" 15 "passed occursCheck"+      verboseS "tc.meta.assign" 30 $ do+        let n = termSize v+        when (n > 200) $ reportSDoc "tc.meta.assign" 30 $+          sep [ text "size" <+> text (show n)+--              , nest 2 $ text "type" <+> prettyTCM t+              , nest 2 $ text "term" <+> prettyTCM v+              ] -        -- Check linearity of @ids@-        -- Andreas, 2010-09-24: Herein, ignore the variables which are not-        -- free in v-        -- Ulf, 2011-09-22: we need to respect irrelevant vars as well, otherwise-        -- we'll build solutions where the irrelevant terms are not valid-        let fvs = allVars $ freeVars v-        reportSDoc "tc.meta.assign" 20 $-          text "fvars rhs:" <+> sep (map (text . show) $ Set.toList fvs)+      -- Check linearity of @ids@+      -- Andreas, 2010-09-24: Herein, ignore the variables which are not+      -- free in v+      -- Ulf, 2011-09-22: we need to respect irrelevant vars as well, otherwise+      -- we'll build solutions where the irrelevant terms are not valid+      let fvs = allFreeVars v+      reportSDoc "tc.meta.assign" 20 $+        text "fvars rhs:" <+> sep (map (text . show) $ Set.toList fvs) -        -- Check that the arguments are variables-        mids <- do-          res <- runExceptT $ inverseSubst args-          case res of-            -- all args are variables-            Right ids -> do-              reportSDoc "tc.meta.assign" 50 $-                text "inverseSubst returns:" <+> sep (map prettyTCM ids)-              return $ Just ids-            -- we have proper values as arguments which could be cased on-            -- here, we cannot prune, since offending vars could be eliminated-            Left CantInvert  -> return Nothing-            -- we have non-variables, but these are not eliminateable-            Left NeutralArg  -> Just <$> attemptPruning x args fvs-            -- we have a projected variable which could not be eta-expanded away:-            -- same as neutral-            Left (ProjectedVar i qs) -> Just <$> attemptPruning x args fvs+      -- Check that the arguments are variables+      mids <- do+        res <- runExceptT $ inverseSubst args+        case res of+          -- all args are variables+          Right ids -> do+            reportSDoc "tc.meta.assign" 50 $+              text "inverseSubst returns:" <+> sep (map prettyTCM ids)+            return $ Just ids+          -- we have proper values as arguments which could be cased on+          -- here, we cannot prune, since offending vars could be eliminated+          Left CantInvert  -> return Nothing+          -- we have non-variables, but these are not eliminateable+          Left NeutralArg  -> Just <$> attemptPruning x args fvs+          -- we have a projected variable which could not be eta-expanded away:+          -- same as neutral+          Left (ProjectedVar i qs) -> Just <$> attemptPruning x args fvs -        case mids of-          Nothing  -> patternViolation -- Ulf 2014-07-13: actually not needed after all: attemptInertRHSImprovement x args v-          Just ids -> do-            -- Check linearity-            ids <- do-              res <- runExceptT $ checkLinearity {- (`Set.member` fvs) -} ids-              case res of-                -- case: linear-                Right ids -> return ids-                -- case: non-linear variables that could possibly be pruned-                Left ()   -> attemptPruning x args fvs+      case mids of+        Nothing  -> patternViolation -- Ulf 2014-07-13: actually not needed after all: attemptInertRHSImprovement x args v+        Just ids -> do+          -- Check linearity+          ids <- do+            res <- runExceptT $ checkLinearity {- (`Set.member` fvs) -} ids+            case res of+              -- case: linear+              Right ids -> return ids+              -- case: non-linear variables that could possibly be pruned+              Left ()   -> attemptPruning x args fvs -            -- Solve.-            m <- getContextSize-            assignMeta' m x t (length args) ids v-    where-        attemptPruning x args fvs = do-          -- non-linear lhs: we cannot solve, but prune-          killResult <- prune x args $ Set.toList fvs-          reportSDoc "tc.meta.assign" 10 $-            text "pruning" <+> prettyTCM x <+> do-            text $-              if killResult `elem` [PrunedSomething,PrunedEverything] then "succeeded"-               else "failed"-          patternViolation+          -- Solve.+          m <- getContextSize+          assignMeta' m x t (length args) ids v+  where+    attemptPruning x args fvs = do+      -- non-linear lhs: we cannot solve, but prune+      killResult <- prune x args $ Set.toList fvs+      reportSDoc "tc.meta.assign" 10 $+        text "pruning" <+> prettyTCM x <+> do+        text $+          if killResult `elem` [PrunedSomething,PrunedEverything] then "succeeded"+           else "failed"+      patternViolation  {- UNUSED -- | When faced with @_X us == D vs@ for an inert D we can solve this by@@ -878,54 +880,68 @@ -- | Turn the assignment problem @_X args <= SizeLt u@ into -- @_X args = SizeLt (_Y args)@ and constraint -- @_Y args <= u@.-subtypingForSizeLt :: CompareDirection -> MetaId -> MetaVariable -> Type -> Args -> Term -> (Term -> TCM ()) -> TCM ()+subtypingForSizeLt+  :: CompareDirection -- ^ @dir@+  -> MetaId           -- ^ The meta variable @x@.+  -> MetaVariable     -- ^ Its associated information @mvar <- lookupMeta x@.+  -> Type             -- ^ Its type @t = jMetaType $ mvJudgement mvar@+  -> Args             -- ^ Its arguments.+  -> Term             -- ^ Its to-be-assigned value @v@, such that @x args `dir` v@.+  -> (Term -> TCM ()) -- ^ Continuation taking its possibly assigned value.+  -> TCM () subtypingForSizeLt DirEq x mvar t args v cont = cont v subtypingForSizeLt dir   x mvar t args v cont = do   let fallback = cont v   -- Check whether we have built-ins SIZE and SIZELT   (mSize, mSizeLt) <- getBuiltinSize   caseMaybe mSize   fallback $ \ qSize   -> do-  caseMaybe mSizeLt fallback $ \ qSizeLt -> do-  -- Check whether v is a SIZELT-  v <- reduce v-  case ignoreSharing v of-    Def q [Apply (Arg ai u)] | q == qSizeLt -> do-      -- Clone the meta into a new size meta @y@.-      -- To this end, we swap the target of t for Size.-      TelV tel _ <- telView t-      let size = sizeType_ qSize-          t'   = telePi tel size-      y <- newMeta (mvInfo mvar) (mvPriority mvar) (mvPermutation mvar)-                   (HasType __IMPOSSIBLE__ t')-      -- Note: no eta-expansion of new meta possible/necessary.-      -- Add the size constraint @y args `dir` u@.-      let yArgs = MetaV y $ map Apply args-      addConstraint $ dirToCmp (`ValueCmp` size) dir yArgs u-      -- We continue with the new assignment problem, and install-      -- an exception handler, since we created a meta and a constraint,-      -- so we cannot fall back to the original handler.-      let xArgs = MetaV x $ map Apply args-          v'    = Def qSizeLt [Apply $ Arg ai yArgs]-          c     = dirToCmp (`ValueCmp` sizeUniv) dir xArgs v'-      catchConstraint c $ cont v'-    _ -> fallback+    caseMaybe mSizeLt fallback $ \ qSizeLt -> do+      -- Check whether v is a SIZELT+      v <- reduce v+      case ignoreSharing v of+        Def q [Apply (Arg ai u)] | q == qSizeLt -> do+          -- Clone the meta into a new size meta @y@.+          -- To this end, we swap the target of t for Size.+          TelV tel _ <- telView t+          let size = sizeType_ qSize+              t'   = telePi tel size+          y <- newMeta (mvInfo mvar) (mvPriority mvar) (mvPermutation mvar)+                       (HasType __IMPOSSIBLE__ t')+          -- Note: no eta-expansion of new meta possible/necessary.+          -- Add the size constraint @y args `dir` u@.+          let yArgs = MetaV y $ map Apply args+          addConstraint $ dirToCmp (`ValueCmp` size) dir yArgs u+          -- We continue with the new assignment problem, and install+          -- an exception handler, since we created a meta and a constraint,+          -- so we cannot fall back to the original handler.+          let xArgs = MetaV x $ map Apply args+              v'    = Def qSizeLt [Apply $ Arg ai yArgs]+              c     = dirToCmp (`ValueCmp` sizeUniv) dir xArgs v'+          catchConstraint c $ cont v'+        _ -> fallback  -- | Eta-expand bound variables like @z@ in @X (fst z)@.-expandProjectedVars :: (Normalise a, TermLike a, PrettyTCM a, NoProjectedVar a, Subst a, PrettyTCM b, Subst b) =>+expandProjectedVars :: (Normalise a, TermLike a, Show a, PrettyTCM a, NoProjectedVar a, Subst a, PrettyTCM b, Subst b) =>   a -> b -> (a -> b -> TCM c) -> TCM c expandProjectedVars args v ret = loop (args, v) where   loop (args, v) = do-    reportSDoc "tc.meta.assign.proj" 40 $ text "meta args: " <+> prettyTCM args+    reportSDoc "tc.meta.assign.proj" 45 $ text "meta args: " <+> prettyTCM args     args <- etaContract =<< normalise args-    reportSDoc "tc.meta.assign.proj" 40 $ text "norm args: " <+> prettyTCM args+    reportSDoc "tc.meta.assign.proj" 45 $ text "norm args: " <+> prettyTCM args+    reportSDoc "tc.meta.assign.proj" 85 $ text "norm args: " <+> text (show args)     let done = ret args v     case noProjectedVar args of-      Right ()              -> done+      Right ()              -> do+        reportSDoc "tc.meta.assign.proj" 40 $+          text "no projected var found in args: " <+> prettyTCM args+        done       Left (ProjVarExc i _) -> etaExpandProjectedVar i (args, v) done loop  -- | Eta-expand a de Bruijn index of record type in context and passed term(s). etaExpandProjectedVar :: (PrettyTCM a, Subst a) => Int -> a -> TCM c -> (a -> TCM c) -> TCM c etaExpandProjectedVar i v fail succeed = do+  reportSDoc "tc.meta.assign.proj" 40 $+    text "trying to expand projected variable" <+> prettyTCM (var i)   caseMaybeM (etaExpandBoundVar i) fail $ \ (delta, sigma, tau) -> do     reportSDoc "tc.meta.assign.proj" 25 $       text "eta-expanding var " <+> prettyTCM (var i) <+>@@ -939,13 +955,19 @@  data ProjVarExc = ProjVarExc Int [QName] -instance Error ProjVarExc where-  noMsg = __IMPOSSIBLE__+-- ASR (17 June 2015). Unused Error instance.+-- instance Error ProjVarExc where+--   noMsg = __IMPOSSIBLE__  instance NoProjectedVar Term where-  noProjectedVar (Var i es)-    | qs@(_:_) <- takeWhileJust id $ map isProjElim es = Left $ ProjVarExc i qs-  noProjectedVar _ = return ()+  noProjectedVar t =+    case ignoreSharing t of+      Var i es+        | qs@(_:_) <- takeWhileJust id $ map isProjElim es -> Left $ ProjVarExc i qs+      -- Andreas, 2015-09-12 Issue 1316:+      -- Also look in inductive record constructors+      Con (ConHead _ Inductive (_:_)) vs -> noProjectedVar vs+      _ -> return ()  instance NoProjectedVar a => NoProjectedVar (I.Arg a) where   noProjectedVar = Fold.mapM_ noProjectedVar@@ -1036,8 +1058,10 @@   | NeutralArg                -- ^ A potentially neutral arg: can't invert, but can try pruning.   | ProjectedVar Int [QName]  -- ^ Try to eta-expand var to remove projs. +#if !MIN_VERSION_transformers(0,4,1) instance Error InvertExcept where   noMsg = CantInvert+#endif  -- | Check that arguments @args@ to a metavar are in pattern fragment. --   Assumes all arguments already in whnf and eta-reduced.
src/full/Agda/TypeChecking/MetaVars/Mention.hs view
@@ -106,6 +106,7 @@                                   -- what metas it depends on     FindInScope{}       -> True   -- this needs to be woken up for any meta     IsEmpty r t         -> mm t+    CheckSizeLtSat t    -> mm t     where       mm v = mentionsMeta x v 
src/full/Agda/TypeChecking/MetaVars/Occurs.hs view
@@ -28,9 +28,13 @@ import Data.Set (Set) import qualified Data.Set as Set +import qualified Agda.Benchmarking as Bench+ import Agda.Syntax.Common import Agda.Syntax.Internal as I+ import Agda.TypeChecking.Monad+import qualified Agda.TypeChecking.Monad.Benchmark as Bench import Agda.TypeChecking.Reduce import Agda.TypeChecking.Pretty import Agda.TypeChecking.Free hiding (Occurrence(..))@@ -102,9 +106,24 @@ initOccursCheck :: MetaVariable -> TCM () initOccursCheck mv = modifyOccursCheckDefs . const =<<   if (miMetaOccursCheck (mvInfo mv) == DontRunMetaOccursCheck)-   then return Set.empty-   else maybe (return Set.empty) lookupMutualBlock =<< asks envMutualBlock+   then do+     reportSLn "tc.meta.occurs" 20 $+       "initOccursCheck: we do not look into definitions"+     return Set.empty+   else do+     reportSLn "tc.meta.occurs" 20 $+       "initOccursCheck: we look into the following definitions:"+     mb <- asks envMutualBlock+     case mb of+       Nothing -> do+         reportSLn "tc.meta.occurs" 20 $ "(none)"+         return Set.empty+       Just b  -> do+         ds <- lookupMutualBlock b+         reportSDoc "tc.meta.occurs" 20 $ sep $ map prettyTCM $ Set.toList ds+         return ds + -- | Is a def in the list of stuff to be checked? defNeedsChecking :: QName -> TCM Bool defNeedsChecking d = Set.member d <$> use stOccursCheckDefs@@ -184,40 +203,40 @@ occursCheck   :: (Occurs a, InstantiateFull a, PrettyTCM a)   => MetaId -> Vars -> a -> TCM a-occursCheck m xs v = liftTCM $ do+occursCheck m xs v = Bench.billTo [ Bench.Typing, Bench.OccursCheck ] $ do   mv <- lookupMeta m   initOccursCheck mv       -- TODO: Can we do this in a better way?   let redo m = m -- disableDestructiveUpdate m >> m   -- First try without normalising the term   redo (occurs NoUnfold  Top m xs v) `catchError` \_ -> do-  initOccursCheck mv-  redo (occurs YesUnfold Top m xs v) `catchError` \err -> case err of-                          -- Produce nicer error messages-    TypeError _ cl -> case clValue cl of-      MetaOccursInItself{} ->-        typeError . GenericError . show =<<-          fsep [ text ("Refuse to construct infinite term by instantiating " ++ prettyShow m ++ " to")-               , prettyTCM =<< instantiateFull v-               ]-      MetaCannotDependOn _ _ i ->-        ifM (isSortMeta m `and2M` (not <$> hasUniversePolymorphism))-        ( typeError . GenericError . show =<<-          fsep [ text ("Cannot instantiate the metavariable " ++ prettyShow m ++ " to")-               , prettyTCM v-               , text "since universe polymorphism is disabled"-               ]-        ) {- else -}-        ( typeError . GenericError . show =<<-            fsep [ text ("Cannot instantiate the metavariable " ++ prettyShow m ++ " to solution")+    initOccursCheck mv+    redo (occurs YesUnfold Top m xs v) `catchError` \err -> case err of+                            -- Produce nicer error messages+      TypeError _ cl -> case clValue cl of+        MetaOccursInItself{} ->+          typeError . GenericError . show =<<+            fsep [ text ("Refuse to construct infinite term by instantiating " ++ prettyShow m ++ " to")+                 , prettyTCM =<< instantiateFull v+                 ]+        MetaCannotDependOn _ _ i ->+          ifM (isSortMeta m `and2M` (not <$> hasUniversePolymorphism))+          ( typeError . GenericError . show =<<+            fsep [ text ("Cannot instantiate the metavariable " ++ prettyShow m ++ " to")                  , prettyTCM v-                 , text "since it contains the variable"-                 , enterClosure cl $ \_ -> prettyTCM (Var i [])-                 , text $ "which is not in scope of the metavariable or irrelevant in the metavariable but relevant in the solution"+                 , text "since universe polymorphism is disabled"                  ]-          )+          ) {- else -}+          ( typeError . GenericError . show =<<+              fsep [ text ("Cannot instantiate the metavariable " ++ prettyShow m ++ " to solution")+                   , prettyTCM v+                   , text "since it contains the variable"+                   , enterClosure cl $ \_ -> prettyTCM (Var i [])+                   , text $ "which is not in scope of the metavariable or irrelevant in the metavariable but relevant in the solution"+                   ]+            )+        _ -> throwError err       _ -> throwError err-    _ -> throwError err  instance Occurs Term where   occurs red ctx m xs v = do@@ -230,83 +249,83 @@       Blocked _ v         -> occurs' Flex v     where       occurs' ctx v = do-      reportSDoc "tc.meta.occurs" 45 $-        text ("occursCheck " ++ prettyShow m ++ " (" ++ show ctx ++ ") of ") <+> prettyTCM v-      reportSDoc "tc.meta.occurs" 70 $-        nest 2 $ text $ show v-      case v of-        Var i es   -> do-          if (i `allowedVar` xs) then Var i <$> occ (weakly ctx) es else do-            -- if the offending variable is of singleton type,-            -- eta-expand it away-            isST <- isSingletonType =<< typeOfBV i-            case isST of-              -- cannot decide, blocked by meta-var-              Left mid -> patternViolation' 70 $ "Disallowed var " ++ show i ++ " not obviously singleton"-              -- not a singleton type-              Right Nothing -> -- abort Rigid turns this error into PatternErr-                abort (strongly ctx) $ MetaCannotDependOn m (takeRelevant xs) i-              -- is a singleton type with unique inhabitant sv-              Right (Just sv) -> return $ sv `applyE` es-        Lam h f     -> Lam h <$> occ (leaveTop ctx) f-        Level l     -> Level <$> occ ctx l  -- stay in Top-        Lit l       -> return v-        DontCare v  -> dontCare <$> occurs red Irrel m (goIrrelevant xs) v-        Def d es    -> Def d <$> occDef d (leaveTop ctx) es-        Con c vs    -> Con c <$> occ (leaveTop ctx) vs  -- if strongly rigid, remain so-        Pi a b      -> uncurry Pi <$> occ (leaveTop ctx) (a,b)-        Sort s      -> Sort <$> occ (leaveTop ctx) s-        v@Shared{}  -> updateSharedTerm (occ ctx) v-        ExtLam{}    -> __IMPOSSIBLE__-        MetaV m' es -> do-            -- Check for loop-            --   don't fail hard on this, since we might still be on the top-level-            --   after some killing (Issue 442)-            ---            -- Andreas, 2013-02-18  Issue 795 demonstrates that a recursive-            -- occurrence of a meta could be solved by the identity.-            --   ? (Q A) = Q (? A)-            -- So, do not throw an error.-            -- I guess the error was there from times when occurrence check-            -- was done after the "lhs=linear variables" check, but now-            -- occurrence check comes first.-            -- WAS:-            -- when (m == m') $ if ctx == Top then patternViolation else-            --   abort ctx $ MetaOccursInItself m'-            when (m == m') $ patternViolation' 50 $ "occursCheck failed: Found " ++ prettyShow m+        reportSDoc "tc.meta.occurs" 45 $+          text ("occursCheck " ++ prettyShow m ++ " (" ++ show ctx ++ ") of ") <+> prettyTCM v+        reportSDoc "tc.meta.occurs" 70 $+          nest 2 $ text $ show v+        case v of+          Var i es   -> do+            if (i `allowedVar` xs) then Var i <$> occ (weakly ctx) es else do+              -- if the offending variable is of singleton type,+              -- eta-expand it away+              isST <- isSingletonType =<< typeOfBV i+              case isST of+                -- cannot decide, blocked by meta-var+                Left mid -> patternViolation' 70 $ "Disallowed var " ++ show i ++ " not obviously singleton"+                -- not a singleton type+                Right Nothing -> -- abort Rigid turns this error into PatternErr+                  abort (strongly ctx) $ MetaCannotDependOn m (takeRelevant xs) i+                -- is a singleton type with unique inhabitant sv+                Right (Just sv) -> return $ sv `applyE` es+          Lam h f     -> Lam h <$> occ (leaveTop ctx) f+          Level l     -> Level <$> occ ctx l  -- stay in Top+          Lit l       -> return v+          DontCare v  -> dontCare <$> occurs red Irrel m (goIrrelevant xs) v+          Def d es    -> Def d <$> occDef d (leaveTop ctx) es+          Con c vs    -> Con c <$> occ (leaveTop ctx) vs  -- if strongly rigid, remain so+          Pi a b      -> uncurry Pi <$> occ (leaveTop ctx) (a,b)+          Sort s      -> Sort <$> occ (leaveTop ctx) s+          v@Shared{}  -> updateSharedTerm (occ ctx) v+          ExtLam{}    -> __IMPOSSIBLE__+          MetaV m' es -> do+              -- Check for loop+              --   don't fail hard on this, since we might still be on the top-level+              --   after some killing (Issue 442)+              --+              -- Andreas, 2013-02-18  Issue 795 demonstrates that a recursive+              -- occurrence of a meta could be solved by the identity.+              --   ? (Q A) = Q (? A)+              -- So, do not throw an error.+              -- I guess the error was there from times when occurrence check+              -- was done after the "lhs=linear variables" check, but now+              -- occurrence check comes first.+              -- WAS:+              -- when (m == m') $ if ctx == Top then patternViolation else+              --   abort ctx $ MetaOccursInItself m'+              when (m == m') $ patternViolation' 50 $ "occursCheck failed: Found " ++ prettyShow m -            -- The arguments of a meta are in a flexible position-            (MetaV m' <$> occurs red Flex m xs es) `catchError` \err -> do-              reportSDoc "tc.meta.kill" 25 $ vcat-                [ text $ "error during flexible occurs check, we are " ++ show ctx-                , text $ show err-                ]-              case err of-                -- On pattern violations try to remove offending-                -- flexible occurrences (if not already in a flexible context)-                PatternErr{} | ctx /= Flex -> do-                  reportSLn "tc.meta.kill" 20 $-                    "oops, pattern violation for " ++ prettyShow m'-                  -- Andreas, 2014-03-02, see issue 1070:-                  -- Do not prune when meta is projected!-                  caseMaybe (allApplyElims es) (throwError err) $ \ vs -> do-                  killResult <- prune m' vs (takeRelevant xs)-                  if (killResult == PrunedEverything)-                    -- after successful pruning, restart occurs check-                    then occurs red ctx m xs =<< instantiate (MetaV m' es)-                    else throwError err-                _ -> throwError err-        where-          occ ctx v = occurs red ctx m xs v-          -- a data or record type constructor propagates strong occurrences-          -- since e.g. x = List x is unsolvable-          occDef d ctx vs = do-            def <- theDef <$> getConstInfo d-            whenM (defNeedsChecking d) $ do-              tallyDef d-              reportSLn "tc.meta.occurs" 30 $ "Checking for occurrences in " ++ show d-              metaOccurs m def-            if (defIsDataOrRecord def) then (occ ctx vs) else (occ (defArgs red ctx) vs)+              -- The arguments of a meta are in a flexible position+              (MetaV m' <$> occurs red Flex m xs es) `catchError` \err -> do+                reportSDoc "tc.meta.kill" 25 $ vcat+                  [ text $ "error during flexible occurs check, we are " ++ show ctx+                  , text $ show err+                  ]+                case err of+                  -- On pattern violations try to remove offending+                  -- flexible occurrences (if not already in a flexible context)+                  PatternErr{} | ctx /= Flex -> do+                    reportSLn "tc.meta.kill" 20 $+                      "oops, pattern violation for " ++ prettyShow m'+                    -- Andreas, 2014-03-02, see issue 1070:+                    -- Do not prune when meta is projected!+                    caseMaybe (allApplyElims es) (throwError err) $ \ vs -> do+                      killResult <- prune m' vs (takeRelevant xs)+                      if (killResult == PrunedEverything)+                        -- after successful pruning, restart occurs check+                        then occurs red ctx m xs =<< instantiate (MetaV m' es)+                        else throwError err+                  _ -> throwError err+          where+            occ ctx v = occurs red ctx m xs v+            -- a data or record type constructor propagates strong occurrences+            -- since e.g. x = List x is unsolvable+            occDef d ctx vs = do+              def <- theDef <$> getConstInfo d+              whenM (defNeedsChecking d) $ do+                tallyDef d+                reportSLn "tc.meta.occurs" 30 $ "Checking for occurrences in " ++ show d+                metaOccurs m def+              if (defIsDataOrRecord def) then (occ ctx vs) else (occ (defArgs red ctx) vs)    metaOccurs m v = do     v <- instantiate v@@ -466,17 +485,17 @@ prune m' vs xs = do   caseEitherM (runExceptT $ mapM (hasBadRigid xs) $ map unArg vs)     (const $ return PrunedNothing) $ \ kills -> do-  reportSDoc "tc.meta.kill" 10 $ vcat-    [ text "attempting kills"-    , nest 2 $ vcat-      [ text "m'    =" <+> pretty m'-      -- , text "xs    =" <+> text (show xs)-      , text "xs    =" <+> prettyList (map (prettyTCM . var) xs)-      , text "vs    =" <+> prettyList (map prettyTCM vs)-      , text "kills =" <+> text (show kills)+    reportSDoc "tc.meta.kill" 10 $ vcat+      [ text "attempting kills"+      , nest 2 $ vcat+        [ text "m'    =" <+> pretty m'+        -- , text "xs    =" <+> text (show xs)+        , text "xs    =" <+> prettyList (map (prettyTCM . var) xs)+        , text "vs    =" <+> prettyList (map prettyTCM vs)+        , text "kills =" <+> text (show kills)+        ]       ]-    ]-  killArgs kills m'+    killArgs kills m'  -- | @hasBadRigid xs v = Just True@ iff one of the rigid variables in @v@ is not in @xs@. --   Actually we can only prune if a bad variable is in the head. See issue 458.@@ -561,11 +580,6 @@             "found forbidden de Bruijn level " ++ show l         return $ Any forbidden   getAny <$> foldRigid id test v---- | Short-cutting disjunction forms a monoid.-instance Monoid (TCM Any) where-  mempty = return mempty-  ma `mappend` mb = Any <$> do (getAny <$> ma) `or2M` (getAny <$> mb)  -- | Collect the *definitely* rigid variables in a monoid. --   We need to successively reduce the expression to do this.
src/full/Agda/TypeChecking/Monad.hs view
@@ -3,7 +3,6 @@     , module Agda.TypeChecking.Monad.Closure     , module Agda.TypeChecking.Monad.Constraints     , module Agda.TypeChecking.Monad.Context-    , module Agda.TypeChecking.Monad.Debug     , module Agda.TypeChecking.Monad.Env     , module Agda.TypeChecking.Monad.Imports     , module Agda.TypeChecking.Monad.MetaVars@@ -22,7 +21,6 @@ import Agda.TypeChecking.Monad.Closure import Agda.TypeChecking.Monad.Constraints import Agda.TypeChecking.Monad.Context-import Agda.TypeChecking.Monad.Debug import Agda.TypeChecking.Monad.Env import Agda.TypeChecking.Monad.Imports import Agda.TypeChecking.Monad.MetaVars
src/full/Agda/TypeChecking/Monad/Base.hs view
@@ -1,17 +1,17 @@-{-# LANGUAGE CPP #-}-{-# LANGUAGE DeriveDataTypeable #-}-{-# LANGUAGE DeriveFoldable #-}-{-# LANGUAGE DeriveFunctor #-}-{-# LANGUAGE DeriveTraversable #-}-{-# LANGUAGE ExistentialQuantification #-}-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE CPP                        #-}+{-# LANGUAGE DeriveDataTypeable         #-}+{-# LANGUAGE DeriveFoldable             #-}+{-# LANGUAGE DeriveFunctor              #-}+{-# LANGUAGE DeriveTraversable          #-}+{-# LANGUAGE ExistentialQuantification  #-}+{-# LANGUAGE FlexibleContexts           #-}+{-# LANGUAGE FlexibleInstances          #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-}-{-# LANGUAGE MultiParamTypeClasses #-}-{-# LANGUAGE NamedFieldPuns #-}-{-# LANGUAGE Rank2Types #-}-{-# LANGUAGE ScopedTypeVariables #-}-{-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE MultiParamTypeClasses      #-}+{-# LANGUAGE NamedFieldPuns             #-}+{-# LANGUAGE Rank2Types                 #-}+{-# LANGUAGE ScopedTypeVariables        #-}+{-# LANGUAGE UndecidableInstances       #-}  module Agda.TypeChecking.Monad.Base where @@ -19,7 +19,6 @@  import Control.Arrow ((***), first, second) import qualified Control.Concurrent as C-import Control.DeepSeq import Control.Exception as E import Control.Monad.State import Control.Monad.Reader@@ -42,6 +41,10 @@ import Data.Traversable import Data.IORef +import qualified System.Console.Haskeline as Haskeline++import Agda.Benchmarking (Benchmark, Phase)+ import Agda.Syntax.Concrete (TopLevelModuleName) import Agda.Syntax.Common hiding (Arg, Dom, NamedArg, ArgInfo) import qualified Agda.Syntax.Common as Common@@ -56,31 +59,32 @@ import Agda.Syntax.Scope.Base  import Agda.TypeChecking.CompiledClause+import Agda.TypeChecking.Positivity.Occurrence  import Agda.Interaction.Exceptions -- import {-# SOURCE #-} Agda.Interaction.FindFile import Agda.Interaction.Options-import {-# SOURCE #-} Agda.Interaction.Response+import Agda.Interaction.Response   (InteractionOutputCallback, defaultInteractionOutputCallback, Response) import Agda.Interaction.Highlighting.Precise   (CompressedFile, HighlightingInfo)  import qualified Agda.Compiler.JS.Syntax as JS -import Agda.TypeChecking.Monad.Base.Benchmark (Benchmark)-import qualified Agda.TypeChecking.Monad.Base.Benchmark as Benchmark- import Agda.Utils.Except   ( Error(noMsg, strMsg)   , ExceptT   , MonadError(catchError, throwError)   ) +import Agda.Utils.Benchmark (MonadBench(..)) import Agda.Utils.FileName-import Agda.Utils.HashMap as HMap hiding (singleton)+import Agda.Utils.HashMap (HashMap)+import qualified Agda.Utils.HashMap as HMap import Agda.Utils.Hash import Agda.Utils.Lens import Agda.Utils.ListT+import Agda.Utils.Monad import Agda.Utils.Null import Agda.Utils.Permutation import Agda.Utils.Pretty@@ -194,7 +198,7 @@   { stPersistentOptions         = defaultOptions   , stDecodedModules            = Map.empty   , stInteractionOutputCallback = defaultInteractionOutputCallback-  , stBenchmark                 = Benchmark.empty+  , stBenchmark                 = empty   , stAccumStatistics           = Map.empty   } @@ -568,6 +572,23 @@   }   deriving (Typeable, Show) +instance Pretty Interface where+  pretty (Interface sourceH importedM moduleN scope insideS signature builtin+                    haskellI highlighting pragmaO patternS) =+    hang (text "Interface") 2 $ vcat+      [ text "source hash:"      <+> (pretty . show) sourceH+      , text "imported modules:" <+> (pretty . show) importedM+      , text "module name:"      <+> pretty moduleN+      , text "scope:"            <+> (pretty . show) scope+      , text "inside scope:"     <+> (pretty . show) insideS+      , text "signature:"        <+> (pretty . show) signature+      , text "builtin:"          <+> (pretty . show) builtin+      , text "Haskell imports:"  <+> (pretty . show) haskellI+      , text "highlighting:"     <+> (pretty . show) highlighting+      , text "pragma options:"   <+> (pretty . show) pragmaO+      , text "pattern syns:"     <+> (pretty . show) patternS+      ]+ -- | Combines the source hash and the (full) hashes of the imported modules. iFullHash :: Interface -> Hash iFullHash i = combineHashes $ iSourceHash i : List.map snd (iImportedModules i)@@ -623,7 +644,9 @@   | UnBlock MetaId   | Guarded Constraint ProblemId   | IsEmpty Range Type-    -- ^ the range is the one of the absurd pattern+    -- ^ The range is the one of the absurd pattern.+  | CheckSizeLtSat Type+    -- ^ Check that the 'Type' is either not a SIZELT or a non-empty SIZELT.   | FindInScope MetaId (Maybe [(Term, Type)])   deriving (Typeable, Show) @@ -884,11 +907,13 @@ data Signature = Sig       { sigSections    :: Sections       , sigDefinitions :: Definitions+      , sigRewriteRules:: RewriteRuleMap  -- ^ The rewrite rules defined in this file.       }   deriving (Typeable, Show)  type Sections    = Map ModuleName Section type Definitions = HashMap QName Definition+type RewriteRuleMap = HashMap QName RewriteRules  data Section = Section       { secTelescope :: Telescope@@ -902,7 +927,7 @@   deriving (Typeable, Show)  emptySignature :: Signature-emptySignature = Sig Map.empty HMap.empty+emptySignature = Sig Map.empty HMap.empty HMap.empty  -- | A @DisplayForm@ is in essence a rewrite rule --   @@@ -966,6 +991,12 @@     -- ^ Matches anything (e.g. irrelevant terms).   | PDef QName PElims     -- ^ Matches @f es@+  | PLam ArgInfo (Abs NLPat)+    -- ^ Matches @λ x → t@+  | PPi (Dom (Type' NLPat)) (Abs (Type' NLPat))+    -- ^ Matches @(x : A) → B@+  | PBoundVar {-# UNPACK #-} !Int PElims+    -- ^ Matches @x es@ where x is a lambda-bound variable   | PTerm Term     -- ^ Matches the term modulo β (ideally βη).   deriving (Typeable, Show)@@ -989,12 +1020,16 @@   , defName           :: QName   , defType           :: Type    -- ^ Type of the lifted definition.   , defPolarity       :: [Polarity]+    -- ^ Variance information on arguments of the definition.+    --   Does not include info for dropped parameters to+    --   projection(-like) functions and constructors.   , defArgOccurrences :: [Occurrence]+    -- ^ Positivity information on arguments of the definition.+    --   Does not include info for dropped parameters to+    --   projection(-like) functions and constructors.   , defDisplay        :: [Open DisplayForm]   , defMutual         :: MutualId   , defCompiledRep    :: CompiledRepresentation-  , defRewriteRules   :: RewriteRules-    -- ^ Rewrite rules for this symbol, (additional to function clauses).   , defInstance       :: Maybe QName     -- ^ @Just q@ when this definition is an instance of class q   , theDef            :: Defn@@ -1012,7 +1047,6 @@   , defDisplay        = defaultDisplayForm x   , defMutual         = 0   , defCompiledRep    = noCompiledRep-  , defRewriteRules   = []   , defInstance       = Nothing   , theDef            = def   }@@ -1048,21 +1082,6 @@ noCompiledRep :: CompiledRepresentation noCompiledRep = CompiledRep Nothing Nothing Nothing Nothing --- | Subterm occurrences for positivity checking.---   The constructors are listed in increasing information they provide:---   @Mixed <= JustPos <= StrictPos <= GuardPos <= Unused@---   @Mixed <= JustNeg <= Unused@.-data Occurrence-  = Mixed     -- ^ Arbitrary occurrence (positive and negative).-  | JustNeg   -- ^ Negative occurrence.-  | JustPos   -- ^ Positive occurrence, but not strictly positive.-  | StrictPos -- ^ Strictly positive occurrence.-  | GuardPos  -- ^ Guarded strictly positive occurrence (i.e., under ∞).  For checking recursive records.-  | Unused    --  ^ No occurrence.-  deriving (Typeable, Show, Eq, Ord)--instance NFData Occurrence where rnf x = seq x ()- -- | Additional information for projection 'Function's. data Projection = Projection   { projProper    :: Maybe QName@@ -1195,6 +1214,13 @@   , funCopatternLHS = False   } +-- | Checking whether we are dealing with a function yet to be defined.+isEmptyFunction :: Defn -> Bool+isEmptyFunction def =+  case def of+    Function { funClauses = [] } -> True+    _ -> False+ isCopatternLHS :: [Clause] -> Bool isCopatternLHS = List.any (List.any (isJust . A.isProjP) . clausePats) @@ -1317,6 +1343,13 @@ defCopy Defn{theDef = Function{funCopy = b}} = b defCopy _                                    = False +-- | Beware when using this function on a @def@ obtained with @getConstInfo q@!+--   If the identifier @q@ is abstract, 'getConstInfo' will turn its @def@ into+--   an 'Axiom' and you always get 'ConcreteDef', paradoxically.+--   Use it in 'IgnoreAbstractMode', like this:+--   @+--     a <- ignoreAbstractMode $ defAbstract <$> getConstInfo q+--   @ defAbstract :: Definition -> IsAbstract defAbstract d = case theDef d of     Axiom{}                   -> ConcreteDef@@ -1359,61 +1392,89 @@ -- ** Trace --------------------------------------------------------------------------- -data Call = CheckClause Type A.SpineClause (Maybe Clause)-          | forall a. CheckPattern A.Pattern Telescope Type (Maybe a)-          | CheckLetBinding A.LetBinding (Maybe ())-          | InferExpr A.Expr (Maybe (Term, Type))-          | CheckExprCall A.Expr Type (Maybe Term)-          | CheckDotPattern A.Expr Term (Maybe Constraints)-          | CheckPatternShadowing A.SpineClause (Maybe ())-          | IsTypeCall A.Expr Sort (Maybe Type)-          | IsType_ A.Expr (Maybe Type)-          | InferVar Name (Maybe (Term, Type))-          | InferDef Range QName (Maybe (Term, Type))-          | CheckArguments Range [NamedArg A.Expr] Type Type (Maybe (Args, Type))-          | CheckDataDef Range Name [A.LamBinding] [A.Constructor] (Maybe ())-          | CheckRecDef Range Name [A.LamBinding] [A.Constructor] (Maybe ())-          | CheckConstructor QName Telescope Sort A.Constructor (Maybe ())-          | CheckFunDef Range Name [A.Clause] (Maybe ())-          | CheckPragma Range A.Pragma (Maybe ())-          | CheckPrimitive Range Name A.Expr (Maybe ())-          | CheckIsEmpty Range Type (Maybe ())-          | CheckWithFunctionType A.Expr (Maybe ())-          | CheckSectionApplication Range ModuleName A.ModuleApplication (Maybe ())-          | ScopeCheckExpr C.Expr (Maybe A.Expr)-          | ScopeCheckDeclaration D.NiceDeclaration (Maybe [A.Declaration])-          | ScopeCheckLHS C.Name C.Pattern (Maybe A.LHS)-          | forall a. NoHighlighting (Maybe a)-          | forall a. SetRange Range (Maybe a)  -- ^ used by 'setCurrentRange'+data Call = CheckClause Type A.SpineClause+          | CheckPattern A.Pattern Telescope Type+          | CheckLetBinding A.LetBinding+          | InferExpr A.Expr+          | CheckExprCall A.Expr Type+          | CheckDotPattern A.Expr Term+          | CheckPatternShadowing A.SpineClause+          | IsTypeCall A.Expr Sort+          | IsType_ A.Expr+          | InferVar Name+          | InferDef Range QName+          | CheckArguments Range [NamedArg A.Expr] Type Type+          | CheckDataDef Range Name [A.LamBinding] [A.Constructor]+          | CheckRecDef Range Name [A.LamBinding] [A.Constructor]+          | CheckConstructor QName Telescope Sort A.Constructor+          | CheckFunDef Range Name [A.Clause]+          | CheckPragma Range A.Pragma+          | CheckPrimitive Range Name A.Expr+          | CheckIsEmpty Range Type+          | CheckWithFunctionType A.Expr+          | CheckSectionApplication Range ModuleName A.ModuleApplication+          | ScopeCheckExpr C.Expr+          | ScopeCheckDeclaration D.NiceDeclaration+          | ScopeCheckLHS C.Name C.Pattern+          | NoHighlighting+          | SetRange Range  -- ^ used by 'setCurrentRange'     deriving (Typeable) +instance Pretty Call where+    pretty CheckClause{}             = text "CheckClause"+    pretty CheckPattern{}            = text "CheckPattern"+    pretty InferExpr{}               = text "InferExpr"+    pretty CheckExprCall{}           = text "CheckExprCall"+    pretty CheckLetBinding{}         = text "CheckLetBinding"+    pretty IsTypeCall{}              = text "IsTypeCall"+    pretty IsType_{}                 = text "IsType_"+    pretty InferVar{}                = text "InferVar"+    pretty InferDef{}                = text "InferDef"+    pretty CheckArguments{}          = text "CheckArguments"+    pretty CheckDataDef{}            = text "CheckDataDef"+    pretty CheckRecDef{}             = text "CheckRecDef"+    pretty CheckConstructor{}        = text "CheckConstructor"+    pretty CheckFunDef{}             = text "CheckFunDef"+    pretty CheckPragma{}             = text "CheckPragma"+    pretty CheckPrimitive{}          = text "CheckPrimitive"+    pretty CheckWithFunctionType{}   = text "CheckWithFunctionType"+    pretty ScopeCheckExpr{}          = text "ScopeCheckExpr"+    pretty ScopeCheckDeclaration{}   = text "ScopeCheckDeclaration"+    pretty ScopeCheckLHS{}           = text "ScopeCheckLHS"+    pretty CheckDotPattern{}         = text "CheckDotPattern"+    pretty CheckPatternShadowing{}   = text "CheckPatternShadowing"+    pretty SetRange{}                = text "SetRange"+    pretty CheckSectionApplication{} = text "CheckSectionApplication"+    pretty CheckIsEmpty{}            = text "CheckIsEmpty"+    pretty NoHighlighting{}          = text "NoHighlighting"+ instance HasRange Call where-    getRange (CheckClause _ c _)                   = getRange c-    getRange (CheckPattern p _ _ _)                = getRange p-    getRange (InferExpr e _)                       = getRange e-    getRange (CheckExprCall e _ _)                 = getRange e-    getRange (CheckLetBinding b _)                 = getRange b-    getRange (IsTypeCall e s _)                    = getRange e-    getRange (IsType_ e _)                         = getRange e-    getRange (InferVar x _)                        = getRange x-    getRange (InferDef _ f _)                      = getRange f-    getRange (CheckArguments r _ _ _ _)            = r-    getRange (CheckDataDef i _ _ _ _)              = getRange i-    getRange (CheckRecDef i _ _ _ _)               = getRange i-    getRange (CheckConstructor _ _ _ c _)          = getRange c-    getRange (CheckFunDef i _ _ _)                 = getRange i-    getRange (CheckPragma r _ _)                   = r-    getRange (CheckPrimitive i _ _ _)              = getRange i-    getRange CheckWithFunctionType{}               = noRange-    getRange (ScopeCheckExpr e _)                  = getRange e-    getRange (ScopeCheckDeclaration d _)           = getRange d-    getRange (ScopeCheckLHS _ p _)                 = getRange p-    getRange (CheckDotPattern e _ _)               = getRange e-    getRange (CheckPatternShadowing c _)           = getRange c-    getRange (SetRange r _)                        = r-    getRange (CheckSectionApplication r _ _ _)     = r-    getRange (CheckIsEmpty r _ _)                  = r-    getRange (NoHighlighting _)                    = noRange+    getRange (CheckClause _ c)               = getRange c+    getRange (CheckPattern p _ _)            = getRange p+    getRange (InferExpr e)                   = getRange e+    getRange (CheckExprCall e _)             = getRange e+    getRange (CheckLetBinding b)             = getRange b+    getRange (IsTypeCall e s)                = getRange e+    getRange (IsType_ e)                     = getRange e+    getRange (InferVar x)                    = getRange x+    getRange (InferDef _ f)                  = getRange f+    getRange (CheckArguments r _ _ _)        = r+    getRange (CheckDataDef i _ _ _)          = getRange i+    getRange (CheckRecDef i _ _ _)           = getRange i+    getRange (CheckConstructor _ _ _ c)      = getRange c+    getRange (CheckFunDef i _ _)             = getRange i+    getRange (CheckPragma r _)               = r+    getRange (CheckPrimitive i _ _)          = getRange i+    getRange CheckWithFunctionType{}         = noRange+    getRange (ScopeCheckExpr e)              = getRange e+    getRange (ScopeCheckDeclaration d)       = getRange d+    getRange (ScopeCheckLHS _ p)             = getRange p+    getRange (CheckDotPattern e _)           = getRange e+    getRange (CheckPatternShadowing c)       = getRange c+    getRange (SetRange r)                    = r+    getRange (CheckSectionApplication r _ _) = r+    getRange (CheckIsEmpty r _)              = r+    getRange NoHighlighting                  = noRange  --------------------------------------------------------------------------- -- ** Instance table@@ -1754,7 +1815,6 @@   deriving (Show)  instance Error SplitError where-  noMsg  = strMsg ""   strMsg = GenericSplitError  data UnquoteError@@ -1973,6 +2033,7 @@         | SafeFlagPrimTrustMe     -- Language option errors         | NeedOptionCopatterns+        | NeedOptionRewriting           deriving (Typeable, Show)  -- | Distinguish error message when parsing lhs or pattern synonym, resp.@@ -1981,9 +2042,10 @@ -- instance Show TypeError where --   show _ = "<TypeError>" -- TODO: more info? +#if !MIN_VERSION_transformers(0,4,1) instance Error TypeError where-    noMsg  = strMsg ""-    strMsg = GenericError+  strMsg = GenericError+#endif  -- | Type-checking errors. @@ -1995,8 +2057,7 @@   deriving (Typeable)  instance Error TCErr where-    noMsg  = strMsg ""-    strMsg = Exception noRange . text . strMsg+  strMsg = Exception noRange . text . strMsg  instance Show TCErr where     show (TypeError _ e) = show (envRange $ clEnv e) ++ ": " ++ show (clValue e)@@ -2092,12 +2153,33 @@             writeIORef r $ oldState { stPersistentState = stPersistentState newState }       unTCM (h err) r e +-- | Interaction monad.++type IM = TCMT (Haskeline.InputT IO)++runIM :: IM a -> TCM a+runIM = mapTCMT (Haskeline.runInputT Haskeline.defaultSettings)++instance MonadError TCErr IM where+  throwError = liftIO . throwIO+  catchError m h = mapTCMT liftIO $ runIM m `catchError` (runIM . h)+ -- | Preserve the state of the failing computation. catchError_ :: TCM a -> (TCErr -> TCM a) -> TCM a catchError_ m h = TCM $ \r e ->   unTCM m r e   `E.catch` \err -> unTCM (h err) r e +-- | Execute a finalizer even when an exception is thrown.+--   Does not catch any errors.+--   In case both the regular computation and the finalizer+--   throw an exception, the one of the finalizer is propagated.+finally_ :: TCM a -> TCM b -> TCM a+finally_ m f = do+    x <- m `catchError_` \ err -> f >> throwError err+    _ <- f+    return x+ {-# 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 f (TCM m) = TCM $ \s e -> f (m s e)@@ -2166,15 +2248,15 @@ {-# INLINE thenTCMT #-}  instance MonadIO m => Functor (TCMT m) where-    fmap = fmapTCMT+  fmap = fmapTCMT  fmapTCMT :: MonadIO m => (a -> b) -> TCMT m a -> TCMT m b fmapTCMT = \f (TCM m) -> TCM $ \r e -> liftM f (m r e) {-# INLINE fmapTCMT #-}  instance MonadIO m => Applicative (TCMT m) where-    pure  = returnTCMT-    (<*>) = apTCMT+  pure  = returnTCMT+  (<*>) = apTCMT  apTCMT :: MonadIO m => TCMT m (a -> b) -> TCMT m a -> TCMT m b apTCMT = \(TCM mf) (TCM m) -> TCM $ \r e -> ap (mf r e) (m r e)@@ -2193,6 +2275,23 @@       handleIOException r e = throwIO $ IOException r e       handleException   r s = throwIO $ Exception r s +-- | We store benchmark statistics in an IORef.+--   This enables benchmarking pure computation, see+--   "Agda.Benchmarking".+instance MonadBench Phase TCM where+  getBenchmark = liftIO $ getBenchmark+  putBenchmark = liftIO . putBenchmark+  finally = finally_++instance Null (TCM Doc) where+  empty = return empty+  null = __IMPOSSIBLE__++-- | Short-cutting disjunction forms a monoid.+instance Monoid (TCM Any) where+  mempty = return mempty+  ma `mappend` mb = Any <$> do (getAny <$> ma) `or2M` (getAny <$> mb)+ patternViolation :: TCM a patternViolation = throwError PatternErr @@ -2272,3 +2371,87 @@ -- | Check whether we have an definition from an absurd lambda. isAbsurdLambdaName :: QName -> Bool isAbsurdLambdaName = (absurdLambdaName ==) . prettyShow . qnameName++---------------------------------------------------------------------------+-- * KillRange instances+---------------------------------------------------------------------------++instance KillRange Signature where+  killRange (Sig secs defs rews) = killRange2 Sig secs defs rews++instance KillRange Sections where+  killRange = fmap killRange++instance KillRange Definitions where+  killRange = fmap killRange++instance KillRange RewriteRuleMap where+  killRange = fmap killRange++instance KillRange Section where+  killRange (Section tel freeVars) = killRange2 Section tel freeVars++instance KillRange Definition where+  killRange (Defn ai name t pols occs displ mut compiled inst def) =+    killRange10 Defn ai name t pols occs displ mut compiled inst def+    -- TODO clarify: Keep the range in the defName field?++instance KillRange NLPat where+  killRange (PVar x)   = killRange1 PVar x+  killRange (PWild)    = PWild+  killRange (PDef x y) = killRange2 PDef x y+  killRange (PLam x y) = killRange2 PLam x y+  killRange (PPi x y)  = killRange2 PPi x y+  killRange (PBoundVar x y) = killRange2 PBoundVar x y+  killRange (PTerm x)  = killRange1 PTerm x++instance KillRange RewriteRule where+  killRange (RewriteRule q gamma lhs rhs t) =+    killRange5 RewriteRule q gamma lhs rhs t++instance KillRange CompiledRepresentation where+  killRange = id++instance KillRange Defn where+  killRange def =+    case def of+      Axiom -> Axiom+      Function cls comp inv mut isAbs delayed proj static copy term extlam with cop ->+        killRange13 Function cls comp inv mut isAbs delayed proj static copy term extlam with cop+      Datatype a b c d e f g h i j   -> killRange10 Datatype a b c d e f g h i j+      Record a b c d e f g h i j k l -> killRange12 Record a b c d e f g h i j k l+      Constructor a b c d e          -> killRange5 Constructor a b c d e+      Primitive a b c d              -> killRange4 Primitive a b c d++instance KillRange MutualId where+  killRange = id++instance KillRange c => KillRange (FunctionInverse' c) where+  killRange NotInjective = NotInjective+  killRange (Inverse m)  = Inverse $ killRangeMap m++instance KillRange TermHead where+  killRange SortHead     = SortHead+  killRange PiHead       = PiHead+  killRange (ConsHead q) = ConsHead $ killRange q++instance KillRange Projection where+  killRange (Projection a b c d e) = killRange4 Projection a b c d e++instance KillRange a => KillRange (Open a) where+  killRange = fmap killRange++instance KillRange DisplayForm where+  killRange (Display n vs dt) = killRange3 Display n vs dt++instance KillRange Polarity where+  killRange = id++instance KillRange DisplayTerm where+  killRange dt =+    case dt of+      DWithApp dt dts args -> killRange3 DWithApp dt dts args+      DCon q dts        -> killRange2 DCon q dts+      DDef q dts        -> killRange2 DDef q dts+      DDot v            -> killRange1 DDot v+      DTerm v           -> killRange1 DTerm v
src/full/Agda/TypeChecking/Monad/Base.hs-boot view
@@ -1,9 +1,22 @@ module Agda.TypeChecking.Monad.Base where +import Control.Applicative (Applicative)+import Control.Monad.IO.Class (MonadIO) import Data.IORef (IORef)+import Data.Map (Map) +import Agda.Syntax.Concrete.Name (TopLevelModuleName)+import Agda.Utils.FileName (AbsolutePath)+ data TCEnv data TCState newtype TCMT m a = TCM { unTCM :: IORef TCState -> TCEnv -> m a } +instance MonadIO m => Applicative (TCMT m)+instance MonadIO m => Functor (TCMT m)+instance MonadIO m => Monad (TCMT m)+instance MonadIO m => MonadIO (TCMT m)+ type TCM = TCMT IO++type ModuleToSource = Map TopLevelModuleName AbsolutePath
− src/full/Agda/TypeChecking/Monad/Base/Benchmark.hs
@@ -1,93 +0,0 @@--- | Data structures for collecting CPU usage.--module Agda.TypeChecking.Monad.Base.Benchmark where--import qualified Agda.Utils.Maybe.Strict as Strict-import Agda.Utils.Trie as Trie-import Agda.Utils.Time (CPUTime)---- | Phases to allocate CPU time to.-data Phase-  = Parsing-    -- ^ Happy parsing and operator parsing.-  | Import-    -- ^ Import chasing.-  | Deserialization-    -- ^ Reading interface files.-  | Scoping-    -- ^ Scope checking and translation to abstract syntax.-  | Typing-    -- ^ Type checking and translation to internal syntax.-  | Termination-    -- ^ Termination checking.-  | Positivity-    -- ^ Positivity checking and polarity computation.-  | Injectivity-    -- ^ Injectivity checking.-  | ProjectionLikeness-    -- ^ Checking for projection likeness.-  | Coverage-    -- ^ Coverage checking and compilation to case trees.-  | Highlighting-    -- ^ Generating highlighting info.-  | Serialization-    -- ^ Writing interface files.-  | Graph-    -- ^ Subphase for 'Termination'.-  | RecCheck-    -- ^ Subphase for 'Termination'.-  | Reduce-    -- ^ Subphase for 'Termination'.-  | Level-    -- ^ Subphase for 'Termination'.-  | Compare-    -- ^ Subphase for 'Termination'.-  | With-    -- ^ Subphase for 'Termination'.-  | ModuleName-    -- ^ Subphase for 'Import'.-  | Sort-    -- ^ Subphase for 'Serialize'.-  | BinaryEncode-    -- ^ Subphase for 'Serialize'.-  | Compress-    -- ^ Subphase for 'Serialize'.-  | Operators-    -- ^ Subphase for 'Parsing'.-  deriving (Eq, Ord, Show, Enum, Bounded)---- | Account we can bill computation time to.---   A word of 'Phase's.-type Account = [Phase]---- | Benchmark structure is a trie, mapping accounts (phases and subphases)---   to CPU time spent on their performance.-data Benchmark = Benchmark-  { currentAccount :: !(Strict.Maybe Account)-  , timings        :: !(Trie Phase CPUTime)-  }---- | Semantic editor combinator.-modifyCurrentAccount ::-  (Strict.Maybe Account -> Strict.Maybe Account) ->-  Benchmark -> Benchmark-modifyCurrentAccount f b = b { currentAccount = f (currentAccount b) }---- | Semantic editor combinator.-modifyTimings ::-  (Trie Phase CPUTime -> Trie Phase CPUTime) ->-  Benchmark -> Benchmark-modifyTimings f b = b { timings = f (timings b) }---- | Initial benchmark structure (empty).-empty :: Benchmark-empty =-  Benchmark { currentAccount = Strict.Nothing, timings = Trie.empty }---- | Add to specified CPU time account.-addCPUTime :: Account -> CPUTime -> Benchmark -> Benchmark-addCPUTime acc t = modifyTimings (Trie.insertWith (+) acc t)---- -- | Lens modifier for specific entry in benchmark structure.--- mapCPUTime :: [Phase] → (CPUTime -> CPUTime) -> Benchmark -> Benchmark--- mapCPUtime k f = inserWith
− src/full/Agda/TypeChecking/Monad/Base/KillRange.hs
@@ -1,133 +0,0 @@-{-# LANGUAGE CPP #-}-{-# LANGUAGE FlexibleInstances #-}--#if __GLASGOW_HASKELL__ <= 708-{-# LANGUAGE OverlappingInstances #-}-#endif---- | 'KillRange' instances for data structures from "Agda.TypeChecking.Monad.Base".---- Andreas, 2014-05-03-module Agda.TypeChecking.Monad.Base.KillRange where--import Data.Map (Map)-import qualified Data.Map as Map--import Agda.Syntax.Common-import Agda.Syntax.Internal-import Agda.Syntax.Position-import Agda.TypeChecking.Monad.Base-import Agda.TypeChecking.CompiledClause--import Agda.Utils.Permutation--instance KillRange Signature where-  killRange (Sig secs defs) = killRange2 Sig secs defs--instance KillRange Sections where-  killRange = fmap killRange--instance KillRange Definitions where-  killRange = fmap killRange--instance KillRange Section where-  killRange (Section tel freeVars) = killRange2 Section tel freeVars--instance KillRange Definition where-  killRange (Defn ai name t pols occs displ mut compiled rew inst def) =-    killRange11 Defn ai name t pols occs displ mut compiled rew inst def-    -- TODO clarify: Keep the range in the defName field?--instance KillRange NLPat where-  killRange (PVar x)   = killRange1 PVar x-  killRange (PWild)    = PWild-  killRange (PDef x y) = killRange2 PDef x y-  killRange (PTerm x)  = killRange1 PTerm x--instance KillRange RewriteRule where-  killRange (RewriteRule q gamma lhs rhs t) =-    killRange5 RewriteRule q gamma lhs rhs t--instance KillRange CompiledRepresentation where-  killRange = id--instance KillRange Defn where-  killRange def =-    case def of-      Axiom -> Axiom-      Function cls comp inv mut isAbs delayed proj static copy term extlam with cop ->-        killRange13 Function cls comp inv mut isAbs delayed proj static copy term extlam with cop-      Datatype a b c d e f g h i j   -> killRange10 Datatype a b c d e f g h i j-      Record a b c d e f g h i j k l -> killRange12 Record a b c d e f g h i j k l-      Constructor a b c d e          -> killRange5 Constructor a b c d e-      Primitive a b c d              -> killRange4 Primitive a b c d--instance KillRange MutualId where-  killRange = id--instance KillRange c => KillRange (FunctionInverse' c) where-  killRange NotInjective = NotInjective-  killRange (Inverse m)  = Inverse $ killRangeMap m--instance KillRange TermHead where-  killRange SortHead     = SortHead-  killRange PiHead       = PiHead-  killRange (ConsHead q) = ConsHead $ killRange q--instance KillRange Projection where-  killRange (Projection a b c d e) = killRange4 Projection a b c d e--instance KillRange Occurrence where-  killRange = id--instance KillRange a => KillRange (Open a) where-  killRange = fmap killRange--instance KillRange DisplayForm where-  killRange (Display n vs dt) = killRange3 Display n vs dt--instance KillRange Polarity where-  killRange = id--instance KillRange DisplayTerm where-  killRange dt =-    case dt of-      DWithApp dt dts args -> killRange3 DWithApp dt dts args-      DCon q dts        -> killRange2 DCon q dts-      DDef q dts        -> killRange2 DDef q dts-      DDot v            -> killRange1 DDot v-      DTerm v           -> killRange1 DTerm v---- * KillRange on CompiledClause--instance KillRange c => KillRange (WithArity c) where-  killRange = fmap killRange--instance KillRange c => KillRange (Case c) where-  killRange (Branches con lit all) = Branches-    (killRangeMap con)-    (killRangeMap lit)-    (killRange all)--instance KillRange CompiledClauses where-  killRange (Case i br) = killRange2 Case i br-  killRange (Done xs v) = killRange2 Done xs v-  killRange Fail        = Fail---- * KillRange on standard data types and Utils--instance KillRange a => KillRange (Drop a) where-  killRange = fmap killRange---- | Overlaps with @KillRange [a]@.-#if __GLASGOW_HASKELL__ >= 710-instance {-# OVERLAPPING #-} KillRange String where-#else-instance KillRange String where-#endif-  killRange = id---- | Remove ranges in keys and values of a map.-killRangeMap :: (KillRange k, KillRange v) => KillRangeT (Map k v)-killRangeMap = Map.mapKeysMonotonic killRange . Map.map killRange-
src/full/Agda/TypeChecking/Monad/Benchmark.hs view
@@ -1,31 +1,39 @@ {-# LANGUAGE CPP #-} +#if __GLASGOW_HASKELL__ <= 708+{-# LANGUAGE OverlappingInstances #-}+#endif+ -- | Measure CPU time for individual phases of the Agda pipeline.  module Agda.TypeChecking.Monad.Benchmark-  ( module Agda.TypeChecking.Monad.Base.Benchmark+  ( module Agda.Benchmarking+  , MonadBench   , getBenchmark-  , benchmarking+  , updateBenchmarkingStatus   , billTo, billPureTo   , print   ) where +import Prelude hiding (print)+ import qualified Control.Exception as E (evaluate) import Control.Monad.State+ import Data.List-import Prelude hiding (print)+ import qualified Text.PrettyPrint.Boxes as Boxes -import Agda.TypeChecking.Monad.Base.Benchmark+import Agda.Benchmarking+ import Agda.TypeChecking.Monad.Base import{-# SOURCE #-} Agda.TypeChecking.Monad.Options-import Agda.TypeChecking.Monad.State -import qualified Agda.Utils.Maybe.Strict as Strict+import Agda.Utils.Benchmark (MonadBench(..), billTo, billPureTo)+import qualified Agda.Utils.Benchmark as B+ import Agda.Utils.Monad import Agda.Utils.Pretty (prettyShow)-import Agda.Utils.Time-import qualified Agda.Utils.Trie as Trie  #include "undefined.h" import Agda.Utils.Impossible@@ -36,6 +44,13 @@ benchmarkLevel :: Int benchmarkLevel = 7 +-- | When verbosity is set or changes, we need to turn benchmarking on or off.+updateBenchmarkingStatus :: TCM ()+-- {-# SPECIALIZE updateBenchmarkingStatus :: TCM () #-}+-- updateBenchmarkingStatus :: (HasOptions m, MonadBench a m) => m ()+updateBenchmarkingStatus =+  B.setBenchmarking =<< hasVerbosity benchmarkKey benchmarkLevel+ -- | Check whether benchmarking is activated. {-# SPECIALIZE benchmarking :: TCM Bool #-} benchmarking :: MonadTCM tcm => tcm Bool@@ -45,47 +60,22 @@ -- profiling is not activated at level 7. print :: MonadTCM tcm => tcm () print = liftTCM $ whenM benchmarking $ do--  (accounts, times) <- unzip . Trie.toList . timings <$> getBenchmark--  -- Generate a table.-  let -- First column: Accounts.-      col1 = Boxes.vcat Boxes.left $-             map Boxes.text $-             "Total" : map showAccount accounts-      -- Second column: Times.-      col2 = Boxes.vcat Boxes.right $-             map (Boxes.text . prettyShow) $-             sum times : times-      table = Boxes.hsep 1 Boxes.left [col1, col2]-  reportSLn benchmarkKey benchmarkLevel $-    Boxes.render table--  where-  showAccount [] = "Miscellaneous"-  showAccount ks = intercalate "." (map show ks)---- | Add CPU time to specified account.-addToAccount :: Account -> CPUTime -> TCM ()-addToAccount k v = modifyBenchmark $ addCPUTime k v+  b <- getBenchmark+  reportSLn benchmarkKey benchmarkLevel $ prettyShow b --- | Bill a computation to a specific account.-billTo :: MonadTCM tcm => Account -> tcm a -> tcm a-billTo account m = ifNotM benchmarking m {- else -} $ do-  oldAccount <- liftTCM $ do-    oldAccount <- currentAccount <$> liftTCM getBenchmark-    modifyBenchmark $ modifyCurrentAccount $ const (Strict.Just account)-    return oldAccount-  (res, time) <- measureTime $ liftIO . E.evaluate =<< m-  liftTCM $ do-    addToAccount account time-    case oldAccount of-      Strict.Just acc -> addToAccount acc (- time)-      Strict.Nothing  -> return ()-    modifyBenchmark $ modifyCurrentAccount $ const oldAccount-  return res+-- -- | Bill a computation to a specific account.+-- {-# SPECIALIZE billTo :: Account -> TCM a -> TCM a #-}+-- billTo :: MonadTCM tcm => Account -> tcm a -> tcm a+-- billTo account = lift1TCM $ B.billTo account+   -- Andreas, 2015-05-23+   -- FAILS as lift1TCM :: (TCM a -> TCM b) -> tcm a -> tcm b+   -- cannot be implemented lazily in general.+   -- With `lazily` I mean that embedded IO computations in @tcm a@ are+   -- not executed, but passed on to @TCM a -> TCM b@ unevaluated.+   -- If they are treated strictly, then the whole benchmarking is inaccurate+   -- of course, as the computation is done before the clock is started. --- | Bill a pure computation to a specific account.-{-# SPECIALIZE billPureTo :: Account -> a -> TCM a #-}-billPureTo :: MonadTCM tcm => Account -> a -> tcm a-billPureTo k a = billTo k $ return a+-- -- | Bill a pure computation to a specific account.+-- {-# SPECIALIZE billPureTo :: Account -> a -> TCM a #-}+-- billPureTo :: MonadTCM tcm => Account -> a -> tcm a+-- billPureTo k a = billTo k $ return a
src/full/Agda/TypeChecking/Monad/Builtin.hs view
@@ -381,17 +381,21 @@  -- | Tries to build a 'CoinductionKit'. -coinductionKit :: TCM (Maybe CoinductionKit)-coinductionKit = (do+coinductionKit' :: TCM CoinductionKit+coinductionKit' = do   Def inf   _ <- ignoreSharing <$> primInf   Def sharp _ <- ignoreSharing <$> primSharp   Def flat  _ <- ignoreSharing <$> primFlat-  return $ Just $ CoinductionKit+  return $ CoinductionKit     { nameOfInf   = inf     , nameOfSharp = sharp     , nameOfFlat  = flat-    })-    `catchError` \_ -> return Nothing+    }++coinductionKit :: TCM (Maybe CoinductionKit)+coinductionKit =+  (Just <$> coinductionKit')+  `catchError` \_ -> return Nothing  ------------------------------------------------------------------------ -- * Builtin equality
src/full/Agda/TypeChecking/Monad/Constraints.hs view
@@ -130,6 +130,7 @@     isBlocking UnBlock{}     = True     isBlocking FindInScope{} = False     isBlocking IsEmpty{}     = True+    isBlocking CheckSizeLtSat{} = True  -- | Add already awake constraints addAwakeConstraints :: Constraints -> TCM ()@@ -157,4 +158,3 @@  modifySleepingConstraints  :: (Constraints -> Constraints) -> TCM () modifySleepingConstraints = modify . mapSleepingConstraints-
src/full/Agda/TypeChecking/Monad/Context.hs view
@@ -124,6 +124,9 @@   addContext = addContext . distributeF   -- addContext dom = addContext (fst $ unDom dom, snd <$> dom) +instance AddContext (Dom Type) where+  addContext dom = addContext ("_", dom)+ instance AddContext Name where   addContext x = addContext (x, dummyDom) @@ -171,7 +174,7 @@  -- | Context entries without a type have this dummy type. dummyDom :: Dom Type-dummyDom = Common.Dom defaultArgInfo $ El Prop $ Sort Prop+dummyDom = defaultDom typeDontCare  -- | Go under an abstraction. {-# SPECIALIZE underAbstraction :: Subst a => Dom Type -> Abs a -> (a -> TCM b) -> TCM b #-}
− src/full/Agda/TypeChecking/Monad/Debug.hs
@@ -1,6 +0,0 @@-module Agda.TypeChecking.Monad.Debug where--import Control.Monad.Trans ( MonadIO(liftIO) )--debug :: MonadIO m => String -> m ()-debug s = liftIO $ putStrLn s
src/full/Agda/TypeChecking/Monad/MetaVars.hs view
@@ -1,7 +1,6 @@--- GHC 7.4.2 requires this layout for the pragmas. See Issue 1460.-{-# LANGUAGE CPP,-             FlexibleInstances,-             TupleSections #-}+{-# LANGUAGE CPP               #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE TupleSections     #-}  module Agda.TypeChecking.Monad.MetaVars where @@ -27,7 +26,6 @@ import Agda.TypeChecking.Monad.Context import Agda.TypeChecking.Substitute -import Agda.Utils.Map.Compat as MapC import Agda.Utils.Functor ((<.>)) import Agda.Utils.Lens import Agda.Utils.Maybe@@ -335,9 +333,17 @@ -- * Freezing and unfreezing metas. --------------------------------------------------------------------------- +-- | Freeze all so far unfrozen metas for the duration of the given computation.+withFreezeMetas :: TCM a -> TCM a+withFreezeMetas cont = do+  ms <- Set.fromList <$> freezeMetas+  x  <- cont+  unfreezeMetas' (`Set.member` ms)+  return x+ -- | Freeze all meta variables and return the list of metas that got frozen. freezeMetas :: TCM [MetaId]-freezeMetas = execWriterT $ stMetaStore %== MapC.traverseWithKey freeze+freezeMetas = execWriterT $ stMetaStore %== Map.traverseWithKey freeze   where   freeze :: Monad m => MetaId -> MetaVariable -> WriterT [MetaId] m MetaVariable   freeze m mvar@@ -407,4 +413,3 @@  instance UnFreezeMeta a => UnFreezeMeta (Abs a) where   unfreezeMeta = Fold.mapM_ unfreezeMeta-
src/full/Agda/TypeChecking/Monad/Options.hs view
@@ -20,6 +20,7 @@ import {-# SOURCE #-} Agda.TypeChecking.Errors import Agda.TypeChecking.Monad.Base import Agda.TypeChecking.Monad.State+import Agda.TypeChecking.Monad.Benchmark import Agda.Interaction.FindFile import Agda.Interaction.Options import qualified Agda.Interaction.Options.Lenses as Lens@@ -48,6 +49,7 @@     Left err   -> __IMPOSSIBLE__     Right opts -> do       stPragmaOptions .= optPragmaOptions opts+      updateBenchmarkingStatus  -- | Sets the command line options (both persistent and pragma options -- are updated).@@ -74,6 +76,7 @@           getIncludeDirs       modify $ Lens.setCommandLineOptions opts{ optIncludeDirs = Right incs }              . Lens.setPragmaOptions (optPragmaOptions opts)+      updateBenchmarkingStatus  class (Functor m, Applicative m, Monad m) => HasOptions m where   -- | Returns the pragma options which are currently in effect.
src/full/Agda/TypeChecking/Monad/Signature.hs view
@@ -5,15 +5,18 @@  module Agda.TypeChecking.Monad.Signature where +import Prelude hiding (null)+ import Control.Arrow (first, second, (***))-import Control.Applicative+import Control.Applicative hiding (empty) import Control.Monad.State import Control.Monad.Reader -import Data.List+import Data.List hiding (null) import Data.Map (Map) import qualified Data.Map as Map import Data.Maybe+import Data.Monoid  import Agda.Syntax.Abstract.Name import Agda.Syntax.Abstract (Ren)@@ -31,21 +34,23 @@ import Agda.TypeChecking.Monad.Mutual import Agda.TypeChecking.Monad.Open import Agda.TypeChecking.Monad.State+import Agda.TypeChecking.Positivity.Occurrence import Agda.TypeChecking.Substitute import {-# SOURCE #-} Agda.TypeChecking.CompiledClause.Compile import {-# SOURCE #-} Agda.TypeChecking.Polarity import {-# SOURCE #-} Agda.TypeChecking.ProjectionLike +import Agda.Utils.Except ( Error ) import Agda.Utils.Functor+import Agda.Utils.Lens+import Agda.Utils.List import Agda.Utils.Map as Map import Agda.Utils.Maybe import Agda.Utils.Monad-import Agda.Utils.Size+import Agda.Utils.Null import Agda.Utils.Permutation import Agda.Utils.Pretty-import Agda.Utils.Lens-import Agda.Utils.List-import Agda.Utils.Except ( Error )+import Agda.Utils.Size import qualified Agda.Utils.HashMap as HMap  #include "undefined.h"@@ -130,7 +135,10 @@ unionSignatures :: [Signature] -> Signature unionSignatures ss = foldr unionSignature emptySignature ss   where-    unionSignature (Sig a b) (Sig c d) = Sig (Map.union a c) (HMap.union b d)+    unionSignature (Sig a b c) (Sig a' b' c') =+      Sig (Map.union a a')+          (HMap.union b b')              -- definitions are unique (in at most one module)+          (HMap.unionWith mappend c c')  -- rewrite rules are accumulated  -- | Add a section to the signature. addSection :: ModuleName -> Nat -> TCM ()@@ -157,9 +165,11 @@     add args top x vs0 = do       def <- getConstInfo x       let cs = defClauses def+          isCopy = defCopy def       case cs of         [ Clause{ namedClausePats = pats, clauseBody = b } ]-          | all (isVar . namedArg) pats+          | isCopy+          , all (isVar . namedArg) pats           , Just (m, Def y es) <- strip (b `apply` vs0)           , Just vs <- mapM isApplyElim es -> do               let ps = raise 1 $ map unArg vs@@ -169,7 +179,8 @@               addDisplayForm y df               add args top y vs         _ -> do-              let reason = case cs of+          let reason = if not isCopy then "not a copy" else+                  case cs of                     []    -> "no clauses"                     _:_:_ -> "many clauses"                     [ Clause{ clauseBody = b } ] -> case strip b of@@ -179,8 +190,9 @@                         | m > length args -> "too many args"                         | otherwise       -> "args=" ++ show args ++ " es=" ++ show es                       Just (m, v) -> "not a def body"-              reportSLn "tc.display.section" 30 $ "no display form from " ++ show x ++ " because " ++ reason-              return ()+          reportSLn "tc.display.section" 30 $+            "no display form from " ++ show x ++ " because " ++ reason+     strip (Body v)   = return (0, unSpine v)     strip  NoBody    = Nothing     strip (Bind b)   = do@@ -239,34 +251,38 @@       copyDef' np def       where         copyDef' np d = do-          reportSLn "tc.mod.apply" 80 $ "making new def for " ++ show y ++ " from " ++ show x ++ " with " ++ show np ++ " args"+          reportSLn "tc.mod.apply" 60 $ "making new def for " ++ show y ++ " from " ++ show x ++ " with " ++ show np ++ " args " ++ show abstr           reportSLn "tc.mod.apply" 80 $             "args = " ++ show ts' ++ "\n" ++             "old type = " ++ prettyShow (defType d) ++ "\n" ++             "new type = " ++ prettyShow t           addConstant y =<< nd y           makeProjection y+          -- Issue1238: the copied def should be an 'instance' if the original+          -- def is one. Skip constructors since the original constructor will+          -- still work as an instance.+          unless isCon $ whenJust inst $ \ c -> addNamedInstance y c           -- Set display form for the old name if it's not a constructor. {- BREAKS fail/Issue478           -- Andreas, 2012-10-20 and if we are not an anonymous module           -- unless (isAnonymousModuleName new || isCon || size ptel > 0) $ do -}-          -- Issue1238: the copied def should be an 'instance' if the original-          -- def is one. Skip constructors since the original constructor will-          -- still work as an instance.-          unless isCon $ whenJust inst $ \ c -> addNamedInstance y c-          unless (isCon || size ptel > 0) $ do+          -- BREAKS fail/Issue1643a+          -- -- Andreas, 2015-09-09 Issue 1643:+          -- -- Do not add a display form for a bare module alias.+          -- when (not isCon && size ptel == 0 && not (null ts)) $ do+          when (not isCon && size ptel == 0) $ do             addDisplayForms y           where             ts' = take np ts             t   = defType d `apply` ts'             pol = defPolarity d `apply` ts'             occ = defArgOccurrences d `apply` ts'-            rew = defRewriteRules d `apply` ts'             inst = defInstance d+            abstr = defAbstract d             -- the name is set by the addConstant function             nd :: QName -> TCM Definition-            nd y = Defn (defArgInfo d) y t pol occ [] (-1) noCompiledRep rew inst <$> def  -- TODO: mutual block?+            nd y = Defn (defArgInfo d) y t pol occ [] (-1) noCompiledRep inst <$> def  -- TODO: mutual block?             oldDef = theDef d             isCon  = case oldDef of { Constructor{} -> True ; _ -> False }             mutual = case oldDef of { Function{funMutual = m} -> m              ; _ -> [] }@@ -309,7 +325,7 @@                         , funDelayed        = NotDelayed                         , funInv            = NotInjective                         , funMutual         = mutual-                        , funAbstr          = ConcreteDef+                        , funAbstr          = ConcreteDef -- OR: abstr -- ?!                         , funProjection     = proj                         , funStatic         = False                         , funCopy           = True@@ -411,10 +427,21 @@   -- | Lookup the definition of a name. The result is a closed thing, all free   --   variables have been abstracted over.   getConstInfo :: QName -> m Definition+  -- | Lookup the rewrite rules with the given head symbol.+  getRewriteRulesFor :: QName -> m RewriteRules  {-# SPECIALIZE getConstInfo :: QName -> TCM Definition #-} +defaultGetRewriteRulesFor :: (Monad m) => m TCState -> QName -> m RewriteRules+defaultGetRewriteRulesFor getTCState q = do+  st <- getTCState+  let sig = st^.stSignature+      imp = st^.stImports+      look s = HMap.lookup q $ sigRewriteRules s+  return $ mconcat $ catMaybes [look sig, look imp]+ instance HasConstInfo (TCMT IO) where+  getRewriteRulesFor = defaultGetRewriteRulesFor get   getConstInfo q = join $ pureTCM $ \st env ->     let defs  = sigDefinitions $ st^.stSignature         idefs = sigDefinitions $ st^.stImports@@ -439,16 +466,13 @@             _             -> q            dropLastModule q@QName{ qnameModule = m } =-            q{ qnameModule = mnameFromList $ init' $ mnameToList m }--          init' [] = {-'-} __IMPOSSIBLE__-          init' xs = init xs+            q{ qnameModule = mnameFromList $ ifNull (mnameToList m) __IMPOSSIBLE__ init }  instance (HasConstInfo m, Error err) => HasConstInfo (ExceptionT err m) where   getConstInfo = lift . getConstInfo+  getRewriteRulesFor = lift . getRewriteRulesFor  {-# INLINE getConInfo #-}-{-# SPECIALIZE getConstInfo :: QName -> TCM Definition #-} getConInfo :: MonadTCM tcm => ConHead -> tcm Definition getConInfo = liftTCM . getConstInfo . conName @@ -466,50 +490,20 @@ setPolarity :: QName -> [Polarity] -> TCM () setPolarity q pol = modifySignature $ updateDefinition q $ updateDefPolarity $ const pol --- | Return a finite list of argument occurrences.-getArgOccurrences :: QName -> TCM [Occurrence]-getArgOccurrences d = defArgOccurrences <$> getConstInfo d--{- OLD--- | Return a finite list of argument occurrences.-getArgOccurrences :: QName -> TCM [Occurrence]-getArgOccurrences d = do-  def <- theDef <$> getConstInfo d-  return $ getArgOccurrences_ def--getArgOccurrences_ :: Defn -> [Occurrence]-getArgOccurrences_ def = case def of-    Function { funArgOccurrences  = os } -> os-    Datatype { dataArgOccurrences = os } -> os-    Record   { recArgOccurrences  = os } -> os-    Constructor{}                        -> [] -- repeat StrictPos-    _                                    -> [] -- repeat Mixed--}-+-- | Get argument occurrence info for argument @i@ of definition @d@ (never fails). getArgOccurrence :: QName -> Nat -> TCM Occurrence getArgOccurrence d i = do   def <- getConstInfo d   return $ case theDef def of     Constructor{} -> StrictPos-    _             -> (defArgOccurrences def ++ repeat Mixed) !! i+    _             -> fromMaybe Mixed $ defArgOccurrences def !!! i  setArgOccurrences :: QName -> [Occurrence] -> TCM ()-setArgOccurrences d os =-  modifySignature $ updateDefinition d $ updateDefArgOccurrences $ const os+setArgOccurrences d os = modifyArgOccurrences d $ const os -{- OLD-getArgOccurrence :: QName -> Nat -> TCM Occurrence-getArgOccurrence d i = do-  def <- theDef <$> getConstInfo d-  return $ case def of-    Function { funArgOccurrences  = os } -> look i os-    Datatype { dataArgOccurrences = os } -> look i os-    Record   { recArgOccurrences  = os } -> look i os-    Constructor{}                        -> StrictPos-    _                                    -> Mixed-  where-    look i os = (os ++ repeat Mixed) !! fromIntegral i--}+modifyArgOccurrences :: QName -> ([Occurrence] -> [Occurrence]) -> TCM ()+modifyArgOccurrences d f =+  modifySignature $ updateDefinition d $ updateDefArgOccurrences f  -- | Get the mutually recursive identifiers. getMutual :: QName -> TCM [QName]@@ -619,20 +613,43 @@                                        -- Allowing destructive updates when ignoring                                        -- abstract may break the abstraction. +-- | Enter concrete or abstract mode depending on whether the given identifier+--   is concrete or abstract.+inConcreteOrAbstractMode :: QName -> TCM a -> TCM a+inConcreteOrAbstractMode q cont = do+  -- Andreas, 2015-07-01: If we do not ignoreAbstractMode here,+  -- we will get ConcreteDef for abstract things, as they are turned into axioms.+  a <- ignoreAbstractMode $ defAbstract <$> getConstInfo q+  case a of+    AbstractDef -> inAbstractMode cont+    ConcreteDef -> inConcreteMode cont+ -- | Check whether a name might have to be treated abstractly (either if we're --   'inAbstractMode' or it's not a local name). Returns true for things not --   declared abstract as well, but for those 'makeAbstract' will have no effect. treatAbstractly :: MonadReader TCEnv m => QName -> m Bool treatAbstractly q = asks $ treatAbstractly' q +-- | Andreas, 2015-07-01:+--   If the @current@ module is a weak suffix of the identifier module,+--   we can see through its abstract definition if we are abstract.+--   (Then @treatAbstractly'@ returns @False@).+--+--   If I am not mistaken, then we cannot see definitions in the @where@+--   block of an abstract function from the perspective of the function,+--   because then the current module is a strict prefix of the module+--   of the local identifier.+--   This problem is fixed by removing trailing anonymous module name parts+--   (underscores) from both names. treatAbstractly' :: QName -> TCEnv -> Bool treatAbstractly' q env = case envAbstractMode env of   ConcreteMode       -> True   IgnoreAbstractMode -> False   AbstractMode       -> not $ current == m || current `isSubModuleOf` m   where-    current = envCurrentModule env-    m       = qnameModule q+    current = dropAnon $ envCurrentModule env+    m       = dropAnon $ qnameModule q+    dropAnon (MName ms) = MName $ reverse $ dropWhile isNoName $ reverse ms  -- | Get type of a constant, instantiated to the current context. typeOfConst :: QName -> TCM Type@@ -654,6 +671,27 @@             Datatype{dataSort = s} -> return s             _                      -> fail $ "Expected " ++ show q ++ " to be a datatype." +-- | The number of parameters of a definition.+defPars :: Definition -> Int+defPars d = case theDef d of+    Axiom{}                  -> 0+    def@Function{}           -> projectionArgs def+    Datatype  {dataPars = n} -> n+    Record     {recPars = n} -> n+    Constructor{conPars = n} -> n+    Primitive{}              -> 0++-- | The number of dropped parameters for a definition.+--   0 except for projection(-like) functions and constructors.+droppedPars :: Definition -> Int+droppedPars d = case theDef d of+    Axiom{}                  -> 0+    def@Function{}           -> projectionArgs def+    Datatype  {dataPars = _} -> 0  -- not dropped+    Record     {recPars = _} -> 0  -- not dropped+    Constructor{conPars = n} -> n+    Primitive{}              -> 0+ -- | Is it the name of a record projection? {-# SPECIALIZE isProjection :: QName -> TCM (Maybe Projection) #-} isProjection :: HasConstInfo m => QName -> m (Maybe Projection)@@ -672,9 +710,17 @@ isProperProjection d = caseMaybe (isProjection_ d) False $ \ isP ->   if projIndex isP <= 0 then False else isJust $ projProper isP --- | Number of dropped initial arguments.+-- | Number of dropped initial arguments of a projection(-like) function. projectionArgs :: Defn -> Int projectionArgs = maybe 0 (max 0 . pred . projIndex) . isProjection_++-- | Check whether a definition uses copatterns.+usesCopatterns :: QName -> TCM Bool+usesCopatterns q = do+  d <- theDef <$> getConstInfo q+  return $ case d of+    Function{ funCopatternLHS = b } -> b+    _ -> False  -- | Apply a function @f@ to its first argument, producing the proper --   postfix projection if @f@ is a projection.
src/full/Agda/TypeChecking/Monad/SizedTypes.hs view
@@ -20,9 +20,11 @@ import Agda.TypeChecking.Monad.Builtin import Agda.TypeChecking.Monad.Signature import Agda.TypeChecking.Monad.State+import Agda.TypeChecking.Positivity.Occurrence import Agda.TypeChecking.Substitute ()  import Agda.Utils.Except ( MonadError(catchError) )+import Agda.Utils.List import Agda.Utils.Monad  #include "undefined.h"@@ -135,7 +137,9 @@             | n == 0    = return v             | otherwise = do   Def suc [] <- ignoreSharing <$> primSizeSuc-  return $ iterate (sizeSuc_ suc) v !! n+  return $ case iterate (sizeSuc_ suc) v !!! n of+             Nothing -> __IMPOSSIBLE__+             Just t  -> t  sizeSuc_ :: QName -> Term -> Term sizeSuc_ suc v = Def suc [Apply $ defaultArg v]@@ -174,6 +178,7 @@   | DSizeVar Nat Offset   | DSizeMeta MetaId Elims Offset   | DOtherSize Term+  deriving (Show)  data SizeViewComparable a   = NotComparable
src/full/Agda/TypeChecking/Monad/State.hs view
@@ -8,10 +8,14 @@ import Control.Applicative import qualified Control.Exception as E import Control.Monad.State-import Data.Set (Set)+ import Data.Map as Map+import Data.Monoid+import Data.Set (Set) import qualified Data.Set as Set +import Agda.Benchmarking+ -- import {-# SOURCE #-} Agda.Interaction.Response import Agda.Interaction.Response   (InteractionOutputCallback, Response)@@ -24,8 +28,8 @@ import Agda.Syntax.Internal  import Agda.TypeChecking.Monad.Base-import Agda.TypeChecking.Monad.Base.Benchmark import {-# SOURCE #-} Agda.TypeChecking.Monad.Options+import Agda.TypeChecking.Positivity.Occurrence  import Agda.Utils.Hash import qualified Agda.Utils.HashMap as HMap@@ -184,6 +188,14 @@   r <- m   setSignature sig0   return r++-- ** Modifiers for rewrite rules++mapRewriteRules :: (RewriteRuleMap -> RewriteRuleMap) -> Signature -> Signature+mapRewriteRules f sig = sig { sigRewriteRules = f (sigRewriteRules sig) }++addRewriteRulesFor :: QName -> RewriteRules -> Signature -> Signature+addRewriteRulesFor f rews = mapRewriteRules $ HMap.insertWith mappend f rews  -- ** Modifiers for parts of the signature 
src/full/Agda/TypeChecking/Monad/Trace.hs view
@@ -18,6 +18,7 @@ import Agda.Utils.Maybe import Agda.Utils.Monad import Agda.Utils.Null+import Agda.Utils.Pretty (prettyShow)  #include "undefined.h" import Agda.Utils.Impossible@@ -28,21 +29,21 @@  interestingCall :: Closure Call -> Bool interestingCall cl = case clValue cl of-    InferVar _ _              -> False-    InferDef _ _ _            -> False-    CheckArguments _ [] _ _ _ -> False-    SetRange _ _              -> False-    NoHighlighting {}         -> False-    _                         -> True+    InferVar{}              -> False+    InferDef{}              -> False+    CheckArguments _ [] _ _ -> False+    SetRange{}              -> False+    NoHighlighting{}        -> False+    _                       -> True -traceCallM :: MonadTCM tcm => tcm (Maybe r -> Call) -> tcm a -> tcm a+traceCallM :: MonadTCM tcm => tcm Call -> tcm a -> tcm a traceCallM mkCall m = flip traceCall m =<< mkCall  -- | Record a function call in the trace.-{-# SPECIALIZE traceCall :: (Maybe r -> Call) -> TCM a -> TCM a #-}-traceCall :: MonadTCM tcm => (Maybe r -> Call) -> tcm a -> tcm a+{-# SPECIALIZE traceCall :: Call -> TCM a -> TCM a #-}+traceCall :: MonadTCM tcm => Call -> tcm a -> tcm a traceCall mkCall m = do-  let call      = mkCall Nothing+  let call      = mkCall       callRange = getRange call   -- Andreas, 2015-02-09 Make sure we do not set a range   -- outside the current file@@ -51,7 +52,8 @@       whenJustM (asks envCurrentPath) $ \ currentFile -> do         unlessNull (filter (/= currentFile) files) $ \ wrongFiles -> do           reportSLn "impossible" 10 $-            "Someone is trying to set the current range to " ++ show callRange +++            prettyShow call +++            " is trying to set the current range to " ++ show callRange ++             " which is outside of the current file " ++ show currentFile           __IMPOSSIBLE__   cl <- liftTCM $ buildClosure call@@ -69,46 +71,42 @@   where   -- | Should the given call trigger interactive highlighting?   highlightCall call = case call of-    CheckClause _ _ _               -> True-    CheckPattern _ _ _ _            -> True-    CheckLetBinding _ _             -> True-    InferExpr _ _                   -> True-    CheckExprCall _ _ _             -> True-    CheckDotPattern _ _ _           -> True-    CheckPatternShadowing _ _       -> True-    IsTypeCall _ _ _                -> True-    IsType_ _ _                     -> True-    InferVar _ _                    -> True-    InferDef _ _ _                  -> True-    CheckArguments _ _ _ _ _        -> True-    CheckDataDef _ _ _ _ _          -> True-    CheckRecDef _ _ _ _ _           -> True-    CheckConstructor _ _ _ _ _      -> True-    CheckFunDef _ _ _ _             -> True-    CheckPragma _ _ _               -> True-    CheckPrimitive _ _ _ _          -> True-    CheckIsEmpty _ _ _              -> True-    CheckWithFunctionType _ _       -> True-    CheckSectionApplication _ _ _ _ -> True-    ScopeCheckExpr _ _              -> False-    ScopeCheckDeclaration _ _       -> False-    ScopeCheckLHS _ _ _             -> False-    NoHighlighting _                -> True-    SetRange _ _                    -> False--  isNoHighlighting (NoHighlighting {}) = True-  isNoHighlighting _                   = False+    CheckClause{}             -> True+    CheckPattern{}            -> True+    CheckLetBinding{}         -> True+    InferExpr{}               -> True+    CheckExprCall{}           -> True+    CheckDotPattern{}         -> True+    CheckPatternShadowing{}   -> True+    IsTypeCall{}              -> True+    IsType_{}                 -> True+    InferVar{}                -> True+    InferDef{}                -> True+    CheckArguments{}          -> True+    CheckDataDef{}            -> True+    CheckRecDef{}             -> True+    CheckConstructor{}        -> True+    CheckFunDef{}             -> True+    CheckPragma{}             -> True+    CheckPrimitive{}          -> True+    CheckIsEmpty{}            -> True+    CheckWithFunctionType{}   -> True+    CheckSectionApplication{} -> True+    ScopeCheckExpr{}          -> False+    ScopeCheckDeclaration{}   -> False+    ScopeCheckLHS{}           -> False+    NoHighlighting{}          -> True+    SetRange{}                -> False -{-# SPECIALIZE traceCall_ :: (Maybe () -> Call) -> TCM r -> TCM r #-}-traceCall_ :: MonadTCM tcm => (Maybe () -> Call) -> tcm r -> tcm r-traceCall_ mkCall = traceCall (mkCall . fmap (const ()))+  isNoHighlighting NoHighlighting{} = True+  isNoHighlighting _                = False -{-# SPECIALIZE traceCallCPS :: (Maybe r -> Call) -> (r -> TCM a) -> ((r -> TCM a) -> TCM b) -> TCM b #-}-traceCallCPS :: MonadTCM tcm => (Maybe r -> Call) -> (r -> tcm a) -> ((r -> tcm a) -> tcm b) -> tcm b+{-# SPECIALIZE traceCallCPS :: Call -> (r -> TCM a) -> ((r -> TCM a) -> TCM b) -> TCM b #-}+traceCallCPS :: MonadTCM tcm => Call -> (r -> tcm a) -> ((r -> tcm a) -> tcm b) -> tcm b traceCallCPS mkCall ret cc = traceCall mkCall (cc ret) -{-# SPECIALIZE traceCallCPS_ :: (Maybe () -> Call) -> TCM a -> (TCM a -> TCM b) -> TCM b #-}-traceCallCPS_ :: MonadTCM tcm => (Maybe () -> Call) -> tcm a -> (tcm a -> tcm b) -> tcm b+{-# SPECIALIZE traceCallCPS_ :: Call -> TCM a -> (TCM a -> TCM b) -> TCM b #-}+traceCallCPS_ :: MonadTCM tcm => Call -> tcm a -> (tcm a -> tcm b) -> tcm b traceCallCPS_ mkCall ret cc =     traceCallCPS mkCall (const ret) (\k -> cc $ k ()) 
src/full/Agda/TypeChecking/Patterns/Abstract.hs view
@@ -41,7 +41,7 @@           let zero  = A.ConP cinfo (A.AmbQ [setRange r $ conName z]) []               suc p = A.ConP cinfo (A.AmbQ [setRange r $ conName s]) [defaultNamedArg p]               info  = A.PatRange r-              cinfo = A.ConPatInfo False info+              cinfo = A.ConPatInfo ConPCon info               p'    = foldr ($) zero $ genericReplicate n suc           return $ foldr (A.AsP info) p' xs       _ -> return p@@ -73,7 +73,6 @@     A.VarP{}             -> return p     A.WildP{}            -> return p     A.DotP{}             -> return p-    A.ImplicitP{}        -> return p     A.LitP{}             -> return p     A.AbsurdP{}          -> return p     A.ConP i ds as       -> A.ConP i ds <$> expandPatternSynonyms as@@ -89,7 +88,7 @@         instPatternSyn :: A.PatternSynDefn -> [A.NamedArg A.Pattern] -> TCM A.Pattern         instPatternSyn (ns, p) as = do           p <- expandPatternSynonyms p-          case A.insertImplicitPatSynArgs (A.ImplicitP . PatRange) (getRange x) ns as of+          case A.insertImplicitPatSynArgs (A.WildP . PatRange) (getRange x) ns as of             Nothing       -> typeError $ BadArgumentsToPatternSynonym x             Just (_, _:_) -> typeError $ TooFewArgumentsToPatternSynonym x             Just (s, [])  -> return $ setRange (getRange i) $ A.substPattern s p
src/full/Agda/TypeChecking/Patterns/Match.hs view
@@ -1,7 +1,6 @@--- GHC 7.4.2 requires this layout for the pragmas. See Issue 1460.-{-# LANGUAGE CPP,-             DeriveFunctor,-             ScopedTypeVariables #-}+{-# LANGUAGE CPP                 #-}+{-# LANGUAGE DeriveFunctor       #-}+{-# LANGUAGE ScopedTypeVariables #-}  -- | Pattern matcher used in the reducer for clauses that --   have not been compiled to case trees yet.@@ -184,12 +183,17 @@         -- 2) whatInduction c sometimes crashes because c may point to         --    an axiom at this stage (if we are checking the         --    projection functions for a record type).+{-         w <- case ignoreSharing <$> w of                NotBlocked r (Def f es) ->   -- Andreas, 2014-06-12 TODO: r == ReallyNotBlocked sufficient?                  unfoldDefinitionE True reduceB' (Def f []) f es                    -- reduceB is used here because some constructors                    -- are actually definitions which need to be                    -- unfolded (due to open public).+               _ -> return w+-}+        w <- case w of+               NotBlocked r u -> unfoldCorecursion u  -- Andreas, 2014-06-12 TODO: r == ReallyNotBlocked sufficient?                _ -> return w         let v = ignoreBlocking w             arg = Arg info v  -- the reduced argument
src/full/Agda/TypeChecking/Polarity.hs view
@@ -11,6 +11,7 @@ import Data.Maybe import Data.Traversable (traverse) +import Agda.Syntax.Abstract.Name import Agda.Syntax.Common import Agda.Syntax.Internal as I @@ -20,10 +21,12 @@ import Agda.TypeChecking.Telescope import Agda.TypeChecking.Reduce import Agda.TypeChecking.Free hiding (Occurrence(..))+import Agda.TypeChecking.Positivity.Occurrence  import Agda.Interaction.Options  import Agda.Utils.List+import Agda.Utils.Maybe ( whenNothingM ) import Agda.Utils.Monad import Agda.Utils.Permutation import Agda.Utils.Size@@ -77,9 +80,10 @@ nextPolarity []       = (Invariant, []) nextPolarity (p : ps) = (p, ps) --- | Replace 'Nonvariant' by 'Invariant'.+-- | Replace 'Nonvariant' by 'Covariant'.+--   (Arbitrary bias, but better than 'Invariant', see issue 1596). purgeNonvariant :: [Polarity] -> [Polarity]-purgeNonvariant = map (\ p -> if p == Nonvariant then Invariant else p)+purgeNonvariant = map (\ p -> if p == Nonvariant then Covariant else p)  ------------------------------------------------------------------------ -- * Computing the polarity of a symbol.@@ -87,13 +91,13 @@  -- | Main function of this module. computePolarity :: QName -> TCM ()-computePolarity x = do+computePolarity x = inConcreteOrAbstractMode x $ do   reportSLn "tc.polarity.set" 25 $ "Computing polarity of " ++ show x    -- get basic polarity from positivity analysis   def      <- getConstInfo x-  let pol0 = map polFromOcc $ defArgOccurrences def---  let pol0 = map polFromOcc $ getArgOccurrences_ $ theDef def+  let npars = droppedPars def+  let pol0 = replicate npars Nonvariant ++ map polFromOcc (defArgOccurrences def)   reportSLn "tc.polarity.set" 15 $ "Polarity of " ++ show x ++ " from positivity: " ++ show pol0  {-@@ -118,25 +122,31 @@   -- t <- instantiateFull t -- Andreas, 2014-04-11 Issue 1099: needed for   --                        -- variable occurrence test in  dependentPolarity.   reportSDoc "tc.polarity.set" 15 $ text "Refining polarity with type " <+> prettyTCM t-  pol <- enablePhantomTypes (theDef def) <$> dependentPolarity t pol1+  pol <- dependentPolarity t (enablePhantomTypes (theDef def) pol1) pol1   reportSLn "tc.polarity.set" 10 $ "Polarity of " ++ show x ++ ": " ++ show pol    -- set the polarity in the signature-  setPolarity x $ pol -- purgeNonvariant pol -- temporarily disable non-variance+  setPolarity x $ drop npars pol -- purgeNonvariant pol -- temporarily disable non-variance    -- make 'Nonvariant' args 'UnusedArg' in type and clause telescope   -- Andreas 2012-11-18: skip this for abstract definitions (fixing issue 755).   -- This means that the most precise type for abstract definitions   -- is not available, even to other abstract definitions.   -- A proper fix would be to introduce a second type for use within abstract.-  t <- if (defAbstract def == AbstractDef) then return t else-         nonvariantToUnusedArg pol t+  --+  -- Andreas, 2015-07-01: I thought one should do this for+  -- abstract local definitions in @where@ blocks to fix Issue 1366b,+  --but it is not necessary.+  -- t <- if (defAbstract def == AbstractDef) && not (isAnonymousModuleName $ qnameModule x)+  t <- if (defAbstract def == AbstractDef)+         then return t+         else nonvariantToUnusedArg pol t   modifySignature $ updateDefinition x $    updateTheDef (nonvariantToUnusedArgInDef pol) . updateDefType (const t)  -- | Data and record parameters are used as phantom arguments all over --   the test suite (and possibly in user developments).---   @enablePhantomTypes@ turns 'Nonvariant' parameters to 'Invariant'+--   @enablePhantomTypes@ turns 'Nonvariant' parameters to 'Covariant' --   to enable phantoms. enablePhantomTypes :: Defn -> [Polarity] -> [Polarity] enablePhantomTypes def pol = case def of@@ -169,14 +179,20 @@  -- | Make arguments 'Invariant' if the type of a not-'Nonvariant' --   later argument depends on it.-dependentPolarity :: Type -> [Polarity] -> TCM [Polarity]-dependentPolarity t []          = return []  -- all remaining are 'Invariant'-dependentPolarity t pols@(p:ps) = do+--   Also, enable phantom types by turning 'Nonvariant' into something+--   else if it is a data/record parameter but not a size argument. [See issue 1596]+--+--   Precondition: the "phantom" polarity list has the same length as the polarity list.+dependentPolarity :: Type -> [Polarity] -> [Polarity] -> TCM [Polarity]+dependentPolarity t _      []          = return []  -- all remaining are 'Invariant'+dependentPolarity t []     (_ : _)     = __IMPOSSIBLE__+dependentPolarity t (q:qs) pols@(p:ps) = do   t <- reduce $ unEl t   case ignoreSharing t of-    Pi a b -> do+    Pi dom b -> do       let c = absBody b-      ps <- dependentPolarity c ps+      ps <- dependentPolarity c qs ps+      let mp = ifM (isJust <$> isSizeType (unDom dom)) (return p) (return q)       p  <- case b of               Abs{} | p /= Invariant  ->                 -- Andreas, 2014-04-11 see Issue 1099@@ -184,8 +200,8 @@                 -- hence metas must have been instantiated before!                 ifM (relevantInIgnoringNonvariant 0 c ps)                   (return Invariant)-                  (return p)-              _ -> return p+                  mp+              _ -> mp       return $ p : ps     _ -> return pols @@ -253,59 +269,66 @@ ------------------------------------------------------------------------  -- | Hack for polarity of size indices.+--   As a side effect, this sets the positivity of the size index.+--   See test/succeed/PolaritySizeSucData.agda for a case where this is needed. sizePolarity :: QName -> [Polarity] -> TCM [Polarity] sizePolarity d pol0 = do   let exit = return pol0   ifM (not . optSizedTypes <$> pragmaOptions) exit $ do-  def <- getConstInfo d-  case theDef def of-    Datatype{ dataPars = np, dataCons = cons } -> do-      let TelV tel _      = telView' $ defType def-          (parTel, ixTel) = genericSplitAt np $ telToList tel-      case ixTel of-        []                 -> exit  -- No size index-        Dom _ (_, a) : _ -> ifM ((/= Just BoundedNo) <$> isSizeType a) exit $ do-          -- we assume the size index to be 'Covariant' ...-          let pol   = genericTake np pol0-              polCo = pol ++ [Covariant]-              polIn = pol ++ [Invariant]-          setPolarity d $ polCo-          -- and seek confirm it by looking at the constructor types-          let check c = do-                t <- defType <$> getConstInfo c-                addCtxTel (telFromList parTel) $ do---OLD:                  let pars = reverse [ defaultArg $ var i | i <- [0..np - 1] ]-                  let pars = map (defaultArg . var) $ downFrom np-                  TelV conTel target <- telView =<< (t `piApplyM` pars)-                  case conTel of-                    EmptyTel  -> return False  -- no size argument-                    ExtendTel arg  tel ->-                      ifM ((/= Just BoundedNo) <$> isSizeType (unDom arg)) (return False) $ do -- also no size argument-                        -- First constructor argument has type Size+    def <- getConstInfo d+    case theDef def of+      Datatype{ dataPars = np, dataCons = cons } -> do+        let TelV tel _      = telView' $ defType def+            (parTel, ixTel) = genericSplitAt np $ telToList tel+        case ixTel of+          []                 -> exit  -- No size index+          Dom _ (_, a) : _ -> ifM ((/= Just BoundedNo) <$> isSizeType a) exit $ do+            -- we assume the size index to be 'Covariant' ...+            let pol   = genericTake np pol0+                polCo = pol ++ [Covariant]+                polIn = pol ++ [Invariant]+            setPolarity d $ polCo+            -- and seek confirm it by looking at the constructor types+            let check c = do+                  t <- defType <$> getConstInfo c+                  addCtxTel (telFromList parTel) $ do+  --OLD:                  let pars = reverse [ defaultArg $ var i | i <- [0..np - 1] ]+                    let pars = map (defaultArg . var) $ downFrom np+                    TelV conTel target <- telView =<< (t `piApplyM` pars)+                    case conTel of+                      EmptyTel  -> return False  -- no size argument+                      ExtendTel arg  tel ->+                        ifM ((/= Just BoundedNo) <$> isSizeType (unDom arg)) (return False) $ do -- also no size argument+                          -- First constructor argument has type Size -                        -- check that only positive occurences in tel-                        let isPos = underAbstraction arg tel $ \ tel -> do-                              pols <- zipWithM polarity [0..] $ map (snd . unDom) $ telToList tel-                              reportSDoc "tc.polarity.size" 25 $-                                text $ "to pass size polarity check, the following polarities need all to be covariant: " ++ show pols-                              return $ all (`elem` [Nonvariant, Covariant]) pols+                          -- check that only positive occurences in tel+                          let isPos = underAbstraction arg tel $ \ tel -> do+                                pols <- zipWithM polarity [0..] $ map (snd . unDom) $ telToList tel+                                reportSDoc "tc.polarity.size" 25 $+                                  text $ "to pass size polarity check, the following polarities need all to be covariant: " ++ show pols+                                return $ all (`elem` [Nonvariant, Covariant]) pols -                        -- check that the size argument appears in the-                        -- right spot in the target type-                        let sizeArg = size tel-                            isLin = addContext conTel $ checkSizeIndex d np sizeArg target+                          -- check that the size argument appears in the+                          -- right spot in the target type+                          let sizeArg = size tel+                              isLin = addContext conTel $ checkSizeIndex d np sizeArg target -                        ok <- isPos `and2M` isLin-                        reportSDoc "tc.polarity.size" 15 $-                          text "constructor" <+> prettyTCM c <+>-                          text (if ok then "passes" else "fails") <+>-                          text "size polarity check"-                        return ok+                          ok <- isPos `and2M` isLin+                          reportSDoc "tc.polarity.size" 15 $+                            text "constructor" <+> prettyTCM c <+>+                            text (if ok then "passes" else "fails") <+>+                            text "size polarity check"+                          return ok -          ifM (andM $ map check cons)-              (return polCo) -- yes, we have a sized type here-              (return polIn) -- no, does not conform to the rules of sized types-    _ -> exit+            ifNotM (andM $ map check cons)+                (return polIn) -- no, does not conform to the rules of sized types+              $ do  -- yes, we have a sized type here+                -- Andreas, 2015-07-01+                -- As a side effect, mark the size also covariant for subsequent+                -- positivity checking (which feeds back into polarity analysis).+                modifyArgOccurrences d $ \ occ -> take np occ ++ [JustPos]+                return polCo+      _ -> exit  -- | @checkSizeIndex d np i a@ checks that constructor target type @a@ --   has form @d ps (↑ i) idxs@ where @|ps| = np@.@@ -319,7 +342,7 @@     text "has size index successor of " <+> prettyTCM (var i)   case ignoreSharing $ unEl a of     Def d0 es -> do-      unlessM (isJust <$> sameDef d d0) __IMPOSSIBLE__+      whenNothingM (sameDef d d0) __IMPOSSIBLE__       s <- sizeView $ unArg ix       case s of         SizeSuc v | Var j [] <- ignoreSharing v, i == j
src/full/Agda/TypeChecking/Positivity.hs view
@@ -1,7 +1,7 @@-{-# LANGUAGE CPP #-}-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE TupleSections #-}+{-# LANGUAGE CPP                  #-}+{-# LANGUAGE FlexibleContexts     #-}+{-# LANGUAGE FlexibleInstances    #-}+{-# LANGUAGE TupleSections        #-} {-# LANGUAGE UndecidableInstances #-}  -- | Check that a datatype is strictly positive.@@ -13,15 +13,19 @@ import Control.DeepSeq import Control.Monad.Reader -import Data.Set (Set)-import qualified Data.Set as Set-import Data.Map (Map)-import qualified Data.Map as Map+import Data.Either+import Data.Graph (SCC(..), flattenSCC) import Data.List as List hiding (null) import Data.Maybe (mapMaybe, fromMaybe)+import Data.Map (Map)+import qualified Data.Map as Map+import Data.Set (Set)+import qualified Data.Set as Set  import Debug.Trace +import Test.QuickCheck+ import Agda.Syntax.Position import Agda.Syntax.Common import Agda.Syntax.Internal as I@@ -30,101 +34,135 @@ import Agda.TypeChecking.Monad import Agda.TypeChecking.Monad.Builtin (primInf, CoinductionKit(..), coinductionKit) import Agda.TypeChecking.Reduce+import Agda.TypeChecking.Positivity.Occurrence import Agda.TypeChecking.Pretty import Agda.TypeChecking.Substitute import Agda.TypeChecking.Telescope -import Agda.Utils.Size+import qualified Agda.Utils.Graph.AdjacencyMap.Unidirectional as Graph+import Agda.Utils.Functor import Agda.Utils.List import Agda.Utils.Maybe import Agda.Utils.Monad import Agda.Utils.Null import qualified Agda.Utils.Permutation as Perm import Agda.Utils.SemiRing-import qualified Agda.Utils.Graph.AdjacencyMap as Graph-import Agda.Utils.Graph.AdjacencyMap (Graph)+import Agda.Utils.Size  #include "undefined.h" import Agda.Utils.Impossible +type Graph n e = Graph.Graph n n e+ -- | Check that the datatypes in the mutual block containing the given --   declarations are strictly positive. -- --   Also add information about positivity and recursivity of records --   to the signature. checkStrictlyPositive :: Set QName -> TCM ()-checkStrictlyPositive qs = disableDestructiveUpdate $ do+checkStrictlyPositive qset = disableDestructiveUpdate $ do   -- compute the occurrence graph for qs-  reportSDoc "tc.pos.tick" 100 $ text "positivity of" <+> prettyTCM (Set.toList qs)-  g <- Graph.filterEdges (\ (Edge o _) -> o /= Unused) <$> buildOccurrenceGraph qs-  let gstar = Graph.transitiveClosure $ fmap occ g+  let qs = Set.toList qset+  reportSDoc "tc.pos.tick" 100 $ text "positivity of" <+> prettyTCM qs+  -- remove @Unused@ edges+  g <- Graph.clean <$> buildOccurrenceGraph qset+  let gstar = Graph.gaussJordanFloydWarshallMcNaughtonYamada $ fmap occ g   reportSDoc "tc.pos.tick" 100 $ text "constructed graph"   reportSLn "tc.pos.graph" 5 $ "Positivity graph: N=" ++ show (size $ Graph.nodes g) ++                                " E=" ++ show (length $ Graph.edges g)   reportSDoc "tc.pos.graph" 10 $ vcat-    [ text "positivity graph for" <+> prettyTCM (Set.toList qs)+    [ text "positivity graph for" <+> (fsep $ map prettyTCM qs)     , nest 2 $ prettyTCM g     ]+  reportSLn "tc.pos.graph" 5 $+    "Positivity graph (completed): E=" ++ show (length $ Graph.edges gstar)   reportSDoc "tc.pos.graph" 50 $ vcat     [ text "transitive closure of positivity graph for" <+>-      prettyTCM (Set.toList qs)+      prettyTCM qs     , nest 2 $ prettyTCM gstar     ]    -- remember argument occurrences for qs in the signature-  mapM_ (setArgs gstar) $ Set.toList qs+  setArgOccs qset qs gstar   reportSDoc "tc.pos.tick" 100 $ text "set args"    -- check positivity for all strongly connected components of the graph for qs-  let sccs = Graph.sccs gstar+  let sccs' = Graph.sccs' gstar+      sccs  = map flattenSCC sccs'+  reportSDoc "tc.pos.graph.sccs" 10 $ do+    let (triv, others) = partitionEithers $ for sccs' $ \ scc -> case scc of+          AcyclicSCC v -> Left v+          CyclicSCC vs -> Right vs+    sep [ text $ show (length triv) ++ " trivial sccs"+        , text $ show (length others) ++ " non-trivial sccs with lengths " +++            show (map length others)+        ]   reportSDoc "tc.pos.graph.sccs" 15 $ text $ "  sccs = " ++ show sccs   forM_ sccs $ \ scc -> setMut [ q | DefNode q <- scc ]-  mapM_ (checkPos g) $ Set.toList qs+  mapM_ (checkPos g gstar) $ qs   reportSDoc "tc.pos.tick" 100 $ text "checked positivity"    where-    checkPos g q = do+    checkPos :: Graph Node Edge ->+                Graph Node Occurrence ->+                QName -> TCM ()+    checkPos g gstar q = inConcreteOrAbstractMode q $ do       -- we check positivity only for data or record definitions       whenJustM (isDatatype q) $ \ dr -> do-      reportSDoc "tc.pos.check" 10 $ text "Checking positivity of" <+> prettyTCM q-      -- get all pathes from q to q that exhibit a non-strictly occurrence-      -- or, in case of records, any recursive occurrence-      let critical IsData   = \ (Edge o _) -> o <= JustPos-          critical IsRecord = \ (Edge o _) -> o /= Unused-          loops      = filter (critical dr) $ Graph.allPaths (critical dr) (DefNode q) (DefNode q) g+        reportSDoc "tc.pos.check" 10 $ text "Checking positivity of" <+> prettyTCM q -      -- if we have a negative loop, raise error-      whenM positivityCheckEnabled $ do-        forM_ [ how | Edge o how <- loops, o <= JustPos ] $ \ how -> do-          err <- fsep $-            [prettyTCM q] ++ pwords "is not strictly positive, because it occurs" ++-            [prettyTCM how]-          setCurrentRange q $ typeError $ GenericDocError err+        let loop      = Graph.lookup (DefNode q) (DefNode q) gstar+            how msg p =+              fsep $ [prettyTCM q] ++ pwords "is" +++                case filter (p . occ) $+                     -- Graph.allTrails (DefNode q) (DefNode q) g of -- exponential, see Issue 1612+                     Graph.allPaths (p . occ) (DefNode q) (DefNode q) g of+                  Edge _ how : _ -> pwords (msg ++ ", because it occurs") +++                                    [prettyTCM how]+                  _              -> pwords $ msg ++ "." -      -- if we find an unguarded record, mark it as such-      when (dr == IsRecord) $ do-       case headMaybe [ how | Edge o how <- loops, o <= StrictPos ] of-        Just how -> do-          reportSDoc "tc.pos.record" 5 $ sep-            [ prettyTCM q <+> text "is not guarded, because it occurs"-            , prettyTCM how-            ]-          unguardedRecord q-          checkInduction q-        -- otherwise, if the record is recursive, mark it as well-        Nothing -> forM_ (take 1 [ how | Edge GuardPos how <- loops ]) $ \ how -> do-          reportSDoc "tc.pos.record" 5 $ sep-            [ prettyTCM q <+> text "is recursive, because it occurs"-            , prettyTCM how-            ]-          recursiveRecord q-          checkInduction q+                  -- For an example of code that exercises the latter,+                  -- uninformative clause above, see+                  -- test/fail/BadInductionRecursion5.agda. +                  -- If a suitable StarSemiRing instance can be+                  -- defined for Edge, then+                  -- gaussJordanFloydWarshallMcNaughtonYamada can be+                  -- used instead of allTrails, thus avoiding the+                  -- uninformative clause.++        -- if we have a negative loop, raise error+        whenM positivityCheckEnabled $+          case loop of+            Just o | p o -> do+              err <- how "not strictly positive" p+              setCurrentRange q $ typeError $ GenericDocError err+              where p = (<= JustPos)+            _ -> return ()++        -- if we find an unguarded record, mark it as such+        when (dr == IsRecord) $+          case loop of+            Just o | p o -> do+              reportSDoc "tc.pos.record" 5 $ how "not guarded" p+              unguardedRecord q+              checkInduction q+              where p = (<= StrictPos)+            _ ->+              -- otherwise, if the record is recursive, mark it as well+              case loop of+                Just o | p o -> do+                  reportSDoc "tc.pos.record" 5 $ how "recursive" p+                  recursiveRecord q+                  checkInduction q+                  where p = (== GuardPos)+                _ -> return ()+     checkInduction q = whenM positivityCheckEnabled $ do       -- Check whether the recursive record has been declared as       -- 'Inductive' or 'Coinductive'.  Otherwise, error.-      unlessM (isJust . recInduction . theDef <$> getConstInfo q) $ do-        setCurrentRange (nameBindingSite $ qnameName q) $ do+      unlessM (isJust . recInduction . theDef <$> getConstInfo q) $+        setCurrentRange (nameBindingSite $ qnameName q) $           typeError . GenericDocError =<<             text "Recursive record" <+> prettyTCM q <+>             text "needs to be declared as either inductive or coinductive"@@ -143,23 +181,28 @@     setMut [q] = return ()  -- no mutual recursion     setMut qs  = forM_ qs $ \ q -> setMutual q (delete q qs) -    -- Set the polarity of the arguments to a definition-    setArgs g q = do-      reportSDoc "tc.pos.args" 10 $ text "checking args of" <+> prettyTCM q-      n <- getDefArity =<< getConstInfo q-      let nArgs = maximum $ n :-                    [ i + 1 | (ArgNode q1 i) <- Set.toList $ Graph.nodes g-                    , q1 == q ]-          findOcc i = fromMaybe Unused $ Graph.lookup (ArgNode q i) (DefNode q) g-          args = map findOcc [0..nArgs - 1]-      reportSDoc "tc.pos.args" 10 $ sep-        [ text "args of" <+> prettyTCM q <+> text "="-        , nest 2 $ prettyList $ map (text . show) args-        ]-      -- The list args can take a long time to compute, but contains-      -- small elements, and is stored in the interface (right?), so-      -- it is computed deep-strictly.-      setArgOccurrences q $!! args+    -- Set the polarity of the arguments to a couple of definitions+    setArgOccs :: Set QName -> [QName] -> Graph Node Occurrence -> TCM ()+    setArgOccs qset qs g = do+      -- Compute a map from each name in q to the maximal argument index+      let maxs = Map.fromListWith max+           [ (q, i) | ArgNode q i <- Set.toList $ Graph.sourceNodes g, q `Set.member` qset ]+      forM_ qs $ \ q -> inConcreteOrAbstractMode q $ do+        reportSDoc "tc.pos.args" 10 $ text "checking args of" <+> prettyTCM q+        n <- getDefArity =<< getConstInfo q+        -- If there is no outgoing edge @ArgNode q i@, all @n@ arguments are @Unused@.+        -- Otherwise, we obtain the occurrences from the Graph.+        let findOcc i = fromMaybe Unused $ Graph.lookup (ArgNode q i) (DefNode q) g+            args = caseMaybe (Map.lookup q maxs) (replicate n Unused) $ \ m ->+              map findOcc [0 .. max m (n - 1)]+        reportSDoc "tc.pos.args" 10 $ sep+          [ text "args of" <+> prettyTCM q <+> text "="+          , nest 2 $ prettyList $ map (text . show) args+          ]+        -- The list args can take a long time to compute, but contains+        -- small elements, and is stored in the interface (right?), so+        -- it is computed deep-strictly.+        setArgOccurrences q $!! args  getDefArity :: Definition -> TCM Int getDefArity def = case theDef def of@@ -172,41 +215,7 @@  -- Specification of occurrences ------------------------------------------- --- | 'Occurrence' is a complete lattice with least element 'Mixed'---   and greatest element 'Unused'.------   It forms a commutative semiring where 'oplus' is meet (glb)---   and 'otimes' is composition. Both operations are idempotent.------   For 'oplus', 'Unused' is neutral (zero) and 'Mixed' is dominant.---   For 'otimes', 'StrictPos' is neutral (one) and 'Unused' is dominant.--instance SemiRing Occurrence where-  oplus Mixed _           = Mixed     -- dominant-  oplus _ Mixed           = Mixed-  oplus Unused o          = o         -- neutral-  oplus o Unused          = o-  oplus JustNeg  JustNeg  = JustNeg-  oplus JustNeg  o        = Mixed     -- negative and any form of positve-  oplus o        JustNeg  = Mixed-  oplus GuardPos o        = o         -- second-rank neutral-  oplus o GuardPos        = o-  oplus StrictPos o       = o         -- third-rank neutral-  oplus o StrictPos       = o-  oplus JustPos JustPos   = JustPos--  otimes Unused _            = Unused     -- dominant-  otimes _ Unused            = Unused-  otimes Mixed _             = Mixed      -- second-rank dominance-  otimes _ Mixed             = Mixed-  otimes JustNeg JustNeg     = JustPos-  otimes JustNeg _           = JustNeg    -- third-rank dominance-  otimes _ JustNeg           = JustNeg-  otimes JustPos _           = JustPos    -- fourth-rank dominance-  otimes _ JustPos           = JustPos-  otimes GuardPos _          = GuardPos   -- _ `elem` [StrictPos, GuardPos]-  otimes _ GuardPos          = GuardPos-  otimes StrictPos StrictPos = StrictPos  -- neutral+-- See also Agda.TypeChecking.Positivity.Occurrence.  -- | Description of an occurrence. data OccursWhere@@ -222,7 +231,7 @@   | InDefOf QName OccursWhere    -- ^ in the definition of a constant   | Here   | Unknown                      -- ^ an unknown position (treated as negative)-  deriving (Show, Eq)+  deriving (Show, Eq, Ord)  (>*<) :: OccursWhere -> OccursWhere -> OccursWhere Here            >*< o  = o@@ -246,14 +255,12 @@       nth 2 = pwords "third"       nth n = pwords $ show (n + 1) ++ "th" -      uniq (x:y:xs)-        | x == y  = uniq (x:xs)-      uniq (x:xs) = x : uniq xs-      uniq []     = []+      -- remove consecutive duplicates+      uniq = map head . group        prettyOs [] = __IMPOSSIBLE__       prettyOs [o] = prettyO o <> text "."-      prettyOs (o:os) = prettyO o <> text ", which occurs" <+> prettyOs os+      prettyOs (o:os) = prettyO o <> text ", which occurs" $$ prettyOs os        prettyO o = case o of         Here           -> empty@@ -361,9 +368,10 @@  -- | Running the monad getOccurrences-  :: (PrettyTCM a, ComputeOccurrences a)+  :: (Show a, PrettyTCM a, ComputeOccurrences a)   => [Maybe Item] -> a -> TCM Occurrences getOccurrences vars a = do+  reportSDoc "tc.pos.occ" 70 $ text "computing occurrences in " <+> text (show a)   reportSDoc "tc.pos.occ" 20 $ text "computing occurrences in " <+> prettyTCM a   kit <- coinductionKit   return $ runReader (occurrences a) $ OccEnv vars $ fmap nameOfInf kit@@ -398,7 +406,7 @@       patItem i p = map (const $ Just $ AnArg i) $ patternVars p  instance ComputeOccurrences Term where-  occurrences v = case v of+  occurrences v = case unSpine v of     Var i args -> do       vars <- asks vars       occs <- occurrences args@@ -458,7 +466,7 @@   occurrences (NoAbs _ b) = occurrences b  instance ComputeOccurrences a => ComputeOccurrences (Elim' a) where-  occurrences Proj{}    = return empty+  occurrences Proj{}    = __IMPOSSIBLE__   occurrences (Apply a) = occurrences a  instance ComputeOccurrences a => ComputeOccurrences (I.Arg a) where@@ -478,7 +486,11 @@  -- | Compute the occurrences in a given definition. computeOccurrences :: QName -> TCM Occurrences-computeOccurrences q = do+computeOccurrences q = inConcreteOrAbstractMode q $ do+  reportSDoc "tc.pos" 25 $ do+    a <- defAbstract <$> getConstInfo q+    m <- asks envAbstractMode+    text "computeOccurrences" <+> prettyTCM q <+> text (show a) <+> text (show m)   def <- getConstInfo q   occursAs (InDefOf q) <$> case theDef def of     Function{funClauses = cs} -> do@@ -516,17 +528,19 @@     Primitive{}   -> return empty  -- | Eta expand a clause to have the given number of variables.---   Warning: doesn't update telescope or permutation!+--   Warning: doesn't put correct types in telescope! --   This is used instead of special treatment of lambdas --   (which was unsound: issue 121) etaExpandClause :: Nat -> Clause -> Clause-etaExpandClause n c@Clause{ namedClausePats = ps, clauseBody = b }+etaExpandClause n c@Clause{ clauseTel = tel, clausePerm = perm, namedClausePats = ps, clauseBody = b }   | m <= 0    = c   | otherwise = c       { namedClausePats = ps ++ genericReplicate m (defaultArg $ unnamed $ VarP underscore)       , clauseBody      = liftBody m b-      , clauseTel       = telFromList $ replicate n $ (underscore,) <$> dummyDom -- Not __IMPOSSIBLE__ because of debug printing-      , clausePerm      = Perm.idP n  -- ditto+      , clauseTel       = telFromList $+          telToList tel ++ (replicate m $ (underscore,) <$> dummyDom)+          -- dummyDom, not __IMPOSSIBLE__, because of debug printing.+      , clausePerm      = Perm.liftP m perm -- Andreas, 2015-06-28 this is probably correct.       }   where     m = n - genericLength ps@@ -555,40 +569,25 @@   prettyTCM (DefNode q)   = prettyTCM q   prettyTCM (ArgNode q i) = prettyTCM q <> text ("." ++ show i) -instance PrettyTCM Occurrence where-  prettyTCM GuardPos  = text "-[g+]->"-  prettyTCM StrictPos = text "-[++]->"-  prettyTCM JustPos   = text "-[+]->"-  prettyTCM JustNeg   = text "-[-]->"-  prettyTCM Mixed     = text "-[*]->"-  prettyTCM Unused    = text "-[ ]->"---- | Pairing something with a node (for printing only).-data WithNode n a = WithNode n a- instance PrettyTCM n => PrettyTCM (WithNode n Edge) where   prettyTCM (WithNode n (Edge o w)) =     prettyTCM o <+> prettyTCM n <+> fsep (pwords $ show w) -instance PrettyTCM n => PrettyTCM (WithNode n Occurrence) where-  prettyTCM (WithNode n o) = prettyTCM o <+> prettyTCM n--instance (PrettyTCM n, PrettyTCM (WithNode n e)) => PrettyTCM (Graph n e) where-  prettyTCM g = vcat $ map pr $ Map.assocs $ Graph.unGraph g-    where-      pr (n, es) = sep-        [ prettyTCM n-        , nest 2 $ vcat $ map (prettyTCM . uncurry WithNode) $ Map.assocs es-        ]- -- | Edge labels for the positivity graph. data Edge = Edge Occurrence OccursWhere-  deriving (Show)+  deriving (Eq, Ord, Show) +instance Null Edge where+  null (Edge o _) = null o+  empty = Edge empty Unknown+ -- | These operations form a semiring if we quotient by the relation -- \"the 'Occurrence' components are equal\".  instance SemiRing Edge where+  ozero = Edge ozero Unknown+  oone  = Edge oone  Unknown+   oplus _                    e@(Edge Mixed _)     = e -- dominant   oplus e@(Edge Mixed _) _                        = e   oplus (Edge Unused _)      e                    = e -- neutral@@ -604,17 +603,26 @@    otimes (Edge o1 w1) (Edge o2 w2) = Edge (otimes o1 o2) (w1 >*< w2) +-- | As 'OccursWhere' does not have an 'oplus' we cannot do something meaningful+--   for the @OccursWhere@ here.+--+--   E.g. @ostar (Edge JustNeg w) = Edge Mixed (w `oplus` (w >*< w))@+--   would probably more sense, if we could do it.+instance StarSemiRing Edge where+  ostar (Edge o w) = Edge (ostar o) w+ buildOccurrenceGraph :: Set QName -> TCM (Graph Node Edge)-buildOccurrenceGraph qs = Graph.unions <$> mapM defGraph (Set.toList qs)+buildOccurrenceGraph qs = Graph.unionsWith oplus <$> mapM defGraph (Set.toList qs)   where     defGraph :: QName -> TCM (Graph Node Edge)     defGraph q = do       occs <- computeOccurrences q-      let onItem (item, occs) = do-            es <- mapM (computeEdge qs) occs-            return $ Graph.unions $-                map (\(b, w) -> Graph.singleton (itemToNode item) b w) es-      Graph.unions <$> mapM onItem (Map.assocs occs)+      Graph.unionsWith oplus <$> do+        forM (Map.assocs occs) $ \ (item, occs) -> do+          let src = itemToNode item+          es <- mapM (computeEdge qs) occs+          return $ Graph.unionsWith oplus $+            for es $ \ (tgt, w) -> Graph.singleton src tgt w       where         itemToNode (AnArg i) = ArgNode q i         itemToNode (ADef q)  = DefNode q@@ -663,3 +671,72 @@         -- D: (A B -> C) generates a positive edge B --> A.1         -- even though the context is negative.         inArg d i = mkEdge (ArgNode d i) StrictPos++------------------------------------------------------------------------+-- * Generators and tests+------------------------------------------------------------------------++instance Arbitrary OccursWhere where+  arbitrary = sized arbitraryS+    where+    arbitraryS n = oneof $+      [ return Here+      , return Unknown+      ] +++      if n <= 0 then [] else+        [ LeftOfArrow <$> arb+        , DefArg <$> arbitrary <*> arbitrary <*> arb+        , UnderInf <$> arb+        , VarArg <$> arb+        , MetaArg <$> arb+        , ConArgType <$> arbitrary <*> arb+        , IndArgType <$> arbitrary <*> arb+        , InClause <$> arbitrary <*> arb+        , Matched <$> arb+        , InDefOf <$> arbitrary <*> arb+        ]+      where arb = arbitraryS (n - 1)++  shrink x = replaceConstructor x ++ genericShrink x+    where+    replaceConstructor Here    = []+    replaceConstructor Unknown = []+    replaceConstructor _       = [Here, Unknown]++    genericShrink (LeftOfArrow a)  = a : [ LeftOfArrow a  | a <- shrink a ]+    genericShrink (DefArg a b c)   = c : [ DefArg a b c   | c <- shrink c ]+    genericShrink (UnderInf a)     = a : [ UnderInf a     | a <- shrink a ]+    genericShrink (VarArg a)       = a : [ VarArg a       | a <- shrink a ]+    genericShrink (MetaArg a)      = a : [ MetaArg a      | a <- shrink a ]+    genericShrink (ConArgType a b) = b : [ ConArgType a b | b <- shrink b ]+    genericShrink (IndArgType a b) = b : [ IndArgType a b | b <- shrink b ]+    genericShrink (InClause a b)   = b : [ InClause a b   | b <- shrink b ]+    genericShrink (Matched a)      = a : [ Matched a      | a <- shrink a ]+    genericShrink (InDefOf a b)    = b : [ InDefOf a b    | b <- shrink b ]+    genericShrink Here             = []+    genericShrink Unknown          = []++instance CoArbitrary OccursWhere where+  coarbitrary (LeftOfArrow a)  = variant  0 . coarbitrary a+  coarbitrary (DefArg a b c)   = variant  1 . coarbitrary (a, b, c)+  coarbitrary (UnderInf a)     = variant  2 . coarbitrary a+  coarbitrary (VarArg a)       = variant  3 . coarbitrary a+  coarbitrary (MetaArg a)      = variant  4 . coarbitrary a+  coarbitrary (ConArgType a b) = variant  5 . coarbitrary (a, b)+  coarbitrary (IndArgType a b) = variant  6 . coarbitrary (a, b)+  coarbitrary (InClause a b)   = variant  7 . coarbitrary (a, b)+  coarbitrary (Matched a)      = variant  8 . coarbitrary a+  coarbitrary (InDefOf a b)    = variant  9 . coarbitrary (a, b)+  coarbitrary Here             = variant 10+  coarbitrary Unknown          = variant 11++instance Arbitrary Edge where+  arbitrary = Edge <$> arbitrary <*> arbitrary++  shrink (Edge o w) = [ Edge o w | o <- shrink o ] +++                      [ Edge o w | w <- shrink w ]++instance CoArbitrary Edge where+  coarbitrary (Edge o w) = coarbitrary (o, w)++-- properties moved to Agda.TypeChecking.Positivity.Tests
+ src/full/Agda/TypeChecking/Positivity/Occurrence.hs view
@@ -0,0 +1,148 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE TemplateHaskell    #-}++-- | Occurrences.++module Agda.TypeChecking.Positivity.Occurrence where++import Control.DeepSeq+import Data.Typeable (Typeable)+import Test.QuickCheck++import Agda.Syntax.Position+import Agda.Utils.Null+import Agda.Utils.SemiRing++-- | Subterm occurrences for positivity checking.+--   The constructors are listed in increasing information they provide:+--   @Mixed <= JustPos <= StrictPos <= GuardPos <= Unused@+--   @Mixed <= JustNeg <= Unused@.+data Occurrence+  = Mixed     -- ^ Arbitrary occurrence (positive and negative).+  | JustNeg   -- ^ Negative occurrence.+  | JustPos   -- ^ Positive occurrence, but not strictly positive.+  | StrictPos -- ^ Strictly positive occurrence.+  | GuardPos  -- ^ Guarded strictly positive occurrence (i.e., under ∞).  For checking recursive records.+  | Unused    --  ^ No occurrence.+  deriving (Typeable, Show, Eq, Ord, Enum, Bounded)++instance NFData Occurrence where rnf x = seq x ()++instance KillRange Occurrence where+  killRange = id++instance Arbitrary Occurrence where+  arbitrary = elements [minBound .. maxBound]++  shrink Unused = []+  shrink _      = [Unused]++instance CoArbitrary Occurrence where+  coarbitrary = coarbitrary . fromEnum++-- | 'Occurrence' is a complete lattice with least element 'Mixed'+--   and greatest element 'Unused'.+--+--   It forms a commutative semiring where 'oplus' is meet (glb)+--   and 'otimes' is composition. Both operations are idempotent.+--+--   For 'oplus', 'Unused' is neutral (zero) and 'Mixed' is dominant.+--   For 'otimes', 'StrictPos' is neutral (one) and 'Unused' is dominant.++instance SemiRing Occurrence where+  ozero = Unused+  oone  = StrictPos++  oplus Mixed _           = Mixed     -- dominant+  oplus _ Mixed           = Mixed+  oplus Unused o          = o         -- neutral+  oplus o Unused          = o+  oplus JustNeg  JustNeg  = JustNeg+  oplus JustNeg  o        = Mixed     -- negative and any form of positve+  oplus o        JustNeg  = Mixed+  oplus GuardPos o        = o         -- second-rank neutral+  oplus o GuardPos        = o+  oplus StrictPos o       = o         -- third-rank neutral+  oplus o StrictPos       = o+  oplus JustPos JustPos   = JustPos++  otimes Unused _            = Unused     -- dominant+  otimes _ Unused            = Unused+  otimes Mixed _             = Mixed      -- second-rank dominance+  otimes _ Mixed             = Mixed+  otimes JustNeg JustNeg     = JustPos+  otimes JustNeg _           = JustNeg    -- third-rank dominance+  otimes _ JustNeg           = JustNeg+  otimes JustPos _           = JustPos    -- fourth-rank dominance+  otimes _ JustPos           = JustPos+  otimes GuardPos _          = GuardPos   -- _ `elem` [StrictPos, GuardPos]+  otimes _ GuardPos          = GuardPos+  otimes StrictPos StrictPos = StrictPos  -- neutral++instance StarSemiRing Occurrence where+  ostar Mixed     = Mixed+  ostar JustNeg   = Mixed+  ostar JustPos   = JustPos+  ostar StrictPos = StrictPos+  ostar GuardPos  = StrictPos+  ostar Unused    = StrictPos++instance Null Occurrence where+  empty = Unused++------------------------------------------------------------------------+-- Tests++prop_Occurrence_oplus_associative ::+  Occurrence -> Occurrence -> Occurrence -> Bool+prop_Occurrence_oplus_associative x y z =+  oplus x (oplus y z) == oplus (oplus x y) z++prop_Occurrence_oplus_ozero :: Occurrence -> Bool+prop_Occurrence_oplus_ozero x =+  oplus ozero x == x++prop_Occurrence_oplus_commutative :: Occurrence -> Occurrence -> Bool+prop_Occurrence_oplus_commutative x y =+  oplus x y == oplus y x++prop_Occurrence_otimes_associative ::+  Occurrence -> Occurrence -> Occurrence -> Bool+prop_Occurrence_otimes_associative x y z =+  otimes x (otimes y z) == otimes (otimes x y) z++prop_Occurrence_otimes_oone :: Occurrence -> Bool+prop_Occurrence_otimes_oone x =+  otimes oone x == x+    &&+  otimes x oone == x++prop_Occurrence_distributive ::+  Occurrence -> Occurrence -> Occurrence -> Bool+prop_Occurrence_distributive x y z =+  otimes x (oplus y z) == oplus (otimes x y) (otimes x z)+    &&+  otimes (oplus x y) z == oplus (otimes x z) (otimes y z)++prop_Occurrence_otimes_ozero :: Occurrence -> Bool+prop_Occurrence_otimes_ozero x =+  otimes ozero x == ozero+    &&+  otimes x ozero == ozero++prop_Occurrence_ostar :: Occurrence -> Bool+prop_Occurrence_ostar x =+  ostar x == oplus oone (otimes x (ostar x))+    &&+  ostar x == oplus oone (otimes (ostar x) x)++-- Template Haskell hack to make the following $quickCheckAll work+-- under GHC 7.8.+return []++-- | Tests.++tests :: IO Bool+tests = do+  putStrLn "Agda.TypeChecking.Positivity.Occurrence"+  $quickCheckAll
+ src/full/Agda/TypeChecking/Positivity/Tests.hs view
@@ -0,0 +1,27 @@+{-# LANGUAGE TemplateHaskell #-}++module Agda.TypeChecking.Positivity.Tests where++import Test.QuickCheck++import Agda.TypeChecking.Positivity++import Agda.Utils.SemiRing++-- | The 'oplus' method for 'Occurrence' matches that for 'Edge'.++prop_oplus_Occurrence_Edge :: Edge -> Edge -> Bool+prop_oplus_Occurrence_Edge e1@(Edge o1 _) e2@(Edge o2 _) =+  case oplus e1 e2 of+    Edge o _ -> o == oplus o1 o2++-- Template Haskell hack to make the following $quickCheckAll work+-- under GHC 7.8.+return []++-- | Tests.++tests :: IO Bool+tests = do+  putStrLn "Agda.TypeChecking.Positivity"+  $quickCheckAll
src/full/Agda/TypeChecking/Pretty.hs view
@@ -9,6 +9,7 @@ import Prelude hiding (null)  import Control.Applicative hiding (empty)+import qualified Data.Map as Map import Data.Maybe  import Agda.Syntax.Position@@ -24,7 +25,10 @@ import qualified Agda.Syntax.Concrete.Pretty as CP  import Agda.TypeChecking.Monad+import Agda.TypeChecking.Positivity.Occurrence +import Agda.Utils.Graph.AdjacencyMap.Unidirectional (Graph)+import qualified Agda.Utils.Graph.AdjacencyMap.Unidirectional as Graph import Agda.Utils.Maybe import Agda.Utils.Null import Agda.Utils.Permutation (Permutation)@@ -39,10 +43,6 @@  type Doc = P.Doc -instance Null (TCM Doc) where-  empty = return empty-  null = __IMPOSSIBLE__- comma, colon, equals :: TCM Doc comma  = return P.comma colon  = return P.colon@@ -140,6 +140,7 @@ instance PrettyTCM NamedClause where prettyTCM x = prettyA =<< reify x instance PrettyTCM Level where prettyTCM x = prettyA =<< reify (Level x) instance PrettyTCM Permutation where prettyTCM = text . show+instance PrettyTCM Polarity where prettyTCM = text . show  instance PrettyTCM Clause where   prettyTCM cl = do@@ -263,6 +264,8 @@                 ]         IsEmpty r t ->             sep [ text "Is empty:", nest 2 $ prettyTCM t ]+        CheckSizeLtSat t ->+            sep [ text "Is not empty type of sizes:", nest 2 $ prettyTCM t ]  instance PrettyTCM TypeCheckingProblem where   prettyTCM (CheckExpr e a) =@@ -337,7 +340,7 @@       showPat (ConP c i ps) = (if b then braces else parens) $ prTy $         prettyTCM c <+> fsep (map (showPat . namedArg) ps)         where-        b = fromMaybe False $ conPRecord i+        b = maybe False (== ConPImplicit) $ conPRecord i         prTy d = caseMaybe (conPType i) d $ \ t -> d  <+> text ":" <+> prettyTCM t       showPat (LitP l)      = text (show l)       showPat (ProjP q)     = text (show q)@@ -346,17 +349,33 @@   prettyTCM (Apply v) = text "$" <+> prettyTCM (unArg v)   prettyTCM (Proj f)  = text "." <> prettyTCM f -instance PrettyTCM (Elim' NLPat) where-  prettyTCM (Apply v) = text "$" <+> prettyTCM (unArg v)-  prettyTCM (Proj f)  = text "." <> prettyTCM f+raisePatVars :: Int -> NLPat -> NLPat+raisePatVars k (PVar x)    = PVar (k+x)+raisePatVars k (PWild)     = PWild+raisePatVars k (PDef f es) = PDef f $ (fmap . fmap) (raisePatVars k) es+raisePatVars k (PLam i u)  = PLam i $ fmap (raisePatVars k) u+raisePatVars k (PPi a b)   = PPi ((fmap . fmap) (raisePatVars k) a) ((fmap . fmap) (raisePatVars k) b)+raisePatVars k (PBoundVar i es) = PBoundVar k $ (fmap . fmap) (raisePatVars k) es+raisePatVars k (PTerm t)   = PTerm t  instance PrettyTCM NLPat where   prettyTCM (PVar x)    = prettyTCM (var x)   prettyTCM (PWild)     = text $ "_"   prettyTCM (PDef f es) = parens $     prettyTCM f <+> fsep (map prettyTCM es)+  prettyTCM (PLam i u)  = text "λ" <+> (addContext (absName u) $ prettyTCM (raisePatVars 1 $ unAbs u))+  prettyTCM (PPi a b)   = text "Π" <+> prettyTCM (Common.unDom a) <+>+                          (addContext (absName b) $ prettyTCM (fmap (raisePatVars 1) $ unAbs b))+  prettyTCM (PBoundVar i es) = parens $ prettyTCM (var i) <+> fsep (map prettyTCM es)   prettyTCM (PTerm t)   = text "." <> parens (prettyTCM t) +instance PrettyTCM (Elim' NLPat) where+  prettyTCM (Apply v) = text "$" <+> prettyTCM (unArg v)+  prettyTCM (Proj f)  = text "." <> prettyTCM f++instance PrettyTCM (Type' NLPat) where+  prettyTCM = prettyTCM . unEl+ instance PrettyTCM RewriteRule where   prettyTCM (RewriteRule q gamma lhs rhs b) = inTopContext $ do     prettyTCM q <+> text " rule " <+> do@@ -365,3 +384,25 @@           prettyTCM lhs <+> text " --> " <+> do             prettyTCM rhs <+> text " : " <+> do               prettyTCM b++instance PrettyTCM Occurrence where+  prettyTCM GuardPos  = text "-[g+]->"+  prettyTCM StrictPos = text "-[++]->"+  prettyTCM JustPos   = text "-[+]->"+  prettyTCM JustNeg   = text "-[-]->"+  prettyTCM Mixed     = text "-[*]->"+  prettyTCM Unused    = text "-[ ]->"++-- | Pairing something with a node (for printing only).+data WithNode n a = WithNode n a++instance PrettyTCM n => PrettyTCM (WithNode n Occurrence) where+  prettyTCM (WithNode n o) = prettyTCM o <+> prettyTCM n++instance (PrettyTCM n, PrettyTCM (WithNode n e)) => PrettyTCM (Graph n n e) where+  prettyTCM g = vcat $ map pr $ Map.assocs $ Graph.graph g+    where+      pr (n, es) = sep+        [ prettyTCM n+        , nest 2 $ vcat $ map (prettyTCM . uncurry WithNode) $ Map.assocs es+        ]
src/full/Agda/TypeChecking/Pretty.hs-boot view
@@ -17,13 +17,13 @@ class PrettyTCM a where     prettyTCM :: a -> TCM Doc -instance PrettyTCM a => PrettyTCM (Closure a) where-instance PrettyTCM a => PrettyTCM [a] where+instance PrettyTCM a => PrettyTCM (Closure a)+instance PrettyTCM a => PrettyTCM [a] -instance PrettyTCM Name where-instance PrettyTCM QName where-instance PrettyTCM Term where-instance PrettyTCM Elim where-instance PrettyTCM Type where-instance PrettyTCM Sort where-instance PrettyTCM DisplayTerm where+instance PrettyTCM Name+instance PrettyTCM QName+instance PrettyTCM Term+instance PrettyTCM Elim+instance PrettyTCM Type+instance PrettyTCM Sort+instance PrettyTCM DisplayTerm
src/full/Agda/TypeChecking/Primitive.hs view
@@ -21,6 +21,7 @@ import Agda.Syntax.Position import Agda.Syntax.Common hiding (Nat) import Agda.Syntax.Internal as I+import Agda.Syntax.Internal.Generic (TermLike) import Agda.Syntax.Literal import Agda.Syntax.Concrete.Pretty () @@ -34,6 +35,7 @@ import Agda.TypeChecking.Level import Agda.TypeChecking.Quote (QuotingKit, quoteTermWithKit, quoteTypeWithKit, quoteClauseWithKit, quotingKit) import Agda.TypeChecking.Pretty ()  -- instances only+import Agda.TypeChecking.MetaVars (allMetas)  import Agda.Utils.Monad import Agda.Utils.Pretty (pretty)@@ -389,7 +391,7 @@     Max bs <- levelView' $ unArg b     redReturn $ Level $ levelMax $ as ++ bs -mkPrimFun1TCM :: (FromTerm a, ToTerm b) =>+mkPrimFun1TCM :: (FromTerm a, ToTerm b, TermLike b) =>                  TCM Type -> (a -> ReduceM b) -> TCM PrimitiveImpl mkPrimFun1TCM mt f = do     toA   <- fromTerm@@ -398,9 +400,11 @@     return $ PrimImpl t $ PrimFun __IMPOSSIBLE__ 1 $ \ts ->       case ts of         [v] ->-          redBind (toA v)-              (\v' -> [v']) $ \x ->-          redReturn =<< fromB =<< f x+          redBind (toA v) (\v' -> [v']) $ \x -> do+            b <- f x+            case allMetas b of+              (m:_) -> return $ NoReduction [reduced (Blocked m v)]+              []       -> redReturn =<< fromB b         _ -> __IMPOSSIBLE__  -- Tying the knot
src/full/Agda/TypeChecking/ProjectionLike.hs view
@@ -1,7 +1,6 @@--- GHC 7.4.2 requires this layout for the pragmas. See Issue 1460.-{-# LANGUAGE CPP,-             FlexibleInstances,-             PatternGuards #-}+{-# LANGUAGE CPP               #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE PatternGuards     #-}  #if __GLASGOW_HASKELL__ >= 710 {-# LANGUAGE FlexibleContexts #-}@@ -66,11 +65,11 @@   case ignoreSharing v of     Def f es -> caseMaybeM (isProjection f) fallback $ \ isP -> do       if projIndex isP <= 0 then fallback else do-      case es of-        []           -> return $ LoneProjectionLike f $ projArgInfo isP-        Apply a : es -> return $ ProjectionView f a es-        -- Since a projection is a function, it cannot be projected itself.-        Proj{}  : _  -> __IMPOSSIBLE__+        case es of+          []           -> return $ LoneProjectionLike f $ projArgInfo isP+          Apply a : es -> return $ ProjectionView f a es+          -- Since a projection is a function, it cannot be projected itself.+          Proj{}  : _  -> __IMPOSSIBLE__     _ -> fallback  -- | Reduce away top-level projection like functions.@@ -152,54 +151,54 @@       reportSLn "tc.proj.like" 30 $ if null ps0 then "  no candidates found"                                                 else "  candidates: " ++ show ps0       unless (null ps0) $ do-      -- Andreas 2012-09-26: only consider non-recursive functions for proj.like.-      -- Issue 700: problems with recursive funs. in term.checker and reduction-      ifM recursive (reportSLn "tc.proj.like" 30 $ "  recursive functions are not considered for projection-likeness") $ do-      ps <- return $ filter (checkOccurs cls . snd) ps0-      when (null ps) $-        reportSLn "tc.proj.like" 50 $-          "  occurs check failed\n    clauses = " ++ show cls-      case reverse ps of-        []         -> return ()-        (d, n) : _ -> do-          reportSDoc "tc.proj.like" 10 $ sep-            [ prettyTCM x <+> text " : " <+> prettyTCM t-            , text $ " is projection like in argument " ++ show n ++ " for type " ++ show d-            ]+        -- Andreas 2012-09-26: only consider non-recursive functions for proj.like.+        -- Issue 700: problems with recursive funs. in term.checker and reduction+        ifM recursive (reportSLn "tc.proj.like" 30 $ "  recursive functions are not considered for projection-likeness") $ do+          ps <- return $ filter (checkOccurs cls . snd) ps0+          when (null ps) $+            reportSLn "tc.proj.like" 50 $+              "  occurs check failed\n    clauses = " ++ show cls+          case reverse ps of+            []         -> return ()+            (d, n) : _ -> do+              reportSDoc "tc.proj.like" 10 $ sep+                [ prettyTCM x <+> text " : " <+> prettyTCM t+                , text $ " is projection like in argument " ++ show n ++ " for type " ++ show d+                ] {--          reportSLn "tc.proj.like" 10 $-            show (defName defn) ++ " is projection like in argument " ++-            show n ++ " for type " ++ show d+              reportSLn "tc.proj.like" 10 $+                show (defName defn) ++ " is projection like in argument " +++                show n ++ " for type " ++ show d -}-          let cls' = map (dropArgs n) cls-              cc   = dropArgs n cc0-          -- cc <- compileClauses (Just (x, __IMPOSSIBLE__)) cls'-          reportSLn "tc.proj.like" 60 $ "  rewrote clauses to\n    " ++ show cc+              let cls' = map (dropArgs n) cls+                  cc   = dropArgs n cc0+              -- cc <- compileClauses (Just (x, __IMPOSSIBLE__)) cls'+              reportSLn "tc.proj.like" 60 $ "  rewrote clauses to\n    " ++ show cc -          -- Andreas, 2013-10-20 build parameter dropping function-          let (ptel, Dom ai _ : _) = splitAt n $ telToList $ theTel $ telView' t-              -- leading lambdas are to ignore parameter applications-              proj = teleNoAbs ptel $ Def x []-              -- proj = foldr (\ (Dom ai (y, _)) -> Lam ai . NoAbs y) (Def x []) ptel+              -- Andreas, 2013-10-20 build parameter dropping function+              let (ptel, Dom ai _ : _) = splitAt n $ telToList $ theTel $ telView' t+                  -- leading lambdas are to ignore parameter applications+                  proj = teleNoAbs ptel $ Def x []+                  -- proj = foldr (\ (Dom ai (y, _)) -> Lam ai . NoAbs y) (Def x []) ptel -          let projection = Projection-                { projProper   = Nothing-                , projFromType = d-                , projIndex    = n + 1-                , projDropPars = proj-                , projArgInfo  = ai-                }-          let newDef = def-                       { funProjection     = Just projection-                       , funClauses        = cls'-                       , funCompiled       = cc-                       , funInv            = dropArgs n $ funInv def-                       }-          addConstant x $ defn { defPolarity       = drop n $ defPolarity defn-                               , defArgOccurrences = drop n $ defArgOccurrences defn-                               , defDisplay        = []-                               , theDef            = newDef-                               }+              let projection = Projection+                    { projProper   = Nothing+                    , projFromType = d+                    , projIndex    = n + 1+                    , projDropPars = proj+                    , projArgInfo  = ai+                    }+              let newDef = def+                           { funProjection     = Just projection+                           , funClauses        = cls'+                           , funCompiled       = cc+                           , funInv            = dropArgs n $ funInv def+                           }+              addConstant x $ defn { defPolarity       = drop n $ defPolarity defn+                                   , defArgOccurrences = drop n $ defArgOccurrences defn+                                   , defDisplay        = []+                                   , theDef            = newDef+                                   }     Function{funInv = Inverse{}} ->       reportSLn "tc.proj.like" 30 $ "  injective functions can't be projections"     Function{funAbstr = AbstractDef} ->
src/full/Agda/TypeChecking/RecordPatterns.hs view
@@ -1,9 +1,8 @@--- GHC 7.4.2 requires this layout for the pragmas. See Issue 1460.-{-# LANGUAGE CPP,-             FlexibleInstances,-             GeneralizedNewtypeDeriving,-             PatternGuards,-             TupleSections #-}+{-# LANGUAGE CPP                        #-}+{-# LANGUAGE FlexibleInstances          #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE PatternGuards              #-}+{-# LANGUAGE TupleSections              #-}  -- | Code which replaces pattern matching on record constructors with -- uses of projection functions.@@ -16,7 +15,7 @@   ) where  import Control.Applicative-import Control.Arrow ((***))+import Control.Arrow (first, second) import Control.Monad.Fix import Control.Monad.Reader import Control.Monad.State@@ -33,7 +32,7 @@ import Agda.TypeChecking.Datatypes import Agda.TypeChecking.Errors import Agda.TypeChecking.Monad-import Agda.TypeChecking.Pretty+import Agda.TypeChecking.Pretty hiding (pretty) import Agda.TypeChecking.Records import Agda.TypeChecking.Reduce import Agda.TypeChecking.Substitute@@ -44,6 +43,8 @@ import qualified Agda.Utils.Map as Map import Agda.Utils.Maybe import Agda.Utils.Permutation hiding (dropFrom)+import Agda.Utils.Pretty (Pretty(..))+import qualified Agda.Utils.Pretty as P import Agda.Utils.Size  #include "undefined.h"@@ -66,7 +67,7 @@     LitP{}       -> typeError $ ShouldBeRecordPattern p     DotP{}       -> typeError $ ShouldBeRecordPattern p     ConP c ci ps -> do-      unless (isJust $ conPRecord ci) $+      whenNothing (conPRecord ci) $         typeError $ ShouldBeRecordPattern p       t <- reduce $ fromMaybe __IMPOSSIBLE__ $ conPType ci       fields <- getRecordTypeFields (unArg t)@@ -128,9 +129,10 @@     loops :: Int                  -- split variable           -> Case CompiledClauses -- original split tree           -> TCM ([Bool], CompiledClauses)-    loops i cs@(Branches { conBranches = conMap-                         , litBranches = litMap-                         , catchAllBranch = catchAll }) = do+    loops i cs@Branches{ projPatterns   = cop+                       , conBranches    = conMap+                       , litBranches    = litMap+                       , catchAllBranch = catchAll } = do        -- recurse on and compute variable status of catch-all clause       (xssa, catchAll) <- unzipMaybe <$> Trav.mapM loop catchAll@@ -172,7 +174,8 @@       case concat $ Map.elems ccs of         -- case: no record pattern was translated         []   -> return (xs, Case i $ Branches-                  { conBranches = conMap+                  { projPatterns = cop+                  , conBranches = conMap                   , litBranches = litMap                   , catchAllBranch = catchAll }) @@ -247,10 +250,12 @@         Fail -> Fail        loops :: Int -> Case CompiledClauses -> Case CompiledClauses-      loops i Branches{ conBranches    = conMap+      loops i Branches{ projPatterns   = cop+                      , conBranches    = conMap                       , litBranches    = litMap                       , catchAllBranch = catchAll } =-        Branches{ conBranches    = fmap (\ (WithArity n c) -> WithArity n $ loop (i + n - 1) c) conMap+        Branches{ projPatterns   = cop+                , conBranches    = fmap (\ (WithArity n c) -> WithArity n $ loop (i + n - 1) c) conMap                 , litBranches    = fmap (loop (i - 1)) litMap                 , catchAllBranch = fmap (loop i) catchAll                 }@@ -414,14 +419,6 @@ -- projection functions. Does not remove record constructor patterns -- which have sub-patterns containing non-record constructor or -- literal patterns.------ If the input clause contains dot patterns inside record patterns,--- then the translation may yield clauses which are not type-correct.--- However, we believe that it is safe to use the output as input to--- 'Agda.TypeChecking.CompiledClause.Compile.compileClauses'. Perhaps--- it would be better to perform record pattern translation on the--- compiled clauses instead, but the code below has already been--- implemented and seems to work.  translateRecordPatterns :: Clause -> TCM Clause translateRecordPatterns clause = do@@ -467,20 +464,19 @@       -- The new telescope, still flattened, with types in the context       -- of the new RHS, in textual left-to-right order, and with       -- Nothing in place of dot patterns.+      substTel = map . fmap . second . applySubst       newTel' =-        map (fmap (id *** applySubst rhsSubst')) $+        substTel rhsSubst' $         translateTel cs $         flattenedOldTel        -- Permutation taking the new variable and dot patterns to the       -- new telescope.       newPerm = adjustForDotPatterns $-                  reorderTel_ $ map (maybe dummy snd) newTel'-        where-        -- It is important that dummy does not mention any variable+                  reorderTel_ $ map (maybe dummyDom snd) newTel'+        -- It is important that dummyDom does not mention any variable         -- (see the definition of reorderTel).-        dummy = dummyDom -- defaultArg (El Prop (Sort Prop))-+        where         isDotP n = case genericIndex cs n of                      Left DotP{} -> True                      _           -> False@@ -490,7 +486,7 @@        -- Substitution used to convert terms in the new RHS's context       -- to terms in the new telescope's context.-      lhsSubst' = permToSubst (reverseP newPerm)+      lhsSubst' = renaming (reverseP newPerm)        -- Substitution used to convert terms in the old telescope's       -- context to terms in the new telescope's context.@@ -499,9 +495,9 @@       -- The new telescope.       newTel =         uncurry unflattenTel . unzip $-        map (maybe __IMPOSSIBLE__ id) $+        map (fromMaybe __IMPOSSIBLE__) $         permute newPerm $-        map (fmap (id *** applySubst lhsSubst')) $+        substTel lhsSubst' $         newTel'        -- New clause.@@ -512,6 +508,30 @@             , clauseBody      = translateBody cs rhsSubst $ clauseBody clause             } +  reportSDoc "tc.lhs.recpat" 20 $ vcat+      [ text "Original clause:"+      , nest 2 $ inTopContext $ vcat+        [ text "delta =" <+> prettyTCM (clauseTel clause)+        , text "perm  =" <+> prettyTCM (clausePerm clause)+        , text "pats  =" <+> text (show $ clausePats clause)+        ]+      , text "Intermediate results:"+      , nest 2 $ vcat+        [ text "ps        =" <+> text (show ps)+        , text "s         =" <+> prettyList (map prettyTCM s)+        , text "cs        =" <+> prettyList (map prettyTCM cs)+        , text "flattenedOldTel =" <+> (text . show) flattenedOldTel+        , text "newTel'   =" <+> (text . show) newTel'+        , text "newPerm   =" <+> prettyTCM newPerm+        ]+      ]++  reportSDoc "tc.lhs.recpat" 20 $ vcat+        [ text "lhsSubst' =" <+> (text . show) lhsSubst'+        , text "lhsSubst  =" <+> (text . show) lhsSubst+        , text "newTel  =" <+> prettyTCM newTel+        ]+   reportSDoc "tc.lhs.recpat" 10 $     escapeContext (size $ clauseTel clause) $ vcat       [ text "Translated clause:"@@ -558,7 +578,7 @@   n <- lift get   lift $ put $ succ n   noVars <- lift ask-  return (VarP "r", Var (noVars - n - 1) [])+  return (VarP "r", var $ noVars - n - 1)  ------------------------------------------------------------------------ -- Types used to record changes to a clause@@ -575,8 +595,21 @@ -- patterns, should be removed, and a new variable, with the name @x@, -- inserted instead. The type of the new variable is @t@. -type Changes = [Either Pattern (Kind -> Nat, ArgName, I.Dom Type)]+type Change  = Either Pattern (Kind -> Nat, ArgName, I.Dom Type)+type Changes = [Change] +instance Pretty (Kind -> Nat) where+  pretty f =+    P.text "(VarPat:" P.<+> P.text (show $ f VarPat) P.<+>+    P.text "DotPat:"  P.<+> P.text (show $ f DotPat) P.<> P.text ")"++instance PrettyTCM (Kind -> Nat) where+  prettyTCM = return . pretty++instance PrettyTCM Change where+  prettyTCM (Left  p) = prettyTCM p+  prettyTCM (Right (f, x, t)) = text "Change" <+> prettyTCM f <+> text x <+> prettyTCM t+ -- | Record pattern trees.  data RecordTree@@ -603,8 +636,7 @@ projections (Leaf (VarP{})) = [(id, VarPat)] projections (Leaf _)        = __IMPOSSIBLE__ projections (RecCon _ args) =-  concatMap (\(p, t) -> map (\(p', k) -> (p' . p, k))-                            (projections t))+  concatMap (\ (p, t) -> map (first (. p)) $ projections t)             args  -- | Converts a record tree to a single pattern along with information@@ -650,18 +682,19 @@  translatePattern :: Pattern -> RecPatM (Pattern, [Term], Changes) translatePattern p@(ConP c ci ps)-  | Nothing <- conPRecord ci = do-      (ps, s, cs) <- translatePatterns ps-      return (ConP c ci ps, s, cs)-  | otherwise = do+  -- Andreas, 2015-05-28 only translate implicit record patterns+  | Just ConPImplicit <- conPRecord ci = do       r <- recordTree p       case r of         Left  r -> r         Right t -> removeTree t+  | otherwise = do+      (ps, s, cs) <- translatePatterns ps+      return (ConP c ci ps, s, cs) translatePattern p@VarP{} = removeTree (Leaf p) translatePattern p@DotP{} = removeTree (Leaf p) translatePattern p@LitP{} = return (p, [], [])-translatePattern p@ProjP{}= __IMPOSSIBLE__+translatePattern p@ProjP{}= return (p, [], [])  translatePatterns :: [I.NamedArg Pattern] -> RecPatM ([I.NamedArg Pattern], [Term], Changes) translatePatterns ps = do@@ -685,8 +718,8 @@ recordTree ::   Pattern ->   RecPatM (Either (RecPatM (Pattern, [Term], Changes)) RecordTree)-recordTree p@(ConP _ ci _) | Nothing <- conPRecord ci = return $ Left $ translatePattern p-recordTree (ConP c ci ps) = do+-- Andreas, 2015-05-28 only translate implicit record patterns+recordTree (ConP c ci ps) | Just ConPImplicit <- conPRecord ci = do   let t = fromMaybe __IMPOSSIBLE__ $ conPType ci   rs <- mapM (recordTree . namedArg) ps   case allRight rs of@@ -701,10 +734,11 @@ --      let proj p = \x -> Def (unArg p) [defaultArg x]       let proj p = (`applyE` [Proj $ unArg p])       return $ Right $ RecCon t $ zip (map proj fields) ts+recordTree p@(ConP _ ci _) = return $ Left $ translatePattern p recordTree p@VarP{} = return (Right (Leaf p)) recordTree p@DotP{} = return (Right (Leaf p)) recordTree p@LitP{} = return $ Left $ translatePattern p-recordTree p@ProjP{}= __IMPOSSIBLE__+recordTree p@ProjP{}= return $ Left $ translatePattern p  ------------------------------------------------------------------------ -- Translation of the clause telescope and body@@ -744,16 +778,6 @@  ------------------------------------------------------------------------ -- Helper functions---- | Turns a permutation into a substitution.--permToSubst :: Permutation -> Substitution-permToSubst (Perm n is) =-  [ makeVar i | i <- [0..n - 1] ] ++# raiseS (size is)-  where-  makeVar i = case genericElemIndex i is of-    Nothing -> __IMPOSSIBLE__-    Just k  -> var k  -- | @dropBinds n b@ drops the initial @n@ occurrences of 'Bind' from @b@. --
src/full/Agda/TypeChecking/Records.hs view
@@ -30,6 +30,7 @@ import Agda.Utils.Functor (for, ($>)) import Agda.Utils.Maybe import Agda.Utils.Monad+import Agda.Utils.Null import qualified Agda.Utils.HashMap as HMap import Agda.Utils.Pretty (prettyShow) import Agda.Utils.Size@@ -41,16 +42,13 @@ --   Use the second argument for missing fields. orderFields :: QName -> a -> [C.Name] -> [(C.Name, a)] -> TCM [a] orderFields r def xs fs = do-  shouldBeNull (ys \\ nub ys) $ DuplicateFields . nub-  shouldBeNull (ys \\ xs)     $ TooManyFields r+  unlessNull (ys \\ nub ys) $ typeError . DuplicateFields . nub+  unlessNull (ys \\ xs)     $ typeError . TooManyFields r   -- shouldBeNull (xs \\ ys)     $ TooFewFields r   return $ order xs fs   where     ys = map fst fs -    shouldBeNull [] err = return ()-    shouldBeNull xs err = typeError $ err xs-     -- invariant: the first list contains at least the fields of the second list     order [] [] = []     order [] _  = __IMPOSSIBLE__@@ -109,6 +107,12 @@         _ -> __IMPOSSIBLE__     _ -> __IMPOSSIBLE__ +-- | Get the original name of the projection+--   (the current one could be from a module application).+getOriginalProjection :: QName -> TCM QName+getOriginalProjection q = do+  proj <- fromMaybe __IMPOSSIBLE__ <$> isProjection q+  return $ fromMaybe __IMPOSSIBLE__ $ projProper proj  -- | Get the type of the record constructor. getRecordConstructorType :: QName -> TCM Type@@ -149,35 +153,17 @@       caseMaybeM (isRecord r) no $ \ def -> return $ Right (r,vs,def)     _ -> no --- | The analogue of 'piApply'.  If @v@ is a value of record type @T@---   with field @f@, then @projectType T f@ returns the type of @f v@.-projectType :: Type -> QName -> TCM (Maybe Type)-projectType t f = do-  res <- isRecordType t-  case res of-    Nothing -> return Nothing-    Just (_r, ps, _rdef) -> do-      def <- getConstInfo f-      if (isProperProjection $ theDef def)-        then return $ Just $ defType def `apply` ps-        else return Nothing--{- DEPRECATED, use Signature.getDefType instead!---- | @projectionType t f@ returns the type of projection or---   projection-like function @t@ applied to the parameters,---   which are read of @t@.---   It fails if @t@ is not a @Def@ applied to the parameters.-projectionType :: Type -> QName -> TCM (Maybe Type)-projectionType t f = do-  t <- reduce t-  case ignoreSharing $ unEl t of-    Def _ es -> do-      flip (maybe $ return Nothing) (allApplyElims es) $ \ pars -> do-        ft <- defType <$> getConstInfo f  -- type of projection(like) function-        return $ Just $ ft `piApply` pars-    _ -> return Nothing--}+-- | The analogue of 'piApply'.  If @v@ is a value of record type @t@+--   with field @f@, then @projectTyped v t f@ returns the type of @f v@.+--+--   Works also for projection-like definitions @f@.+--+--   Precondition: @t@ is reduced.+projectTyped :: Term -> Type -> QName -> TCM (Maybe (Term, Type))+projectTyped v t f = caseMaybeM (getDefType f t) (return Nothing) $ \ tf -> do+  (dom, b) <- mustBePi tf+  u <- f `applyDef` (argFromDom dom $> v)+  return $ Just (u, b `absApp` v)  -- | Check if a name refers to an eta expandable record. {-# SPECIALIZE isEtaRecord :: QName -> TCM Bool #-}@@ -206,8 +192,8 @@  -- | Check if a name refers to a record constructor. --   If yes, return record definition.-isRecordConstructor :: QName -> TCM (Maybe (QName, Defn))-isRecordConstructor c = do+isRecordConstructor :: MonadTCM tcm => QName -> tcm (Maybe (QName, Defn))+isRecordConstructor c = liftTCM $ do   def <- theDef <$> getConstInfo c   case def of     Constructor{ conData = r } -> fmap (r,) <$> isRecord r@@ -259,15 +245,30 @@ Postcondition: @Δ = Γ₁, Γ', Γ₂[c Γ']@ and @Γ ⊢ σ : Δ@ and @Δ ⊢ τ : Γ@. -} etaExpandBoundVar :: Int -> TCM (Maybe (Telescope, Substitution, Substitution))-etaExpandBoundVar i = do-  -- Get the context with last variable added first in list.-  gamma <- getContext-  -- Extract type of @i@th variable.-  let (gamma2, dom@(Dom ai (x, a)) : gamma1) = splitAt i gamma+etaExpandBoundVar i = fmap (\ (delta, sigma, tau, _) -> (delta, sigma, tau)) <$> do+  expandRecordVar i =<< getContextTelescope++-- | @expandRecordVar i Γ = (Δ, σ, τ, Γ')@+--+--   Precondition: @Γ = Γ₁, x:R pars, Γ₂@ where+--     @|Γ₂| = i@ and @R@ is a eta-expandable record type+--     with constructor @c@ and fields @Γ'@.+--+--   Postcondition: @Δ = Γ₁, Γ', Γ₂[c Γ']@ and @Γ ⊢ σ : Δ@ and @Δ ⊢ τ : Γ@.++expandRecordVar :: Int -> Telescope -> TCM (Maybe (Telescope, Substitution, Substitution, Telescope))+expandRecordVar i gamma0 = do+  -- Get the context with last variable added last in list.+  let gamma = telToList gamma0+  -- Convert the de Bruijn index i to a de Bruijn level+      l     = size gamma - 1 - i+  -- Extract type of @i@th de Bruijn index.+  -- Γ = Γ₁, x:a, Γ₂+  let (gamma1, dom@(Dom ai (x, a)) : gamma2) = splitAt l gamma   -- This must be a eta-expandable record type.   let failure = do         reportSDoc "tc.meta.assign.proj" 25 $-          text "failed to eta-expand variable " <+> prettyTCM x <+>+          text "failed to eta-expand variable " <+> pretty x <+>           text " since its type " <+> prettyTCM a <+>           text " is not a record type"         return Nothing@@ -290,20 +291,32 @@           zs  = for fs $ fmap $ \ f -> Var 0 [Proj f]       --  We need to reverse the field sequence to build the substitution.       -- @Γ₁, x:_ ⊢ σ₀ : Γ₁, Γ'@-          sigma0 = parallelS $ reverse $ map unArg zs+          sigma0 = reverse (map unArg zs) ++# raiseS 1       -- @Γ₁, x:_, Γ₂ ⊢ σ₀ : Γ₁, Γ', Γ₂@           sigma  = liftS (size gamma2) sigma0        -- Construct @Δ@ as telescope.       -- Note @Γ₁, x:_ ⊢ Γ₂@, thus, @Γ₁, Γ' ⊢ [τ₀]Γ₂@ -          rev   = foldl (\ l (Dom ai (n, t)) -> Dom ai (nameToArgName n, t) : l) []           -- Use "f(x)" as variable name for the projection f(x).           s     = prettyShow x           tel'  = mapAbsNames (\ f -> stringToArgName $ argNameToString f ++ "(" ++ s ++ ")") tel-          delta = telFromList $ rev gamma1 ++ telToList tel' ++ rev (applySubst tau0 gamma2)+          delta = telFromList $ gamma1 ++ telToList tel' ++ applySubst tau0 gamma2 -      return (delta, sigma, tau)+      return (delta, sigma, tau, tel)++-- | Precondition: variable list is ordered descendingly.  Can be empty.+expandRecordVarsRecursively :: [Int] -> Telescope -> TCM (Telescope, Substitution, Substitution)+expandRecordVarsRecursively [] gamma = return (gamma, idS, idS)+expandRecordVarsRecursively (i : is) gamma = do+  caseMaybeM (expandRecordVar i gamma) (expandRecordVarsRecursively is gamma)+  $ \ (gamma1, sigma1, tau1, tel) -> do+    -- Γ ⊢ σ₁ : Γ₁  and  Γ₁ ⊢ τ₁ : Γ+    let n = size tel+        newis = take n $ downFrom $ i + n+    (gamma2, sigma2, tau2) <- expandRecordVarsRecursively (newis ++ is) gamma1+    -- Γ₁ ⊢ σ₂ : Γ₂  and  Γ₂ ⊢ τ₂ : Γ₁+    return (gamma2, applySubst sigma1 sigma2, applySubst tau2 tau1)  -- | @curryAt v (Γ (y : R pars) -> B) n = --     ( \ v -> λ Γ ys → v Γ (c ys)            {- curry   -}
src/full/Agda/TypeChecking/Reduce.hs view
@@ -21,6 +21,7 @@  import Agda.Syntax.Position import Agda.Syntax.Common hiding (Arg, Dom, NamedArg, ArgInfo)+import qualified Agda.Syntax.Common as Common import Agda.Syntax.Internal import Agda.Syntax.Scope.Base (Scope) import Agda.Syntax.Literal@@ -41,6 +42,7 @@ import {-# SOURCE #-} Agda.TypeChecking.Pretty import {-# SOURCE #-} Agda.TypeChecking.Rewriting +import Agda.Utils.Either import Agda.Utils.Function import Agda.Utils.Functor import Agda.Utils.Monad@@ -187,6 +189,7 @@   instantiate' (UnBlock m)          = return $ UnBlock m   instantiate' (FindInScope m args) = FindInScope m <$> mapM instantiate' args   instantiate' (IsEmpty r t)        = IsEmpty r <$> instantiate' t+  instantiate' (CheckSizeLtSat t)   = CheckSizeLtSat <$> instantiate' t  instance (Ord k, Instantiate e) => Instantiate (Map k e) where     instantiate' = traverse instantiate'@@ -321,11 +324,6 @@       ExtLam{}   -> __IMPOSSIBLE__       Shared{}   -> __IMPOSSIBLE__ -- updateSharedTermF reduceB' v     where-      rewriteAfter :: (Term -> ReduceM (Blocked Term)) -> Term -> ReduceM (Blocked Term)-      rewriteAfter f = trampolineM $ \ v -> do-        vb <- f v-        caseMaybeM (rewrite $ ignoreBlocking vb) (return $ Left vb) $ \ u ->-          return $ Right u       -- NOTE: reduceNat can traverse the entire term.       reduceNat v@Shared{} = __IMPOSSIBLE__ -- updateSharedTerm reduceNat v       reduceNat v@(Con c []) = do@@ -344,6 +342,24 @@               _                -> Con c [defaultArg w]       reduceNat v = return v +rewriteAfter :: (Term -> ReduceM (Blocked Term)) -> Term -> ReduceM (Blocked Term)+rewriteAfter f = trampolineM $ rewrite <=< f++-- Andreas, 2013-03-20 recursive invokations of unfoldCorecursion+-- need also to instantiate metas, see Issue 826.+unfoldCorecursionE :: Elim -> ReduceM (Blocked Elim)+unfoldCorecursionE e@(Proj f)           = return $ notBlocked e+unfoldCorecursionE (Apply (Common.Arg info v)) = fmap (Apply . Common.Arg info) <$>+  unfoldCorecursion v++unfoldCorecursion :: Term -> ReduceM (Blocked Term)+unfoldCorecursion = rewriteAfter $ \ v -> do+  v <- instantiate' v+  case v of+    Def f es -> unfoldDefinitionE True unfoldCorecursion (Def f []) f es+    Shared{} -> fmap shared <$> unfoldCorecursion (ignoreSharing v) -- don't update when unfolding corecursion!+    _          -> reduceB' v+ -- | If the first argument is 'True', then a single delayed clause may -- be unfolded. unfoldDefinition ::@@ -602,6 +618,7 @@   reduce' (UnBlock m)           = return $ UnBlock m   reduce' (FindInScope m cands) = FindInScope m <$> mapM reduce' cands   reduce' (IsEmpty r t)         = IsEmpty r <$> reduce' t+  reduce' (CheckSizeLtSat t)    = CheckSizeLtSat <$> reduce' t  instance (Ord k, Reduce e) => Reduce (Map k e) where     reduce' = traverse reduce'@@ -732,6 +749,7 @@   simplify' (UnBlock m)           = return $ UnBlock m   simplify' (FindInScope m cands) = FindInScope m <$> mapM simplify' cands   simplify' (IsEmpty r t)         = IsEmpty r <$> simplify' t+  simplify' (CheckSizeLtSat t)    = CheckSizeLtSat <$> simplify' t  instance Simplify Bool where   simplify' = return@@ -871,6 +889,7 @@   normalise' (UnBlock m)           = return $ UnBlock m   normalise' (FindInScope m cands) = FindInScope m <$> mapM normalise' cands   normalise' (IsEmpty r t)         = IsEmpty r <$> normalise' t+  normalise' (CheckSizeLtSat t)    = CheckSizeLtSat <$> normalise' t  instance Normalise Bool where   normalise' = return@@ -920,7 +939,7 @@             Inf        -> return s             SizeUniv   -> return s -instance InstantiateFull Type where+instance (InstantiateFull a) => InstantiateFull (Type' a) where     instantiateFull' (El s t) =       El <$> instantiateFull' s <*> instantiateFull' t @@ -1039,6 +1058,7 @@     UnBlock m           -> return $ UnBlock m     FindInScope m cands -> FindInScope m <$> mapM instantiateFull' cands     IsEmpty r t         -> IsEmpty r <$> instantiateFull' t+    CheckSizeLtSat t    -> CheckSizeLtSat <$> instantiateFull' t  instance (InstantiateFull a) => InstantiateFull (Elim' a) where   instantiateFull' (Apply v) = Apply <$> instantiateFull' v@@ -1057,7 +1077,7 @@     instantiateFull' = return  instance InstantiateFull Signature where-  instantiateFull' (Sig a b) = uncurry Sig <$> instantiateFull' (a, b)+  instantiateFull' (Sig a b c) = uncurry3 Sig <$> instantiateFull' (a, b, c)  instance InstantiateFull Section where   instantiateFull' (Section tel n) = flip Section n <$> instantiateFull' tel@@ -1070,14 +1090,17 @@     instantiateFull' = return  instance InstantiateFull Definition where-    instantiateFull' (Defn rel x t pol occ df i c rew inst d) = do-      (t, (df, d, rew)) <- instantiateFull' (t, (df, d, rew))-      return $ Defn rel x t pol occ df i c rew inst d+    instantiateFull' (Defn rel x t pol occ df i c inst d) = do+      (t, df, d) <- instantiateFull' (t, df, d)+      return $ Defn rel x t pol occ df i c inst d  instance InstantiateFull NLPat where   instantiateFull' (PVar x)   = return $ PVar x   instantiateFull' (PWild)    = return PWild   instantiateFull' (PDef x y) = PDef <$> instantiateFull' x <*> instantiateFull' y+  instantiateFull' (PLam x y) = PLam x <$> instantiateFull' y+  instantiateFull' (PPi x y)  = PPi <$> instantiateFull' x <*> instantiateFull' y+  instantiateFull' (PBoundVar x y) = PBoundVar x <$> instantiateFull' y   instantiateFull' (PTerm x)  = PTerm <$> instantiateFull' x  instance InstantiateFull RewriteRule where@@ -1129,10 +1152,11 @@   instantiateFull' (WithArity n a) = WithArity n <$> instantiateFull' a  instance InstantiateFull a => InstantiateFull (Case a) where-  instantiateFull' (Branches cs ls m) =-    Branches <$> instantiateFull' cs-             <*> instantiateFull' ls-             <*> instantiateFull' m+  instantiateFull' (Branches cop cs ls m) =+    Branches cop+      <$> instantiateFull' cs+      <*> instantiateFull' ls+      <*> instantiateFull' m  instance InstantiateFull CompiledClauses where   instantiateFull' Fail        = return Fail
src/full/Agda/TypeChecking/Reduce/Monad.hs view
@@ -3,6 +3,8 @@ {-# LANGUAGE TupleSections #-} {-# LANGUAGE RankNTypes #-} +{-# OPTIONS_GHC -fno-warn-orphans #-}+ module Agda.TypeChecking.Reduce.Monad   ( constructorForm   , enterClosure@@ -15,13 +17,16 @@   , askR, applyWhenVerboseS   ) where +import Prelude hiding (null)+ import Control.Arrow ((***), first, second)-import Control.Applicative+import Control.Applicative hiding (empty) import Control.Monad.Reader import Control.Monad.Identity  import qualified Data.Map as Map import Data.Maybe+import Data.Monoid  import Debug.Trace import System.IO.Unsafe@@ -39,6 +44,7 @@ import qualified Agda.Utils.HashMap as HMap import Agda.Utils.Lens import Agda.Utils.Monad+import Agda.Utils.Null import Agda.Utils.Pretty  #include "undefined.h"@@ -161,6 +167,7 @@ traceSLn k n s = applyWhenVerboseS k n (trace s)  instance HasConstInfo ReduceM where+  getRewriteRulesFor = defaultGetRewriteRulesFor (gets id)   getConstInfo q = ReduceM $ ReaderT $ \(ReduceEnv env st) -> Identity $     let defs  = sigDefinitions $ st^.stSignature         idefs = sigDefinitions $ st^.stImports@@ -182,8 +189,4 @@             _                 -> q            dropLastModule q@QName{ qnameModule = m } =-            q{ qnameModule = mnameFromList $ init' $ mnameToList m }--          init' [] = {-'-} __IMPOSSIBLE__-          init' xs = init xs-+            q{ qnameModule = mnameFromList $ ifNull (mnameToList m) __IMPOSSIBLE__ init }
src/full/Agda/TypeChecking/Rewriting.hs view
@@ -45,6 +45,7 @@  import Prelude hiding (null) +import Control.Applicative hiding (empty) import Control.Monad import Control.Monad.Reader (local) @@ -52,7 +53,10 @@ import Data.IntSet (IntSet) import qualified Data.IntSet as IntSet import qualified Data.List as List+import Data.Monoid +import Agda.Interaction.Options+ import Agda.Syntax.Common import Agda.Syntax.Internal as I @@ -69,6 +73,7 @@  import qualified Agda.TypeChecking.Reduce.Monad as Red +import Agda.Utils.Functor import Agda.Utils.Maybe import Agda.Utils.Monad import Agda.Utils.Null@@ -78,12 +83,17 @@ #include "undefined.h" import Agda.Utils.Impossible +requireOptionRewriting :: TCM ()+requireOptionRewriting =+  unlessM (optRewriting <$> pragmaOptions) $ typeError NeedOptionRewriting+ -- | Check that the name given to the BUILTIN REWRITE is actually --   a relation symbol. --   I.e., its type should be of the form @Δ → (lhs rhs : A) → Set ℓ@. --   Note: we do not care about hiding/non-hiding of lhs and rhs. verifyBuiltinRewrite :: Term -> Type -> TCM () verifyBuiltinRewrite v t = do+  requireOptionRewriting   let failure reason = typeError . GenericDocError =<< sep        [ prettyTCM v <+> text " does not have the right type for a rewriting relation"        , reason@@ -91,20 +101,20 @@   caseMaybeM (relView t)     (failure $ text "because it should accept at least two arguments") $     \ (RelView tel delta a b core) -> do-  case ignoreSharing (unEl core) of-    Sort{} -> do-      -- Check that the types of the last two arguments are equal.-      unlessM (tryConversion $-                 inTopContext $ addContext tel $ escapeContext 1 $-                   equalType (raise 1 a) b) $-        failure $ text $ "because the types of the last two arguments are different"-    Con{}    -> __IMPOSSIBLE__-    Level{}  -> __IMPOSSIBLE__-    Lam{}    -> __IMPOSSIBLE__-    Pi{}     -> __IMPOSSIBLE__-    Shared{} -> __IMPOSSIBLE__-    _ -> failure $ text "because its type does not end in a sort, but in "-           <+> do inTopContext $ addContext tel $ prettyTCM core+    case ignoreSharing (unEl core) of+      Sort{} -> do+        -- Check that the types of the last two arguments are equal.+        unlessM (tryConversion $+                   inTopContext $ addContext tel $ escapeContext 1 $+                     equalType (raise 1 a) b) $+          failure $ text $ "because the types of the last two arguments are different"+      Con{}    -> __IMPOSSIBLE__+      Level{}  -> __IMPOSSIBLE__+      Lam{}    -> __IMPOSSIBLE__+      Pi{}     -> __IMPOSSIBLE__+      Shared{} -> __IMPOSSIBLE__+      _ -> failure $ text "because its type does not end in a sort, but in "+             <+> do inTopContext $ addContext tel $ prettyTCM core  -- | Deconstructing a type into @Δ → t → t' → core@. data RelView = RelView@@ -123,8 +133,8 @@   let n                = size tel       (delta, lastTwo) = splitAt (n - 2) $ telToList tel   if size lastTwo < 2 then return Nothing else do-  let [a, b] = snd . unDom <$> lastTwo-  return $ Just $ RelView tel delta a b core+    let [a, b] = snd . unDom <$> lastTwo+    return $ Just $ RelView tel delta a b core  -- | Add @q : Γ → rel us lhs rhs@ as rewrite rule --   @@@ -137,17 +147,30 @@ --   Makes only sense in empty context. addRewriteRule :: QName -> TCM () addRewriteRule q = inTopContext $ do+  requireOptionRewriting   Def rel _ <- primRewrite+  def <- getConstInfo q+  -- Issue 1651: Check that we are not adding a rewrite rule+  -- for a type signature whose body has not been type-checked yet.+  when (isEmptyFunction $ theDef def) $+    typeError . GenericDocError =<< hsep+      [ text "Rewrite rule from function "+      , prettyTCM q+      , text " cannot be added before the function definition"+      ]   -- We know that the type of rel is that of a relation.   Just (RelView _tel delta a _a' _core) <- relView =<< do     defType <$> getConstInfo rel   reportSDoc "rewriting" 30 $ do     text "rewrite relation at type " <+> do-    inTopContext     $ prettyTCM (telFromList delta) <+> text " |- " <+> do-    addContext delta $ prettyTCM a+      inTopContext $ prettyTCM (telFromList delta) <+> text " |- " <+> do+        addContext delta $ prettyTCM a   -- Get rewrite rule (type of q).-  t <- defType <$> getConstInfo q-  TelV gamma core <- telView t+  TelV gamma core <- telView $ defType def+  reportSDoc "rewriting" 30 $ do+    text "attempting to add rewrite rule of type " <+> do+      inTopContext $ prettyTCM gamma <+> text " |- " <+> do+        addContext gamma $ prettyTCM core    let failureWrongTarget = typeError . GenericDocError =<< hsep         [ prettyTCM q , text " does not target rewrite relation" ]@@ -173,7 +196,8 @@           n  = size vs           (us, [lhs, rhs]) = splitAt (n - 2) vs       unless (size delta == size us) __IMPOSSIBLE__-      let b  = applySubst (parallelS $ reverse us) a+      b <- instantiateFull $ applySubst (parallelS $ reverse us) a+      gamma <- instantiateFull gamma        -- Find head symbol f of the lhs.       f <- case ignoreSharing lhs of@@ -188,7 +212,7 @@       -- Normalize rhs: might be more efficient.       rhs <- etaContract =<< normalise rhs       unless (null $ allMetas (telToList gamma, lhs, rhs, b)) failureMetas-      pat <- patternFrom lhs+      pat <- patternFrom 0 lhs       let rew = RewriteRule q gamma pat rhs b       reportSDoc "rewriting" 10 $ addContext gamma $         text "considering rewrite rule " <+> prettyTCM rew@@ -227,81 +251,89 @@ addRewriteRules :: QName -> RewriteRules -> TCM () addRewriteRules f rews = do   reportSDoc "rewriting" 10 $ text "rewrite rule ok, adding it to the definition of " <+> prettyTCM f-  modifySignature $ updateDefinition f $ updateRewriteRules $ (++ rews)-  rules <- defRewriteRules <$> getConstInfo f+  modifySignature $ addRewriteRulesFor f rews+  rules <- getRewriteRulesFor f   reportSDoc "rewriting" 20 $ vcat     [ text "rewrite rules for " <+> prettyTCM f <+> text ":"     , vcat (map prettyTCM rules)     ] --- | Lens for 'RewriteRules'.-updateRewriteRules :: (RewriteRules -> RewriteRules) -> Definition -> Definition-updateRewriteRules f def = def { defRewriteRules = f (defRewriteRules def) }- -- | @rewriteWith t v rew@ --   tries to rewrite @v : t@ with @rew@, returning the reduct if successful.-rewriteWith :: Maybe Type -> Term -> RewriteRule -> ReduceM (Maybe Term)+rewriteWith :: Maybe Type -> Term -> RewriteRule -> ReduceM (Either (Blocked Term) Term) rewriteWith mt v (RewriteRule q gamma lhs rhs b) = do   Red.traceSDoc "rewriting" 95 (sep     [ text "attempting to rewrite term " <+> prettyTCM v     , text " with rule " <+> prettyTCM q     ]) $ do-  let no = return Nothing-  caseMaybeM (nonLinMatch lhs v) no $ \ sub -> do-    let v' = applySubst sub rhs-    Red.traceSDoc "rewriting" 90 (sep-      [ text "rewrote " <+> prettyTCM v-      , text " to " <+> prettyTCM v'-      ]) $ do-    return $ Just v'+    result <- nonLinMatch lhs v+    case result of+      Left block -> return $ Left $ const v <$> block+      Right sub  -> do+        let v' = applySubst sub rhs+        Red.traceSDoc "rewriting" 90 (sep+          [ text "rewrote " <+> prettyTCM v+          , text " to " <+> prettyTCM v'+          ]) $ return $ Right v' -  {- OLD CODE:-  -- Freeze all metas, remember which one where not frozen before.-  -- This ensures that we do not instantiate metas while matching-  -- on the rewrite lhs.-  ms <- freezeMetas-  res <- tryConversion' $ do+    {- OLD CODE:+    -- Freeze all metas, remember which one where not frozen before.+    -- This ensures that we do not instantiate metas while matching+    -- on the rewrite lhs.+    ms <- freezeMetas+    res <- tryConversion' $ do -    -- Create new metas for the lhs variables of the rewriting rule.-    xs <- newTelMeta gamma-    let sigma        = parallelS $ map unArg xs-        (lhs', rhs', b') = applySubst sigma (lhs, rhs, b)-    -- Unify type and term with type and lhs of rewrite rule.-    whenJust mt $ \ t -> leqType t b'-    local (\ e -> e {envCompareBlocked = True}) $ equalTerm b' lhs' v-    -- Check that all variables have been solved for.-    unlessM (isInstantiatedMeta xs) $ do-      reportSDoc "rewriting" 20 $ text "lhs variables solved with: " <+> do-        sep $ map prettyTCM xs-      -- The following error is caught immediately by tryConversion.-      typeError $ GenericError $ "free variables not bound by left hand side"-    return rhs'+      -- Create new metas for the lhs variables of the rewriting rule.+      xs <- newTelMeta gamma+      let sigma        = parallelS $ map unArg xs+          (lhs', rhs', b') = applySubst sigma (lhs, rhs, b)+      -- Unify type and term with type and lhs of rewrite rule.+      whenJust mt $ \ t -> leqType t b'+      local (\ e -> e {envCompareBlocked = True}) $ equalTerm b' lhs' v+      -- Check that all variables have been solved for.+      unlessM (isInstantiatedMeta xs) $ do+        reportSDoc "rewriting" 20 $ text "lhs variables solved with: " <+> do+          sep $ map prettyTCM xs+        -- The following error is caught immediately by tryConversion.+        typeError $ GenericError $ "free variables not bound by left hand side"+      return rhs' -  -- Thaw metas that were frozen by a call to this function.-  unfreezeMetas' (`elem` ms)-  return res-}+    -- Thaw metas that were frozen by a call to this function.+    unfreezeMetas' (`elem` ms)+    return res-}  -- | @rewrite t@ tries to rewrite a reduced term.-rewrite :: Term -> ReduceM (Maybe Term)-rewrite v = do+rewrite :: Blocked Term -> ReduceM (Either (Blocked Term) Term)+rewrite bv = ifNotM (optRewriting <$> pragmaOptions) (return $ Left bv) $ {- else -} do+  let v     = ignoreBlocking bv   case ignoreSharing v of     -- We only rewrite @Def@s and @Con@s.     Def f es -> rew f (Def f) es     Con c vs -> rew (conName c) hd (Apply <$> vs)       where hd es = Con c $ fromMaybe __IMPOSSIBLE__ $ allApplyElims es-    _ -> return Nothing+    _ -> return $ Left bv   where     -- Try all rewrite rules for f.-    rew :: QName -> (Elims -> Term) -> Elims -> ReduceM (Maybe Term)-    rew f hd es = loop =<< do defRewriteRules <$> getConstInfo f+    rew :: QName -> (Elims -> Term) -> Elims -> ReduceM (Either (Blocked Term) Term)+    rew f hd es = do+      rules <- getRewriteRulesFor f+      case rules of+        [] -> return $ Left $ bv $> hd es+        _  -> do+          es <- etaContract =<< instantiateFull' es+          loop (void bv) es rules       where-      loop [] = return Nothing-      loop (rew:rews)+      loop :: Blocked_ -> Elims -> [RewriteRule] -> ReduceM (Either (Blocked Term) Term)+      loop block es [] = return $ Left $ block $> hd es+      loop block es (rew:rews)        | let n = rewArity rew, length es >= n = do            let (es1, es2) = List.genericSplitAt n es-           caseMaybeM (rewriteWith Nothing (hd es1) rew) (loop rews) $ \ w ->-             return $ Just $ w `applyE` es2-       | otherwise = loop rews+           result <- rewriteWith Nothing (hd es1) rew+           case result of+             Left (Blocked m u)    -> loop (block `mappend` Blocked m ()) es rews+             Left (NotBlocked _ _) -> loop block es rews+             Right w               -> return $ Right $ w `applyE` es2+       | otherwise = loop (block `mappend` NotBlocked Underapplied ()) es rews  ------------------------------------------------------------------------ -- * Auxiliary functions@@ -319,6 +351,9 @@       PVar i    -> singleton i       PDef _ es -> nlPatVars es       PWild     -> empty+      PLam _ p' -> nlPatVars $ unAbs p'+      PPi a b   -> nlPatVars a `IntSet.union` nlPatVars (unAbs b)+      PBoundVar _ es -> nlPatVars es       PTerm{}   -> empty  rewArity :: RewriteRule -> Int
src/full/Agda/TypeChecking/Rewriting.hs-boot view
@@ -4,4 +4,4 @@ import Agda.TypeChecking.Monad.Base  verifyBuiltinRewrite :: Term -> Type -> TCM ()-rewrite :: Term -> ReduceM (Maybe Term)+rewrite :: Blocked Term -> ReduceM (Either (Blocked Term) Term)
src/full/Agda/TypeChecking/Rewriting/NonLinMatch.hs view
@@ -1,7 +1,7 @@--- GHC 7.4.2 requires this layout for the pragmas. See Issue 1460.-{-# LANGUAGE CPP,-             FlexibleInstances,-             MultiParamTypeClasses #-}+{-# LANGUAGE CPP                   #-}+{-# LANGUAGE FlexibleContexts      #-}+{-# LANGUAGE FlexibleInstances     #-}+{-# LANGUAGE MultiParamTypeClasses #-}  {- |  Non-linear matching of the lhs of a rewrite rule against a       neutral term.@@ -23,10 +23,11 @@  module Agda.TypeChecking.Rewriting.NonLinMatch where -import Prelude hiding (sequence)+import Prelude hiding (null, sequence) +import Control.Arrow (first, second) import Control.Monad.Trans.Maybe-import Control.Monad.Writer hiding (forM, sequence)+import Control.Monad.State  import Debug.Trace import System.IO.Unsafe@@ -36,72 +37,69 @@ import Data.Traversable hiding (for) import Data.IntMap (IntMap) import qualified Data.IntMap as IntMap+import Data.IntSet (IntSet)+import qualified Data.IntSet as IntSet  import Agda.Syntax.Common (unArg)+import qualified Agda.Syntax.Common as C import Agda.Syntax.Internal  import Agda.TypeChecking.EtaContract+import Agda.TypeChecking.Free import Agda.TypeChecking.Monad import Agda.TypeChecking.Pretty import Agda.TypeChecking.Reduce import Agda.TypeChecking.Reduce.Monad import Agda.TypeChecking.Substitute +import Agda.Utils.Either+import Agda.Utils.Except import Agda.Utils.Functor import Agda.Utils.Maybe-import Agda.Utils.Monad hiding (sequence)+import Agda.Utils.Monad+import Agda.Utils.Null import Agda.Utils.Singleton  #include "undefined.h" import Agda.Utils.Impossible --- nonLinMatch :: NLPat -> Term -> ReduceM (Maybe Substitution)--- nonLinMatch p v = do---   let no = return Nothing---   caseMaybeM (execNLM $ ambMatch p v) no $ \ (sub, eqs) -> do---     -- Check that the substitution is non-ambiguous and total.---     msub <- runWriterT $ Map.forM sub $ \case---       [v] -> return v---       []  -> mzero---       (v : vs) -> v <$ forM_ vs $ \ u -> do---         ifM (equal v u) (return ()) mzero---     caseMaybe msub no $ \ sub' -> do---     -----     -- Check that the equations are satisfied.---- -- | Non-linear (non-constructor) first-order pattern.--- data NLPat---   = PVar {-# UNPACK #-} !Int---     -- ^ Matches anything (modulo non-linearity).---   | PWild---     -- ^ Matches anything (e.g. irrelevant terms).---   | PDef QName PElims---     -- ^ Matches @f es@---   | PTerm Term---     -- ^ Matches the term modulo β (ideally βη).--- type PElims = [Elim' NLPat]- -- | Turn a term into a non-linear pattern, treating the --   free variables as pattern variables.+--   The first argument is the number of bound variables.  class PatternFrom a b where-  patternFrom :: a -> TCM b+  patternFrom :: Int -> a -> TCM b -instance (Traversable f, PatternFrom a b) => PatternFrom (f a) (f b) where-  patternFrom = traverse patternFrom+instance (PatternFrom a b) => PatternFrom [a] [b] where+  patternFrom k = traverse $ patternFrom k +instance (PatternFrom a b) => PatternFrom (Arg a) (Arg b) where+  patternFrom k = traverse $ patternFrom k++instance (PatternFrom a b) => PatternFrom (Elim' a) (Elim' b) where+  patternFrom k = traverse $ patternFrom k++instance (PatternFrom a b) => PatternFrom (Dom a) (Dom b) where+  patternFrom k = traverse $ patternFrom k++instance (PatternFrom a b) => PatternFrom (Type' a) (Type' b) where+  patternFrom k = traverse $ patternFrom k+ instance PatternFrom Term NLPat where-  patternFrom v = do+  patternFrom k v = do     v <- etaContract =<< reduce v     let done = return $ PTerm v     case ignoreSharing v of-      Var i [] -> return $ PVar i-      Var{}    -> done-      Lam{}    -> done+      Var i es+       | i < k     -> PBoundVar i <$> patternFrom k es+       | otherwise -> if null es+                      then return $ PVar (i-k)+                      else done+      Lam i t  -> PLam i <$> patternFrom k t       Lit{}    -> done-      Def f es -> PDef f <$> patternFrom es-      Con c vs -> PDef (conName c) <$> patternFrom (Apply <$> vs)-      Pi{}     -> done+      Def f es -> PDef f <$> patternFrom k es+      Con c vs -> PDef (conName c) <$> patternFrom k (Apply <$> vs)+      Pi a b   -> PPi <$> patternFrom k a <*> patternFrom k b       Sort{}   -> done       Level{}  -> return PWild   -- TODO: unLevel and continue       DontCare{} -> return PWild@@ -109,11 +107,14 @@       Shared{}   -> __IMPOSSIBLE__       ExtLam{}   -> __IMPOSSIBLE__ +instance (PatternFrom a b) => PatternFrom (Abs a) (Abs b) where+  patternFrom k (Abs n x)   = Abs n   <$> patternFrom (k+1) x+  patternFrom k (NoAbs n x) = NoAbs n <$> patternFrom k x  -- | Monad for non-linear matching.-type NLM = MaybeT (WriterT NLMOut ReduceM)+type NLM = ExceptT Blocked_ (StateT NLMState ReduceM) -type NLMOut = (AmbSubst, PostponedEquations)+type NLMState = (Sub, PostponedEquations)  liftRed :: ReduceM a -> NLM a liftRed = lift . lift@@ -122,74 +123,65 @@   pragmaOptions      = liftRed pragmaOptions   commandLineOptions = liftRed commandLineOptions -runNLM :: NLM () -> ReduceM (Maybe NLMOut)+runNLM :: NLM () -> ReduceM (Either Blocked_ NLMState) runNLM nlm = do-  (ok, sub) <- runWriterT $ runMaybeT nlm-  return $ const sub <$> ok+  (ok,out) <- runStateT (runExceptT nlm) empty+  case ok of+    Left block -> return $ Left block+    Right _    -> return $ Right out  traceSDocNLM :: VerboseKey -> Int -> TCM Doc -> NLM a -> NLM a traceSDocNLM k n doc = applyWhenVerboseS k n $ \ cont -> do   ReduceEnv env st <- liftRed askR   trace (show $ fst $ unsafePerformIO $ runTCM env st doc) cont ---- execNLM :: NLM a -> ReduceM (Maybe NLMOut)--- execNLM m = runMaybeT $ execWriterT m+matchingBlocked :: Blocked_ -> NLM ()+matchingBlocked = throwError  -- | Add substitution @i |-> v@ to result of matching.-tellSubst :: Int -> Term -> NLM ()-tellSubst i v = tell (singleton (i, v), mempty)--tellEq :: Term -> Term -> NLM ()-tellEq u v = tell (mempty, singleton $ PostponedEquation u v)---- | Non-linear matching returns first an ambiguous substitution,---   mapping one de Bruijn index to possibly several terms.-newtype AmbSubst = AmbSubst { ambSubst :: IntMap [Term] }--instance Monoid AmbSubst where-  mempty                          = AmbSubst mempty-  AmbSubst m `mappend` AmbSubst n = AmbSubst $ IntMap.unionWith (++) m n+tellSub :: Int -> Term -> NLM ()+tellSub i v = do+  caseMaybeM (IntMap.lookup i <$> gets fst) (modify $ first $ IntMap.insert i v) $ \v' -> do+    unlessM (liftRed $ equal v v') $ matchingBlocked $ NotBlocked ReallyNotBlocked () -- lies! -instance Singleton (Int,Term) AmbSubst where-  singleton (i, v) = AmbSubst $ IntMap.singleton i [v]+tellEq :: Int -> Term -> Term -> NLM ()+tellEq k u v =+  traceSDocNLM "rewriting" 60 (sep+               [ text "adding equality between" <+> prettyTCM u+               , text " and " <+> prettyTCM v+               , text ("(with " ++ show k ++ " free variables)") ]) $ do+  modify $ second $ (PostponedEquation k u v:) --- sgSubst :: Int -> Term -> AmbSubst--- sgSubst i v = AmbSubst $ IntMap.singleton i [v]+type Sub = IntMap Term  -- | Matching against a term produces a constraint --   which we have to verify after applying --   the substitution computed by matching. data PostponedEquation = PostponedEquation-  { eqLhs :: Term  -- ^ Term from pattern, living in pattern context.-  , eqRhs :: Term  -- ^ Term from scrutinee, living in context where matching was invoked.+  { eqFreeVars :: Int -- ^ Number of free variables in the equation+  , eqLhs :: Term     -- ^ Term from pattern, living in pattern context.+  , eqRhs :: Term     -- ^ Term from scrutinee, living in context where matching was invoked.   } type PostponedEquations = [PostponedEquation] -instance Subst PostponedEquation where-  applySubst rho (PostponedEquation lhs rhs) =-    PostponedEquation (applySubst rho lhs) (applySubst rho rhs)- -- | Match a non-linear pattern against a neutral term, --   returning a substitution. -class AmbMatch a b where-  ambMatch :: a -> b -> NLM ()+class Match a b where+  match :: Int -> a -> b -> NLM () -instance AmbMatch a b => AmbMatch [a] [b] where-  ambMatch ps vs-    | length ps == length vs = zipWithM_ ambMatch ps vs-    | otherwise              = traceSDocNLM "rewriting" 100 (sep-                                 [ text $ "mismatching number of arguments: " ++-                                          show (length ps) ++ " vs " ++ show (length vs) ]) mzero+instance Match a b => Match [a] [b] where+  match k ps vs+    | length ps == length vs = zipWithM_ (match k) ps vs+    | otherwise              = matchingBlocked $ NotBlocked ReallyNotBlocked () -instance AmbMatch a b => AmbMatch (Arg a) (Arg b) where-  ambMatch p v = ambMatch (unArg p) (unArg v)+instance Match a b => Match (Arg a) (Arg b) where+  match k p v = match k (unArg p) (unArg v) -instance AmbMatch a b => AmbMatch (Elim' a) (Elim' b) where-  ambMatch p v =+instance Match a b => Match (Elim' a) (Elim' b) where+  match k p v =    case (p, v) of-     (Apply p, Apply v) -> ambMatch p v+     (Apply p, Apply v) -> match k p v      (Proj x , Proj y ) -> if x == y then return () else                              traceSDocNLM "rewriting" 100 (sep                                [ text "mismatch between projections " <+> prettyTCM x@@ -197,32 +189,62 @@      (Apply{}, Proj{} ) -> __IMPOSSIBLE__      (Proj{} , Apply{}) -> __IMPOSSIBLE__ -instance AmbMatch NLPat Term where-  ambMatch p v = do+instance Match a b => Match (Dom a) (Dom b) where+  match k p v = match k (C.unDom p) (C.unDom v)++instance Match a b => Match (Type' a) (Type' b) where+  match k p v = match k (unEl p) (unEl v)++instance (Match a b, Subst b, Free b, PrettyTCM a, PrettyTCM b) => Match (Abs a) (Abs b) where+  match k (Abs _ p) (Abs _ v) = match (k+1) p v+  match k (Abs _ p) (NoAbs _ v) = match (k+1) p (raise 1 v)+  match k (NoAbs _ p) (Abs _ v) = if (0 `freeIn` v) then no else match k p (raise (-1) v)+    where+      no = traceSDocNLM "rewriting" 100 (sep+        [ text "mismatch between" <+> prettyTCM p+        , text " and " <+> prettyTCM v ]) mzero+  match k (NoAbs _ p) (NoAbs _ v) = match k p v++instance Match NLPat Term where+  match k p v = do     let yes = return ()-        no x y =+        no  =           traceSDocNLM "rewriting" 100 (sep-            [ text "mismatch between" <+> prettyTCM x-            , text " and " <+> prettyTCM y]) mzero+            [ text "mismatch between" <+> prettyTCM p+            , text " and " <+> prettyTCM v]) mzero     case p of       PWild  -> yes-      PVar i -> tellSubst i v+      PVar i -> if null (allFreeVars v `IntSet.intersection` IntSet.fromList [0..(k-1)])+                then tellSub i (raise (-k) v)+                else no       PDef f ps -> do         v <- liftRed $ constructorForm v         case ignoreSharing v of           Def f' es-            | f == f'   -> matchArgs ps es-            | otherwise -> no f f'+            | f == f'   -> matchArgs k ps es+            | otherwise -> no           Con c vs-            | f == conName c -> matchArgs ps (Apply <$> vs)-            | otherwise -> no f c-          _ -> no p v-      PTerm u -> tellEq u v+            | f == conName c -> matchArgs k ps (Apply <$> vs)+            | otherwise -> no+          MetaV m es -> do+            matchingBlocked $ Blocked m ()+          _ -> no+      PLam i p' -> do+        let body = Abs (absName p') $ raise 1 v `apply` [C.Arg i (var 0)]+        body <- liftRed (etaContract =<< reduce' body)+        match k p' body+      PPi pa pb  -> case ignoreSharing v of+        Pi a b -> match k pa a >> match k pb b+        _ -> no+      PBoundVar i ps -> case ignoreSharing v of+        Var i' es | i == i' -> matchArgs k ps es+        _ -> no+      PTerm u -> tellEq k u v     where-      matchArgs :: [Elim' NLPat] -> Elims -> NLM ()-      matchArgs ps es = ambMatch ps =<< liftRed (etaContract =<< reduce' es)+      matchArgs :: Int -> [Elim' NLPat] -> Elims -> NLM ()+      matchArgs k ps es = match k ps =<< liftRed (etaContract =<< reduce' es) -makeSubstitution :: IntMap Term -> Substitution+makeSubstitution :: Sub -> Substitution makeSubstitution sub   | IntMap.null sub = idS   | otherwise       = map val [0 .. highestIndex] ++# raiseS (highestIndex + 1)@@ -230,29 +252,22 @@     highestIndex = fst $ IntMap.findMax sub  -- find highest key     val i = fromMaybe (var i) $ IntMap.lookup i sub -disambiguateSubstitution :: AmbSubst -> ReduceM (Maybe Substitution)-disambiguateSubstitution as = do-  mvs <- forM (ambSubst as) $ \vs -> case vs of-    [] -> __IMPOSSIBLE__ -- unbound variable-    (v:vs) -> do-      ok <- andM (equal v <$> vs)-      if ok then return (Just v) else return Nothing-  case sequence mvs of-    Nothing -> return Nothing-    Just vs -> return $ Just $ makeSubstitution vs- checkPostponedEquations :: Substitution -> PostponedEquations -> ReduceM Bool-checkPostponedEquations sub eqs = andM $ for (applySubst sub eqs) $-  \ (PostponedEquation lhs rhs) -> equal lhs rhs+checkPostponedEquations sub eqs = andM $ for eqs $+  \ (PostponedEquation k lhs rhs) -> equal (applySubst (liftS k sub) lhs) rhs  -- main function-nonLinMatch :: (AmbMatch a b) => a -> b -> ReduceM (Maybe Substitution)+nonLinMatch :: (Match a b) => a -> b -> ReduceM (Either Blocked_ Substitution) nonLinMatch p v = do-  let no msg = traceSDoc "rewriting" 100 (sep-                [ text "matching failed during" <+> text msg ]) $ return Nothing-  caseMaybeM (runNLM $ ambMatch p v) (no "ambiguous matching") $ \ (asub, eqs) -> do-    caseMaybeM (disambiguateSubstitution asub) (no "disambiguation") $ \ sub -> do-      ifM (checkPostponedEquations sub eqs) (return $ Just sub) (no "checking of postponed equations")+  let no msg b = traceSDoc "rewriting" 100 (sep+                   [ text "matching failed during" <+> text msg+                   , text "blocking: " <+> text (show b) ]) $ return (Left b)+  caseEitherM (runNLM $ match 0 p v) (no "matching") $ \ (s, eqs) -> do+    let sub = makeSubstitution s+    traceSDoc "rewriting" 90 (text $ "sub = " ++ show sub) $ do+      ifM (checkPostponedEquations sub eqs)+        (return $ Right sub)+        (no "checking of postponed equations" $ NotBlocked ReallyNotBlocked ()) -- more lies  -- | Untyped βη-equality, does not handle things like empty record types. equal :: Term -> Term -> ReduceM Bool
src/full/Agda/TypeChecking/Rules/Builtin/Coinduction.hs view
@@ -19,9 +19,11 @@ import Agda.TypeChecking.Level import Agda.TypeChecking.Monad import Agda.TypeChecking.Monad.Builtin+import Agda.TypeChecking.Positivity.Occurrence import Agda.TypeChecking.Primitive import Agda.TypeChecking.Reduce import Agda.TypeChecking.Substitute+import Agda.TypeChecking.Telescope import Agda.TypeChecking.Rules.Builtin import Agda.TypeChecking.Rules.Term @@ -67,27 +69,27 @@ bindBuiltinSharp :: A.Expr -> TCM () bindBuiltinSharp e =   bindPostulatedName builtinSharp e $ \sharp sharpDefn -> do-    sharpE    <- instantiateFull =<< checkExpr (A.Def sharp) =<< typeOfSharp+    sharpType <- typeOfSharp+    TelV fieldTel _ <- telView sharpType+    sharpE    <- instantiateFull =<< checkExpr (A.Def sharp) sharpType     Def inf _ <- ignoreSharing <$> primInf     infDefn   <- getConstInfo inf     addConstant (defName infDefn) $       infDefn { defPolarity       = [] -- not monotone               , defArgOccurrences = [Unused, StrictPos]-              , theDef = Datatype-                  { dataPars           = 2-                  , dataSmallPars      = Perm 2 []-                  , dataNonLinPars     = Drop 0 $ Perm 2 []-                  , dataIxs            = 0-                  , dataInduction      = CoInductive-                  , dataClause         = Nothing-                  , dataCons           = [sharp]-                  , dataSort           = varSort 1-{--                  , dataPolarity       = [Invariant, Invariant]-                  , dataArgOccurrences = [Unused, StrictPos]--}-                  , dataMutual         = []-                  , dataAbstr          = ConcreteDef+              , theDef = Record+                  { recPars           = 2+                  , recInduction      = Just CoInductive+                  , recClause         = Nothing+                  , recConHead        = ConHead sharp CoInductive []  -- flat is added later+                  , recConType        = sharpType+                  , recNamedCon       = True+                  , recFields         = []  -- flat is added later+                  , recTel            = fieldTel+                  , recRecursive      = False+                  , recEtaEquality    = False+                  , recMutual         = []+                  , recAbstr          = ConcreteDef                   }               }     addConstant sharp $@@ -133,15 +135,16 @@           , clauseBody      = Bind $ Abs "x" $ Body $ var 0           , clauseType      = Just $ defaultArg $ El (varSort 2) $ var 1           }-        cc = Case 0 $ Branches (Map.singleton sharp+        cc = Case 0 $ Branches False+                               (Map.singleton sharp                                  $ WithArity 1 $ Done [defaultArg "x"] $ var 0)                                Map.empty                                Nothing         projection = Projection-          { projProper   = Nothing+          { projProper   = Just flat           , projFromType = inf           , projIndex    = 3-          , projDropPars = teleNoAbs (take 2 $ telToList tel) $ Def flat []+          , projDropPars = teleNoAbs (take 2 $ telToList tel) $ Lam defaultArgInfo $ Abs "x" $ Var 0 [Proj flat]           , projArgInfo  = defaultArgInfo           }     addConstant flat $@@ -167,6 +170,8 @@     -- register flat as record field for constructor sharp     modifySignature $ updateDefinition sharp $ updateTheDef $ \ def ->       def { conSrcCon = sharpCon }+    modifySignature $ updateDefinition inf $ updateTheDef $ \ def ->+      def { recConHead = sharpCon, recFields = [defaultArg flat] }     return flatE  -- The coinductive primitives.
src/full/Agda/TypeChecking/Rules/Data.hs view
@@ -1,5 +1,9 @@ {-# LANGUAGE CPP #-} +#if __GLASGOW_HASKELL__ >= 710+{-# LANGUAGE FlexibleContexts #-}+#endif+ module Agda.TypeChecking.Rules.Data where  import Control.Applicative@@ -379,10 +383,10 @@         nonLinearParams n pars ixs =           -- compute the free de Bruijn indices in the data indices           -- ALT: Ignore all sorts?-          let fv = freeVarsIgnore IgnoreInAnnotations ixs+          let fv = allRelevantVarsIgnoring IgnoreInAnnotations ixs           -- keep relevant ones, convert to de Bruijn levels           -- note: xs is descending list-              xs = map ((n-1) -) $ VarSet.toList $ relevantVars fv+              xs = map ((n-1) -) $ VarSet.toList fv           -- keep those that correspond to parameters           -- in ascending list           in  reverse $ filter (< size pars) xs
src/full/Agda/TypeChecking/Rules/Decl.hs view
@@ -73,6 +73,7 @@ -- | Type check a sequence of declarations. checkDecls :: [A.Declaration] -> TCM () checkDecls ds = do+  reportSLn "tc.decl" 45 $ "Checking " ++ show (length ds) ++ " declarations..."   mapM_ checkDecl ds   -- Andreas, 2011-05-30, unfreezing moved to Interaction/Imports   -- whenM onTopLevel unfreezeMetas@@ -81,10 +82,10 @@  checkDecl :: A.Declaration -> TCM () checkDecl d = setCurrentRange d $ do-    reportSDoc "tc.decl" 10 $ vcat-      [ text "checking declaration"-      , prettyA d-      ]+    reportSDoc "tc.decl" 10 $ text "checking declaration"+    debugPrintDecl d+    reportSDoc "tc.decl" 90 $ (text . show) d+    reportSDoc "tc.decl" 10 $ prettyA d  -- Might loop, see e.g. Issue 1597      -- Issue 418 fix: freeze metas before checking an abstract thing     when_ isAbstract freezeMetas@@ -130,7 +131,7 @@                                   -- highlighting purposes.       A.UnquoteDecl mi i x e   -> checkUnquoteDecl mi i x e -    unlessM (isJust <$> asks envMutualBlock) $ do+    whenNothingM (asks envMutualBlock) $ do        -- Syntax highlighting.       highlight_ d@@ -152,6 +153,7 @@      check x i m = do       reportSDoc "tc.decl" 5 $ text "Checking" <+> prettyTCM x <> text "."+      reportSLn "tc.decl.abstract" 25 $ show (Info.defAbstract i)       r <- abstract (Info.defAbstract i) m       reportSDoc "tc.decl" 5 $ text "Checked" <+> prettyTCM x <> text "."       return r@@ -180,7 +182,12 @@   -- checkCoinductiveRecords  ds   -- Andreas, 2012-09-11:  Injectivity check stores clauses   -- whose 'Relevance' is affected by polarity computation,-  -- so do it here.+  -- so do it here (again).+  -- Andreas, 2015-07-01:  In particular, 'UnusedArg's of local functions+  -- are only recognized after the polarity computation.+  -- See Issue 1366 for an example where injectivity of a local function+  -- is used to solve metas.  It fails if we do injectivity analysis+  -- before polarity only.   checkInjectivity_        names   checkProjectionLikeness_ names @@ -202,13 +209,13 @@       -- Add x to signature, otherwise reification gets unhappy.       addConstant x =<< do         useTerPragma $ defaultDefn defaultArgInfo x a emptyFunction-      a <- reifyUnquoted a+      a <- reifyUnquoted $ killRange a       reportSDoc "tc.unquote.decl" 10 $         vcat [ text "unquoteDecl" <+> prettyTCM x <+> text "-->"              , prettyTCM x <+> text ":" <+> prettyA a ]       tel <- getContextTelescope       let tel' = replaceEmptyName "r" $ killRange tel-      cs <- mapM (reifyUnquoted . QNamed x . abstract tel) cs+      cs <- mapM (reifyUnquoted . QNamed x . killRange . abstract tel) cs       reportSDoc "tc.unquote.decl" 10 $ vcat $ map prettyA cs       let ds = [ A.Axiom A.FunSig i defaultArgInfo x a   -- TODO other than defaultArg                , A.FunDef i x NotDelayed cs ]@@ -298,18 +305,7 @@   -- Andreas, 2012-02-13: Polarity computation uses info from   -- positivity check, so it needs happen after positivity   -- check.-  let -- | Do we need to compute polarity information for the-      -- definition corresponding to the given name?-      relevant q = do-        def <- theDef <$> getConstInfo q-        return $ case def of-          Function{}    -> Just q-          Datatype{}    -> Just q-          Record{}      -> Just q-          Axiom{}       -> Nothing-          Constructor{} -> Nothing-          Primitive{}   -> Nothing-  mapM_ computePolarity =<< do mapMaybeM relevant $ Set.toList names+  mapM_ computePolarity $ Set.toList names  -- | Check that all coinductive records are actually recursive. --   (Otherwise, one can implement invalid recursion schemes just like@@ -325,38 +321,61 @@ checkInjectivity_ :: Set QName -> TCM () checkInjectivity_ names = Bench.billTo [Bench.Injectivity] $ do   reportSLn "tc.decl" 20 $ "checkDecl: checking injectivity..."--  -- OLD CODE, REFACTORED using for-loop-  -- let checkInj (q, def@Defn{ theDef = d@Function{ funClauses = cs, funTerminates = Just True }}) = do-  --       inv <- checkInjectivity q cs-  --       modifySignature $ updateDefinition q $ const $-  --         def { theDef = d { funInv = inv }}-  --     checkInj _ = return ()-  -- namesDefs <- mapM (\ q -> (q,) <$> getConstInfo q) $ Set.toList names-  -- mapM_ checkInj namesDefs--  Fold.forM_ names $ \ q -> do+  -- Andreas, 2015-07-01, see Issue1366b:+  -- Injectivity check needs also to be run for abstract definitions.+  -- Fold.forM_ names $ \ q -> ignoreAbstractMode $ do -- NOT NECESSARY after all+  Fold.forM_ names $ \ q -> inConcreteOrAbstractMode q $ do+    -- For abstract q, we should be inAbstractMode,+    -- otherwise getConstInfo returns Axiom.+    --+    -- Andreas, 2015-07-01:+    -- Quite surprisingly, inAbstractMode does not allow us to look+    -- at a local definition (@where@ block) of an abstract definition.+    -- This is because the local definition is defined in a strict submodule.+    -- We can only see through abstract definitions in the current module+    -- or super modules inAbstractMode.+    -- I changed that in Monad.Signature.treatAbstractly', so we can see+    -- our own local definitions.     def <- getConstInfo q     case theDef def of-      d@Function{ funClauses = cs, funTerminates = Just True } -> do-        inv <- checkInjectivity q cs-        modifySignature $ updateDefinition q $ const $-          def { theDef = d { funInv = inv }}-      _ -> return ()+      d@Function{ funClauses = cs, funTerminates = term } -> do+        case term of+          Just True -> do+            inv <- checkInjectivity q cs+            modifySignature $ updateDefinition q $ const $+              def { theDef = d { funInv = inv }}+          _ -> reportSLn "tc.inj.check" 20 $+             show q ++ " is not verified as terminating, thus, not considered for injectivity"+      _ -> do+        abstr <- asks envAbstractMode+        reportSLn "tc.inj.check" 20 $+          "we are in " ++ show abstr ++ " and " +++             show q ++ " is abstract or not a function, thus, not considered for injectivity"  -- | Check a set of mutual names for projection likeness.+--+--   Only a single, non-abstract function can be projection-like.+--   Making an abstract function projection-like would break the+--   invariant that the type of the principle argument of a projection-like+--   function is always inferable.+ checkProjectionLikeness_ :: Set QName -> TCM () checkProjectionLikeness_ names = Bench.billTo [Bench.ProjectionLikeness] $ do       -- Non-mutual definitions can be considered for       -- projection likeness-      reportSLn "tc.decl" 20 $ "checkDecl: checking projection-likeness..."-      case Set.toList names of+      let ds = Set.toList names+      reportSLn "tc.proj.like" 20 $ "checkDecl: checking projection-likeness of " ++ show ds+      case ds of         [d] -> do           def <- getConstInfo d+          -- For abstract identifiers, getConstInfo returns Axiom.+          -- Thus, abstract definitions are not considered for projection-likeness.           case theDef def of             Function{} -> makeProjection (defName def)-            _          -> return ()-        _ -> return ()+            _          -> reportSLn "tc.proj.like" 25 $+              show d ++ " is abstract or not a function, thus, not considered for projection-likeness"+        _ -> reportSLn "tc.proj.like" 25 $+               "mutual definitions are not considered for projection-likeness"  -- | Type check an axiom. checkAxiom :: A.Axiom -> Info.DefInfo -> A.ArgInfo -> QName -> A.Expr -> TCM ()@@ -489,8 +508,8 @@           if not correct             then typeError $ GenericError "COMPILED_EXPORT directive only works on functions"             else do-          ty <- haskellType $ defType def-          addHaskellExport x ty hs+              ty <- haskellType $ defType def+              addHaskellExport x ty hs         A.CompiledEpicPragma x ep -> do           def <- getConstInfo x           case theDef def of@@ -508,7 +527,7 @@             _          -> typeError $ GenericError "STATIC directive only works on functions"         A.OptionsPragma{} -> typeError $ GenericError $ "OPTIONS pragma only allowed at beginning of file, before top module declaration"         A.EtaPragma r -> do-          unlessM (isJust <$> isRecord r) $+          whenNothingM (isRecord r) $             typeError $ GenericError $ "ETA pragma is only applicable to records"           modifySignature $ updateDefinition r $ updateTheDef $ setEta           where@@ -629,46 +648,46 @@   when (extraParams > 0) $ reportSLn "tc.mod.apply" 30 $ "Extra parameters to " ++ show m1 ++ ": " ++ show extraParams   -- Type-check the LHS (ptel) of the module macro.   checkTelescope ptel $ \ ptel -> do-  -- We are now in the context @ptel@.-  -- Get the correct parameter telescope of @m2@.-  tel <- lookupSection m2-  vs  <- freeVarsToApply $ mnameToQName m2-  let tel'  = apply tel vs-      args' = convColor args-  -- Compute the remaining parameter telescope after stripping of-  -- the initial parameters that are determined by the @args@.-  -- Warning: @etaTel@ is not well-formed in @ptel@, since-  -- the actual application has not happened.-  etaTel <- checkModuleArity m2 tel' args'-  -- Take the module parameters that will be instantiated by @args@.-  let tel'' = telFromList $ take (size tel' - size etaTel) $ telToList tel'-  reportSDoc "tc.mod.apply" 15 $ vcat-    [ text "applying section" <+> prettyTCM m2-    , nest 2 $ text "args =" <+> sep (map prettyA args)-    , nest 2 $ text "ptel =" <+> escapeContext (size ptel) (prettyTCM ptel)-    , nest 2 $ text "tel  =" <+> prettyTCM tel-    , nest 2 $ text "tel' =" <+> prettyTCM tel'-    , nest 2 $ text "tel''=" <+> prettyTCM tel''-    , nest 2 $ text "eta  =" <+> escapeContext (size ptel) (addContext tel'' $ prettyTCM etaTel)-    ]-  -- Now, type check arguments.-  ts <- noConstraints $ checkArguments_ DontExpandLast (getRange i) args' tel''-  -- Perform the application of the module parameters.-  let aTel = tel' `apply` ts-  reportSDoc "tc.mod.apply" 15 $ vcat-    [ nest 2 $ text "aTel =" <+> prettyTCM aTel-    ]-  -- Andreas, 2014-04-06, Issue 1094:-  -- Add the section with well-formed telescope.-  addCtxTel aTel $ addSection m1 (size ptel + size aTel + extraParams)+    -- We are now in the context @ptel@.+    -- Get the correct parameter telescope of @m2@.+    tel <- lookupSection m2+    vs  <- freeVarsToApply $ mnameToQName m2+    let tel'  = apply tel vs+        args' = convColor args+    -- Compute the remaining parameter telescope after stripping of+    -- the initial parameters that are determined by the @args@.+    -- Warning: @etaTel@ is not well-formed in @ptel@, since+    -- the actual application has not happened.+    etaTel <- checkModuleArity m2 tel' args'+    -- Take the module parameters that will be instantiated by @args@.+    let tel'' = telFromList $ take (size tel' - size etaTel) $ telToList tel'+    reportSDoc "tc.mod.apply" 15 $ vcat+      [ text "applying section" <+> prettyTCM m2+      , nest 2 $ text "args =" <+> sep (map prettyA args)+      , nest 2 $ text "ptel =" <+> escapeContext (size ptel) (prettyTCM ptel)+      , nest 2 $ text "tel  =" <+> prettyTCM tel+      , nest 2 $ text "tel' =" <+> prettyTCM tel'+      , nest 2 $ text "tel''=" <+> prettyTCM tel''+      , nest 2 $ text "eta  =" <+> escapeContext (size ptel) (addContext tel'' $ prettyTCM etaTel)+      ]+    -- Now, type check arguments.+    ts <- noConstraints $ checkArguments_ DontExpandLast (getRange i) args' tel''+    -- Perform the application of the module parameters.+    let aTel = tel' `apply` ts+    reportSDoc "tc.mod.apply" 15 $ vcat+      [ nest 2 $ text "aTel =" <+> prettyTCM aTel+      ]+    -- Andreas, 2014-04-06, Issue 1094:+    -- Add the section with well-formed telescope.+    addCtxTel aTel $ addSection m1 (size ptel + size aTel + extraParams) -  reportSDoc "tc.mod.apply" 20 $ vcat-    [ sep [ text "applySection", prettyTCM m1, text "=", prettyTCM m2, fsep $ map prettyTCM (vs ++ ts) ]-    , nest 2 $ text "  defs:" <+> text (show rd)-    , nest 2 $ text "  mods:" <+> text (show rm)-    ]-  args <- instantiateFull $ vs ++ ts-  applySection m1 ptel m2 args rd rm+    reportSDoc "tc.mod.apply" 20 $ vcat+      [ sep [ text "applySection", prettyTCM m1, text "=", prettyTCM m2, fsep $ map prettyTCM (vs ++ ts) ]+      , nest 2 $ text "  defs:" <+> text (show rd)+      , nest 2 $ text "  mods:" <+> text (show rm)+      ]+    args <- instantiateFull $ vs ++ ts+    applySection m1 ptel m2 args rd rm  checkSectionApplication' i m1 (A.RecordModuleIFS x) rd rm = do   let name = mnameToQName x@@ -726,3 +745,46 @@ --   the work is done when scope checking. checkImport :: Info.ModuleInfo -> ModuleName -> TCM () checkImport i x = return ()++------------------------------------------------------------------------+-- * Debugging+------------------------------------------------------------------------++class ShowHead a where+  showHead :: a -> String++instance ShowHead A.Declaration where+  showHead d =+    case d of+      A.Axiom        {} -> "Axiom"+      A.Field        {} -> "Field"+      A.Primitive    {} -> "Primitive"+      A.Mutual       {} -> "Mutual"+      A.Section      {} -> "Section"+      A.Apply        {} -> "Apply"+      A.Import       {} -> "Import"+      A.Pragma       {} -> "Pragma"+      A.Open         {} -> "Open"+      A.FunDef       {} -> "FunDef"+      A.DataSig      {} -> "DataSig"+      A.DataDef      {} -> "DataDef"+      A.RecSig       {} -> "RecSig"+      A.RecDef       {} -> "RecDef"+      A.PatternSynDef{} -> "PatternSynDef"+      A.UnquoteDecl  {} -> "UnquoteDecl"+      A.ScopedDecl   {} -> "ScopedDecl"++debugPrintDecl :: A.Declaration -> TCM ()+debugPrintDecl d = do+    verboseS "tc.decl" 45 $ do+      reportSLn "tc.decl" 45 $ "checking a " ++ showHead d+      case d of+        A.Section info mname tel ds -> do+          reportSLn "tc.decl" 45 $+            "section " ++ show mname ++ " has "+              ++ show (length tel) ++ " parameters and "+              ++ show (length ds) ++ " declarations"+          reportSDoc "tc.decl" 45 $ prettyA $ A.Section info mname tel []+          forM_ ds $ \ d -> do+            reportSDoc "tc.decl" 45 $ prettyA d+        _ -> return ()
src/full/Agda/TypeChecking/Rules/Def.hs view
@@ -41,6 +41,7 @@ import Agda.TypeChecking.Injectivity import Agda.TypeChecking.Irrelevance import Agda.TypeChecking.SizedTypes.Solve+import Agda.TypeChecking.RecordPatterns import Agda.TypeChecking.CompiledClause (CompiledClauses(..)) import Agda.TypeChecking.CompiledClause.Compile @@ -50,9 +51,10 @@  import Agda.Utils.Except ( MonadError(catchError, throwError) ) import Agda.Utils.Lens-import Agda.Utils.Size-import Agda.Utils.Permutation+import Agda.Utils.Maybe ( whenNothing ) import Agda.Utils.Monad+import Agda.Utils.Permutation+import Agda.Utils.Size  #include "undefined.h" import Agda.Utils.Impossible@@ -185,7 +187,7 @@               -- 2014-04-24: The size solver requires each clause to be               -- checked individually, since otherwise we get constraints               -- in typing contexts which are not prefixes of each other.-              unless (isJust extlam) $ solveSizeConstraints+              whenNothing extlam solveSizeConstraints               -- Andreas, 2013-10-27 add clause as soon it is type-checked               -- TODO: instantiateFull?               addClauses name [c]@@ -216,11 +218,13 @@         -- however, Data.Star.Decoration.gmapAll no longer type-checks         -- possibly due to missing eta-contraction!? -        -- Check if the function is injective+        -- Check if the function is injective.+        -- Andreas, 2015-07-01 we do it here in order to resolve metas+        -- in mutual definitions, e.g. the U/El definition in succeed/Issue439.agda+        -- We do it again for the mutual block after polarity analysis, see Rules.Decl.         reportSLn "tc.inj.def" 20 $ "checkFunDef': checking injectivity..."         inv <- Bench.billTo [Bench.Injectivity] $           checkInjectivity name cs-        -- inv <- return NotInjective          reportSDoc "tc.cc" 15 $ do           sep [ text "clauses before compilation"@@ -320,240 +324,240 @@     unless (null withPats) $       typeError $ UnexpectedWithPatterns withPats     traceCall (CheckClause t c) $ do-    aps <- expandPatternSynonyms aps-    checkLeftHandSide (CheckPatternShadowing c) (Just x) aps t $ \ (LHSResult delta ps trhs perm) -> do-      -- Note that we might now be in irrelevant context,-      -- in case checkLeftHandSide walked over an irrelevant projection pattern.+      aps <- expandPatternSynonyms aps+      checkLeftHandSide (CheckPatternShadowing c) (Just x) aps t $ \ (LHSResult delta ps trhs perm) -> do+        -- Note that we might now be in irrelevant context,+        -- in case checkLeftHandSide walked over an irrelevant projection pattern. -      -- As we will be type-checking the @rhs@ in @delta@, but the final-      -- body should have bindings in the order of the pattern variables,-      -- we need to apply the permutation to the checked rhs @v@.-      let mkBody v  = foldr (\ x t -> Bind $ Abs x t) b xs-           where b  = Body $ applySubst (renamingR perm) v-                 xs = [ stringToArgName $ "h" ++ show n-                        | n <- [0..permRange perm - 1] ]+        -- As we will be type-checking the @rhs@ in @delta@, but the final+        -- body should have bindings in the order of the pattern variables,+        -- we need to apply the permutation to the checked rhs @v@.+        let mkBody v  = foldr (\ x t -> Bind $ Abs x t) b xs+             where b  = Body $ applySubst (renamingR perm) v+                   xs = [ stringToArgName $ "h" ++ show n+                          | n <- [0..permRange perm - 1] ] -      -- introduce trailing implicits for checking the where decls-      TelV htel t0 <- telViewUpTo' (-1) (not . visible) $ unArg trhs-      let n = size htel-          aps' = convColor aps-          checkWhere' wh = addCtxTel htel . checkWhere (size delta + n) wh . escapeContext (size htel)-      (body, with) <- checkWhere' wh $ let-          -- for the body, we remove the implicits again-          handleRHS rhs =-              case rhs of-                A.RHS e-                  | any (containsAbsurdPattern . namedArg) aps ->-                    typeError $ AbsurdPatternRequiresNoRHS aps'-                  | otherwise -> do-                    v <- checkExpr e $ unArg trhs-                    return (mkBody v, NoWithFunction)-                A.AbsurdRHS-                  | any (containsAbsurdPattern . namedArg) aps-                              -> return (NoBody, NoWithFunction)-                  | otherwise -> typeError $ NoRHSRequiresAbsurdPattern aps'-                A.RewriteRHS [] rhs [] -> handleRHS rhs-                -- Andreas, 2014-01-17, Issue 1402:-                -- If the rewrites are discarded since lhs=rhs, then-                -- we can actually have where clauses.-                A.RewriteRHS [] rhs wh -> checkWhere' wh $ handleRHS rhs-                A.RewriteRHS ((qname,eq):qes) rhs wh -> do+        -- introduce trailing implicits for checking the where decls+        TelV htel t0 <- telViewUpTo' (-1) (not . visible) $ unArg trhs+        let n = size htel+            aps' = convColor aps+            checkWhere' wh = addCtxTel htel . checkWhere (size delta + n) wh . escapeContext (size htel)+        (body, with) <- checkWhere' wh $ let+            -- for the body, we remove the implicits again+            handleRHS rhs =+                case rhs of+                  A.RHS e+                    | any (containsAbsurdPattern . namedArg) aps ->+                      typeError $ AbsurdPatternRequiresNoRHS aps'+                    | otherwise -> do+                      v <- checkExpr e $ unArg trhs+                      return (mkBody v, NoWithFunction)+                  A.AbsurdRHS+                    | any (containsAbsurdPattern . namedArg) aps+                                -> return (NoBody, NoWithFunction)+                    | otherwise -> typeError $ NoRHSRequiresAbsurdPattern aps'+                  A.RewriteRHS [] rhs [] -> handleRHS rhs+                  -- Andreas, 2014-01-17, Issue 1402:+                  -- If the rewrites are discarded since lhs=rhs, then+                  -- we can actually have where clauses.+                  A.RewriteRHS [] rhs wh -> checkWhere' wh $ handleRHS rhs+                  A.RewriteRHS ((qname,eq):qes) rhs wh -> do -                     -- Action for skipping this rewrite.-                     -- We do not want to create unsolved metas in case of-                     -- a futile rewrite with a reflexive equation.-                     -- Thus, we restore the state in this case,-                     -- unless the rewrite expression contains questionmarks.-                     st <- get-                     let recurse = do-                          st' <- get-                          -- Comparing the whole stInteractionPoints maps is a bit-                          -- wasteful, but we assume-                          -- 1. rewriting with a reflexive equality to happen rarely,-                          -- 2. especially with ?-holes in the rewrite expression-                          -- 3. and a large overall number of ?s.-                          let sameIP = (==) `on` (^.stInteractionPoints)-                          when (sameIP st st') $ put st-                          handleRHS $ A.RewriteRHS qes rhs wh+                       -- Action for skipping this rewrite.+                       -- We do not want to create unsolved metas in case of+                       -- a futile rewrite with a reflexive equation.+                       -- Thus, we restore the state in this case,+                       -- unless the rewrite expression contains questionmarks.+                       st <- get+                       let recurse = do+                            st' <- get+                            -- Comparing the whole stInteractionPoints maps is a bit+                            -- wasteful, but we assume+                            -- 1. rewriting with a reflexive equality to happen rarely,+                            -- 2. especially with ?-holes in the rewrite expression+                            -- 3. and a large overall number of ?s.+                            let sameIP = (==) `on` (^.stInteractionPoints)+                            when (sameIP st st') $ put st+                            handleRHS $ A.RewriteRHS qes rhs wh -                     -- Get value and type of rewrite-expression.+                       -- Get value and type of rewrite-expression. -                     (proof,t) <- inferExpr eq+                       (proof,t) <- inferExpr eq -                     -- Get the names of builtins EQUALITY and REFL.+                       -- Get the names of builtins EQUALITY and REFL. -                     equality <- primEqualityName-                     Con reflCon [] <- ignoreSharing <$> primRefl+                       equality <- primEqualityName+                       Con reflCon [] <- ignoreSharing <$> primRefl -                     -- Check that the type is actually an equality (lhs ≡ rhs)-                     -- and extract lhs, rhs, and their type.+                       -- Check that the type is actually an equality (lhs ≡ rhs)+                       -- and extract lhs, rhs, and their type. -                     t' <- reduce =<< instantiateFull t-                     (rewriteType,rewriteFrom,rewriteTo) <- do-                       case ignoreSharing $ unEl t' of-                         Def equality'-                           [ _level-                           , Apply (Arg (ArgInfo Hidden    Relevant _) rewriteType)-                           , Apply (Arg (ArgInfo NotHidden Relevant _) rewriteFrom)-                           , Apply (Arg (ArgInfo NotHidden Relevant _) rewriteTo)-                           ] | equality' == equality ->-                               return (El (getSort t') rewriteType, rewriteFrom, rewriteTo)-                         _ -> do-                          err <- text "Cannot rewrite by equation of type" <+> prettyTCM t'-                          typeError $ GenericDocError err+                       t' <- reduce =<< instantiateFull t+                       (rewriteType,rewriteFrom,rewriteTo) <- do+                         case ignoreSharing $ unEl t' of+                           Def equality'+                             [ _level+                             , Apply (Arg (ArgInfo Hidden    Relevant _) rewriteType)+                             , Apply (Arg (ArgInfo NotHidden Relevant _) rewriteFrom)+                             , Apply (Arg (ArgInfo NotHidden Relevant _) rewriteTo)+                             ] | equality' == equality ->+                                 return (El (getSort t') rewriteType, rewriteFrom, rewriteTo)+                           _ -> do+                            err <- text "Cannot rewrite by equation of type" <+> prettyTCM t'+                            typeError $ GenericDocError err -                     -- Andreas, 2014-05-17  Issue 1110:-                     -- Rewriting with a reflexive equation has no effect, but gives an-                     -- incomprehensible error message about the generated-                     -- with clause. Thus, we rather do simply nothing if-                     -- rewriting with @a ≡ a@ is attempted.+                       -- Andreas, 2014-05-17  Issue 1110:+                       -- Rewriting with a reflexive equation has no effect, but gives an+                       -- incomprehensible error message about the generated+                       -- with clause. Thus, we rather do simply nothing if+                       -- rewriting with @a ≡ a@ is attempted. -                     let isReflexive = tryConversion $ dontAssignMetas $-                          equalTerm rewriteType rewriteFrom rewriteTo+                       let isReflexive = tryConversion $ dontAssignMetas $+                            equalTerm rewriteType rewriteFrom rewriteTo -                     ifM isReflexive recurse $ {- else -} do+                       ifM isReflexive recurse $ {- else -} do -                     -- Transform 'rewrite' clause into a 'with' clause,-                     -- going back to abstract syntax.+                         -- Transform 'rewrite' clause into a 'with' clause,+                         -- going back to abstract syntax. -                     let cinfo      = ConPatInfo False patNoRange-                         underscore = A.Underscore Info.emptyMetaInfo+                         let cinfo      = ConPatInfo ConPCon patNoRange+                             underscore = A.Underscore Info.emptyMetaInfo -                     -- Andreas, 2015-02-09 Issue 1421: kill ranges-                     -- as reify puts in ranges that may point to other files.-                     (rewriteFromExpr,rewriteToExpr,rewriteTypeExpr, proofExpr) <- killRange <$> do-                      disableDisplayForms $ withShowAllArguments $ reify-                        (rewriteFrom,   rewriteTo,    rewriteType    , proof)-                     let (inner, outer) -- the where clauses should go on the inner-most with-                           | null qes  = ([], wh)-                           | otherwise = (wh, [])-                         -- Andreas, 2014-03-05 kill range of copied patterns-                         -- since they really do not have a source location.-                         newRhs = A.WithRHS qname [rewriteFromExpr, proofExpr]-                                  [A.Clause (A.LHS i (A.LHSHead x (killRange aps)) pats)-                                    -- Note: handleRHS (A.RewriteRHS _ eqs _ _)-                                    -- is defined by induction on eqs.-                                    (A.RewriteRHS qes (insertPatterns pats rhs) inner)-                                    outer]-                         pats = [ A.DotP patNoRange underscore-                                , A.ConP cinfo (AmbQ [conName reflCon]) []]-                     reportSDoc "tc.rewrite.top" 25 $ vcat-                       [ text "rewrite"-                       , text "  from  = " <+> prettyTCM rewriteFromExpr-                       , text "  to    = " <+> prettyTCM rewriteToExpr-                       , text "  typ   = " <+> prettyTCM rewriteType-                       , text "  proof = " <+> prettyTCM proofExpr-                       , text "  equ   = " <+> prettyTCM t'-                       ]-                     handleRHS newRhs+                         -- Andreas, 2015-02-09 Issue 1421: kill ranges+                         -- as reify puts in ranges that may point to other files.+                         (rewriteFromExpr,rewriteToExpr,rewriteTypeExpr, proofExpr) <- killRange <$> do+                          disableDisplayForms $ withShowAllArguments $ reify+                            (rewriteFrom,   rewriteTo,    rewriteType    , proof)+                         let (inner, outer) -- the where clauses should go on the inner-most with+                               | null qes  = ([], wh)+                               | otherwise = (wh, [])+                             -- Andreas, 2014-03-05 kill range of copied patterns+                             -- since they really do not have a source location.+                             newRhs = A.WithRHS qname [rewriteFromExpr, proofExpr]+                                      [A.Clause (A.LHS i (A.LHSHead x (killRange aps)) pats)+                                        -- Note: handleRHS (A.RewriteRHS _ eqs _ _)+                                        -- is defined by induction on eqs.+                                        (A.RewriteRHS qes (insertPatterns pats rhs) inner)+                                        outer]+                             pats = [ A.DotP patNoRange underscore+                                    , A.ConP cinfo (AmbQ [conName reflCon]) []]+                         reportSDoc "tc.rewrite.top" 25 $ vcat+                           [ text "rewrite"+                           , text "  from  = " <+> prettyTCM rewriteFromExpr+                           , text "  to    = " <+> prettyTCM rewriteToExpr+                           , text "  typ   = " <+> prettyTCM rewriteType+                           , text "  proof = " <+> prettyTCM proofExpr+                           , text "  equ   = " <+> prettyTCM t'+                           ]+                         handleRHS newRhs -                A.WithRHS aux es cs -> do-                  reportSDoc "tc.with.top" 15 $ vcat-                    [ text "TC.Rules.Def.checkclause reached A.WithRHS"-                    , sep $ prettyA aux : map (parens . prettyA) es-                    ]-                  reportSDoc "tc.with.top" 30 $-                    prettyA c-                  reportSDoc "tc.with.top" 20 $ do-                    m  <- currentModule-                    nfv <- getModuleFreeVars m-                    sep [ text "with function module:" <+>-                          prettyList (map prettyTCM $ mnameToList m)-                        ,  text $ "free variables: " ++ show nfv-                        ]+                  A.WithRHS aux es cs -> do+                    reportSDoc "tc.with.top" 15 $ vcat+                      [ text "TC.Rules.Def.checkclause reached A.WithRHS"+                      , sep $ prettyA aux : map (parens . prettyA) es+                      ]+                    reportSDoc "tc.with.top" 30 $+                      prettyA c+                    reportSDoc "tc.with.top" 20 $ do+                      m  <- currentModule+                      nfv <- getModuleFreeVars m+                      sep [ text "with function module:" <+>+                            prettyList (map prettyTCM $ mnameToList m)+                          ,  text $ "free variables: " ++ show nfv+                          ] -                  -- Infer the types of the with expressions-                  (vs0, as) <- unzip <$> mapM inferExprForWith es-                  (vs, as)  <- normalise (vs0, as)+                    -- Infer the types of the with expressions+                    (vs0, as) <- unzip <$> mapM inferExprForWith es+                    (vs, as)  <- normalise (vs0, as) -                  -- Split the telescope into the part needed to type the with arguments-                  -- and all the other stuff-                  let fv = allVars $ freeVars (vs, as)-                      SplitTel delta1 delta2 perm' = splitTelescope fv delta-                      finalPerm = composeP perm' perm+                    -- Split the telescope into the part needed to type the with arguments+                    -- and all the other stuff+                    let fv = allFreeVars (vs, as)+                        SplitTel delta1 delta2 perm' = splitTelescope fv delta+                        finalPerm = composeP perm' perm -                  reportSLn "tc.with.top" 75 $ "delta  = " ++ show delta+                    reportSLn "tc.with.top" 75 $ "delta  = " ++ show delta -                  -- Andreas, 2012-09-17: for printing delta,-                  -- we should remove it from the context first-                  reportSDoc "tc.with.top" 25 $ escapeContext (size delta) $ vcat-                    [ text "delta  =" <+> prettyTCM delta-                    , text "delta1 =" <+> prettyTCM delta1-                    , text "delta2 =" <+> addCtxTel delta1 (prettyTCM delta2)-                    ]-                  reportSDoc "tc.with.top" 25 $ vcat-                    [ text "vs     =" <+> prettyTCM vs-                    , text "as     =" <+> prettyTCM as-                    , text "perm'  =" <+> text (show perm')-                    , text "perm   =" <+> text (show perm)-                    , text "fPerm  =" <+> text (show finalPerm)-                    ]+                    -- Andreas, 2012-09-17: for printing delta,+                    -- we should remove it from the context first+                    reportSDoc "tc.with.top" 25 $ escapeContext (size delta) $ vcat+                      [ text "delta  =" <+> prettyTCM delta+                      , text "delta1 =" <+> prettyTCM delta1+                      , text "delta2 =" <+> addCtxTel delta1 (prettyTCM delta2)+                      ]+                    reportSDoc "tc.with.top" 25 $ vcat+                      [ text "vs     =" <+> prettyTCM vs+                      , text "as     =" <+> prettyTCM as+                      , text "perm'  =" <+> text (show perm')+                      , text "perm   =" <+> text (show perm)+                      , text "fPerm  =" <+> text (show finalPerm)+                      ] -                  -- Create the body of the original function+                    -- Create the body of the original function -                  -- All the context variables-                  us <- getContextArgs-                  let n = size us-                      m = size delta-                      -- First the variables bound outside this definition-                      (us0, us1') = genericSplitAt (n - m) us-                      -- Then permute the rest and grab those needed to for the with arguments-                      (us1, us2)  = genericSplitAt (size delta1) $ permute perm' us1'-                      -- Now stuff the with arguments in between and finish with the remaining variables-                      v    = Def aux $ map Apply $ us0 ++ us1 ++ (map defaultArg vs0) ++ us2+                    -- All the context variables+                    us <- getContextArgs+                    let n = size us+                        m = size delta+                        -- First the variables bound outside this definition+                        (us0, us1') = genericSplitAt (n - m) us+                        -- Then permute the rest and grab those needed to for the with arguments+                        (us1, us2)  = genericSplitAt (size delta1) $ permute perm' us1'+                        -- Now stuff the with arguments in between and finish with the remaining variables+                        v    = Def aux $ map Apply $ us0 ++ us1 ++ (map defaultArg vs0) ++ us2 -                  -- We need Δ₁Δ₂ ⊢ t'-                  t' <- return $ renameP (reverseP perm') $ unArg trhs-                  -- and Δ₁ ⊢ vs : as-                  (vs, as) <- do-                    let -- We know that as does not depend on Δ₂-                        rho = compactS __IMPOSSIBLE__ (replicate (size delta2) Nothing)-                    return $ applySubst rho $ renameP (reverseP perm') (vs, as)+                    -- We need Δ₁Δ₂ ⊢ t'+                    t' <- return $ renameP (reverseP perm') $ unArg trhs+                    -- and Δ₁ ⊢ vs : as+                    (vs, as) <- do+                      let -- We know that as does not depend on Δ₂+                          rho = compactS __IMPOSSIBLE__ (replicate (size delta2) Nothing)+                      return $ applySubst rho $ renameP (reverseP perm') (vs, as)  -                  -- Andreas, 2013-02-26 add with-name to signature for printing purposes-                  addConstant aux =<< do-                    useTerPragma $ Defn defaultArgInfo aux typeDontCare [] [] [] 0 noCompiledRep [] Nothing emptyFunction+                    -- Andreas, 2013-02-26 add with-name to signature for printing purposes+                    addConstant aux =<< do+                      useTerPragma $ Defn defaultArgInfo aux typeDontCare [] [] [] 0 noCompiledRep Nothing emptyFunction -                  -- Andreas, 2013-02-26 separate msgs to see which goes wrong-                  reportSDoc "tc.with.top" 20 $-                    text "    with arguments" <+> do escapeContext (size delta2) $ prettyList (map prettyTCM vs)-                  reportSDoc "tc.with.top" 20 $-                    text "             types" <+> do escapeContext (size delta2) $ prettyList (map prettyTCM as)-                  reportSDoc "tc.with.top" 20 $-                    text "with function call" <+> prettyTCM v-                  reportSDoc "tc.with.top" 20 $-                    text "           context" <+> (prettyTCM =<< getContextTelescope)-                  reportSDoc "tc.with.top" 20 $-                    text "             delta" <+> do escapeContext (size delta) $ prettyTCM delta-                  reportSDoc "tc.with.top" 20 $-                    text "                fv" <+> text (show fv)-                  reportSDoc "tc.with.top" 20 $-                    text "              body" <+> (addCtxTel delta $ prettyTCM $ mkBody v)+                    -- Andreas, 2013-02-26 separate msgs to see which goes wrong+                    reportSDoc "tc.with.top" 20 $+                      text "    with arguments" <+> do escapeContext (size delta2) $ prettyList (map prettyTCM vs)+                    reportSDoc "tc.with.top" 20 $+                      text "             types" <+> do escapeContext (size delta2) $ prettyList (map prettyTCM as)+                    reportSDoc "tc.with.top" 20 $+                      text "with function call" <+> prettyTCM v+                    reportSDoc "tc.with.top" 20 $+                      text "           context" <+> (prettyTCM =<< getContextTelescope)+                    reportSDoc "tc.with.top" 20 $+                      text "             delta" <+> do escapeContext (size delta) $ prettyTCM delta+                    reportSDoc "tc.with.top" 20 $+                      text "                fv" <+> text (show fv)+                    reportSDoc "tc.with.top" 20 $+                      text "              body" <+> (addCtxTel delta $ prettyTCM $ mkBody v) -                  return (mkBody v, WithFunction x aux t delta1 delta2 vs as t' ps perm' perm finalPerm cs)-          in handleRHS rhs0-      escapeContext (size delta) $ checkWithFunction with+                    return (mkBody v, WithFunction x aux t delta1 delta2 vs as t' ps perm' perm finalPerm cs)+            in handleRHS rhs0+        escapeContext (size delta) $ checkWithFunction with -      reportSDoc "tc.lhs.top" 10 $ escapeContext (size delta) $ vcat-        [ text "Clause before translation:"-        , nest 2 $ vcat-          [ text "delta =" <+> prettyTCM delta-          , text "perm  =" <+> text (show perm)-          , text "ps    =" <+> text (show ps)-          , text "body  =" <+> text (show body)-          , text "body  =" <+> prettyTCM body+        reportSDoc "tc.lhs.top" 10 $ escapeContext (size delta) $ vcat+          [ text "Clause before translation:"+          , nest 2 $ vcat+            [ text "delta =" <+> prettyTCM delta+            , text "perm  =" <+> text (show perm)+            , text "ps    =" <+> text (show ps)+            , text "body  =" <+> text (show body)+            , text "body  =" <+> prettyTCM body+            ]           ]-        ] -      return $-        Clause { clauseRange     = getRange i-               , clauseTel       = killRange delta-               , clausePerm      = perm-               , namedClausePats = ps-               , clauseBody      = body-               , clauseType      = Just trhs-               }+        return $+          Clause { clauseRange     = getRange i+                 , clauseTel       = killRange delta+                 , clausePerm      = perm+                 , namedClausePats = ps+                 , clauseBody      = body+                 , clauseType      = Just trhs+                 }   checkWithFunction :: WithFunctionProblem -> TCM ()@@ -635,7 +639,7 @@       , prettyTCM dt       ]   addConstant aux =<< do-    useTerPragma $ Defn defaultArgInfo aux auxType [] [] [df] 0 noCompiledRep [] Nothing emptyFunction+    useTerPragma $ Defn defaultArgInfo aux auxType [] [] [df] 0 noCompiledRep Nothing emptyFunction   -- solveSizeConstraints -- Andreas, 2012-10-16 does not seem necessary    reportSDoc "tc.with.top" 10 $ sep@@ -681,7 +685,6 @@     A.AbsurdP _   -> True     A.VarP _      -> False     A.WildP _     -> False-    A.ImplicitP _ -> False     A.DotP _ _    -> False     A.LitP _      -> False     A.AsP _ _ p   -> containsAbsurdPattern p
src/full/Agda/TypeChecking/Rules/LHS.hs view
@@ -1,4 +1,7 @@ {-# LANGUAGE CPP #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE PatternGuards #-}+{-# LANGUAGE TypeSynonymInstances #-}  module Agda.TypeChecking.Rules.LHS where @@ -9,6 +12,7 @@ import Control.Applicative import Control.Monad hiding (mapM) import Control.Monad.State hiding (mapM)+import Control.Monad.Trans.Maybe  import Data.Traversable @@ -20,7 +24,7 @@ import Agda.Syntax.Abstract (IsProjP(..)) import qualified Agda.Syntax.Abstract as A import Agda.Syntax.Abstract.Views (asView)-import Agda.Syntax.Common+import Agda.Syntax.Common as Common import Agda.Syntax.Info import Agda.Syntax.Position @@ -49,7 +53,8 @@ import Agda.TypeChecking.Rules.Data  import Agda.Utils.Except (MonadError(..))-import Agda.Utils.Functor (($>))+import Agda.Utils.Functor+import Agda.Utils.List import Agda.Utils.ListT import Agda.Utils.Monad import Agda.Utils.Permutation@@ -59,24 +64,54 @@ import Agda.Utils.Impossible  -- | Compute the set of flexible patterns in a list of patterns. The result is---   the deBruijn indices of the flexible patterns. A pattern is flexible if it---   is dotted or implicit.+--   the deBruijn indices of the flexible patterns. flexiblePatterns :: [A.NamedArg A.Pattern] -> TCM FlexibleVars-flexiblePatterns nps = map setFlex <$> filterM (flexible . namedArg . snd) (zip [0..] $ reverse nps)-  where-    setFlex (i, Arg ai p)    = FlexibleVar (getHiding ai) (classify $ namedThing p) i-    classify A.DotP{}        = DotFlex-    classify A.ImplicitP{}   = ImplicitFlex-    classify A.ConP{}        = RecordFlex-    classify _               = __IMPOSSIBLE__-    flexible (A.DotP _ _)    = return True-    flexible (A.ImplicitP _) = return True-    flexible (A.ConP _ (A.AmbQ [c]) qs) =-      ifM (isJust <$> isRecordConstructor c)-          (andM $ map (flexible . namedArg) qs)-          (return False)-    flexible _               = return False+flexiblePatterns nps = do+  forMaybeM (zip (downFrom $ length nps) nps) $ \ (i, Arg ai p) -> do+    runMaybeT $ (\ f -> FlexibleVar (getHiding ai) f i) <$> maybeFlexiblePattern p +-- | A pattern is flexible if it is dotted or implicit, or a record pattern+--   with only flexible subpatterns.+class IsFlexiblePattern a where+  maybeFlexiblePattern :: a -> MaybeT TCM FlexibleVarKind++  isFlexiblePattern :: a -> TCM Bool+  isFlexiblePattern p = isJust <$> runMaybeT (maybeFlexiblePattern p)++instance IsFlexiblePattern A.Pattern where+  maybeFlexiblePattern p =+    case p of+      A.DotP{}+        -> return DotFlex+      A.WildP{}+        -> return ImplicitFlex+      A.ConP _ (A.AmbQ [c]) qs+        -> ifM (isNothing <$> isRecordConstructor c) mzero {-else-}+             (maybeFlexiblePattern qs)+      _ -> mzero++instance IsFlexiblePattern (I.Pattern' a) where+  maybeFlexiblePattern p =+    case p of+      I.DotP{}  -> return DotFlex+      I.ConP _ i ps+        | Just ConPImplicit <- conPRecord i -> return ImplicitFlex  -- expanded from ImplicitP+        | Just _            <- conPRecord i -> maybeFlexiblePattern ps+        | otherwise -> mzero+      I.VarP{}  -> mzero+      I.LitP{}  -> mzero+      I.ProjP{} -> mzero++-- | Lists of flexible patterns are 'RecordFlex'.+instance IsFlexiblePattern a => IsFlexiblePattern [a] where+  maybeFlexiblePattern ps = RecordFlex <$> mapM maybeFlexiblePattern ps++instance IsFlexiblePattern a => IsFlexiblePattern (Common.Arg c a) where+  maybeFlexiblePattern = maybeFlexiblePattern . unArg++instance IsFlexiblePattern a => IsFlexiblePattern (Common.Named name a) where+  maybeFlexiblePattern = maybeFlexiblePattern . namedThing+ -- | Compute the dot pattern instantiations. dotPatternInsts :: [A.NamedArg A.Pattern] -> Substitution -> [I.Dom Type] -> TCM [DotPatternInst] dotPatternInsts ps s as = dpi (map namedArg ps) (reverse s) as@@ -90,7 +125,7 @@     dpi (p : ps) (Just u : s) (a : as) =       case p of         A.DotP _ e    -> (DPI e u a :) <$> dpi ps s as-        A.ImplicitP _ -> dpi ps s as+        A.WildP _     -> dpi ps s as         -- record pattern         A.ConP _ (A.AmbQ [c]) qs -> do           Def r es   <- ignoreSharing <$> reduce (unEl $ unDom a)@@ -220,7 +255,10 @@       ProjP{}      -> return p     replace p = do       i <- next-      return $ fromMaybe p $ DotP <$> sub' !! i+      let s = case sub' !!! i of+                Nothing -> __IMPOSSIBLE__+                Just s  -> s+      return $ fromMaybe p $ DotP <$> s   @@ -229,12 +267,18 @@ isSolvedProblem problem = null (restPats $ problemRest problem) &&     all (isSolved . snd . asView . namedArg) (problemInPat problem)   where-    isSolved (A.DefP _ _ []) = False  -- projection pattern-    isSolved (A.VarP _)      = True-    isSolved (A.WildP _)     = True-    isSolved (A.ImplicitP _) = True-    isSolved (A.AbsurdP _)   = True-    isSolved _               = False+    -- need further splitting:+    isSolved A.ConP{}        = False+    isSolved A.DotP{}        = False+    isSolved A.LitP{}        = False+    isSolved A.DefP{}        = False  -- projection pattern+    -- solved:+    isSolved A.VarP{}        = True+    isSolved A.WildP{}       = True+    isSolved A.AbsurdP{}     = True+    -- impossible:+    isSolved A.AsP{}         = __IMPOSSIBLE__  -- removed by asView+    isSolved A.PatternSynP{} = __IMPOSSIBLE__  -- expanded before  -- | For each user-defined pattern variable in the 'Problem', check -- that the corresponding data type (if any) does not contain a@@ -244,7 +288,7 @@ -- Precondition: The problem has to be solved.  noShadowingOfConstructors-  :: (Maybe r -> Call) -- ^ Trace, e.g., @CheckPatternShadowing clause@+  :: Call -- ^ Trace, e.g., @CheckPatternShadowing clause@   -> Problem -> TCM () noShadowingOfConstructors mkCall problem =   traceCall mkCall $ do@@ -256,7 +300,6 @@   where   noShadowing (A.WildP     {}) t = return ()   noShadowing (A.AbsurdP   {}) t = return ()-  noShadowing (A.ImplicitP {}) t = return ()   noShadowing (A.ConP      {}) t = return ()  -- only happens for eta expanded record patterns   noShadowing (A.DefP      {}) t = return ()  -- projection pattern   noShadowing (A.AsP       {}) t = __IMPOSSIBLE__@@ -316,8 +359,11 @@     -- Should be ok to do noConstraints here     noConstraints $ equalTerm a u v --- | Bind the variables in a left hand side. Precondition: the patterns should---   all be 'A.VarP', 'A.WildP', 'A.AbsurdP', or 'A.ImplicitP' and the+-- | Bind the variables in a left hand side and check that 'Hiding' of+--   the patterns matches the hiding info in the type.+--+--   Precondition: the patterns should+--   all be 'A.VarP', 'A.WildP', or 'A.AbsurdP' and the --   telescope should have the same size as the pattern list. --   There could also be 'A.ConP's resulting from eta expanded implicit record --   patterns.@@ -328,11 +374,14 @@   __IMPOSSIBLE__ bindLHSVars (_ : _)   EmptyTel         _   = __IMPOSSIBLE__ bindLHSVars []        EmptyTel         ret = ret-bindLHSVars (p : ps) (ExtendTel a tel) ret =+bindLHSVars (p : ps) (ExtendTel a tel) ret = do+  unless (getHiding p == getHiding a) $ typeError WrongHidingInLHS   case namedArg p of     A.VarP x      -> addContext (x, a) $ bindLHSVars ps (absBody tel) ret     A.WildP _     -> bindDummy (absName tel)-    A.ImplicitP _ -> bindDummy (absName tel)+                 -- @bindDummy underscore@ does not fix issue 819, but+                 -- introduces unwanted underscores in error messages+                 -- (Andreas, 2015-05-28)     A.AbsurdP pi  -> do       -- Andreas, 2012-03-15: allow postponement of emptyness check       isEmptyType (getRange pi) $ unDom a@@ -397,7 +446,7 @@ --   if successful.  checkLeftHandSide-  :: (Maybe r -> Call)+  :: Call      -- ^ Trace, e.g. @CheckPatternShadowing clause@   -> Maybe QName      -- ^ The name of the definition we are checking.@@ -459,19 +508,18 @@   -- since we might insert eta expanded record patterns.   if isSolvedProblem problem then return $ st { lhsProblem = problem } else do -  unlessM (optPatternMatching <$> gets getPragmaOptions) $-    typeError $ GenericError $ "Pattern matching is disabled"+    unlessM (optPatternMatching <$> gets getPragmaOptions) $+      typeError $ GenericError $ "Pattern matching is disabled" -  sp <- runListT $ splitProblem f problem-  reportSDoc "tc.lhs.split" 20 $ text "splitting completed"-  foldListT trySplit nothingToSplit $ ListT $ return sp+    foldListT trySplit nothingToSplit $ splitProblem f problem   where      nothingToSplit = do       reportSLn "tc.lhs.split" 50 $ "checkLHS: nothing to split in problem " ++ show problem       nothingToSplitError problem -    -- Split problem rest (projection pattern)+    -- Split problem rest (projection pattern, does not fail as there is no call to unifier)+     trySplit (SplitRest projPat projType) _ = do        -- Compute the new problem@@ -488,7 +536,8 @@       applyRelevanceToContext (getRelevance projPat) $ do         checkLHS f st' -    -- Split on literal pattern+    -- Split on literal pattern (does not fail as there is no call to unifier)+     trySplit (Split p0 xs (Arg _ (LitFocus lit iph hix a)) p1) _ = do        -- plug the hole with a lit pattern@@ -498,7 +547,9 @@       -- substitute the literal in p1 and sigma and dpi and asb       let delta1 = problemTel p0           delta2 = absApp (fmap problemTel p1) (Lit lit)-          rho    = liftS (size delta2) $ singletonS (Lit lit)+          rho    = singletonS (size delta2) (Lit lit)+          -- Andreas, 2015-06-13 Literals are closed, so need to raise them!+          -- rho    = liftS (size delta2) $ singletonS 0 (Lit lit)           -- rho    = [ var i | i <- [0..size delta2 - 1] ]           --       ++ [ raise (size delta2) $ Lit lit ]           --       ++ [ var i | i <- [size delta2 ..] ]@@ -516,7 +567,7 @@       st' <- updateProblemRest (LHSState problem' sigma' dpi' asb')       checkLHS f st' -    -- Split on constructor pattern+    -- Split on constructor pattern (unifier might fail)      trySplit (Split p0 xs focus@(Arg info Focus{}) p1) tryNextSplit = do       res <- trySplitConstructor p0 xs focus p1@@ -544,7 +595,7 @@     trySplitConstructor p0 xs (Arg info LitFocus{}) p1 = __IMPOSSIBLE__     trySplitConstructor p0 xs (Arg info              (Focus { focusCon      = c-                    , focusImplicit = impl+                    , focusPatOrigin= porigin                     , focusConArgs  = qs                     , focusRange    = r                     , focusOutPat   = iph@@ -555,245 +606,249 @@                     , focusType     = a                     }              )) p1 = do-      traceCall (CheckPattern (A.ConP (ConPatInfo impl $ PatRange r) (A.AmbQ [c]) qs)+      traceCall (CheckPattern (A.ConP (ConPatInfo porigin $ PatRange r) (A.AmbQ [c]) qs)                                        (problemTel p0)                                        (El Prop $ Def d $ map Apply $ vs ++ ws)) $ do -      let delta1 = problemTel p0-      let typeOfSplitVar = Arg info a+        let delta1 = problemTel p0+        let typeOfSplitVar = Arg info a -      reportSDoc "tc.lhs.split" 10 $ sep-        [ text "checking lhs"-        , nest 2 $ text "tel =" <+> prettyTCM (problemTel problem)-        , nest 2 $ text "rel =" <+> (text $ show $ argInfoRelevance info)-        ]+        reportSDoc "tc.lhs.split" 10 $ sep+          [ text "checking lhs"+          , nest 2 $ text "tel =" <+> prettyTCM (problemTel problem)+          , nest 2 $ text "rel =" <+> (text $ show $ argInfoRelevance info)+          ] -      reportSDoc "tc.lhs.split" 15 $ sep-        [ text "split problem"-        , nest 2 $ vcat-          [ text "delta1 = " <+> prettyTCM delta1-          , text "typeOfSplitVar =" <+> prettyTCM typeOfSplitVar-          , text "focusOutPat =" <+> (text . show) iph-          , text "delta2 = " <+> prettyTCM (problemTel $ absBody p1)+        reportSDoc "tc.lhs.split" 15 $ sep+          [ text "split problem"+          , nest 2 $ vcat+            [ text "delta1 = " <+> prettyTCM delta1+            , text "typeOfSplitVar =" <+> prettyTCM typeOfSplitVar+            , text "focusOutPat =" <+> (text . show) iph+            , text "delta2 = " <+> prettyTCM (problemTel $ absBody p1)+            ]           ]-        ] -      c <- (`withRangeOf` c) <$> getConForm c-      ca <- defType <$> getConInfo c+        c <- (`withRangeOf` c) <$> getConForm c+        ca <- defType <$> getConInfo c -      reportSDoc "tc.lhs.split" 20 $ nest 2 $ vcat-        [ text "ca =" <+> prettyTCM ca-        , text "vs =" <+> prettyList (map prettyTCM vs)-        ]+        reportSDoc "tc.lhs.split" 20 $ nest 2 $ vcat+          [ text "ca =" <+> prettyTCM ca+          , text "vs =" <+> prettyList (map prettyTCM vs)+          ] -      -- Lookup the type of the constructor at the given parameters-      let a = ca `piApply` vs+        -- Lookup the type of the constructor at the given parameters+        let a = ca `piApply` vs -      -- It will end in an application of the datatype-      (gamma', ca, d', us) <- do-        TelV gamma' ca@(El _ def) <- telView a-        let Def d' es = ignoreSharing def-            Just us   = allApplyElims es-        return (gamma', ca, d', us)+        -- It will end in an application of the datatype+        (gamma', ca, d', us) <- do+          TelV gamma' ca@(El _ def) <- telView a+          let Def d' es = ignoreSharing def+              Just us   = allApplyElims es+          return (gamma', ca, d', us) -      -- This should be the same datatype as we split on-      unless (d == d') $ typeError $ ShouldBeApplicationOf ca d'+        -- This should be the same datatype as we split on+        unless (d == d') $ typeError $ ShouldBeApplicationOf ca d' -      -- reportSDoc "tc.lhs.top" 20 $ nest 2 $ vcat-      --   [ text "gamma' =" <+> text (show gamma')-      --   ]+        -- reportSDoc "tc.lhs.top" 20 $ nest 2 $ vcat+        --   [ text "gamma' =" <+> text (show gamma')+        --   ] -      -- Andreas 2010-09-07  propagate relevance info to new vars-      let updRel = composeRelevance (getRelevance info)-      gamma' <- return $ mapRelevance updRel <$> gamma'+        -- Andreas 2010-09-07  propagate relevance info to new vars+        let updRel = composeRelevance (getRelevance info)+        gamma' <- return $ mapRelevance updRel <$> gamma' -      -- Insert implicit patterns-      qs' <- insertImplicitPatterns ExpandLast qs gamma'+        -- Insert implicit patterns+        qs' <- insertImplicitPatterns ExpandLast qs gamma' -      unless (size qs' == size gamma') $-        typeError $ WrongNumberOfConstructorArguments (conName c) (size gamma') (size qs')+        unless (size qs' == size gamma') $+          typeError $ WrongNumberOfConstructorArguments (conName c) (size gamma') (size qs') -      let gamma = useNamesFromPattern qs' gamma'+        let gamma = useNamesFromPattern qs' gamma' -      -- Get the type of the datatype.-      da <- (`piApply` vs) . defType <$> getConstInfo d+        -- Get the type of the datatype.+        da <- (`piApply` vs) . defType <$> getConstInfo d -      -- Compute the flexible variables-      flex <- flexiblePatterns (problemInPat p0 ++ qs')+        -- Compute the flexible variables+        flex <- flexiblePatterns (problemInPat p0 ++ qs') -      -- Compute the constructor indices by dropping the parameters-      let us' = drop (size vs) us+        -- Compute the constructor indices by dropping the parameters+        let us' = drop (size vs) us -      reportSDoc "tc.lhs.top" 15 $ addCtxTel delta1 $-        sep [ text "preparing to unify"-            , nest 2 $ vcat-              [ text "c      =" <+> prettyTCM c <+> text ":" <+> prettyTCM a-              , text "d      =" <+> prettyTCM d <+> text ":" <+> prettyTCM da-              , text "gamma  =" <+> prettyTCM gamma-              , text "gamma' =" <+> prettyTCM gamma'-              , text "vs     =" <+> brackets (fsep $ punctuate comma $ map prettyTCM vs)-              , text "us'    =" <+> brackets (fsep $ punctuate comma $ map prettyTCM us')-              , text "ws     =" <+> brackets (fsep $ punctuate comma $ map prettyTCM ws)+        reportSDoc "tc.lhs.top" 15 $ addCtxTel delta1 $+          sep [ text "preparing to unify"+              , nest 2 $ vcat+                [ text "c      =" <+> prettyTCM c <+> text ":" <+> prettyTCM a+                , text "d      =" <+> prettyTCM d <+> text ":" <+> prettyTCM da+                , text "gamma  =" <+> prettyTCM gamma+                , text "gamma' =" <+> prettyTCM gamma'+                , text "vs     =" <+> brackets (fsep $ punctuate comma $ map prettyTCM vs)+                , text "us'    =" <+> brackets (fsep $ punctuate comma $ map prettyTCM us')+                , text "ws     =" <+> brackets (fsep $ punctuate comma $ map prettyTCM ws)+                ]               ]-            ] -      -- Unify constructor target and given type (in Δ₁Γ)-      res <- addCtxTel (delta1 `abstract` gamma) $-              unifyIndices flex (raise (size gamma) da) us' (raise (size gamma) ws)-      whenUnifies res $ \ sub0 -> do+        -- Unify constructor target and given type (in Δ₁Γ)+        res <- addCtxTel (delta1 `abstract` gamma) $+                unifyIndices flex (raise (size gamma) da) us' (raise (size gamma) ws)+        whenUnifies res $ \ sub0 -> do -      -- Andreas 2014-11-25  clear 'Forced' and 'Unused'-      -- Andreas 2015-01-19  ... only after unification-      gamma <- return $ mapRelevance ignoreForced <$> gamma+          -- Andreas 2014-11-25  clear 'Forced' and 'Unused'+          -- Andreas 2015-01-19  ... only after unification+          gamma <- return $ mapRelevance ignoreForced <$> gamma -      -- We should substitute c ys for x in Δ₂ and sigma-      let ys     = teleArgs gamma-          delta2 = absApp (raise (size gamma) $ fmap problemTel p1) (Con c ys)-          rho0   = liftS (size delta2) $ consS (Con c ys) $ raiseS (size gamma)-          -- rho0 = [ var i | i <- [0..size delta2 - 1] ]-          --     ++ [ raise (size delta2) $ Con c ys ]-          --     ++ [ var i | i <- [size delta2 + size gamma ..] ]-          sigma0 = applySubst rho0 sigma-          dpi0   = applySubst rho0 dpi-          asb0   = applySubst rho0 asb-          rest0  = applySubst rho0 (problemRest problem)+          -- We should substitute c ys for x in Δ₂ and sigma+          let ys     = teleArgs gamma+              delta2 = absApp (raise (size gamma) $ fmap problemTel p1) (Con c ys)+              rho0   = liftS (size delta2) $ consS (Con c ys) $ raiseS (size gamma)+              -- rho0 = [ var i | i <- [0..size delta2 - 1] ]+              --     ++ [ raise (size delta2) $ Con c ys ]+              --     ++ [ var i | i <- [size delta2 + size gamma ..] ]+              sigma0 = applySubst rho0 sigma+              dpi0   = applySubst rho0 dpi+              asb0   = applySubst rho0 asb+              rest0  = applySubst rho0 (problemRest problem) -      reportSDoc "tc.lhs.top" 15 $ addCtxTel (delta1 `abstract` gamma) $ nest 2 $ vcat-        [ text "delta2 =" <+> prettyTCM delta2-        , text "sub0   =" <+> brackets (fsep $ punctuate comma $ map (maybe (text "_") prettyTCM) sub0)-        ]-      reportSDoc "tc.lhs.top" 15 $ addCtxTel (delta1 `abstract` gamma `abstract` delta2) $-        nest 2 $ vcat-          [ text "dpi0 = " <+> brackets (fsep $ punctuate comma $ map prettyTCM dpi0)-          , text "asb0 = " <+> brackets (fsep $ punctuate comma $ map prettyTCM asb0)-          ]+          reportSDoc "tc.lhs.top" 15 $ addCtxTel (delta1 `abstract` gamma) $ nest 2 $ vcat+            [ text "delta2 =" <+> prettyTCM delta2+            , text "sub0   =" <+> brackets (fsep $ punctuate comma $ map (maybe (text "_") prettyTCM) sub0)+            ]+          reportSDoc "tc.lhs.top" 15 $ addCtxTel (delta1 `abstract` gamma `abstract` delta2) $+            nest 2 $ vcat+              [ text "dpi0 = " <+> brackets (fsep $ punctuate comma $ map prettyTCM dpi0)+              , text "asb0 = " <+> brackets (fsep $ punctuate comma $ map prettyTCM asb0)+              ] -      -- Andreas, 2010-09-09, save the type.-      -- It is relative to delta1, but it should be relative to-      -- all variables which will be bound by patterns.-      -- Thus, it has to be raised by 1 (the "hole" variable)-      -- plus the length of delta2 (the variables coming after the hole).-      let storedPatternType = raise (1 + size delta2) typeOfSplitVar-      -- Also remember if we are a record pattern and from an implicit pattern.-      isRec <- isRecord d-      let cpi = ConPatternInfo (isRec $> impl) (Just storedPatternType)+          -- Andreas, 2010-09-09, save the type.+          -- It is relative to delta1, but it should be relative to+          -- all variables which will be bound by patterns.+          -- Thus, it has to be raised by 1 (the "hole" variable)+          -- plus the length of delta2 (the variables coming after the hole).+          let storedPatternType = raise (1 + size delta2) typeOfSplitVar+          -- Also remember if we are a record pattern and from an implicit pattern.+          isRec <- isRecord d+          let cpi = ConPatternInfo (isRec $> porigin) (Just storedPatternType) -      -- Plug the hole in the out pattern with c ys-      let ysp = map (argFromDom . fmap (namedVarP . fst)) $ telToList gamma-          ip  = plugHole (ConP c cpi ysp) iph-          ip0 = applySubst rho0 ip+          -- Plug the hole in the out pattern with c ys+          let ysp = map (argFromDom . fmap (namedVarP . fst)) $ telToList gamma+              ip  = plugHole (ConP c cpi ysp) iph+              ip0 = applySubst rho0 ip -      -- Δ₁Γ ⊢ sub0, we need something in Δ₁ΓΔ₂-      -- Also needs to be padded with Nothing's to have the right length.-      let pad n xs x = xs ++ replicate (max 0 $ n - size xs) x-          newTel = problemTel p0 `abstract` (gamma `abstract` delta2)-          sub    = replicate (size delta2) Nothing ++-                   pad (size delta1 + size gamma) (raise (size delta2) sub0) Nothing+          -- Δ₁Γ ⊢ sub0, we need something in Δ₁ΓΔ₂+          -- Also needs to be padded with Nothing's to have the right length.+          let pad n xs x = xs ++ replicate (max 0 $ n - size xs) x+              newTel = problemTel p0 `abstract` (gamma `abstract` delta2)+              sub    = replicate (size delta2) Nothing +++                       pad (size delta1 + size gamma) (raise (size delta2) sub0) Nothing -      reportSDoc "tc.lhs.top" 15 $ nest 2 $ vcat-        [ text "newTel =" <+> prettyTCM newTel-        , addCtxTel newTel $ text "sub =" <+> brackets (fsep $ punctuate comma $ map (maybe (text "_") prettyTCM) sub)-        , text "ip   =" <+> text (show ip)-        , text "ip0  =" <+> text (show ip0)-        ]-      reportSDoc "tc.lhs.top" 15 $ nest 2 $ vcat-        [ text "rho0 =" <+> text (show rho0)-        ]+          reportSDoc "tc.lhs.top" 15 $ nest 2 $ vcat+            [ text "newTel =" <+> prettyTCM newTel+            , addCtxTel newTel $ text "sub =" <+> brackets (fsep $ punctuate comma $ map (maybe (text "_") prettyTCM) sub)+            , text "ip   =" <+> do prettyList $ map (prettyTCM . namedArg) ip+            , text "ip0  =" <+> do prettyList $ map (prettyTCM . namedArg) ip0+            ]+          reportSDoc "tc.lhs.top" 15 $ nest 2 $ vcat+            [ text "rho0 =" <+> text (show rho0)+            ] -      -- Instantiate the new telescope with the given substitution-      (delta', perm, rho, instTypes) <- instantiateTel sub newTel+          -- Instantiate the new telescope with the given substitution+          (delta', perm, rho, instTypes) <- instantiateTel sub newTel  -      reportSDoc "tc.lhs.inst" 12 $-        vcat [ sep [ text "instantiateTel"-                   , nest 4 $ brackets $ fsep $ punctuate comma $ map (maybe (text "_") prettyTCM) sub-                   , nest 4 $ prettyTCM newTel-                   ]-             , nest 2 $ text "delta' =" <+> prettyTCM delta'-             , nest 2 $ text "perm   =" <+> text (show perm)-             , nest 2 $ text "itypes =" <+> fsep (punctuate comma $ map prettyTCM instTypes)-             ]+          reportSDoc "tc.lhs.inst" 12 $+            vcat [ sep [ text "instantiateTel"+                       , nest 4 $ brackets $ fsep $ punctuate comma $ map (maybe (text "_") prettyTCM) sub+                       , nest 4 $ prettyTCM newTel+                       ]+                 , nest 2 $ text "delta' =" <+> prettyTCM delta'+                 , nest 2 $ text "perm   =" <+> text (show perm)+                 , nest 2 $ text "itypes =" <+> fsep (punctuate comma $ map prettyTCM instTypes)+                 ] -{-          -- Andreas, 2010-09-09-      -- temporary error message to find non-id perms-      let sorted (Perm _ xs) = xs == List.sort xs-      unless (sorted (perm)) $ typeError $ GenericError $ "detected proper permutation " ++ show perm--}-      -- Compute the new dot pattern instantiations-      let ps0'   = problemInPat p0 ++ qs' ++ problemInPat (absBody p1)+  {-      -- Andreas, 2010-09-09+          -- temporary error message to find non-id perms+          let sorted (Perm _ xs) = xs == List.sort xs+          unless (sorted (perm)) $ typeError $ GenericError $ "detected proper permutation " ++ show perm+  -}+          -- Compute the new dot pattern instantiations+          let ps0'   = problemInPat p0 ++ qs' ++ problemInPat (absBody p1) -      reportSDoc "tc.lhs.top" 15 $ nest 2 $ vcat-        [ text "subst rho sub =" <+> brackets (fsep $ punctuate comma $ map (maybe (text "_") prettyTCM) (applySubst rho sub))-        , text "ps0'  =" <+> brackets (fsep $ punctuate comma $ map prettyA ps0')-        ]+          reportSDoc "tc.lhs.top" 15 $ nest 2 $ vcat+            [ text "subst rho sub =" <+> brackets (fsep $ punctuate comma $ map (maybe (text "_") prettyTCM) (applySubst rho sub))+            , text "ps0'  =" <+> brackets (fsep $ punctuate comma $ map prettyA ps0')+            ] -      newDpi <- dotPatternInsts ps0' (applySubst rho sub) instTypes+          newDpi <- dotPatternInsts ps0' (applySubst rho sub) instTypes -      -- The final dpis and asbs are the new ones plus the old ones substituted by ρ-      let dpi' = applySubst rho dpi0 ++ newDpi-          asb' = applySubst rho $ asb0 ++ raise (size delta2) (map (\x -> AsB x (Con c ys) ca) xs)+          -- The final dpis and asbs are the new ones plus the old ones substituted by ρ+          let dpi' = applySubst rho dpi0 ++ newDpi+              asb' = applySubst rho $ asb0 ++ raise (size delta2) (map (\x -> AsB x (Con c ys) ca) xs) -      reportSDoc "tc.lhs.top" 15 $ nest 2 $ vcat-        [ text "dpi' = " <+> brackets (fsep $ punctuate comma $ map prettyTCM dpi')-        , text "asb' = " <+> brackets (fsep $ punctuate comma $ map prettyTCM asb')-        ]+          reportSDoc "tc.lhs.top" 15 $ nest 2 $ vcat+            [ text "dpi' = " <+> brackets (fsep $ punctuate comma $ map prettyTCM dpi')+            , text "asb' = " <+> brackets (fsep $ punctuate comma $ map prettyTCM asb')+            ] -      -- Apply the substitution to the type-      let sigma'   = applySubst rho sigma0-          rest'    = applySubst rho rest0+          -- Apply the substitution to the type+          let sigma'   = applySubst rho sigma0+              rest'    = applySubst rho rest0 -      reportSDoc "tc.lhs.inst" 15 $-        nest 2 $ text "ps0 = " <+> brackets (fsep $ punctuate comma $ map prettyA ps0')+          reportSDoc "tc.lhs.inst" 15 $+            nest 2 $ text "ps0 = " <+> brackets (fsep $ punctuate comma $ map prettyA ps0') -      -- Permute the in patterns-      let ps'  = permute perm ps0'+          -- Permute the in patterns+          let ps'  = permute perm ps0' -     -- Compute the new permutation of the out patterns. This is the composition of-      -- the new permutation with the expansion of the old permutation to-      -- reflect the split.-      let perm'  = expandP hix (size gamma) $ fst (problemOutPat problem)-          iperm' = perm `composeP` perm'+          -- Compute the new permutation of the out patterns. This is the composition of+          -- the new permutation with the expansion of the old permutation to+          -- reflect the split.+          let perm'  = expandP hix (size gamma) $ fst (problemOutPat problem)+              iperm' = perm `composeP` perm' -      -- Instantiate the out patterns-      let ip'    = instantiatePattern sub perm' ip0-          newip  = applySubst rho ip'+          -- Instantiate the out patterns+          let ip'    = instantiatePattern sub perm' ip0+              newip  = applySubst rho ip' -      -- Construct the new problem-      let problem' = Problem ps' (iperm', newip) delta' rest'+          -- Construct the new problem+          let problem' = Problem ps' (iperm', newip) delta' rest' -      reportSDoc "tc.lhs.top" 12 $ sep-        [ text "new problem"-        , nest 2 $ vcat-          [ text "ps'    = " <+> fsep (map prettyA ps')-          , text "delta' = " <+> prettyTCM delta'-          ]-        ]+          reportSDoc "tc.lhs.top" 12 $ sep+            [ text "new problem"+            , nest 2 $ vcat+              [ text "ps'    = " <+> fsep (map prettyA ps')+              , text "delta' = " <+> prettyTCM delta'+              ]+            ] -      reportSDoc "tc.lhs.top" 14 $ nest 2 $ vcat-        [ text "perm'  =" <+> text (show perm')-        , text "iperm' =" <+> text (show iperm')-        ]-      reportSDoc "tc.lhs.top" 14 $ nest 2 $ vcat-        [ text "ip'    =" <+> text (show ip')-        , text "newip  =" <+> text (show newip)-        ]+          reportSDoc "tc.lhs.top" 14 $ nest 2 $ vcat+            [ text "perm'  =" <+> text (show perm')+            , text "iperm' =" <+> text (show iperm')+            ]+          reportSDoc "tc.lhs.top" 14 $ nest 2 $ vcat+            [ text "ip'    =" <+> prettyList (map (prettyTCM . namedArg) ip')+            , text "newip  =" <+> prettyList (map (prettyTCM . namedArg) newip)+            ]+          reportSDoc "tc.lhs.top" 60 $ nest 2 $ vcat+            [ text "ip'    =" <+> text (show ip')+            , text "newip  =" <+> text (show newip)+            ] -      -- if rest type reduces,-      -- extend the split problem by previously not considered patterns-      st'@(LHSState problem'@(Problem ps' (iperm', ip') delta' rest')-                    sigma' dpi' asb')-        <- updateProblemRest $ LHSState problem' sigma' dpi' asb'+          -- if rest type reduces,+          -- extend the split problem by previously not considered patterns+          st'@(LHSState problem'@(Problem ps' (iperm', ip') delta' rest')+                        sigma' dpi' asb')+            <- updateProblemRest $ LHSState problem' sigma' dpi' asb' -      reportSDoc "tc.lhs.top" 12 $ sep-        [ text "new problem from rest"-        , nest 2 $ vcat-          [ text "ps'    = " <+> fsep (map prettyA ps')-          , text "delta' = " <+> prettyTCM delta'-          , text "ip'    =" <+> text (show ip')-          , text "iperm' =" <+> text (show iperm')-          ]-        ]-      return $ Unifies st'+          reportSDoc "tc.lhs.top" 12 $ sep+            [ text "new problem from rest"+            , nest 2 $ vcat+              [ text "ps'    = " <+> fsep (map prettyA ps')+              , text "delta' = " <+> prettyTCM delta'+              , text "ip'    = " <+> prettyList (map (prettyTCM . namedArg) ip')+              , text "iperm' = " <+> text (show iperm')+              ]+            ]+          return $ Unifies st'   -- | Ensures that we are not performing pattern matching on codata.
src/full/Agda/TypeChecking/Rules/LHS/Implicit.hs view
@@ -3,7 +3,9 @@  module Agda.TypeChecking.Rules.LHS.Implicit where -import Control.Applicative+import Prelude hiding (null)++import Control.Applicative hiding (empty) import Control.Monad (forM)  import Agda.Syntax.Common@@ -25,7 +27,10 @@ import Agda.TypeChecking.Rules.LHS.Problem  import Agda.Utils.Function+import Agda.Utils.Functor import Agda.Utils.Maybe+import Agda.Utils.Monad+import Agda.Utils.Null  #include "undefined.h" import Agda.Utils.Impossible@@ -55,7 +60,7 @@ --   (record constructor applied to as many implicit patterns as there are fields). expandImplicitPattern' :: Type -> A.NamedArg A.Pattern -> TCM (Maybe (A.NamedArg A.Pattern)) expandImplicitPattern' a p-  | A.ImplicitP{} <- namedArg p, getHiding p /= Instance = do+  | A.WildP{} <- namedArg p, getHiding p /= Instance = do      -- Eta expand implicit patterns of record type (issue 473),      -- but not instance arguments since then they won't be found      -- by the instance search@@ -68,24 +73,44 @@          -- generate one implicit pattern for each field          qs <- forM (recFields def) $ \ f -> flip Arg implicitP <$> reify (argInfo f)          -- generate the pattern (c _ _ ... _)-         let q  = A.ConP (ConPatInfo True patNoRange) (A.AmbQ [recCon def]) qs+         let q  = A.ConP (ConPatInfo ConPImplicit patNoRange) (A.AmbQ [recCon def]) qs          -- equip it with the name/arginfo of the original implicit pattern              p' = updateNamedArg (const q) p   -- WAS: ((q <$) <$> p)  -- Andreas, 2013-03-21 forbiddingly cryptic          return $ Just p'   | otherwise = return Nothing  implicitP :: Named_ A.Pattern-implicitP = unnamed $ A.ImplicitP $ PatRange $ noRange+implicitP = unnamed $ A.WildP $ PatRange $ noRange  -- | Insert implicit patterns in a list of patterns.+--   Even if 'DontExpandLast', trailing SIZELT patterns are inserted. insertImplicitPatterns :: ExpandHidden -> [A.NamedArg A.Pattern] ->                           Telescope -> TCM [A.NamedArg A.Pattern] insertImplicitPatterns exh ps tel =   insertImplicitPatternsT exh ps (telePi tel typeDontCare) +-- | Insert trailing SizeLt patterns, if any.+insertImplicitSizeLtPatterns :: Type -> TCM [A.NamedArg A.Pattern]+insertImplicitSizeLtPatterns t = do+  -- Testing for SizeLt.  In case of blocked type, we return no.+  -- We assume that on the LHS, we know the type.  (TODO: Sufficient?)+  isSize <- isSizeTypeTest+  let isBounded BoundedNo   = False+      isBounded BoundedLt{} = True+      isSizeLt t = maybe False isBounded . isSize <$> reduce t++  -- Search for the last SizeLt type among the hidden arguments.+  TelV tel _ <- telView t+  let ts = reverse $ takeWhile (not . visible) $ telToList tel+  keep <- reverse <$> dropWhileM (not <.> isSizeLt . snd . unDom) ts+  -- Insert implicit patterns upto (including) the last SizeLt type.+  forM keep $ \ (Dom ai _) -> flip Arg implicitP <$> reify ai++-- | Insert implicit patterns in a list of patterns.+--   Even if 'DontExpandLast', trailing SIZELT patterns are inserted. insertImplicitPatternsT :: ExpandHidden -> [A.NamedArg A.Pattern] -> Type ->                            TCM [A.NamedArg A.Pattern]-insertImplicitPatternsT DontExpandLast [] a = return []+insertImplicitPatternsT DontExpandLast [] a = insertImplicitSizeLtPatterns a insertImplicitPatternsT exh            ps a = do   TelV tel b <- telViewUpTo' (-1) (not . visible) a   reportSDoc "tc.lhs.imp" 20 $@@ -96,39 +121,30 @@         , nest 2 $ text "b   = " <+> prettyTCM b         ]   case ps of-    [] -> do-      i <- insImp dummy tel-      case i of-        Just [] -> __IMPOSSIBLE__-        Just hs -> return hs-        Nothing -> return []+    [] -> insImp dummy tel     p : ps -> do       -- Andreas, 2015-05-11.       -- If p is a projection pattern, make it visible for the purpose of       -- calling insImp / insertImplicit, to get correct behavior.       let p' = applyWhen (isJust $ isProjP p) (setHiding NotHidden) p-      i <- insImp p' tel-      case i of-        Just [] -> __IMPOSSIBLE__-        Just hs -> insertImplicitPatternsT exh (hs ++ p : ps) (telePi tel b)-        Nothing -> do+      hs <- insImp p' tel+      case hs of+        [] -> do           a <- reduce a           case ignoreSharing $ unEl a of             Pi arg b -> do               p <- expandImplicitPattern (unDom arg) p               (p :) <$> insertImplicitPatternsT exh ps (absBody b)             _ -> return (p : ps)+        hs -> insertImplicitPatternsT exh (hs ++ p : ps) (telePi tel b)   where     dummy = defaultNamedArg (A.VarP __IMPOSSIBLE__) -    insImp p EmptyTel-      | visible p          = return Nothing-      | isJust (isProjP p) = __IMPOSSIBLE__-      | otherwise          = typeError WrongHidingInLHS+    insImp p EmptyTel = return []     insImp p tel = case insertImplicit p $ map (argFromDom . fmap fst) $ telToList tel of       BadImplicits   -> typeError WrongHidingInLHS       NoSuchName x   -> typeError WrongHidingInLHS-      ImpInsert n    -> return $ Just (map implicitArg n)-      NoInsertNeeded -> return Nothing+      ImpInsert n    -> return $ map implicitArg n+      NoInsertNeeded -> return []      implicitArg h = setHiding h $ defaultArg implicitP
src/full/Agda/TypeChecking/Rules/LHS/Problem.hs view
@@ -32,8 +32,10 @@ --   The alternatives are ordered such that we will assign the higher one first, --   i.e., first we try to assign a @DotFlex@, then... data FlexibleVarKind-  = RecordFlex   -- ^ From a record pattern ('ConP').-  | ImplicitFlex -- ^ From a hidden formal argument ('ImplicitP').+  = RecordFlex [FlexibleVarKind]+      -- ^ From a record pattern ('ConP').+      --   Saves the 'FlexibleVarKind' of its subpatterns.+  | ImplicitFlex -- ^ From a hidden formal argument or underscore ('WildP').   | DotFlex      -- ^ From a dot pattern ('DotP').   deriving (Eq, Ord, Show) @@ -117,7 +119,7 @@ data Focus   = Focus     { focusCon      :: QName-    , focusImplicit :: Bool -- ^ Do we come from an implicit record pattern?+    , focusPatOrigin:: ConPOrigin -- ^ Do we come from an implicit or record pattern?     , focusConArgs  :: [A.NamedArg A.Pattern]     , focusRange    :: Range     , focusOutPat   :: OneHolePatterns@@ -209,4 +211,3 @@ instance Null a => Null (Problem' a) where   null p = null (problemInPat p) && null (problemRest p)   empty  = Problem empty empty empty empty-
src/full/Agda/TypeChecking/Rules/LHS/ProblemRest.hs view
@@ -1,6 +1,5 @@--- GHC 7.4.2 requires this layout for the pragmas. See Issue 1460.-{-# LANGUAGE CPP,-             TupleSections #-}+{-# LANGUAGE CPP           #-}+{-# LANGUAGE TupleSections #-}  module Agda.TypeChecking.Rules.LHS.ProblemRest where @@ -109,14 +108,9 @@ -- | Try to move patterns from the problem rest into the problem. --   Possible if type of problem rest has been updated to a function type. updateProblemRest_ :: Problem -> TCM (Nat, Problem)-updateProblemRest_ p@(Problem _ _ _ (ProblemRest [] _)) = return (0, p) updateProblemRest_ p@(Problem ps0 (perm0@(Perm n0 is0), qs0) tel0 (ProblemRest ps a)) = do-  TelV tel' b0 <- telView $ unArg a-  case tel' of-    EmptyTel -> return (0, p)  -- no progress-    ExtendTel{} -> do     -- a did reduce to a pi-type-      ps <- insertImplicitPatterns DontExpandLast ps tel'-      -- Issue 734: Redo the telView to preserve clause types as much as possible.+      ps <- insertImplicitPatternsT DontExpandLast ps $ unArg a+      -- (Issue 734: Do only the necessary telView to preserve clause types as much as possible.)       TelV tel b   <- telViewUpTo (length ps) $ unArg a       let gamma     = useNamesFromPattern ps tel           as        = telToList gamma
src/full/Agda/TypeChecking/Rules/LHS/Split.hs view
@@ -223,79 +223,79 @@                 | otherwise = keepGoing           -- ifBlockedType reduces the type           ifBlockedType a (const tryInstantiate) $ \ a' -> do-          case ignoreSharing $ unEl a' of+            case ignoreSharing $ unEl a' of -            -- Subcase: split type is a Def.-            Def d es    -> do+              -- Subcase: split type is a Def.+              Def d es    -> do -              def <- liftTCM $ theDef <$> getConstInfo d+                def <- liftTCM $ theDef <$> getConstInfo d -              -- We cannot split on (shape-)irrelevant non-records.-              -- Andreas, 2011-10-04 unless allowed by option-              unless (defIsRecord def) $-                when (unusableRelevance $ getRelevance ai) $-                unlessM (liftTCM $ optExperimentalIrrelevance <$> pragmaOptions) $-                typeError $ SplitOnIrrelevant p dom+                -- We cannot split on (shape-)irrelevant non-records.+                -- Andreas, 2011-10-04 unless allowed by option+                unless (defIsRecord def) $+                  when (unusableRelevance $ getRelevance ai) $+                  unlessM (liftTCM $ optExperimentalIrrelevance <$> pragmaOptions) $+                  typeError $ SplitOnIrrelevant p dom -              -- Check that we are at record or data type and return-              -- the number of parameters.-              let mp = case def of-                        Datatype{dataPars = np} -> Just np-                        Record{recPars = np}    -> Just np-                        _                       -> Nothing-              case mp of-                Nothing -> keepGoing-                Just np -> do-                  let vs = fromMaybe __IMPOSSIBLE__ $ allApplyElims es-                  traceCall (CheckPattern p EmptyTel a) $ do  -- TODO: wrong telescope-                  -- Check that we construct something in the right datatype-                  c <- lift $ do-                      cs' <- mapM canonicalName cs-                      d'  <- canonicalName d-                      let cons def = case theDef def of-                            Datatype{dataCons = cs} -> cs-                            Record{recConHead = c}      -> [conName c]-                            _                       -> __IMPOSSIBLE__-                      cs0 <- cons <$> getConstInfo d'-                      case [ c | (c, c') <- zip cs cs', elem c' cs0 ] of-                        [c]   -> do-                          -- If constructor pattern was ambiguous,-                          -- remember our choice for highlighting info.-                          when (length cs >= 2) $ storeDisambiguatedName c-                          return c-                        []    -> typeError $ ConstructorPatternInWrongDatatype (head cs) d-                        cs    -> -- if there are more than one we give up (they might have different types)-                          typeError $ CantResolveOverloadedConstructorsTargetingSameDatatype d cs+                -- Check that we are at record or data type and return+                -- the number of parameters.+                let mp = case def of+                          Datatype{dataPars = np} -> Just np+                          Record{recPars = np}    -> Just np+                          _                       -> Nothing+                case mp of+                  Nothing -> keepGoing+                  Just np -> do+                    let vs = fromMaybe __IMPOSSIBLE__ $ allApplyElims es+                    traceCall (CheckPattern p EmptyTel a) $ do  -- TODO: wrong telescope+                      -- Check that we construct something in the right datatype+                      c <- lift $ do+                          cs' <- mapM canonicalName cs+                          d'  <- canonicalName d+                          let cons def = case theDef def of+                                Datatype{dataCons = cs} -> cs+                                Record{recConHead = c}      -> [conName c]+                                _                       -> __IMPOSSIBLE__+                          cs0 <- cons <$> getConstInfo d'+                          case [ c | (c, c') <- zip cs cs', elem c' cs0 ] of+                            [c]   -> do+                              -- If constructor pattern was ambiguous,+                              -- remember our choice for highlighting info.+                              when (length cs >= 2) $ storeDisambiguatedName c+                              return c+                            []    -> typeError $ ConstructorPatternInWrongDatatype (head cs) d+                            cs    -> -- if there are more than one we give up (they might have different types)+                              typeError $ CantResolveOverloadedConstructorsTargetingSameDatatype d cs -                  let (pars, ixs) = genericSplitAt np vs-                  lift $ reportSDoc "tc.lhs.split" 10 $ vcat-                    [ sep [ text "splitting on"-                          , nest 2 $ fsep [ prettyA p, text ":", prettyTCM dom ]-                          ]-                    , nest 2 $ text "pars =" <+> fsep (punctuate comma $ map prettyTCM pars)-                    , nest 2 $ text "ixs  =" <+> fsep (punctuate comma $ map prettyTCM ixs)-                    ]+                      let (pars, ixs) = genericSplitAt np vs+                      lift $ reportSDoc "tc.lhs.split" 10 $ vcat+                        [ sep [ text "splitting on"+                              , nest 2 $ fsep [ prettyA p, text ":", prettyTCM dom ]+                              ]+                        , nest 2 $ text "pars =" <+> fsep (punctuate comma $ map prettyTCM pars)+                        , nest 2 $ text "ixs  =" <+> fsep (punctuate comma $ map prettyTCM ixs)+                        ] -                  -- Andreas, 2013-03-22 fixing issue 279-                  -- To resolve ambiguous constructors, Agda always looks up-                  -- their original definition and reconstructs the parameters-                  -- from the type @Def d vs@ we check against.-                  -- However, the constructor could come from a module instantiation-                  -- with some of the parameters already fixed.-                  -- Agda did not make sure the two parameter lists coincide,-                  -- so we add a check here.-                  -- I guess this issue could be solved more systematically,-                  -- but the extra check here is non-invasive to the existing code.-                  checkParsIfUnambiguous cs d pars+                      -- Andreas, 2013-03-22 fixing issue 279+                      -- To resolve ambiguous constructors, Agda always looks up+                      -- their original definition and reconstructs the parameters+                      -- from the type @Def d vs@ we check against.+                      -- However, the constructor could come from a module instantiation+                      -- with some of the parameters already fixed.+                      -- Agda did not make sure the two parameter lists coincide,+                      -- so we add a check here.+                      -- I guess this issue could be solved more systematically,+                      -- but the extra check here is non-invasive to the existing code.+                      checkParsIfUnambiguous cs d pars -                  (return Split-                    { splitLPats   = empty-                    , splitAsNames = xs-                    , splitFocus   = Arg ai $ Focus c (A.patImplicit ci) args (getRange p) q i d pars ixs a-                    , splitRPats   = Abs x  $ Problem ps () tel __IMPOSSIBLE__-                    }) `mplus` keepGoing-            -- Subcase: split type is not a Def.-            _   -> keepGoing+                      (return Split+                        { splitLPats   = empty+                        , splitAsNames = xs+                        , splitFocus   = Arg ai $ Focus c (A.patOrigin ci) args (getRange p) q i d pars ixs a+                        , splitRPats   = Abs x  $ Problem ps () tel __IMPOSSIBLE__+                        }) `mplus` keepGoing+              -- Subcase: split type is not a Def.+              _   -> keepGoing          -- Case: neither literal nor constructor pattern.         _ -> keepGoing
src/full/Agda/TypeChecking/Rules/LHS/Unify.hs view
@@ -1,13 +1,14 @@-{-# LANGUAGE CPP #-}-{-# LANGUAGE DeriveDataTypeable #-}-{-# LANGUAGE DeriveFoldable #-}-{-# LANGUAGE DeriveFunctor #-}-{-# LANGUAGE DeriveTraversable #-}-{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE CPP                        #-}+{-# LANGUAGE DeriveDataTypeable         #-}+{-# LANGUAGE DeriveFoldable             #-}+{-# LANGUAGE DeriveFunctor              #-}+{-# LANGUAGE DeriveTraversable          #-}+{-# LANGUAGE FlexibleContexts           #-}+{-# LANGUAGE FlexibleInstances          #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-}-{-# LANGUAGE MultiParamTypeClasses #-}-{-# LANGUAGE PatternGuards #-}-{-# LANGUAGE TupleSections #-}+{-# LANGUAGE MultiParamTypeClasses      #-}+{-# LANGUAGE PatternGuards              #-}+{-# LANGUAGE TupleSections              #-}  module Agda.TypeChecking.Rules.LHS.Unify where @@ -63,6 +64,7 @@   , MonadError(catchError, throwError)   ) import Agda.Utils.Either+import Agda.Utils.List import Agda.Utils.Maybe import Agda.Utils.Monad import Agda.Utils.Null@@ -101,7 +103,8 @@   local cont (U (ReaderT f)) = U $ ReaderT $ \ a -> local cont (f a)  instance HasConstInfo Unify where-  getConstInfo = U . lift . lift . lift . lift . getConstInfo+  getConstInfo       = U . lift . lift . lift . lift . getConstInfo+  getRewriteRulesFor = U . lift . lift . lift . lift . getRewriteRulesFor  -- UnifyEnv ------------------------------------------------------------------------@@ -157,7 +160,6 @@   | GenericUnifyException String  instance Error UnifyException where-  noMsg  = strMsg ""   strMsg = GenericUnifyException  data UnifyState = USt@@ -276,9 +278,8 @@ --   TODO: later solutions may remove flexible occurences occursCheck :: Nat -> Term -> Type -> Unify () occursCheck i u a = do-  let fv = freeVars u-      v  = var i-  case occurrence i fv of+  let v  = var i+  case occurrence i u of     -- Andreas, 2011-04-14     -- a strongly rigid recursive occurrences signals unsolvability     StronglyRigid -> do@@ -296,7 +297,7 @@ (|->) :: Nat -> (Term, Type) -> Unify () i |-> (u, a) = do   occursCheck i u a-  liftTCM $ reportSDoc "tc.lhs.unify.assign" 15 $ prettyTCM (var i) <+> text ":=" <+> prettyTCM u+  liftTCM $ reportSDoc "tc.lhs.unify.assign" 10 $ prettyTCM (var i) <+> text ":=" <+> prettyTCM u   modSub $ IntMap.insert i (killRange u)   -- Apply substitution to itself (issue 552)   rho  <- getSub@@ -380,7 +381,9 @@     instantiate :: Nat -> Substitution -> Substitution     instantiate i s = map (fmap $ inst i u) s       where-        Just u = s !! i+        u = case s !!! i of+              Just (Just u) -> u+              _             -> __IMPOSSIBLE__      -- @inst i u v@ replaces index @i@ in @v@ by @u@, without removing the index.     inst :: Nat -> Term -> Term -> Term@@ -622,46 +625,7 @@        unifyConArgs (tel `absAppHH` uHH) us vs --    -- | Used for arguments of a 'Def'.-    unifyElims :: Type -> Elims -> Elims -> Unify ()-    unifyElims _ (_ : _) [] = __IMPOSSIBLE__-    unifyElims _ [] (_ : _) = __IMPOSSIBLE__-    unifyElims _ [] [] = return ()-    unifyElims _ (Proj{} : _) (Apply{} : _) = __IMPOSSIBLE__ -- Andreas, 2013-10-19-    unifyElims _ (Apply{} : _) (Proj{} : _) = __IMPOSSIBLE__ -- being optimistic-    unifyElims t (Proj f : es1) (Proj f' : es2)-      | f == f' = do-          maybe __IMPOSSIBLE__ (\ t -> unifyElims t es1 es2) =<< do-            liftTCM $ projectType t f-      | otherwise = projectionMismatch f f'-    unifyElims a us0@(Apply arg@(Arg _ u) : us) vs0@(Apply (Arg _ v) : vs) = do-      liftTCM $ reportSDoc "tc.lhs.unify" 15 $ sep-        [ text "unifyElims"-        , nest 2 $ parens (prettyTCM a)-        , nest 2 $ prettyList $ map prettyTCM us0-        , nest 2 $ prettyList $ map prettyTCM vs0-        ]-      a <- ureduce a  -- Q: reduce sufficient?-      case ignoreSharing $ unEl a of-        Pi b _  -> do-          -- Andreas, Ulf, 2011-09-08 (AIM XVI)-          -- in case of dependent function type, we cannot postpone-          -- unification of u and v, otherwise us or vs might be ill-typed-          let dep = dependent $ unEl a-          -- skip irrelevant parts-          unless (isIrrelevant b) $-            (if dep then noPostponing else id) $-              unify (unDom b) u v-          arg <- traverse ureduce arg-          unifyElims (a `piApply` [arg]) us vs-        _         -> __IMPOSSIBLE__-      where dependent (Pi _ NoAbs{}) = False-            dependent (Pi b c)       = 0 `relevantIn` absBody c-            dependent (Shared p)     = dependent (derefPtr p)-            dependent _              = False-{--    -- | Used for arguments of a 'Def', not 'Con'.+    -- | Used for arguments of a 'Def' (data/record/postulate), not 'Con'.     unifyArgs :: Type -> [I.Arg Term] -> [I.Arg Term] -> Unify ()     unifyArgs _ (_ : _) [] = __IMPOSSIBLE__     unifyArgs _ [] (_ : _) = __IMPOSSIBLE__@@ -691,7 +655,7 @@             dependent (Pi b c)       = 0 `relevantIn` absBody c             dependent (Shared p)     = dependent (derefPtr p)             dependent _              = False--}+     -- | Check using conversion check.     recheckEqualities :: Unify ()     recheckEqualities = do@@ -847,7 +811,7 @@                 Nothing -> checkEqualityHH aHH u v           | otherwise -> constructorMismatchHH aHH u v         -- Definitions are ok as long as they can't reduce (i.e. datatypes/axioms)-        (Def d us, Def d' vs)+        (Def d es, Def d' es')           | d == d' -> do               -- d must be a data, record or axiom               def <- getConstInfo d@@ -857,8 +821,10 @@                     Axiom{}    -> True                     _          -> False               inj <- liftTCM $ optInjectiveTypeConstructors <$> pragmaOptions-              if inj && ok-                then unifyElims (defType def) us vs `catchException` \ _ ->+              if inj && ok then do+                  let us = fromMaybe __IMPOSSIBLE__ $ allApplyElims es+                      vs = fromMaybe __IMPOSSIBLE__ $ allApplyElims es'+                  unifyArgs (defType def) us vs `catchException` \ _ ->                        constructorMismatchHH aHH u v                 else checkEqualityHH aHH u v           -- Andreas, 2011-05-30: if heads disagree, abort
src/full/Agda/TypeChecking/Rules/Record.hs view
@@ -15,6 +15,7 @@ import Agda.TypeChecking.Substitute import Agda.TypeChecking.Telescope import Agda.TypeChecking.Reduce+import Agda.TypeChecking.Positivity.Occurrence import Agda.TypeChecking.Pretty import Agda.TypeChecking.Polarity import Agda.TypeChecking.Irrelevance@@ -331,124 +332,123 @@       -- disabled by --no-irrelevant-projections       ifM (return (rel == Irrelevant) `and2M` do not . optIrrelevantProjections <$> pragmaOptions) recurse $ do -      reportSDoc "tc.rec.proj" 10 $ sep-        [ text "adding projection"-        , nest 2 $ prettyTCM projname <+> text ":" <+> inTopContext (prettyTCM finalt)-        ]+        reportSDoc "tc.rec.proj" 10 $ sep+          [ text "adding projection"+          , nest 2 $ prettyTCM projname <+> text ":" <+> inTopContext (prettyTCM finalt)+          ] -      -- The body should be-      --  P.xi {tel} (r _ .. x .. _) = x-      -- Ulf, 2011-08-22: actually we're dropping the parameters from the-      -- projection functions so the body is now-      --  P.xi (r _ .. x .. _) = x-      -- Andreas, 2012-01-12: irrelevant projections get translated to-      --  P.xi (r _ .. x .. _) = irrAxiom {level of t} {t} x-      -- PROBLEM: because of dropped parameters, cannot refer to t+        -- The body should be+        --  P.xi {tel} (r _ .. x .. _) = x+        -- Ulf, 2011-08-22: actually we're dropping the parameters from the+        -- projection functions so the body is now+        --  P.xi (r _ .. x .. _) = x+        -- Andreas, 2012-01-12: irrelevant projections get translated to+        --  P.xi (r _ .. x .. _) = irrAxiom {level of t} {t} x+        -- PROBLEM: because of dropped parameters, cannot refer to t -      -- compute body modification for irrelevant projections-      let bodyMod = case rel of-            Relevant   -> id-            Irrelevant -> DontCare-            _          -> __IMPOSSIBLE__+        -- compute body modification for irrelevant projections+        let bodyMod = case rel of+              Relevant   -> id+              Irrelevant -> DontCare+              _          -> __IMPOSSIBLE__ -{- 2012-04-02: DontCare instead of irrAxiom-          Irrelevant -> do-            irrAxiom <- primIrrAxiom-            let sortToLevel (Type l) = l-                sortToLevel _        = Max [ClosedLevel 0] -- something random here, we don't care a lot-                levelOfT = Level $ sortToLevel $ getSort t-            return $ \ n x -> let -- mkArg t = Arg Hidden Relevant $ raise n t-                                  -- ERR: Variables of t not in Scope!-                                  mkArg t = Arg Hidden Relevant $ Sort Prop-                              in  apply irrAxiom [mkArg levelOfT, mkArg (unEl t), Arg NotHidden Irrelevant x]--}+  -- 2012-04-02: DontCare instead of irrAxiom+  --          Irrelevant -> do+  --            irrAxiom <- primIrrAxiom+  --            let sortToLevel (Type l) = l+  --                sortToLevel _        = Max [ClosedLevel 0] -- something random here, we don't care a lot+  --                levelOfT = Level $ sortToLevel $ getSort t+  --            return $ \ n x -> let -- mkArg t = Arg Hidden Relevant $ raise n t+  --                                  -- ERR: Variables of t not in Scope!+  --                                  mkArg t = Arg Hidden Relevant $ Sort Prop+  --                              in  apply irrAxiom [mkArg levelOfT, mkArg (unEl t), Arg NotHidden Irrelevant x] -      let -- Andreas, 2010-09-09: comment for existing code-          -- split the telescope into parameters (ptel) and the type or the record-          -- (rt) which should be  R ptel-          (ptel,[rt]) = splitAt (size tel - 1) $ telToList tel-          projArgI    = domInfo rt-          cpi    = ConPatternInfo (Just False) (Just $ argFromDom $ fmap snd rt)-          conp   = defaultArg $ ConP con cpi $-                   [ Arg info $ unnamed $ VarP "x" | Dom info _ <- telToList ftel ]-          nobind 0 = id-          nobind n = Bind . Abs "_" . nobind (n - 1)-          body   = nobind (size ftel1)-                 $ Bind . Abs "x"-                 $ nobind (size ftel2)-                 $ Body $ bodyMod $ var (size ftel2)-          cltel  = ftel-          clause = Clause { clauseRange = getRange info-                          , clauseTel       = killRange cltel-                          , clausePerm      = idP $ size ftel-                          , namedClausePats = [Named Nothing <$> conp]-                          , clauseBody      = body-                          , clauseType      = Just $ Arg ai t-                          }+        let -- Andreas, 2010-09-09: comment for existing code+            -- split the telescope into parameters (ptel) and the type or the record+            -- (rt) which should be  R ptel+            (ptel,[rt]) = splitAt (size tel - 1) $ telToList tel+            projArgI    = domInfo rt+            cpi    = ConPatternInfo (Just ConPRec) (Just $ argFromDom $ fmap snd rt)+            conp   = defaultArg $ ConP con cpi $+                     [ Arg info $ unnamed $ VarP "x" | Dom info _ <- telToList ftel ]+            nobind 0 = id+            nobind n = Bind . Abs "_" . nobind (n - 1)+            body   = nobind (size ftel1)+                   $ Bind . Abs "x"+                   $ nobind (size ftel2)+                   $ Body $ bodyMod $ var (size ftel2)+            cltel  = ftel+            clause = Clause { clauseRange = getRange info+                            , clauseTel       = killRange cltel+                            , clausePerm      = idP $ size ftel+                            , namedClausePats = [Named Nothing <$> conp]+                            , clauseBody      = body+                            , clauseType      = Just $ Arg ai t+                            } -      -- Andreas, 2013-10-20-      -- creating the projection construction function-      let core = Lam projArgI $ Abs "r" $ bodyMod $ projcall-          -- leading lambdas are to ignore parameter applications-          proj = teleNoAbs ptel core-          -- proj = foldr (\ (Dom ai (x, _)) -> Lam ai . NoAbs x) core ptel-          projection = Projection-            { projProper   = Just projname-            -- name of the record type:-            , projFromType = r-            -- index of the record argument (in the type),-            -- start counting with 1:-            , projIndex    = size ptel + 1  -- which is @size tel@-            , projDropPars = proj-            , projArgInfo  = projArgI-            }+        -- Andreas, 2013-10-20+        -- creating the projection construction function+        let core = Lam projArgI $ Abs "r" $ bodyMod $ projcall+            -- leading lambdas are to ignore parameter applications+            proj = teleNoAbs ptel core+            -- proj = foldr (\ (Dom ai (x, _)) -> Lam ai . NoAbs x) core ptel+            projection = Projection+              { projProper   = Just projname+              -- name of the record type:+              , projFromType = r+              -- index of the record argument (in the type),+              -- start counting with 1:+              , projIndex    = size ptel + 1  -- which is @size tel@+              , projDropPars = proj+              , projArgInfo  = projArgI+              } -      reportSDoc "tc.rec.proj" 80 $ sep-        [ text "adding projection"-        , nest 2 $ prettyTCM projname <+> text (show clause)-        ]-      reportSDoc "tc.rec.proj" 70 $ sep-        [ text "adding projection"-        , nest 2 $ prettyTCM projname <+> text (show (clausePats clause)) <+> text "=" <+>-                     inTopContext (addCtxTel ftel (prettyTCM (clauseBody clause)))-        ]-      reportSDoc "tc.rec.proj" 10 $ sep-        [ text "adding projection"-        , nest 2 $ prettyTCM (QNamed projname clause)-        ]+        reportSDoc "tc.rec.proj" 80 $ sep+          [ text "adding projection"+          , nest 2 $ prettyTCM projname <+> text (show clause)+          ]+        reportSDoc "tc.rec.proj" 70 $ sep+          [ text "adding projection"+          , nest 2 $ prettyTCM projname <+> text (show (clausePats clause)) <+> text "=" <+>+                       inTopContext (addCtxTel ftel (prettyTCM (clauseBody clause)))+          ]+        reportSDoc "tc.rec.proj" 10 $ sep+          [ text "adding projection"+          , nest 2 $ prettyTCM (QNamed projname clause)+          ] -            -- Record patterns should /not/ be translated when the-            -- projection functions are defined. Record pattern-            -- translation is defined in terms of projection-            -- functions.-      cc <- compileClauses Nothing [clause]+              -- Record patterns should /not/ be translated when the+              -- projection functions are defined. Record pattern+              -- translation is defined in terms of projection+              -- functions.+        cc <- compileClauses Nothing [clause] -      reportSDoc "tc.cc" 10 $ do-        sep [ text "compiled clauses of " <+> prettyTCM projname-            , nest 2 $ text (show cc)-            ]+        reportSDoc "tc.cc" 10 $ do+          sep [ text "compiled clauses of " <+> prettyTCM projname+              , nest 2 $ text (show cc)+              ] -      escapeContext (size tel) $ do-        addConstant projname $-          (defaultDefn ai projname (killRange finalt)-            Function { funClauses        = [clause]-                     , funCompiled       = Just cc-                     , funDelayed        = NotDelayed-                     , funInv            = NotInjective-                     , funAbstr          = ConcreteDef-                     , funMutual         = []-                     , funProjection     = Just projection-                     , funStatic         = False-                     , funCopy           = False-                     , funTerminates     = Just True-                     , funExtLam         = Nothing-                     , funWith           = Nothing-                     , funCopatternLHS   = isCopatternLHS [clause]-                     })-            { defArgOccurrences = [StrictPos] }-        computePolarity projname+        escapeContext (size tel) $ do+          addConstant projname $+            (defaultDefn ai projname (killRange finalt)+              Function { funClauses        = [clause]+                       , funCompiled       = Just cc+                       , funDelayed        = NotDelayed+                       , funInv            = NotInjective+                       , funAbstr          = ConcreteDef+                       , funMutual         = []+                       , funProjection     = Just projection+                       , funStatic         = False+                       , funCopy           = False+                       , funTerminates     = Just True+                       , funExtLam         = Nothing+                       , funWith           = Nothing+                       , funCopatternLHS   = isCopatternLHS [clause]+                       })+              { defArgOccurrences = [StrictPos] }+          computePolarity projname -      recurse+        recurse      checkProjs ftel1 ftel2 (d : fs) = do       checkDecl d
src/full/Agda/TypeChecking/Rules/Term.hs view
@@ -1,10 +1,11 @@-{-# LANGUAGE CPP #-}-{-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE CPP                   #-}+{-# LANGUAGE FlexibleInstances     #-}+{-# LANGUAGE NamedFieldPuns        #-}+{-# LANGUAGE NondecreasingIndentation #-} {-# LANGUAGE MultiParamTypeClasses #-}-{-# LANGUAGE PatternGuards #-}-{-# LANGUAGE ScopedTypeVariables #-}-{-# LANGUAGE TupleSections #-}+{-# LANGUAGE PatternGuards         #-}+{-# LANGUAGE ScopedTypeVariables   #-}+{-# LANGUAGE TupleSections         #-}  #if __GLASGOW_HASKELL__ >= 710 {-# LANGUAGE FlexibleContexts #-}@@ -52,12 +53,14 @@ import Agda.TypeChecking.Level import Agda.TypeChecking.MetaVars import Agda.TypeChecking.Patterns.Abstract+import Agda.TypeChecking.Positivity.Occurrence import Agda.TypeChecking.Pretty import Agda.TypeChecking.Primitive import Agda.TypeChecking.Quote import Agda.TypeChecking.RecordPatterns import Agda.TypeChecking.Records import Agda.TypeChecking.Reduce+import Agda.TypeChecking.SizedTypes import Agda.TypeChecking.Substitute import Agda.TypeChecking.Telescope import Agda.TypeChecking.Rules.LHS (checkLeftHandSide, LHSResult(..))@@ -110,12 +113,12 @@       return t'     A.Pi _ tel e | null tel -> isType_ e     A.Pi _ tel e -> do-      checkPiTelescope tel $ \tel -> do-        t   <- instantiateFull =<< isType_ e+      (t0, t') <- checkPiTelescope tel $ \ tel -> do+        t0  <- instantiateFull =<< isType_ e         tel <- instantiateFull tel-        let t' = telePi tel t-        noFunctionsIntoSize t t'-        return t'+        return (t0, telePi tel t0)+      noFunctionsIntoSize t0 t'+      return t'     A.Set _ n    -> do       n <- ifM typeInType (return 0) (return n)       return $ sort (mkType n)@@ -137,6 +140,10 @@ ptsRule a b = pts <$> reduce (getSort a) <*> reduce (getSort b)  -- | Ensure that a (freshly created) function type does not inhabit 'SizeUniv'.+--   Precondition:  When @noFunctionsIntoSize t tBlame@ is called,+--   we are in the context of @tBlame@ in order to print it correctly.+--   Not being in context of @t@ should not matter, as we are only+--   checking whether its sort reduces to 'SizeUniv'. noFunctionsIntoSize :: Type -> Type -> TCM () noFunctionsIntoSize t tBlame = do   reportSDoc "tc.fun" 20 $ do@@ -262,6 +269,8 @@ checkLambda (Arg _ (A.TLet _ lbs)) body target =   checkLetBindings lbs (checkExpr body target) checkLambda (Arg info (A.TBind _ xs typ)) body target = do+  reportSLn "tc.term.lambda" 60 $ "checkLambda   xs = " ++ show xs+   let numbinds = length xs   TelV tel btyp <- telViewUpTo numbinds target   if size tel < numbinds || numbinds /= 1@@ -274,12 +283,17 @@        -- First check that argsT is a valid type       argsT <- workOnTypes $ Dom info <$> isType_ typ+      -- Andreas, 2015-05-28 Issue 1523+      -- If argsT is a SizeLt, it must be non-empty to avoid non-termination.+      -- TODO: do we need to block checkExpr?+      checkSizeLtSat $ unDom argsT        -- In order to have as much type information as possible when checking       -- body, we first unify (xs : argsT) → ?t₁ with the target type. If this       -- is inconclusive we need to block the resulting term so we create a       -- fresh problem for the check.       let tel = telFromList $ bindsWithHidingToTel xs argsT+      reportSLn "tc.term.lambda" 60 $ "dontUseTargetType tel = " ++ show tel       -- DONT USE tel for addContext, as it loses NameIds.       -- WRONG: t1 <- addContext tel $ workOnTypes newTypeMeta_       t1 <- addContext (xs, argsT) $ workOnTypes newTypeMeta_@@ -300,6 +314,8 @@      useTargetType tel@(ExtendTel arg (Abs y EmptyTel)) btyp = do         verboseS "tc.term.lambda" 5 $ tick "lambda-with-target-type"+        reportSLn "tc.term.lambda" 60 $ "useTargetType y  = " ++ show y+         -- merge in the hiding info of the TBind         info <- return $ mapHiding (mappend h) info         unless (getHiding arg == getHiding info) $ typeError $ WrongHidingInLambda target@@ -307,15 +323,21 @@         let r  = getRelevance info             r' = getRelevance arg -- relevance of function type         when (r == Irrelevant && r' /= r) $ typeError $ WrongIrrelevanceInLambda target+        -- Andreas, 2015-05-28 Issue 1523+        -- Ensure we are not stepping under a possibly non-existing size.+        -- TODO: do we need to block checkExpr?+        let a = unDom arg+        checkSizeLtSat a         -- We only need to block the final term on the argument type         -- comparison. The body will be blocked if necessary. We still want to         -- compare the argument types first, so we spawn a new problem for that         -- check.-        (pid, argT) <- newProblem $ isTypeEqualTo typ (unDom arg)-        v <- add y (Dom (setRelevance r' info) argT) $ checkExpr body btyp+        (pid, argT) <- newProblem $ isTypeEqualTo typ a+        v <- add (notInScopeName y) (Dom (setRelevance r' info) argT) $ checkExpr body btyp         blockTermOnProblem target (Lam info $ Abs (nameToArgName x) v) pid       where         [WithHiding h x] = xs+        -- Andreas, Issue 630: take name from function type if lambda name is "_"         add y dom | isNoName x = addContext (y, dom)                   | otherwise  = addContext (x, dom)     useTargetType _ _ = __IMPOSSIBLE__@@ -374,13 +396,13 @@         let h' = getHiding dom         -- Found expected hiding: return function type.         if h == h' then ret t else do-        -- Found a visible argument but expected a hidden one:-        -- That's an error, as we cannot insert a visible lambda.-        if visible h' then typeError $ WrongHidingInLambda target else do-        -- Otherwise, we found a hidden argument that we can insert.-        let x = absName b-        Lam (domInfo dom) . Abs x <$> do-          addContext (x, dom) $ insertHiddenLambdas h (absBody b) postpone ret+          -- Found a visible argument but expected a hidden one:+          -- That's an error, as we cannot insert a visible lambda.+          if visible h' then typeError $ WrongHidingInLambda target else do+            -- Otherwise, we found a hidden argument that we can insert.+            let x = absName b+            Lam (domInfo dom) . Abs x <$> do+              addContext (x, dom) $ insertHiddenLambdas h (absBody b) postpone ret        _ -> typeError . GenericDocError =<< do         text "Expected " <+> prettyTCM target <+> text " to be a function type"@@ -412,7 +434,7 @@           addConstant aux             $ Defn (setRelevance rel info') aux t'                    [Nonvariant] [Unused] (defaultDisplayForm aux)-                   0 noCompiledRep [] Nothing+                   0 noCompiledRep Nothing             $ Function               { funClauses        =                   [Clause@@ -487,8 +509,9 @@     [ text "checking record expression"     , prettyA e     ]-  t <- reduce t+  ifBlockedType t (\ _ t -> guessRecordType t) {-else-} $ \ t -> do   case ignoreSharing $ unEl t of+    -- Case: We know the type of the record already.     Def r es  -> do       let ~(Just vs) = allApplyElims es       reportSDoc "tc.term.rec" 20 $ text $ "  r   = " ++ show r@@ -501,37 +524,45 @@         text =<< show <$> getRecordConstructor r        def <- getRecordDef r-      let axs  = recordFieldNames def+      let -- Field names with ArgInfo.+          axs  = recordFieldNames def+          -- Just field names.           xs   = map unArg axs-          ftel = recTel def+          -- Record constructor.           con  = killRange $ recConHead def       reportSDoc "tc.term.rec" 20 $ vcat         [ text $ "  xs  = " ++ show xs-        , text   "  ftel= " <> prettyTCM ftel+        , text   "  ftel= " <> prettyTCM (recTel def)         , text $ "  con = " ++ show con         ]-      scope  <- getScope+      -- Compute the list of given fields, decorated with the ArgInfo from the record def.       let arg x e =             case [ a | a <- axs, unArg a == x ] of               [a] -> unnamed e <$ a               _   -> defaultNamedArg e -- we only end up here if the field names are bad-      let meta x = A.Underscore $ A.MetaInfo (getRange e) scope Nothing (show x)-          missingExplicits = [ (unArg a, [unnamed . meta <$> a])+          givenFields = [ (x, Just $ arg x e) | (x, e) <- fs ]+      -- Compute a list of metas for the missing visible fields.+      scope <- getScope+      let re = getRange e+          meta x = A.Underscore $ A.MetaInfo re scope Nothing (show x)+          missingExplicits = [ (unArg a, Just $ unnamed . meta <$> a)                              | a <- axs, notHidden a                              , notElem (unArg a) (map fst fs) ]       -- In es omitted explicit fields are replaced by underscores       -- (from missingExplicits). Omitted implicit or instance fields       -- are still left out and inserted later by checkArguments_.-      es   <- concat <$> orderFields r [] xs ([ (x, [arg x e]) | (x, e) <- fs ] ++-                                              missingExplicits)-      let tel = ftel `apply` vs-      args <- checkArguments_ ExpandLast (getRange e)-                es -- (zipWith (\ax e -> fmap (const (unnamed e)) ax) axs es)-                tel+      es   <- catMaybes <$> do+        -- Default value @Nothing@ will only be used for missing hidden fields.+        -- These can be ignored as they will be inserted by @checkArguments_@.+        orderFields r Nothing xs $ givenFields ++ missingExplicits+      args <- checkArguments_ ExpandLast re es $ recTel def `apply` vs       -- Don't need to block here!       reportSDoc "tc.term.rec" 20 $ text $ "finished record expression"       return $ Con con args-    MetaV _ _ -> do+    _         -> typeError $ ShouldBeRecordType t++  where+    guessRecordType t = do       let fields = map fst fs       rs <- findPossibleRecords fields       case rs of@@ -571,7 +602,6 @@             , nest 2 $ prettyA e <+> text ":" <+> prettyTCM t             ]           postponeTypeCheckingProblem_ $ CheckExpr e t-    _         -> typeError $ ShouldBeRecordType t   -- | @checkRecordUpdate ei recexpr fs e t@@@ -673,13 +703,13 @@          -- Insert hidden lambda if all of the following conditions are met:             -- type is a hidden function type, {x : A} -> B or {{x : A} -> B-        _   | Pi (Dom info _) _ <- ignoreSharing $ unEl t+        _   | Pi (Dom info _) b <- ignoreSharing $ unEl t             , let h = getHiding info             , notVisible h             -- expression is not a matching hidden lambda or question mark             , not (hiddenLambdaOrHole h e)             -> do-                x <- freshName rx (argName t)+                x <- freshName rx $ notInScopeName $ absName b                 info <- reify info                 reportSLn "tc.term.expr.impl" 15 $ "Inserting implicit lambda"                 checkExpr (A.Lam (A.ExprRange re) (domainFree info x) e) t@@ -766,12 +796,11 @@         A.Let i ds e -> checkLetBindings ds $ checkExpr e t         A.Pi _ tel e | null tel -> checkExpr e t         A.Pi _ tel e -> do-            t' <- checkPiTelescope tel $ \tel -> do-                    t   <- instantiateFull =<< isType_ e+            (t0, t') <- checkPiTelescope tel $ \ tel -> do+                    t0  <- instantiateFull =<< isType_ e                     tel <- instantiateFull tel-                    let t' = telePi tel t-                    noFunctionsIntoSize t t'-                    return t'+                    return (t0, telePi tel t0)+            noFunctionsIntoSize t0 t'             let s = getSort t'                 v = unEl t'             when (s == Inf) $ reportSDoc "tc.term.sort" 20 $@@ -792,8 +821,6 @@           coerce (Sort $ mkType n) (sort $ mkType $ n + 1) t         A.Prop _     -> do           typeError $ GenericError "Prop is no longer supported"-          -- s <- ifM typeInType (return $ mkType 0) (return Prop)-          -- coerce (Sort Prop) (sort $ mkType 1) t          A.Rec _ fs  -> checkRecordExpression fs e t @@ -863,19 +890,19 @@       -- Lets look at the target type at this point       let getCon :: TCM (Maybe ConHead)           getCon = do-          TelV tel t1 <- telView t-          addCtxTel tel $ do-           reportSDoc "tc.check.term.con" 40 $ nest 2 $-             text "target type: " <+> prettyTCM t1-           ifBlockedType t1 (\ m t -> return Nothing) $ \ t' ->-             caseMaybeM (isDataOrRecord $ unEl t') (badCon t') $ \ d ->-               case [ c | (d', c) <- dcs, d == d' ] of-                 [c] -> do-                   reportSLn "tc.check.term" 40 $ "  decided on: " ++ show c-                   storeDisambiguatedName $ conName c-                   return $ Just c-                 []  -> badCon $ t' $> Def d []-                 cs  -> typeError $ CantResolveOverloadedConstructorsTargetingSameDatatype d $ map conName cs+            TelV tel t1 <- telView t+            addCtxTel tel $ do+             reportSDoc "tc.check.term.con" 40 $ nest 2 $+               text "target type: " <+> prettyTCM t1+             ifBlockedType t1 (\ m t -> return Nothing) $ \ t' ->+               caseMaybeM (isDataOrRecord $ unEl t') (badCon t') $ \ d ->+                 case [ c | (d', c) <- dcs, d == d' ] of+                   [c] -> do+                     reportSLn "tc.check.term" 40 $ "  decided on: " ++ show c+                     storeDisambiguatedName $ conName c+                     return $ Just c+                   []  -> badCon $ t' $> Def d []+                   cs  -> typeError $ CantResolveOverloadedConstructorsTargetingSameDatatype d $ map conName cs       let unblock = isJust <$> getCon -- to unblock, call getCon later again       mc <- getCon       case mc of@@ -1072,42 +1099,42 @@     t0 <- reduce (Def d [])     case (ignoreSharing t0, ignoreSharing $ unEl t) of -- Only fully applied constructors get special treatment       (Def d0 _, Def d' es) -> do-       let ~(Just vs) = allApplyElims es-       reportSDoc "tc.term.con" 50 $ nest 2 $ text "d0   =" <+> prettyTCM d0-       reportSDoc "tc.term.con" 50 $ nest 2 $ text "d'   =" <+> prettyTCM d'-       reportSDoc "tc.term.con" 50 $ nest 2 $ text "vs   =" <+> prettyTCM vs-       if d' /= d0 then fallback else do-        -- Issue 661: d' may take more parameters than d, in particular-        -- these additional parameters could be a module parameter telescope.-        -- Since we get the constructor type ctype from d but the parameters-        -- from t = Def d' vs, we drop the additional parameters.-        npars  <- getNumberOfParameters d-        npars' <- getNumberOfParameters d'-        caseMaybe (sequenceA $ List2 (npars, npars')) fallback $ \ (List2 (n,n')) -> do-        reportSDoc "tc.term.con" 50 $ nest 2 $ text $ "n    = " ++ show n-        reportSDoc "tc.term.con" 50 $ nest 2 $ text $ "n'   = " ++ show n'-        when (n > n')  -- preprocessor does not like ', so put on next line-          __IMPOSSIBLE__-        let ps    = genericTake n $ genericDrop (n' - n) vs-            ctype = defType cdef-        reportSDoc "tc.term.con" 20 $ vcat-          [ text "special checking of constructor application of" <+> prettyTCM c-          , nest 2 $ vcat [ text "ps     =" <+> prettyTCM ps-                          , text "ctype  =" <+> prettyTCM ctype ] ]-        let ctype' = ctype `piApply` ps-        reportSDoc "tc.term.con" 20 $ nest 2 $ text "ctype' =" <+> prettyTCM ctype'-        -- get the parameter names-        TelV ptel _ <- telViewUpTo n ctype-        let pnames = map (fst . unDom) $ telToList ptel-        -- drop the parameter arguments-            args' = dropArgs pnames args-        -- check the non-parameter arguments-        expandLast <- asks envExpandLast-        checkArguments' expandLast ExpandInstanceArguments (getRange c) args' ctype' t $ \us t' -> do-          reportSDoc "tc.term.con" 20 $ nest 2 $ vcat-            [ text "us     =" <+> prettyTCM us-            , text "t'     =" <+> prettyTCM t' ]-          coerce (Con c us) t' t+        let ~(Just vs) = allApplyElims es+        reportSDoc "tc.term.con" 50 $ nest 2 $ text "d0   =" <+> prettyTCM d0+        reportSDoc "tc.term.con" 50 $ nest 2 $ text "d'   =" <+> prettyTCM d'+        reportSDoc "tc.term.con" 50 $ nest 2 $ text "vs   =" <+> prettyTCM vs+        if d' /= d0 then fallback else do+         -- Issue 661: d' may take more parameters than d, in particular+         -- these additional parameters could be a module parameter telescope.+         -- Since we get the constructor type ctype from d but the parameters+         -- from t = Def d' vs, we drop the additional parameters.+         npars  <- getNumberOfParameters d+         npars' <- getNumberOfParameters d'+         caseMaybe (sequenceA $ List2 (npars, npars')) fallback $ \ (List2 (n,n')) -> do+           reportSDoc "tc.term.con" 50 $ nest 2 $ text $ "n    = " ++ show n+           reportSDoc "tc.term.con" 50 $ nest 2 $ text $ "n'   = " ++ show n'+           when (n > n')  -- preprocessor does not like ', so put on next line+             __IMPOSSIBLE__+           let ps    = genericTake n $ genericDrop (n' - n) vs+               ctype = defType cdef+           reportSDoc "tc.term.con" 20 $ vcat+             [ text "special checking of constructor application of" <+> prettyTCM c+             , nest 2 $ vcat [ text "ps     =" <+> prettyTCM ps+                             , text "ctype  =" <+> prettyTCM ctype ] ]+           let ctype' = ctype `piApply` ps+           reportSDoc "tc.term.con" 20 $ nest 2 $ text "ctype' =" <+> prettyTCM ctype'+           -- get the parameter names+           TelV ptel _ <- telViewUpTo n ctype+           let pnames = map (fst . unDom) $ telToList ptel+           -- drop the parameter arguments+               args' = dropArgs pnames args+           -- check the non-parameter arguments+           expandLast <- asks envExpandLast+           checkArguments' expandLast ExpandInstanceArguments (getRange c) args' ctype' t $ \us t' -> do+             reportSDoc "tc.term.con" 20 $ nest 2 $ vcat+               [ text "us     =" <+> prettyTCM us+               , text "t'     =" <+> prettyTCM t' ]+             coerce (Con c us) t' t       _ -> do         reportSDoc "tc.term.con" 50 $ nest 2 $ text "we are not at a datatype, falling back"         fallback@@ -1212,6 +1239,10 @@         typeError $ NotImplemented           "coinductive constructor in the scope of a let-bound variable" +      arg <- case args of+               [a] | getHiding a == NotHidden -> return $ namedArg a+               _ -> typeError $ GenericError $ show c ++ " must be applied to exactly one argument."+       -- The name of the fresh function.       i <- fresh :: TCM Int       let name = filter (/= '_') (show $ A.nameConcrete $ A.qnameName c) ++ "-" ++ show i@@ -1219,12 +1250,26 @@               liftM2 qualify (killRange <$> currentModule)                              (freshName_ name) +      kit <- coinductionKit'+      let flat = nameOfFlat kit+          inf  = nameOfInf  kit+       -- The application of the fresh function to the relevant       -- arguments.       e' <- Def c' . map Apply <$> getContextArgs        -- Add the type signature of the fresh function to the       -- signature.+      -- To make sure we can type check the generated function we have to make+      -- sure that its type is \inf. The reason for this is that we don't yet+      -- postpone checking of patterns when we don't know their types (Issue480).+      forcedType <- do+        lvl <- levelType+        l   <- newValueMeta RunMetaOccursCheck lvl+        lv  <- levelView l+        a   <- newValueMeta RunMetaOccursCheck (sort $ Type lv)+        return $ El (Type lv) $ Def inf [Apply $ setHiding Hidden $ defaultArg l, Apply $ defaultArg a]+       i   <- currentOrFreshMutualBlock       tel <- getContextTelescope       -- If we are in irrelevant position, add definition irrelevantly.@@ -1233,18 +1278,21 @@       addConstant c' =<< do         let ai = setRelevance rel defaultArgInfo         useTerPragma $-          Defn ai c' t [] [] (defaultDisplayForm c') i noCompiledRep [] Nothing $+          Defn ai c' forcedType [] [] (defaultDisplayForm c') i noCompiledRep Nothing $           emptyFunction        -- Define and type check the fresh function.       ctx <- getContext >>= mapM (\d -> flip Dom (unDom d) <$> reify (domInfo d))-      args' <- mapM (\a -> flip Arg (unArg a) <$> reify (argInfo a)) args       let info   = A.mkDefInfo (A.nameConcrete $ A.qnameName c') defaultFixity'                                PublicAccess ConcreteDef noRange           pats   = map (\ (Dom info (n, _)) -> Arg info $ Named Nothing $ A.VarP n) $                        reverse ctx-          clause = A.Clause (A.LHS (A.LHSRange noRange) (A.LHSHead c' pats) [])-                            (A.RHS $ unAppView (A.Application (A.Con (AmbQ [c])) args'))+          core   = A.LHSProj { A.lhsDestructor = flat+                             , A.lhsPatsLeft   = []+                             , A.lhsFocus      = defaultNamedArg $ A.LHSHead c' pats+                             , A.lhsPatsRight  = [] }+          clause = A.Clause (A.LHS (A.LHSRange noRange) core [])+                            (A.RHS arg)                             []        reportSDoc "tc.term.expr.coind" 15 $ vcat $@@ -1258,14 +1306,14 @@           , nest 2 $ prettyA clause <> text "."           ] -      inTopContext $ checkFunDef Delayed info c' [clause]+      inTopContext $ checkFunDef NotDelayed info c' [clause]        reportSDoc "tc.term.expr.coind" 15 $ do         def <- theDef <$> getConstInfo c'         text "The definition is" <+> text (show $ funDelayed def) <>           text "." -      return e'+      blockTerm t $ e' <$ workOnTypes (leqType forcedType t)     A.Con _  -> __IMPOSSIBLE__     _ -> defaultResult   where@@ -1275,21 +1323,12 @@     checkArguments' expandLast ExpandInstanceArguments (getRange hd) args t0 t $ \vs t1 -> do       coerce (f vs) t1 t --- Stupid ErrorT!-instance Error (a, b, c) where-  strMsg _ = __IMPOSSIBLE__-  noMsg = __IMPOSSIBLE__--traceCallE :: Error e => (Maybe r -> Call) -> ExceptT e TCM r -> ExceptT e TCM r+traceCallE :: Error e => Call -> ExceptT e TCM r -> ExceptT e TCM r traceCallE call m = do-  z <- lift $ traceCall call' $ runExceptT m+  z <- lift $ traceCall call $ runExceptT m   case z of     Right e  -> return e     Left err -> throwError err-  where-    call' Nothing          = call Nothing-    call' (Just (Left _))  = call Nothing-    call' (Just (Right x)) = call (Just x)  -- | Check a list of arguments: @checkArgs args t0 t1@ checks that --   @t0 = Delta -> t0'@ and @args : Delta@. Inserts hidden arguments to@@ -1341,7 +1380,7 @@       let (mxs, us) = unzip $ map (\ (Arg ai (Named mx u)) -> (mx, Arg ai u)) nargs           xs        = catMaybes mxs       -- We are done inserting implicit args.  Now, try to check @arg@.-      ifBlockedType t (\ m t -> throwError ([], args0, t)) $ \ t0' -> do+      ifBlockedType t (\ m t -> throwError (us, args0, t)) $ \ t0' -> do          -- What can go wrong? @@ -1405,10 +1444,13 @@ --   variable.  Except for neutrals, for them a polymorphic type is inferred. inferExpr :: A.Expr -> TCM (Term, Type) -- inferExpr e = inferOrCheck e Nothing-inferExpr e = case e of+inferExpr = inferExpr' DontExpandLast++inferExpr' :: ExpandHidden -> A.Expr -> TCM (Term, Type)+inferExpr' exh e = case e of   _ | Application hd args <- appView e, defOrVar hd -> traceCall (InferExpr e) $ do     (f, t0) <- inferHead hd-    res <- runExceptT $ checkArguments DontExpandLast ExpandInstanceArguments (getRange hd) (map convColor args) t0 (sort Prop)+    res <- runExceptT $ checkArguments exh ExpandInstanceArguments (getRange hd) (map convColor args) t0 (sort Prop)     case res of       Right (vs, t1) -> return (f vs, t1)       Left t1 -> fallback -- blocked on type t1@@ -1475,25 +1517,25 @@   reportSDoc "tc.with.infer" 20 $ text "inferExprforWith " <+> prettyTCM e   reportSLn  "tc.with.infer" 80 $ "inferExprforWith " ++ show e   traceCall (InferExpr e) $ do-  -- With wants type and term fully instantiated!-  (v, t) <- instantiateFull =<< inferExpr e-  v0 <- reduce v-  -- Andreas 2014-11-06, issue 1342.-  -- Check that we do not `with` on a module parameter!-  case ignoreSharing v0 of-    Var i [] -> whenM (isModuleFreeVar i) $ typeError $ WithOnFreeVariable e-    _        -> return ()-  -- Possibly insert hidden arguments.-  TelV tel t0 <- telViewUpTo' (-1) ((NotHidden /=) . getHiding) t-  case ignoreSharing $ unEl t0 of-    Def d vs -> do-      res <- isDataOrRecordType d-      case res of-        Nothing -> return (v, t)-        Just{}  -> do-          (args, t1) <- implicitArgs (-1) (NotHidden /=) t-          return (v `apply` args, t1)-    _ -> return (v, t)+    -- With wants type and term fully instantiated!+    (v, t) <- instantiateFull =<< inferExpr e+    v0 <- reduce v+    -- Andreas 2014-11-06, issue 1342.+    -- Check that we do not `with` on a module parameter!+    case ignoreSharing v0 of+      Var i [] -> whenM (isModuleFreeVar i) $ typeError $ WithOnFreeVariable e+      _        -> return ()+    -- Possibly insert hidden arguments.+    TelV tel t0 <- telViewUpTo' (-1) ((NotHidden /=) . getHiding) t+    case ignoreSharing $ unEl t0 of+      Def d vs -> do+        res <- isDataOrRecordType d+        case res of+          Nothing -> return (v, t)+          Just{}  -> do+            (args, t1) <- implicitArgs (-1) (NotHidden /=) t+            return (v `apply` args, t1)+      _ -> return (v, t)  --------------------------------------------------------------------------- -- * Let bindings@@ -1513,7 +1555,7 @@ checkLetBinding b@(A.LetPatBind i p e) ret =   traceCallCPS_ (CheckLetBinding b) ret $ \ret -> do     p <- expandPatternSynonyms p-    (v, t) <- inferExpr e+    (v, t) <- inferExpr' ExpandLast e     let -- construct a type  t -> dummy  for use in checkLeftHandSide         t0 = El (getSort t) $ Pi (Dom defaultArgInfo t) (NoAbs underscore typeDontCare)         p0 = Arg defaultArgInfo (Named Nothing p)
src/full/Agda/TypeChecking/Serialise.hs view
@@ -1,7 +1,7 @@-{-# LANGUAGE CPP #-}+{-# LANGUAGE CPP                       #-} {-# LANGUAGE ExistentialQuantification #-}-{-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE FlexibleInstances         #-}+{-# LANGUAGE ScopedTypeVariables       #-}  #if __GLASGOW_HASKELL__ >= 710 {-# LANGUAGE FlexibleContexts #-}@@ -37,9 +37,11 @@ import qualified Control.Exception as E import Control.Monad import Control.Monad.Reader-import Control.Monad.State.Strict+import Control.Monad.State.Strict (StateT, runStateT, gets, modify)+ import Data.Array.IArray import Data.Word+import Data.ByteString.Lazy (ByteString) import qualified Data.ByteString.Lazy as L import Data.Hashable import qualified Data.HashTable.IO as H@@ -55,18 +57,21 @@ import qualified Data.List as List import Data.Function import Data.Typeable ( cast, Typeable, typeOf, TypeRep )+ import qualified Codec.Compression.GZip as G  import qualified Agda.Compiler.Epic.Interface as Epic -import Agda.Syntax.Common+import Agda.Syntax.Common as Common import Agda.Syntax.Concrete.Name as C+import qualified Agda.Syntax.Concrete as C import qualified Agda.Syntax.Abstract as A import Agda.Syntax.Info import Agda.Syntax.Internal as I import Agda.Syntax.Scope.Base-import Agda.Syntax.Position (Position, Range, noRange)-import qualified Agda.Syntax.Position as P+import Agda.Syntax.Position as P+-- import Agda.Syntax.Position (Position, Range, noRange)+-- import qualified Agda.Syntax.Position as P import Agda.Syntax.Fixity import Agda.Syntax.Notation import Agda.Syntax.Literal@@ -79,6 +84,7 @@  import Agda.TypeChecking.Monad import Agda.TypeChecking.CompiledClause+import Agda.TypeChecking.Positivity.Occurrence -- import Agda.TypeChecking.Pretty  import Agda.Utils.BiMap (BiMap)@@ -97,25 +103,12 @@ #include "undefined.h" import Agda.Utils.Impossible --- | Compatibility with @bytestring < 0.10@ which does not implement---   @instance NFData@, to support @ghc <= 7.4@.------   Note that we only @deepSeq@ for the purpose of correct benchmarking.---   Thus, a simply non-forcing @return@ would be a possible implementation.--returnForcedByteString :: Monad m => L.ByteString -> m L.ByteString-#if MIN_VERSION_bytestring(0,10,0)-returnForcedByteString bs = return $!! bs-#else-returnForcedByteString bs = return $! bs-#endif- -- Note that the Binary instance for Int writes 64 bits, but throws -- away the 32 high bits when reading (at the time of writing, on -- 32-bit machines). Word64 does not have these problems.  currentInterfaceVersion :: Word64-currentInterfaceVersion = 20150511 * 10 + 0+currentInterfaceVersion = 20150829 * 10 + 0  -- | Constructor tag (maybe omitted) and argument indices. @@ -150,47 +143,65 @@ lensReuse :: Lens' Int32 FreshAndReuse lensReuse f r = f (farReuse r) <&> \ i -> r { farReuse = i } +-- | Two 'A.QName's are equal if their @QNameId@ is equal.+type QNameId = [NameId]++-- | Computing a qualified names composed ID.+qnameId :: A.QName -> QNameId+qnameId (A.QName (A.MName ns) n) = map A.nameId $ n:ns+ -- | State of the the encoder. data Dict = Dict-  { nodeD        :: !(HashTable Node    Int32)-  , stringD      :: !(HashTable String  Int32)-  , integerD     :: !(HashTable Integer Int32)-  , doubleD      :: !(HashTable Double  Int32)-  , termD        :: !(HashTable (Ptr Term) Int32)+  -- Dictionaries which are serialized:+  { nodeD        :: !(HashTable Node    Int32)    -- ^ Written to interface file.+  , stringD      :: !(HashTable String  Int32)    -- ^ Written to interface file.+  , integerD     :: !(HashTable Integer Int32)    -- ^ Written to interface file.+  , doubleD      :: !(HashTable Double  Int32)    -- ^ Written to interface file.+  -- Dicitionaries which are not serialized, but provide+  -- short cuts to speed up serialization:+  , termD        :: !(HashTable (Ptr Term) Int32) -- ^ Not written to interface file.+  -- Andreas, Makoto, AIM XXI+  -- Memoizing A.Name does not buy us much if we already memoize A.QName.+  , nameD        :: !(HashTable NameId  Int32)    -- ^ Not written to interface file.+  , qnameD       :: !(HashTable QNameId Int32)    -- ^ Not written to interface file.+  -- Fresh UIDs and reuse statistics:   , nodeC        :: !(IORef FreshAndReuse)  -- counters for fresh indexes   , stringC      :: !(IORef FreshAndReuse)   , integerC     :: !(IORef FreshAndReuse)   , doubleC      :: !(IORef FreshAndReuse)   , termC        :: !(IORef FreshAndReuse)-  , stats        :: !(HashTable String Int32)+  , nameC        :: !(IORef FreshAndReuse)+  , qnameC       :: !(IORef FreshAndReuse)+  , stats        :: !(HashTable String Int)   , collectStats :: Bool     -- ^ If @True@ collect in @stats@ the quantities of     --   calls to @icode@ for each @Typeable a@.-  , fileMod      :: !SourceToModule+  , absPathD     :: !(HashTable AbsolutePath Int32) -- ^ Not written to interface file.   }  -- | Creates an empty dictionary. emptyDict   :: Bool      -- ^ Collect statistics for @icode@ calls?-  -> SourceToModule-     -- ^ Maps file names to the corresponding module names.-     --   Must contain a mapping for every file name that is later encountered.   -> IO Dict-emptyDict collectStats fileMod = Dict+emptyDict collectStats = Dict   <$> H.new   <*> H.new   <*> H.new   <*> H.new   <*> H.new+  <*> H.new+  <*> H.new   <*> newIORef farEmpty   <*> newIORef farEmpty   <*> newIORef farEmpty   <*> newIORef farEmpty   <*> newIORef farEmpty+  <*> newIORef farEmpty+  <*> newIORef farEmpty   <*> H.new   <*> pure collectStats-  <*> pure fileMod+  <*> H.new  -- | Universal type, wraps everything. data U    = forall a . Typeable a => U !a@@ -200,14 +211,15 @@  -- | State of the decoder. data St = St-  { nodeE     :: !(Array Int32 Node)-  , stringE   :: !(Array Int32 String)-  , integerE  :: !(Array Int32 Integer)-  , doubleE   :: !(Array Int32 Double)+  { nodeE     :: !(Array Int32 Node)     -- ^ Obtained from interface file.+  , stringE   :: !(Array Int32 String)   -- ^ Obtained from interface file.+  , integerE  :: !(Array Int32 Integer)  -- ^ Obtained from interface file.+  , doubleE   :: !(Array Int32 Double)   -- ^ Obtained from interface file.   , nodeMemo  :: !Memo+    -- ^ Created and modified by decoder.+    --   Used to introduce sharing while deserializing objects.   , modFile   :: !ModuleToSource-    -- ^ Maps module names to file names. This is the only component-    -- of the state which is updated by the decoder.+    -- ^ Maps module names to file names. Constructed by the decoder.   , includes  :: [AbsolutePath]     -- ^ The include directories.   }@@ -254,9 +266,16 @@ encode a = do     collectStats <- hasVerbosity "profile.serialize" 20     fileMod <- sourceToModule-    newD@(Dict nD sD iD dD _ nC sC iC dC tC stats _ _) <- liftIO $-      emptyDict collectStats fileMod-    root <- liftIO $ runReaderT (icode a) newD+    newD@(Dict nD sD iD dD _tD+      _nameD+      _qnameD+      nC sC iC dC tC+      nameC+      qnameC+      stats _ _) <- liftIO $ emptyDict collectStats+    root <- liftIO $ (`runReaderT` newD) $ do+       icodeFileMod fileMod+       icode a     nL <- benchSort $ l nD     sL <- benchSort $ l sD     iL <- benchSort $ l iD@@ -269,19 +288,22 @@       statistics "String"   sC       statistics "Double"   dC       statistics "Node"     nC+      statistics "Shared Term" tC+      statistics "A.QName"  qnameC+      statistics "A.Name"  nameC     when collectStats $ do       stats <- Map.fromList . map (second toInteger) <$> do         liftIO $ H.toList stats       modifyStatistics $ Map.union stats     -- Encode hashmaps and root, and compress.     bits1 <- Bench.billTo [ Bench.Serialization, Bench.BinaryEncode ] $-      returnForcedByteString $ B.encode (root, nL, sL, iL, dL)+      return $!! B.encode (root, nL, sL, iL, dL)     let compressParams = G.defaultCompressParams           { G.compressLevel    = G.bestSpeed           , G.compressStrategy = G.huffmanOnlyStrategy           }     cbits <- Bench.billTo [ Bench.Serialization, Bench.Compress ] $-      returnForcedByteString $ G.compressWith compressParams bits1+      return $!! G.compressWith compressParams bits1     let x = B.encode currentInterfaceVersion `L.append` cbits     return x   where@@ -407,6 +429,20 @@ decodeFile :: FilePath -> TCM (Maybe Interface) decodeFile f = decodeInterface =<< liftIO (L.readFile f) +-- | Store a 'SourceToModule' (map from 'AbsolutePath' to 'TopLevelModuleName')+--   as map from 'AbsolutePath' to 'Int32', in order to directly get the identifiers+--   from absolute pathes rather than going through top level module names.+icodeFileMod+  :: SourceToModule+     -- ^ Maps file names to the corresponding module names.+     --   Must contain a mapping for every file name that is later encountered.+  -> S ()+icodeFileMod fileMod = do+  hmap <- asks absPathD+  forM_ (Map.toList fileMod) $ \ (absolutePath, topLevelModuleName) -> do+    i <- icod_ topLevelModuleName+    liftIO $ H.insert hmap absolutePath i+ #if __GLASGOW_HASKELL__ >= 710 instance {-# OVERLAPPING #-} EmbPrj String where #else@@ -475,10 +511,8 @@  instance EmbPrj AbsolutePath where   icod_ file = do-    mm <- Map.lookup file <$> asks fileMod-    case mm of-      Just m  -> icode m-      Nothing -> __IMPOSSIBLE__+    d <-  asks absPathD+    liftIO $ fromMaybe __IMPOSSIBLE__ <$> H.lookup d file   value m = do     m :: TopLevelModuleName             <- value m@@ -654,7 +688,7 @@                            valu _      = malformed  instance EmbPrj A.QName where-  icod_ (A.QName a b) = icode2' a b+  icod_ n@(A.QName a b) = icodeMemo qnameD qnameC (qnameId n) $ icode2' a b   value = vcase valu where valu [a, b] = valu2 A.QName a b                            valu _      = malformed @@ -667,7 +701,7 @@   value n = A.MName `fmap` value n  instance EmbPrj A.Name where-  icod_ (A.Name a b c d) = icode4' a b c d+  icod_ (A.Name a b c d) = icodeMemo nameD nameC a $ icode4' a b c d   value = vcase valu where valu [a, b, c, d] = valu4 A.Name a b c d                            valu _            = malformed @@ -706,10 +740,13 @@   icod_ (A.Set  _ a)            = icode1 13 a   icod_ (A.Prop _)              = icode0 14   icod_ (A.Let  _ _ _)          = __IMPOSSIBLE__-  icod_ (A.ETel a)              = icode1 16 a+  icod_ (A.ETel{})              = __IMPOSSIBLE__   icod_ (A.Rec  _ a)            = icode1 17 a   icod_ (A.RecUpdate _ a b)     = icode2 18 a b-  icod_ (A.ScopedExpr a b)      = icode2 19 a b+  -- Andreas, 2015-07-15, drop scopes embedded in expressions.+  -- As expressions are not @unScope@d before serialization,+  -- this case is not __IMPOSSIBLE__.+  icod_ (A.ScopedExpr a b)      = icod_ b -- WAS: icode2 19 a b   icod_ (A.QuoteGoal _ a b)     = icode2 20 a b   icod_ (A.QuoteContext _ a b)  = icode2 21 a b   icod_ (A.Quote _)             = icode0 22@@ -735,10 +772,9 @@       valu [12, a, b] = valu2 (A.Fun i) a b       valu [13, a]    = valu1 (A.Set i) a       valu [14]       = valu0 (A.Prop i)-      valu [16, a]    = valu1 A.ETel a       valu [17, a]    = valu1 (A.Rec i) a       valu [18, a, b] = valu2 (A.RecUpdate i) a b-      valu [19, a, b] = valu2 A.ScopedExpr a b+      -- valu [19, a, b] = valu2 A.ScopedExpr a b       valu [20, a, b] = valu2 (A.QuoteGoal i) a b       valu [21, a, b] = valu2 (A.QuoteContext i) a b       valu [22]       = valu0 (A.Quote i)@@ -751,29 +787,31 @@        i = ExprRange noRange +instance EmbPrj ConPatInfo where+  icod_ (ConPatInfo a _) = icod_ a+  value a = flip ConPatInfo patNoRange <$> value a+ instance EmbPrj A.Pattern where   icod_ (A.VarP a)            = icode1 0 a-  icod_ (A.ConP _ a b)        = icode2 1 a b+  icod_ (A.ConP a b c)        = icode3 1 a b c   icod_ (A.DefP _ a b)        = icode2 2 a b   icod_ (A.WildP _)           = icode0 3   icod_ (A.AsP _ a b)         = icode2 4 a b   icod_ (A.DotP _ a)          = icode1 5 a   icod_ (A.AbsurdP _)         = icode0 6   icod_ (A.LitP a)            = icode1 7 a-  icod_ (A.ImplicitP _)       = icode0 8   icod_ (A.PatternSynP _ a b) = icode2 9 a b    value = vcase valu     where      valu [0, a]    = valu1 A.VarP a-     valu [1, a, b] = valu2 (A.ConP (ConPatInfo False i)) a b+     valu [1, a, b, c] = valu3 A.ConP a b c      valu [2, a, b] = valu2 (A.DefP i) a b      valu [3]       = valu0 (A.WildP i)      valu [4, a, b] = valu2 (A.AsP i) a b      valu [5, a]    = valu1 (A.DotP i) a      valu [6]       = valu0 (A.AbsurdP i)      valu [7, a]    = valu1 (A.LitP) a-     valu [8]       = valu0 (A.ImplicitP i)      valu [9, a, b] = valu2 (A.PatternSynP i) a b      valu _         = malformed @@ -815,7 +853,7 @@                            valu [1, a, b]    = valu2 A.TLet a b                            valu _            = malformed -instance EmbPrj c => EmbPrj (Agda.Syntax.Common.ArgInfo c) where+instance EmbPrj c => EmbPrj (Common.ArgInfo c) where   icod_ (ArgInfo h r cs) = icode3' h r cs    value = vcase valu where valu [h, r, cs] = valu3 ArgInfo h r cs@@ -827,9 +865,9 @@                            valu _      = malformed  instance EmbPrj Signature where-  icod_ (Sig a b) = icode2' a b-  value = vcase valu where valu [a, b] = valu2 Sig a b-                           valu _      = malformed+  icod_ (Sig a b c) = icode3' a b c+  value = vcase valu where valu [a, b, c] = valu3 Sig a b c+                           valu _ = malformed  instance (Eq k, Hashable k, EmbPrj k, EmbPrj v) => EmbPrj (HashMap k v) where   icod_ m = icode (HMap.toList m)@@ -869,53 +907,68 @@   value = vcase valu where valu [a, b] = valu2 WithHiding a b                            valu _      = malformed -instance (EmbPrj a, EmbPrj c) => EmbPrj (Agda.Syntax.Common.Arg c a) where+instance (EmbPrj a, EmbPrj c) => EmbPrj (Common.Arg c a) where   icod_ (Arg i e) = icode2' i e   value = vcase valu where valu [i, e] = valu2 Arg i e                            valu _      = malformed -instance (EmbPrj a, EmbPrj c) => EmbPrj (Agda.Syntax.Common.Dom c a) where+instance (EmbPrj a, EmbPrj c) => EmbPrj (Common.Dom c a) where   icod_ (Dom i e) = icode2' i e   value = vcase valu where valu [i, e] = valu2 Dom i e                            valu _      = malformed -instance EmbPrj Agda.Syntax.Common.Induction where+instance EmbPrj Common.Induction where   icod_ Inductive   = icode0'   icod_ CoInductive = icode0 1   value = vcase valu where valu []  = valu0 Inductive                            valu [1] = valu0 CoInductive                            valu _   = malformed -instance EmbPrj Agda.Syntax.Common.Hiding where-  icod_ Hidden    = icode0 0-  icod_ NotHidden = icode0'-  icod_ Instance  = icode0 2-  value = vcase valu where valu [0] = valu0 Hidden-                           valu []  = valu0 NotHidden-                           valu [2] = valu0 Instance-                           valu _   = malformed+instance EmbPrj Common.Hiding where+  icod_ Hidden    = return 0+  icod_ NotHidden = return 1+  icod_ Instance  = return 2+  value 0 = return Hidden+  value 1 = return NotHidden+  value 2 = return Instance+  value _ = malformed -instance EmbPrj Agda.Syntax.Common.Relevance where-  icod_ Relevant   = icode0'-  icod_ Irrelevant = icode0 1-  icod_ (Forced Small) = icode0 2-  icod_ (Forced Big)   = icode0 5-  icod_ NonStrict  = icode0 3-  icod_ UnusedArg  = icode0 4-  value = vcase valu where valu []  = valu0 Relevant-                           valu [1] = valu0 Irrelevant-                           valu [2] = valu0 (Forced Small)-                           valu [5] = valu0 (Forced Big)-                           valu [3] = valu0 NonStrict-                           valu [4] = valu0 UnusedArg-                           valu _   = malformed+instance EmbPrj Common.Relevance where+  icod_ Relevant       = return 0+  icod_ Irrelevant     = return 1+  icod_ (Forced Small) = return 2+  icod_ (Forced Big)   = return 3+  icod_ NonStrict      = return 4+  icod_ UnusedArg      = return 5+  value 0 = return Relevant+  value 1 = return Irrelevant+  value 2 = return (Forced Small)+  value 3 = return (Forced Big)+  value 4 = return NonStrict+  value 5 = return UnusedArg+  value _ = malformed +-- instance EmbPrj Common.Relevance where+--   icod_ Relevant   = icode0'+--   icod_ Irrelevant = icode0 1+--   icod_ (Forced Small) = icode0 2+--   icod_ (Forced Big)   = icode0 5+--   icod_ NonStrict  = icode0 3+--   icod_ UnusedArg  = icode0 4+--   value = vcase valu where valu []  = valu0 Relevant+--                            valu [1] = valu0 Irrelevant+--                            valu [2] = valu0 (Forced Small)+--                            valu [5] = valu0 (Forced Big)+--                            valu [3] = valu0 NonStrict+--                            valu [4] = valu0 UnusedArg+--                            valu _   = malformed+ instance EmbPrj I.ConHead where   icod_ (ConHead a b c) = icode3' a b c   value = vcase valu where valu [a, b, c] = valu3 ConHead a b c                            valu _         = malformed -instance EmbPrj I.Type where+instance (EmbPrj a) => EmbPrj (I.Type' a) where   icod_ (El a b) = icode2' a b   value = vcase valu where valu [a, b] = valu2 El a b                            valu _      = malformed@@ -928,6 +981,7 @@                            valu _         = malformed  instance EmbPrj I.Term where+  icod_ (Var     a []) = icode1' a   icod_ (Var      a b) = icode2 0 a b   icod_ (Lam      a b) = icode2 1 a b   icod_ (Lit      a  ) = icode1 2 a@@ -939,23 +993,12 @@   icod_ ExtLam{}       = __IMPOSSIBLE__   icod_ (DontCare a  ) = icode1 8 a   icod_ (Level    a  ) = icode1 9 a-  icod_ (Shared p)     = do-    h  <- asks termD-    mi <- liftIO $ H.lookup h p-    st <- asks termC-    case mi of-      Just i  -> liftIO $ do-        modifyIORef' st $ over lensReuse (+ 1)-        return i-      Nothing -> do-        liftIO $ modifyIORef' st $ over lensFresh (+1)-        n <- icode (derefPtr p)-        liftIO $ H.insert h p n-        return n+  icod_ (Shared p)     = icodeMemo termD termC p $ icode (derefPtr p)    value r = vcase valu' r     where       valu' xs = shared <$> valu xs+      valu [a]       = valu1 var   a       valu [0, a, b] = valu2 Var   a b       valu [1, a, b] = valu2 Lam   a b       valu [2, a]    = valu1 Lit   a@@ -1048,19 +1091,25 @@   value n = MutId `fmap` value n  instance EmbPrj Definition where-  icod_ (Defn rel a b c d e f g h i j) = icode11' rel a (P.killRange b) c d e f g h i j-  value = vcase valu where valu [rel, a, b, c, d, e, f, g, h, i, j] = valu11 Defn rel a b c d e f g h i j-                           valu _                             = malformed+  icod_ (Defn rel a b c d e f g h i) = icode10' rel a (P.killRange b) c d e f g h i+  value = vcase valu where valu [rel, a, b, c, d, e, f, g, h, i] = valu10 Defn rel a b c d e f g h i+                           valu _ = malformed  instance EmbPrj NLPat where   icod_ (PVar a)   = icode1 0 a   icod_ (PWild)    = icode0 1   icod_ (PDef a b) = icode2 2 a b-  icod_ (PTerm a)  = icode1 3 a+  icod_ (PLam a b) = icode2 3 a b+  icod_ (PPi a b)  = icode2 4 a b+  icod_ (PBoundVar a b) = icode2 5 a b+  icod_ (PTerm a)  = icode1 6 a   value = vcase valu where valu [0, a]    = valu1 PVar a                            valu [1]       = valu0 PWild                            valu [2, a, b] = valu2 PDef a b-                           valu [3, a]    = valu1 PTerm a+                           valu [3, a, b] = valu2 PLam a b+                           valu [4, a, b] = valu2 PPi a b+                           valu [5, a, b] = valu2 PBoundVar a b+                           valu [6, a]    = valu1 PTerm a                            valu _         = malformed  instance EmbPrj RewriteRule where@@ -1137,35 +1186,63 @@   value n = JS.MemberId `fmap` value n  instance EmbPrj Polarity where-  icod_ Covariant     = icode0'-  icod_ Contravariant = icode0 1-  icod_ Invariant     = icode0 2-  icod_ Nonvariant    = icode0 3+  icod_ Covariant     = return 0+  icod_ Contravariant = return 1+  icod_ Invariant     = return 2+  icod_ Nonvariant    = return 3 -  value = vcase valu where-    valu []  = valu0 Covariant-    valu [1] = valu0 Contravariant-    valu [2] = valu0 Invariant-    valu [3] = valu0 Nonvariant-    valu _   = malformed+  value 0 = return Covariant+  value 1 = return Contravariant+  value 2 = return Invariant+  value 3 = return Nonvariant+  value _  = malformed +-- instance EmbPrj Polarity where+--   icod_ Covariant     = icode0'+--   icod_ Contravariant = icode0 1+--   icod_ Invariant     = icode0 2+--   icod_ Nonvariant    = icode0 3++--   value = vcase valu where+--     valu []  = valu0 Covariant+--     valu [1] = valu0 Contravariant+--     valu [2] = valu0 Invariant+--     valu [3] = valu0 Nonvariant+--     valu _   = malformed+ instance EmbPrj Occurrence where-  icod_ StrictPos = icode0'-  icod_ Mixed     = icode0 1-  icod_ Unused    = icode0 2-  icod_ GuardPos  = icode0 3-  icod_ JustPos   = icode0 4-  icod_ JustNeg   = icode0 5+  icod_ StrictPos = return 0+  icod_ Mixed     = return 1+  icod_ Unused    = return 2+  icod_ GuardPos  = return 3+  icod_ JustPos   = return 4+  icod_ JustNeg   = return 5 -  value = vcase valu where-    valu []  = valu0 StrictPos-    valu [1] = valu0 Mixed-    valu [2] = valu0 Unused-    valu [3] = valu0 GuardPos-    valu [4] = valu0 JustPos-    valu [5] = valu0 JustNeg-    valu _   = malformed+  value 0 = return StrictPos+  value 1 = return Mixed+  value 2 = return Unused+  value 3 = return GuardPos+  value 4 = return JustPos+  value 5 = return JustNeg+  value _ = malformed +-- instance EmbPrj Occurrence where+--   icod_ StrictPos = icode0'+--   icod_ Mixed     = icode0 1+--   icod_ Unused    = icode0 2+--   icod_ GuardPos  = icode0 3+--   icod_ JustPos   = icode0 4+--   icod_ JustNeg   = icode0 5++--   value = vcase valu where+--     valu []  = valu0 StrictPos+--     valu [1] = valu0 Mixed+--     valu [2] = valu0 Unused+--     valu [3] = valu0 GuardPos+--     valu [4] = valu0 JustPos+--     valu [5] = valu0 JustNeg+--     valu _   = malformed+ instance EmbPrj CompiledRepresentation where   icod_ (CompiledRep a b c d) = icode4' a b c d   value = vcase valu where valu [a, b, c, d] = valu4 CompiledRep a b c d@@ -1195,11 +1272,11 @@     valu _      = malformed  instance EmbPrj a => EmbPrj (Case a) where-  icod_ (Branches a b c) = icode3' a b c+  icod_ (Branches a b c d) = icode4' a b c d    value = vcase valu where-    valu [a, b, c] = valu3 Branches a b c-    valu _         = malformed+    valu [a, b, c, d] = valu4 Branches a b c d+    valu _            = malformed  instance EmbPrj CompiledClauses where   icod_ Fail       = icode0'@@ -1228,7 +1305,7 @@                            valu [2, a] = valu1 ConsHead a                            valu _      = malformed -instance EmbPrj Agda.Syntax.Common.IsAbstract where+instance EmbPrj Common.IsAbstract where   icod_ AbstractDef = icode0 0   icod_ ConcreteDef = icode0'   value = vcase valu where valu [0] = valu0 AbstractDef@@ -1261,6 +1338,15 @@   value = vcase valu where valu [a, b] = valu2 ConPatternInfo a b                            valu _      = malformed +instance EmbPrj ConPOrigin where+  icod_ ConPImplicit = return 0+  icod_ ConPCon      = return 1+  icod_ ConPRec      = return 2+  value 0 = return ConPImplicit+  value 1 = return ConPCon+  value 2 = return ConPRec+  value _ = malformed+ instance EmbPrj I.Pattern where   icod_ (VarP a    ) = icode1' a   icod_ (ConP a b c) = icode3' a b c@@ -1375,6 +1461,7 @@     valu [8]    = valu0 WithArgCtx     valu [9]    = valu0 DotPatternCtx     valu _      = malformed+ instance EmbPrj ScopeInfo where   icod_ (ScopeInfo a b c d) = icode4' a b c d   value = vcase valu where valu [a, b, c, d] = valu4 ScopeInfo a b c d@@ -1535,6 +1622,28 @@  -- icodeN :: [Int32] -> S Int32 -- icodeN = icodeX nodeD nodeC++-- | @icode@ only if thing has not seen before.+icodeMemo+  :: (Eq a, Ord a, Hashable a)+  => (Dict -> HashTable a Int32)    -- ^ Memo structure for thing of key @a@.+  -> (Dict -> IORef FreshAndReuse)  -- ^ Statistics.+  -> a        -- ^ Key to the thing.+  -> S Int32  -- ^ Fallback computation to encode the thing.+  -> S Int32  -- ^ Encoded thing.+icodeMemo getDict getCounter a icodeP = do+    h  <- asks getDict+    mi <- liftIO $ H.lookup h a+    st <- asks getCounter+    case mi of+      Just i  -> liftIO $ do+        modifyIORef' st $ over lensReuse (+ 1)+        return i+      Nothing -> do+        liftIO $ modifyIORef' st $ over lensFresh (+1)+        i <- icodeP+        liftIO $ H.insert h a i+        return i  {-# INLINE vcase #-} -- | @vcase value ix@ decodes thing represented by @ix :: Int32@
src/full/Agda/TypeChecking/SizedTypes.hs view
@@ -1,13 +1,17 @@-{-# LANGUAGE CPP #-}-{-# LANGUAGE PatternGuards #-}+{-# LANGUAGE CPP                      #-}+{-# LANGUAGE NondecreasingIndentation #-}+{-# LANGUAGE PatternGuards            #-}  module Agda.TypeChecking.SizedTypes where  import Prelude hiding (null) +import Control.Monad.Writer+ import Data.Function import Data.List hiding (null) import qualified Data.Map as Map+import Data.Monoid  import Agda.Interaction.Options @@ -25,7 +29,7 @@ import {-# SOURCE #-} Agda.TypeChecking.Constraints  import Agda.Utils.Except ( MonadError(catchError, throwError) )-import Agda.Utils.List+import Agda.Utils.List as List import Agda.Utils.Maybe import Agda.Utils.Monad import Agda.Utils.Null@@ -40,6 +44,122 @@ ------------------------------------------------------------------------ -- * SIZELT stuff ------------------------------------------------------------------------++-- | Check whether a type is either not a SIZELT or a SIZELT that is non-empty.+checkSizeLtSat :: Type -> TCM ()+checkSizeLtSat t = do+  reportSDoc "tc.size" 10 $ sep+    [ text "checking that " <+> prettyTCM t <+> text " is not an empty type of sizes"+    , text "in context " <+> do inTopContext . prettyTCM =<< getContextTelescope+    ]+  let postpone t = addConstraint $ CheckSizeLtSat t+  ifBlockedType t (const postpone) $ \ t -> do+    caseMaybeM (isSizeType t) (return ()) $ \ b -> do+      case b of+        BoundedNo -> return ()+        BoundedLt b -> do+          ifBlocked b (\ _ _ -> postpone t) $ \ b -> do+            catchConstraint (CheckSizeLtSat t) $ do+              unlessM (checkSizeNeverZero b) $ do+                typeError . GenericDocError =<< do+                  text "Possibly empty type of sizes " <+> prettyTCM t++-- | Precondition: Term is reduced and not blocked.+--   Throws a 'patternViolation' if undecided+checkSizeNeverZero :: Term -> TCM Bool+checkSizeNeverZero u = do+  v <- sizeView u+  case v of+    SizeInf     -> return True  -- OK, infty is never 0.+    SizeSuc{}   -> return True  -- OK, a + 1 is never 0.+    OtherSize u ->+      case ignoreSharing u of+        Var i [] -> checkSizeVarNeverZero i+        -- neutral sizes cannot be guaranteed > 0+        _ -> return False++-- -- | A size variable is never zero if it is the strict upper bound of+-- --   some other size variable in context.+-- --   Eg. @i : Size, j : Size< i@ |- i is never zero.+-- --   Throws a 'patternViolation' if undecided.+-- checkSizeVarNeverZero :: Int -> TCM Bool+-- checkSizeVarNeverZero i = do+--   -- Looking for a variable j : Size< i, we can restrict to the last i+--   -- entries, as this variable necessarily has been defined later than i.+--   doms <- take i <$> getContext+--   -- We raise each type to make sense in the current context.+--   let ts = zipWith raise [1..] $ map (snd . unDom) doms+--   reportSDoc "tc.size" 15 $ sep+--     [ text "checking that size " <+> prettyTCM (var i) <+> text " is never 0"+--     , text "in context " <+> do sep $ map prettyTCM ts+--     ]+--   foldr f (return False) ts+--   where+--   f t cont = do+--     -- If we encounter a blocked type in the context, we cannot+--     -- definitely say no.+--     let yes     = return True+--         no      = cont+--         perhaps = cont >>= \ res -> if res then return res else patternViolation+--     ifBlockedType t (\ _ _ -> perhaps) $ \ t -> do+--       caseMaybeM (isSizeType t) no $ \ b -> do+--         case b of+--           BoundedNo -> no+--           BoundedLt u -> ifBlocked u (\ _ _ -> perhaps) $ \ u -> do+--             case ignoreSharing u of+--                Var i' [] | i == i' -> yes+--                _ -> no+++-- | Checks that a size variable is ensured to be @> 0@.+--   E.g. variable @i@ cannot be zero in context+--   @(i : Size) (j : Size< ↑ ↑ i) (k : Size< j) (k' : Size< k)@.+--   Throws a 'patternViolation' if undecided.+checkSizeVarNeverZero :: Int -> TCM Bool+checkSizeVarNeverZero i = do+  reportSDoc "tc.size" 20 $ text "checkSizeVarNeverZero" <+> prettyTCM (var i)+  -- Looking for the minimal value for size variable i,+  -- we can restrict to the last i+  -- entries, as only these can contain i in an upper bound.+  ts <- map (snd . unDom) . take i <$> getContext+  -- If we encountered a blocking meta in the context, we cannot+  -- say ``no'' for sure.+  (n, Any meta) <- runWriterT $ minSizeValAux ts $ repeat 0+  if n > 0 then return True else+    if meta then patternViolation else return False+  where+  -- Compute the least valuation for size context ts above the+  -- given valuation and return its last value.+  minSizeValAux :: [Type] -> [Int] -> WriterT Any TCM Int+  minSizeValAux _        []      = __IMPOSSIBLE__+  minSizeValAux []       (n : _) = return n+  minSizeValAux (t : ts) (n : ns) = do+    reportSDoc "tc.size" 60 $+       text ("minSizeVal (n:ns) = " ++ show (take (length ts + 2) $ n:ns) +++             " t =") <+> (text . show) t  -- prettyTCM t  -- Wrong context!+    -- n is the min. value for variable 0 which has type t.+    let cont = minSizeValAux ts ns+        perhaps = tell (Any True) >> cont+    -- If we encounter a blocked type in the context, we cannot+    -- give a definite answer.+    ifBlockedType t (\ _ _ -> perhaps) $ \ t -> do+      caseMaybeM (liftTCM $ isSizeType t) cont $ \ b -> do+        case b of+          BoundedNo -> cont+          BoundedLt u -> ifBlocked u (\ _ _ -> perhaps) $ \ u -> do+            reportSLn "tc.size" 60 $ "minSizeVal upper bound u = " ++ show u+            v <- liftTCM $ deepSizeView u+            case v of+              -- Variable 0 has bound @(< j + m)@+              -- meaning that @minval(j) > n - m@, i.e., @minval(j) >= n+1-m@.+              -- Thus, we update the min value for @j@ with function @(max (n+1-m))@.+              DSizeVar j m -> do+                reportSLn "tc.size" 60 $ "minSizeVal upper bound v = " ++ show v+                let ns' = List.updateAt j (max $ n+1-m) ns+                reportSLn "tc.size" 60 $ "minSizeVal ns' = " ++ show (take (length ts + 1) ns')+                minSizeValAux ts ns'+              DSizeMeta{} -> perhaps+              _ -> cont  -- | Check whether a variable in the context is bounded by a size expression. --   If @x : Size< a@, then @a@ is returned.
src/full/Agda/TypeChecking/SizedTypes/Solve.hs view
@@ -55,21 +55,21 @@  module Agda.TypeChecking.SizedTypes.Solve where -import Control.Monad ( forM )-import Data.Foldable (Foldable, foldMap)+import Control.Monad (unless)+import Data.Foldable (Foldable, foldMap, forM_) import Data.Function import Data.List import Data.Monoid (mappend) import qualified Data.Map as Map import qualified Data.Set as Set-import Data.Traversable (Traversable)+import Data.Traversable (Traversable, forM)  import Agda.Interaction.Options  import Agda.Syntax.Common import Agda.Syntax.Internal -import Agda.TypeChecking.Monad as TCM+import Agda.TypeChecking.Monad as TCM hiding (Offset) import Agda.TypeChecking.Monad.Builtin import Agda.TypeChecking.Pretty import Agda.TypeChecking.Reduce@@ -248,18 +248,18 @@ getSizeHypotheses gamma = inTopContext $ modifyContext (const gamma) $ do   (_, msizelt) <- getBuiltinSize   caseMaybe msizelt (return []) $ \ sizelt -> do-  -- Traverse the context from newest to oldest de Bruijn Index-  catMaybes <$> do-    forM (zip [0..] gamma) $ \ (i, ce) -> do-      -- Get name and type of variable i.-      let xt = unDom $ ctxEntry ce-          x  = show $ fst xt-      t <- reduce . raise (1 + i) . unEl . snd $ xt-      case ignoreSharing t of-        Def d [Apply u] | d == sizelt -> do-          caseMaybeM (sizeExpr $ unArg u) (return Nothing) $ \ a ->-            return $ Just $ (ctxId ce, Constraint (Rigid (NamedRigid x i) 0) Lt a)-        _ -> return Nothing+    -- Traverse the context from newest to oldest de Bruijn Index+    catMaybes <$> do+      forM (zip [0..] gamma) $ \ (i, ce) -> do+        -- Get name and type of variable i.+        let xt = unDom $ ctxEntry ce+            x  = show $ fst xt+        t <- reduce . raise (1 + i) . unEl . snd $ xt+        case ignoreSharing t of+          Def d [Apply u] | d == sizelt -> do+            caseMaybeM (sizeExpr $ unArg u) (return Nothing) $ \ a ->+              return $ Just $ (ctxId ce, Constraint (Rigid (NamedRigid x i) 0) Lt a)+          _ -> return Nothing  -- | Convert size constraint into form where each meta is applied --   to indices @0,1,..,n-1@ where @n@ is the arity of that meta.@@ -397,20 +397,20 @@ computeSizeConstraint c = do   let cxt = envContext $ clEnv c   inTopContext $ modifyContext (const cxt) $ do-  case clValue c of-    ValueCmp CmpLeq _ u v -> do-      reportSDoc "tc.size.solve" 50 $ sep $-        [ text "converting size constraint"-        , prettyTCM c-        ]-      ma <- sizeExpr u-      mb <- sizeExpr v-      (hids, hs) <- unzip <$> getSizeHypotheses cxt-      let mk a b = HypSizeConstraint cxt hids hs $ Size.Constraint a Le b-      -- We only create a size constraint if both terms can be-      -- parsed to our format of size expressions.-      return $ mk <$> ma <*> mb-    _ -> __IMPOSSIBLE__+    case clValue c of+      ValueCmp CmpLeq _ u v -> do+        reportSDoc "tc.size.solve" 50 $ sep $+          [ text "converting size constraint"+          , prettyTCM c+          ]+        ma <- sizeExpr u+        mb <- sizeExpr v+        (hids, hs) <- unzip <$> getSizeHypotheses cxt+        let mk a b = HypSizeConstraint cxt hids hs $ Size.Constraint a Le b+        -- We only create a size constraint if both terms can be+        -- parsed to our format of size expressions.+        return $ mk <$> ma <*> mb+      _ -> __IMPOSSIBLE__  -- | Turn a term into a size expression. --@@ -424,7 +424,7 @@   s <- sizeView u   case s of     SizeInf     -> return $ Just Infty-    SizeSuc u   -> fmap (`plus` (1 :: Int)) <$> sizeExpr u+    SizeSuc u   -> fmap (`plus` (1 :: Offset)) <$> sizeExpr u     OtherSize u -> case ignoreSharing u of       Var i []    -> (\ x -> Just $ Rigid (NamedRigid x i) 0) . show <$> nameOfBV i --      MetaV m es  -> return $ Just $ Flex (SizeMeta m es) 0@@ -441,11 +441,11 @@ unSizeExpr :: DBSizeExpr -> TCM Term unSizeExpr a =   case a of-    Infty                  -> primSizeInf-    Rigid r n              -> do+    Infty         -> primSizeInf+    Rigid r (O n) -> do       unless (n >= 0) __IMPOSSIBLE__       sizeSuc n $ var $ rigidIndex r-    Flex (SizeMeta x es) n -> do+    Flex (SizeMeta x es) (O n) -> do       unless (n >= 0) __IMPOSSIBLE__       sizeSuc n $ MetaV x $ map (Apply . defaultArg . var) es-    Const{}                -> __IMPOSSIBLE__+    Const{} -> __IMPOSSIBLE__
src/full/Agda/TypeChecking/SizedTypes/Syntax.hs view
@@ -3,6 +3,7 @@ {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE UndecidableInstances #-}@@ -18,13 +19,29 @@ import qualified Data.Set as Set import Data.Traversable (Traversable) +import Test.QuickCheck+ import Agda.TypeChecking.SizedTypes.Utils  -- * Syntax  -- | Constant finite sizes @n >= 0@.-type Offset = Int+newtype Offset = O Int+  deriving (Eq, Ord, Num, Show, Enum) +instance MeetSemiLattice Offset where+  meet = min++instance Plus Offset Offset Offset where+  plus (O x) (O y) = O (plus x y)++instance Arbitrary Offset where+  arbitrary = do+    NonNegative x <- arbitrary+    return x++  shrink (O x) = map O $ filter (>= 0) (shrink x)+ -- | Fixed size variables @i@. newtype Rigid  = RigidId { rigidId :: String }   deriving (Eq, Ord)@@ -53,6 +70,10 @@   | Le  -- ^ @≤@.   deriving (Eq, Bounded, Enum) +instance Dioid Cmp where+  compose     = min+  unitCompose = Le+ -- | Comparison operator is ordered @'Lt' < 'Le'@. instance Ord Cmp where   Lt <= x  = True@@ -64,6 +85,9 @@  instance Top Cmp where   top = Le++instance Arbitrary Cmp where+  arbitrary = arbitraryBoundedEnum  -- | Constraint: an inequation between size expressions, --   e.g. @X < ∞@ or @i + 3 ≤ j@.
src/full/Agda/TypeChecking/SizedTypes/Tests.hs view
@@ -11,23 +11,6 @@ import Agda.TypeChecking.SizedTypes.WarshallSolver import Agda.TypeChecking.SizedTypes.Utils -instance Arbitrary Cmp where-  arbitrary = arbitraryBoundedEnum--instance Arbitrary Weight where-  arbitrary = frequency-    [ (1, return Infinity)-    , (5, Offset <$> choose (0, 200))-    ]---- instance Arbitrary Label where---   arbitrary = Label <$> arbitrary <*> arbitrary-instance Arbitrary Label where-  arbitrary = frequency-    [ (1, return LInf)-    , (5, Label <$> arbitrary <*> arbitrary)-    ]- -- * Label interpretation  type Relation a = a -> a -> Bool@@ -55,7 +38,7 @@ prop_ComposeSound l1 l2 x y z =   eval l1 x y && eval l2 y z ==> eval (compose l1 l2) x z -prop_ComposeComplete :: Label -> Label -> Int -> Weight -> Property+prop_ComposeComplete :: Label -> Label -> Offset -> Weight -> Property prop_ComposeComplete l1 l2 k z = let x = Offset k in   eval (compose l1 l2) x z ==>     let y = z + toWeight l2
src/full/Agda/TypeChecking/SizedTypes/Utils.hs view
@@ -24,6 +24,9 @@ class Plus a b c where   plus :: a -> b -> c +instance Plus Int Int Int where+  plus = (+)+ class MeetSemiLattice a where   meet :: a -> a -> a 
src/full/Agda/TypeChecking/SizedTypes/WarshallSolver.hs view
@@ -14,7 +14,7 @@  import Prelude hiding (truncate) --- import Control.Applicative hiding (Const)-- ((<*>))+import Control.Applicative hiding (Const) import Control.Monad  import Data.Function (on)@@ -27,6 +27,8 @@ import qualified Data.Map as Map import Data.Traversable (for) +import Test.QuickCheck (Arbitrary(..), frequency, choose)+ import Agda.TypeChecking.SizedTypes.Syntax import Agda.TypeChecking.SizedTypes.Utils @@ -97,13 +99,10 @@         , l2 <- maybeToList $ lookupEdge g v w       ] -instance MeetSemiLattice Offset where-  meet = min- -- * Edge weights  data Weight-  = Offset Int+  = Offset Offset   | Infinity   deriving (Eq) @@ -127,8 +126,8 @@   succ (Infinity) = Infinity   pred (Offset x) = Offset (pred x)   pred (Infinity) = Infinity-  toEnum   = Offset-  fromEnum (Offset x) = x+  toEnum = Offset . toEnum+  fromEnum (Offset x) = fromEnum x   fromEnum (Infinity) = __IMPOSSIBLE__  -- | Partial implementation of @Num@.@@ -149,6 +148,12 @@ instance Plus Weight Offset Weight where   plus w k = w + (Offset k) +instance Arbitrary Weight where+  arbitrary = frequency+    [ (1, return Infinity)+    , (5, Offset . O <$> choose (0, 200))+    ]+ -- | Test for negativity, used to detect negative cycles. class Negative a where   negative :: a -> Bool@@ -161,6 +166,9 @@ instance Negative Int where   negative = (< 0) +instance Negative Offset where+  negative (O x) = negative x+ instance Negative Weight where   negative Infinity = False   negative (Offset x) = negative x@@ -219,16 +227,18 @@   isTop Label{}       = False   isTop LInf          = True +instance Arbitrary Label where+  arbitrary = frequency+    [ (1, return LInf)+    , (5, Label <$> arbitrary <*> arbitrary)+    ]+ -- * Semiring with idempotent '+' == dioid  instance Dioid Weight where   compose     = (+)   unitCompose = 0 -instance Dioid Cmp where-  compose     = min-  unitCompose = Le- instance Dioid Label where   compose (Label Lt w) (Label Lt w')    = Label Lt $ pred $ w + w'   compose (Label cmp w) (Label cmp' w') = Label (compose cmp cmp') $ w + w'@@ -543,9 +553,6 @@   -- * Compute solution from constraint graph.--instance Plus Int Int Int where-  plus = (+)  instance Plus Offset Weight Weight where   plus e Infinity   = Infinity
src/full/Agda/TypeChecking/Substitute.hs view
@@ -1,15 +1,18 @@-{-# LANGUAGE CPP #-}+{-# LANGUAGE CPP                #-} {-# LANGUAGE DeriveDataTypeable #-}-{-# LANGUAGE DeriveFunctor #-}-{-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE PatternGuards #-}+{-# LANGUAGE DeriveFunctor      #-}+{-# LANGUAGE FlexibleContexts   #-}+{-# LANGUAGE FlexibleInstances  #-}+{-# LANGUAGE PatternGuards      #-} {-# LANGUAGE StandaloneDeriving #-}-{-# LANGUAGE TupleSections #-}+{-# LANGUAGE TupleSections      #-}  #if __GLASGOW_HASKELL__ <= 708 {-# LANGUAGE OverlappingInstances #-} #endif +{-# OPTIONS_GHC -fno-warn-orphans #-}+ module Agda.TypeChecking.Substitute   ( module Agda.TypeChecking.Substitute   , Substitution(..)@@ -32,9 +35,10 @@ import Agda.Syntax.Internal import Agda.Syntax.Position -import Agda.TypeChecking.Monad.Base as Base+import Agda.TypeChecking.Monad.Base import Agda.TypeChecking.Free as Free import Agda.TypeChecking.CompiledClause+import Agda.TypeChecking.Positivity.Occurrence as Occ  import Agda.Utils.Empty import Agda.Utils.Functor@@ -157,17 +161,17 @@   apply (ExtendTel _ tel) (t : ts) = lazyAbsApp tel (unArg t) `apply` ts  instance Apply Definition where-  apply (Defn info x t pol occ df m c rew inst d) args =-    Defn info x (piApply t args) (apply pol args) (apply occ args) df m c (apply rew args) inst (apply d args)+  apply (Defn info x t pol occ df m c inst d) args =+    Defn info x (piApply t args) (apply pol args) (apply occ args) df m c inst (apply d args)  instance Apply RewriteRule where   apply (RewriteRule q gamma lhs rhs t) args =     RewriteRule q (apply gamma args) lhs rhs t  #if __GLASGOW_HASKELL__ >= 710-instance {-# OVERLAPPING #-} Apply [Base.Occurrence] where+instance {-# OVERLAPPING #-} Apply [Occ.Occurrence] where #else-instance Apply [Base.Occurrence] where+instance Apply [Occ.Occurrence] where #endif   apply occ args = List.drop (length args) occ @@ -280,10 +284,10 @@   applyE (WithArity n a) es   = WithArity n $ applyE a es  instance Apply a => Apply (Case a) where-  apply (Branches cs ls m) args =-    Branches (apply cs args) (apply ls args) (apply m args)-  applyE (Branches cs ls m) es =-    Branches (applyE cs es) (applyE ls es) (applyE m es)+  apply (Branches cop cs ls m) args =+    Branches cop (apply cs args) (apply ls args) (apply m args)+  applyE (Branches cop cs ls m) es =+    Branches cop (applyE cs es) (applyE ls es) (applyE m es)  instance Apply FunctionInverse where   apply NotInjective  args = NotInjective@@ -386,8 +390,8 @@   ExtendTel arg xtel `abstract` tel = ExtendTel arg $ xtel <&> (`abstract` tel)  instance Abstract Definition where-  abstract tel (Defn info x t pol occ df m c rews inst d) =-    Defn info x (abstract tel t) (abstract tel pol) (abstract tel occ) df m c (abstract tel rews) inst (abstract tel d)+  abstract tel (Defn info x t pol occ df m c inst d) =+    Defn info x (abstract tel t) (abstract tel pol) (abstract tel occ) df m c inst (abstract tel d)  -- | @tel ⊢ (Γ ⊢ lhs ↦ rhs : t)@ becomes @tel, Γ ⊢ lhs ↦ rhs : t)@ --   we do not need to change lhs, rhs, and t since they live in Γ.@@ -397,9 +401,9 @@     RewriteRule q (abstract tel gamma) lhs rhs t  #if __GLASGOW_HASKELL__ >= 710-instance {-# OVERLAPPING #-} Abstract [Base.Occurrence] where+instance {-# OVERLAPPING #-} Abstract [Occ.Occurrence] where #else-instance Abstract [Base.Occurrence] where+instance Abstract [Occ.Occurrence] where #endif   abstract tel []  = []   abstract tel occ = replicate (size tel) Mixed ++ occ -- TODO: check occurrence@@ -479,8 +483,8 @@   abstract tel (WithArity n a) = WithArity n $ abstract tel a  instance Abstract a => Abstract (Case a) where-  abstract tel (Branches cs ls m) =-    Branches (abstract tel cs) (abstract tel ls) (abstract tel m)+  abstract tel (Branches cop cs ls m) =+    Branches cop (abstract tel cs) (abstract tel ls) (abstract tel m)  telVars :: Telescope -> [Arg Pattern] telVars = map (fmap namedThing) . namedTelVars@@ -543,9 +547,12 @@   | n + 1 == m = wkS (m - 1) (liftS 1 rho) consS u rho = seq u (u :# rho) -singletonS :: Term -> Substitution-singletonS u = consS u idS+-- | To replace index @n@ by term @u@, do @applySubst (singletonS n u)@.+singletonS :: Int -> Term -> Substitution+singletonS n u = map var [0..n-1] ++# consS u (raiseS n)+  -- ALT: foldl (\ s i -> var i `consS` s) (consS u $ raiseS n) $ downFrom n +-- | Lift a substitution under k binders. liftS :: Int -> Substitution -> Substitution liftS 0 rho          = rho liftS k IdS          = IdS@@ -643,14 +650,17 @@ raiseFrom :: Subst t => Nat -> Nat -> t -> t raiseFrom n k = applySubst (liftS n $ raiseS k) -subst :: Subst t => Term -> t -> t-subst u t = substUnder 0 u t+-- | Replace de Bruijn index i by a 'Term' in something.+subst :: Subst t => Int -> Term -> t -> t+subst i u = applySubst $ singletonS i u  strengthen :: Subst t => Empty -> t -> t strengthen err = applySubst (compactS err [Nothing]) +-- | Replace what is now de Bruijn index 0, but go under n binders.+--   @substUnder n u == subst n (raise n u)@. substUnder :: Subst t => Nat -> Term -> t -> t-substUnder n u = applySubst (liftS n (singletonS u))+substUnder n u = applySubst (liftS n (singletonS 0 u))  instance Subst Substitution where   applySubst rho sgm = composeS rho sgm@@ -674,7 +684,7 @@ instance Subst a => Subst (Ptr a) where   applySubst rho = fmap (applySubst rho) -instance Subst Type where+instance (Subst a) => Subst (Type' a) where   applySubst rho (El s t) = applySubst rho s `El` applySubst rho t  instance Subst Sort where@@ -702,6 +712,13 @@ instance Subst Bool where   applySubst rho = id +#if __GLASGOW_HASKELL__ >= 710+instance {-# OVERLAPPING #-} Subst String where+#else+instance Subst String where+#endif+  applySubst rho = id+ instance Subst Name where   applySubst rho = id @@ -716,6 +733,16 @@     LitP l       -> p     ProjP _      -> p +instance Subst NLPat where+  applySubst rho p = case p of+    PVar i -> p+    PWild  -> p+    PDef f es -> PDef f $ applySubst rho es+    PLam i u -> PLam i $ applySubst rho u+    PPi a b -> PPi (applySubst rho a) (applySubst rho b)+    PBoundVar i es -> PBoundVar i $ applySubst rho es+    PTerm u -> PTerm $ applySubst rho u+ instance Subst t => Subst (Blocked t) where   applySubst rho b = fmap (applySubst rho) b @@ -745,6 +772,7 @@     LevelCmp cmp l1 l2       -> LevelCmp cmp (rf l1) (rf l2)     Guarded c cs             -> Guarded (rf c) cs     IsEmpty r a              -> IsEmpty r (rf a)+    CheckSizeLtSat t         -> CheckSizeLtSat (rf t)     FindInScope m cands      -> FindInScope m (rf cands)     UnBlock{}                -> c     where@@ -906,7 +934,7 @@ --   @dLub s1 \i.s2 = \omega@ if @i@ appears in the rigid variables of @s2@. dLub :: Sort -> Abs Sort -> Sort dLub s1 (NoAbs _ s2) = sLub s1 s2-dLub s1 b@(Abs _ s2) = case occurrence 0 $ freeVars s2 of+dLub s1 b@(Abs _ s2) = case occurrence 0 s2 of   Flexible      -> DLub s1 b   Irrelevantly  -> DLub s1 b   NoOccurrence  -> sLub s1 (noabsApp __IMPOSSIBLE__ b)@@ -923,7 +951,7 @@  -- | Instantiate an abstraction. Strict in the term. absApp :: Subst t => Abs t -> Term -> t-absApp (Abs   _ v) u = subst u v+absApp (Abs   _ v) u = subst 0 u v absApp (NoAbs _ v) _ = v  -- | Instantiate an abstraction. Lazy in the term, which allow it to be
src/full/Agda/TypeChecking/Telescope.hs view
@@ -1,5 +1,9 @@ {-# LANGUAGE CPP #-} +#if __GLASGOW_HASKELL__ >= 710+{-# LANGUAGE FlexibleContexts #-}+#endif+ module Agda.TypeChecking.Telescope where  import Control.Applicative@@ -57,13 +61,12 @@  -- | If @permute π : [a]Γ -> [a]Δ@, then @applySubst (renaming π) : Term Γ -> Term Δ@ renaming :: Permutation -> Substitution-renaming p = gammaAux+renaming p = prependS __IMPOSSIBLE__ gamma $ raiseS $ size p   where-    n        = size p-    gamma    = safePermute (reverseP $ invertP (-1) $ reverseP p) $ map var [0..]-    gammaAux = prependS __IMPOSSIBLE__ gamma (raiseS n)+    gamma = inversePermute p var+    -- gamma = safePermute (invertP (-1) p) $ map var [0..] --- | If @permute π : [a]Γ -> [a]Δ@, then @substs (renamingR π) : Term Δ -> Term Γ@+-- | If @permute π : [a]Γ -> [a]Δ@, then @applySubst (renamingR π) : Term Δ -> Term Γ@ renamingR :: Permutation -> Substitution renamingR p@(Perm n _) = permute (reverseP p) (map var [0..]) ++# raiseS n @@ -182,11 +185,31 @@ -- | Decomposing a function type.  mustBePi :: MonadTCM tcm => Type -> tcm (Dom Type, Abs Type)-mustBePi t = liftTCM $ do-  t <- reduce t-  case ignoreSharing $ unEl t of-    Pi a b -> return (a, b)-    _      -> __IMPOSSIBLE__+mustBePi t = ifNotPiType t __IMPOSSIBLE__ $ \ a b -> return (a,b)++-- | If the given type is a @Pi@, pass its parts to the first continuation.+--   If not (or blocked), pass the reduced type to the second continuation.+ifPi :: MonadTCM tcm => Term -> (Dom Type -> Abs Type -> tcm a) -> (Term -> tcm a) -> tcm a+ifPi t yes no = do+  t <- liftTCM $ reduce t+  case ignoreSharing t of+    Pi a b -> yes a b+    _      -> no t++-- | If the given type is a @Pi@, pass its parts to the first continuation.+--   If not (or blocked), pass the reduced type to the second continuation.+ifPiType :: MonadTCM tcm => Type -> (Dom Type -> Abs Type -> tcm a) -> (Type -> tcm a) -> tcm a+ifPiType (El s t) yes no = ifPi t yes (no . El s)++-- | If the given type is blocked or not a @Pi@, pass it reduced to the first continuation.+--   If it is a @Pi@, pass its parts to the second continuation.+ifNotPi :: MonadTCM tcm => Term -> (Term -> tcm a) -> (Dom Type -> Abs Type -> tcm a) -> tcm a+ifNotPi = flip . ifPi++-- | If the given type is blocked or not a @Pi@, pass it reduced to the first continuation.+--   If it is a @Pi@, pass its parts to the second continuation.+ifNotPiType :: MonadTCM tcm => Type -> (Type -> tcm a) -> (Dom Type -> Abs Type -> tcm a) -> tcm a+ifNotPiType = flip . ifPiType  -- | A safe variant of piApply. 
src/full/Agda/TypeChecking/Test/Generators.hs view
@@ -1,8 +1,9 @@-{-# LANGUAGE CPP #-}-{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE CPP                    #-}+{-# LANGUAGE FlexibleContexts       #-}+{-# LANGUAGE FlexibleInstances      #-} {-# LANGUAGE FunctionalDependencies #-}-{-# LANGUAGE MultiParamTypeClasses #-}-{-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE MultiParamTypeClasses  #-}+{-# LANGUAGE UndecidableInstances   #-}  module Agda.TypeChecking.Test.Generators where @@ -548,8 +549,8 @@  -- Tests ------------------------------------------------------------------ -isWellScoped :: Free a => TermConfiguration -> a -> Bool-isWellScoped conf t = allVars (freeVars t) `Set.isSubsetOf` Set.fromList (tcFreeVariables conf)+isWellScoped :: FreeVS a => TermConfiguration -> a -> Bool+isWellScoped conf t = allFreeVars t `Set.isSubsetOf` Set.fromList (tcFreeVariables conf)  -- | Check that the generated terms don't have any out of scope variables. prop_wellScopedVars :: TermConfiguration -> Property
src/full/Agda/TypeChecking/Unquote.hs view
@@ -352,7 +352,7 @@           n  = vars True ps  -- with dot patterns           n' = vars False ps -- without dot patterns           dummyTel 0 = EmptyTel-          dummyTel n = ExtendTel (defaultDom typeDontCare) (Abs "x" $ dummyTel (n - 1))+          dummyTel n = ExtendTel dummyDom (Abs "x" $ dummyTel (n - 1))           mkBody 0 b = maybe NoBody Body b           mkBody n b = Bind $ Abs "x" $ mkBody (n - 1) b           vars d ps = sum $ map (vars' d . namedArg) ps@@ -373,7 +373,7 @@        checkClause :: I.Clause -> UnquoteM I.Clause       checkClause cl@Clause{ clausePerm = Perm n vs , clauseBody = body } = do-        let freevs    = allVars $ freeVars $ fromMaybe __IMPOSSIBLE__ $ getBody body+        let freevs    = allFreeVars $ fromMaybe __IMPOSSIBLE__ $ getBody body             propervs  = Set.fromList $ map ((n-1)-) vs             dottedvs  = Set.difference (Set.fromList [0..n-1]) propervs             offending = Set.intersection freevs dottedvs
src/full/Agda/TypeChecking/With.hs view
@@ -31,6 +31,7 @@  import Agda.TypeChecking.Abstract import Agda.TypeChecking.Rules.LHS.Implicit+import Agda.TypeChecking.Rules.LHS (isFlexiblePattern)  import Agda.Utils.Functor import Agda.Utils.List@@ -203,15 +204,21 @@       -> TCM [A.NamedArg A.Pattern]   -- ^ With-clause patterns decomposed by parent-clause patterns.      -- Case: out of with-clause patterns.-    strip _ _ []      (_ : _) =-      typeError $ GenericError $ "Too few arguments given in with-clause"+    strip self t [] qs@(_ : _) = do+      -- Andreas, 2015-06-11, issue 1551:+      -- As the type t develops, we need to insert more implicit patterns,+      -- due to copatterns / flexible arity.+      ps <- insertImplicitPatternsT ExpandLast [] t+      if null ps then+        typeError $ GenericError $ "Too few arguments given in with-clause"+       else strip self t ps qs      -- Case: out of parent-clause patterns.     -- This is only ok if all remaining with-clause patterns     -- are implicit patterns (we inserted too many).     strip _ _ ps      []      = do-      let implicit (A.ImplicitP{}) = True-          implicit (A.ConP ci _ _) = patImplicit ci+      let implicit (A.WildP{})     = True+          implicit (A.ConP ci _ _) = patOrigin ci == ConPImplicit           implicit _               = False       unless (all (implicit . namedArg) ps) $         typeError $ GenericError $ "Too many arguments given in with-clause"@@ -228,12 +235,21 @@         , nest 2 $ text "qs0 =" <+> fsep (punctuate comma $ map (prettyTCM . namedArg) qs0)         , nest 2 $ text "t   =" <+> prettyTCM t         ]+      let failDotPat = do+            d <- prettyA p+            typeError $ GenericError $+                "Inaccessible (dotted) patterns from the parent clause must " +++                "also be inaccessible in the with clause, when checking the " +++                "pattern " ++ show d ++ ","       case namedArg q of         ProjP d -> case A.isProjP p of-          Just d' | d == d' -> do-            t1 <- fromMaybe __IMPOSSIBLE__ <$> projectType t d-            strip (self `applyE` [Proj d]) t1 ps qs-          _ -> mismatch+          Just d' -> do+            d' <- getOriginalProjection d'+            if d /= d' then mismatch else do+              t <- reduce t+              (self1, t1) <- fromMaybe __IMPOSSIBLE__ <$> projectTyped self t d+              strip self1 t1 ps qs+          Nothing -> mismatch          VarP (i, _x)  -> do           ps <- intro1 t $ \ t -> strip (self `apply1` var i) t ps qs@@ -241,40 +257,49 @@          DotP v  -> case namedArg p of           A.DotP _ _    -> ok p-          A.ImplicitP _ -> ok p+          A.WildP _     -> ok p           -- Andreas, 2013-03-21 in case the implicit A.pattern has already been eta-expanded           -- we just fold it back.  This fixes issues 665 and 824.-          A.ConP ci _ _ | patImplicit ci -> ok $ updateNamedArg (const $ A.ImplicitP patNoRange) p+          A.ConP ci _ _ | patOrigin ci == ConPImplicit -> okFlex p+          -- Andreas, 2015-07-07 issue 1606: Same for flexible record patterns.+          -- Agda might have replaced a record of dot patterns (A.ConP) by a dot pattern (I.DotP).+          p'@A.ConP{} -> ifM (isFlexiblePattern p') (okFlex p) {-else-} failDotPat            p@(A.PatternSynP pi' c' [ps']) -> do              reportSDoc "impossible" 10 $                text "stripWithClausePatterns: encountered pattern synonym " <+> prettyA p              __IMPOSSIBLE__ -          _ -> do-            d <- prettyA p-            typeError $ GenericError $-                "Inaccessible (dotted) patterns from the parent clause must " ++-                "also be inaccessible in the with clause, when checking the " ++-                "pattern " ++ show d ++ ","+          _ -> failDotPat           where+            okFlex = ok . makeImplicitP             ok p = do               t' <- piApply1 t v               (p :) <$> strip (self `apply1` v) t' ps qs -        ConP c ci qs' -> do+        q'@(ConP c ci qs') -> do          reportSDoc "tc.with.strip" 60 $            text "parent pattern is constructor " <+> prettyTCM c          (a, b) <- mustBePi t          case namedArg p of -          -- Andreas, 2013-03-21 if we encounter an implicit pattern in the with-clause-          -- that has been expanded in the parent clause, we expand it and restart-          A.ImplicitP _ | Just True <- conPRecord ci -> do+          -- Andreas, 2015-07-07 Issue 1606.+          -- Agda sometimes changes a record of dot patterns into a dot pattern,+          -- so the user should be allowed to do likewise.+          A.DotP{} -> ifNotM (isFlexiblePattern q') mismatch $ {-else-} do+            maybe __IMPOSSIBLE__ (\ p -> strip self t (p : ps) qs0) =<< do+              expandImplicitPattern' (unDom a) $ makeImplicitP p++          -- Andreas, 2013-03-21 if we encounter an implicit pattern+          -- in the with-clause, we expand it and restart+          -- Andreas, 2015-07-07 Issue 1606 do this whenever the parent+          -- is a record pattern, regardless of whether it came from an implicit+          -- or not.  This allows to drop hidden flexible record patterns from+          -- the with clauses even when they were present in the parent clause.+          A.WildP{} | Just _ <- conPRecord ci -> do             maybe __IMPOSSIBLE__ (\ p -> strip self t (p : ps) qs0) =<<               expandImplicitPattern' (unDom a) p -           A.ConP _ (A.AmbQ cs') ps' -> do             c <- (`withRangeOf` c) <$> do getConForm $ conName c             cs' <- mapM getConForm cs'@@ -312,11 +337,8 @@             unless (size psi' == size tel') $ typeError $               WrongNumberOfConstructorArguments (conName c) (size tel') (size psi') -            -- Do it again for everything (is this necessary?)-            psi' <- insertImplicitPatternsT ExpandLast (psi' ++ ps) t'-             -- Keep going-            strip (self `apply1` v) t' psi' (qs' ++ qs)+            strip (self `apply1` v) t' (psi' ++ ps) (qs' ++ qs)            p@(A.PatternSynP pi' c' ps') -> do              reportSDoc "impossible" 10 $@@ -343,6 +365,9 @@       where         mismatch = typeError $           WithClausePatternMismatch (namedArg p0) (snd <$> namedArg q)+        -- | Make an ImplicitP, keeping arg. info.+        makeImplicitP :: A.NamedArg A.Pattern -> A.NamedArg A.Pattern+        makeImplicitP = updateNamedArg $ const $ A.WildP patNoRange  -- | Construct the display form for a with function. It will display --   applications of the with function as applications to the original function.
+ src/full/Agda/Utils/Benchmark.hs view
@@ -0,0 +1,165 @@+{-# LANGUAGE FlexibleInstances         #-}+{-# LANGUAGE FunctionalDependencies    #-}+{-# LANGUAGE MultiParamTypeClasses     #-}+{-# LANGUAGE NoMonomorphismRestriction #-}+{-# LANGUAGE UndecidableInstances      #-}+{-# LANGUAGE TupleSections             #-}++-- | Tools for benchmarking and accumulating results.+--   Nothing Agda-specific in here.++module Agda.Utils.Benchmark where++import Prelude hiding (null)++import qualified Control.Exception as E (evaluate)+import Control.Monad.Reader+import Control.Monad.State++import Data.Functor+import qualified Data.List as List++import qualified Text.PrettyPrint.Boxes as Boxes++import Agda.Utils.Null+import Agda.Utils.Monad hiding (finally)+import qualified Agda.Utils.Maybe.Strict as Strict+import Agda.Utils.Pretty+import Agda.Utils.Time+import Agda.Utils.Trie (Trie)+import qualified Agda.Utils.Trie as Trie+++-- * Benchmark trie++-- | Account we can bill computation time to.+type Account a = [a]++-- | Record when we started billing the current account.+type CurrentAccount a = Strict.Maybe (Account a, CPUTime)++type Timings        a = Trie a CPUTime++-- | Benchmark structure is a trie, mapping accounts (phases and subphases)+--   to CPU time spent on their performance.+data Benchmark a = Benchmark+  { benchmarkOn    :: !Bool+    -- ^ Are we benchmarking at all?+  , currentAccount :: !(CurrentAccount a)+    -- ^ What are we billing to currently?+  , timings        :: !(Timings a)+    -- ^ The accounts and their accumulated timing bill.+  }++-- | Initial benchmark structure (empty).+instance Null (Benchmark a) where+  empty = Benchmark+    { benchmarkOn = False+    , currentAccount = Strict.Nothing+    , timings = empty+    }+  null = null . timings++-- | Semantic editor combinator.+mapBenchmarkOn :: (Bool -> Bool) -> Benchmark a -> Benchmark a+mapBenchmarkOn f b = b { benchmarkOn = f $ benchmarkOn b }++-- | Semantic editor combinator.+mapCurrentAccount ::+  (CurrentAccount a -> CurrentAccount a) -> Benchmark a -> Benchmark a+mapCurrentAccount f b = b { currentAccount = f (currentAccount b) }++-- | Semantic editor combinator.+mapTimings :: (Timings a -> Timings a) -> Benchmark a -> Benchmark a+mapTimings f b = b { timings = f (timings b) }++-- | Add to specified CPU time account.+addCPUTime :: Ord a => Account a -> CPUTime -> Benchmark a -> Benchmark a+addCPUTime acc t = mapTimings (Trie.insertWith (+) acc t)++-- | Print benchmark as two-column table with totals.+instance (Ord a, Pretty a) => Pretty (Benchmark a) where+  pretty b = text $ Boxes.render table+    where+    (accounts, times) = unzip $ Trie.toList $ timings b++    -- Generate a table.+    table = Boxes.hsep 1 Boxes.left [col1, col2]++    -- First column: Accounts.+    col1 = Boxes.vcat Boxes.left $+           map Boxes.text $+           "Total" : map showAccount accounts+    -- Second column: Times.+    col2 = Boxes.vcat Boxes.right $+           map (Boxes.text . prettyShow) $+           sum times : times++    showAccount [] = "Miscellaneous"+    showAccount ks = List.intercalate "." $ map prettyShow ks+++-- * Benchmarking monad.++-- | Monad with access to benchmarking data.++class (Ord a, Functor m, MonadIO m) => MonadBench a m | m -> a where+  getBenchmark :: m (Benchmark a)++  getsBenchmark :: (Benchmark a -> c) -> m c+  getsBenchmark f = f <$> getBenchmark++  putBenchmark :: Benchmark a -> m ()+  putBenchmark b = modifyBenchmark $ const b++  modifyBenchmark :: (Benchmark a -> Benchmark a) -> m ()+  modifyBenchmark f = do+    b <- getBenchmark+    putBenchmark $! f b++  -- | We need to be able to terminate benchmarking in case of an exception.+  finally :: m b -> m c -> m b++-- needs UndecidableInstances because of weakness of FunctionalDependencies+instance MonadBench a m => MonadBench a (ReaderT r m) where+  getBenchmark    = lift $ getBenchmark+  putBenchmark    = lift . putBenchmark+  modifyBenchmark = lift . modifyBenchmark+  finally m f = ReaderT $ \ r ->+    finally (m `runReaderT` r) (f `runReaderT` r)++-- | Turn benchmarking on/off.++setBenchmarking :: MonadBench a m => Bool -> m ()+setBenchmarking b = modifyBenchmark $ mapBenchmarkOn $ const b++-- | Bill current account with time up to now.+--   Switch to new account.+--   Return old account (if any).++switchBenchmarking :: MonadBench a m+  => Strict.Maybe (Account a)      -- ^ Maybe new account.+  -> m (Strict.Maybe (Account a))  -- ^ Maybe old account.+switchBenchmarking newAccount = do+  now <- liftIO $ getCPUTime+  -- Stop and bill current benchmarking.+  oldAccount <- getsBenchmark currentAccount+  Strict.whenJust oldAccount $ \ (acc, start) ->+    modifyBenchmark $ addCPUTime acc $ now - start+  -- Switch to new account.+  modifyBenchmark $ mapCurrentAccount $ const $ (, now) <$> newAccount+  return $ fst <$> oldAccount++-- | Bill a computation to a specific account.+--   Works even if the computation is aborted by an exception.++billTo :: MonadBench a m => Account a -> m c -> m c+billTo account m = ifNotM (getsBenchmark benchmarkOn) m $ do+  -- Switch to new account.+  old <- switchBenchmarking $ Strict.Just account+  -- Compute and switch back to old account.+  (liftIO . E.evaluate =<< m) `finally` switchBenchmarking old++-- | Bill a pure computation to a specific account.+billPureTo :: MonadBench a m  => Account a -> c -> m c+billPureTo account = billTo account . return
src/full/Agda/Utils/Either.hs view
@@ -5,9 +5,11 @@ module Agda.Utils.Either   ( whileLeft, caseEitherM   , mapEither, mapLeft, mapRight+  , traverseEither   , isLeft, isRight   , fromLeft, fromRight-  , allRight+  , maybeLeft, maybeRight+  , allLeft, allRight   , tests   ) where @@ -45,6 +47,11 @@ mapRight :: (b -> d) -> Either a b -> Either a d mapRight = mapEither id +-- | 'Either' is bitraversable.++traverseEither :: Functor f => (a -> f c) -> (b -> f d) -> Either a b -> f (Either c d)+traverseEither f g = either (fmap Left . f) (fmap Right . g)+ -- | Returns 'True' iff the argument is @'Right' x@ for some @x@. --   Note: from @base >= 4.7.0.0@ already present in @Data.Either@. isRight :: Either a b -> Bool@@ -65,7 +72,28 @@ fromRight :: (a -> b) -> Either a b -> b fromRight f = either f id +-- | Safe projection from 'Left'.+--   @+--     maybeLeft (Left a) = Just a+--     maybeLeft Right{}  = Nothing+--   @+maybeLeft :: Either a b -> Maybe a+maybeLeft = either Just (const Nothing)++-- | Safe projection from 'Right'.+--   @+--     maybeRight (Right b) = Just b+--     maybeRight Left{}    = Nothing+--   @+maybeRight :: Either a b -> Maybe b+maybeRight = either (const Nothing) Just+ -- | Returns @'Just' <input with tags stripped>@ if all elements are+-- to the 'Left', and otherwise 'Nothing'.+allLeft :: [Either a b] -> Maybe [a]+allLeft = mapM maybeLeft++-- | Returns @'Just' <input with tags stripped>@ if all elements are -- to the right, and otherwise 'Nothing'. -- -- @@@ -77,9 +105,7 @@ -- @  allRight :: [Either a b] -> Maybe [b]-allRight []             = Just []-allRight (Left  _ : _ ) = Nothing-allRight (Right b : xs) = (b:) <$> allRight xs+allRight = mapM maybeRight  prop_allRight :: Eq b => [Either t b] -> Bool prop_allRight xs =
src/full/Agda/Utils/Except.hs view
@@ -1,6 +1,10 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleInstances #-} +#if !(MIN_VERSION_mtl(2,2,1))+{-# OPTIONS_GHC -fno-warn-orphans #-}+#endif+ ------------------------------------------------------------------------------ -- | Wrapper for Control.Monad.Except from the mtl package ------------------------------------------------------------------------------@@ -11,8 +15,12 @@   , mkExceptT   , MonadError(catchError, throwError)   , runExceptT+  , mapExceptT   ) where +#include "undefined.h"+import Agda.Utils.Impossible+ ------------------------------------------------------------------------ #if MIN_VERSION_mtl(2,2,1) -- New mtl, reexport ExceptT, define class Error for backward compat.@@ -37,7 +45,7 @@  -- | A string can be thrown as an error. instance Error String where-    strMsg = id+  strMsg = id  ------------------------------------------------------------------------ #else@@ -58,4 +66,15 @@ runExceptT ::  ExceptT e m a -> m (Either e a) runExceptT = runErrorT +mapExceptT :: (m (Either e a) -> m' (Either e' a')) -> ExceptT e m a -> ExceptT e' m' a'+mapExceptT = mapErrorT+ #endif++-- | To simulate @MaybeT@ by @ExceptT@.+instance Error () where+  noMsg = ()++-- Stupid ErrorT!+instance Error (a, b, c) where+  noMsg = __IMPOSSIBLE__
src/full/Agda/Utils/Favorites.hs view
@@ -1,9 +1,8 @@--- GHC 7.4.2 requires this layout for the pragmas. See Issue 1460.-{-# LANGUAGE CPP,-             DeriveFoldable,-             GeneralizedNewtypeDeriving,-             ScopedTypeVariables,-             TemplateHaskell #-}+{-# LANGUAGE CPP                        #-}+{-# LANGUAGE DeriveFoldable             #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE ScopedTypeVariables        #-}+{-# LANGUAGE TemplateHaskell            #-}  -- | Maintaining a list of favorites of some partially ordered type. --   Only the best elements are kept.@@ -79,9 +78,9 @@   loop as@(b : bs) = case comparable a b of     POLT -> dominates b $ loop bs  -- @a@ is a new favorite, bye-bye, @b@     POLE -> dominates b $ loop bs  -- ditto-    POEQ -> IsDominated a          -- @b@ is as least as good as @a@, bye-bye, @a@-    POGE -> IsDominated a          -- ditto-    POGT -> IsDominated a          -- ditto+    POEQ -> IsDominated b          -- @b@ is as least as good as @a@, bye-bye, @a@+    POGE -> IsDominated b          -- ditto+    POGT -> IsDominated b          -- ditto     POAny -> doesnotd b $ loop bs -- don't know, compare with my other favorites   -- add an outperformed favorite   dominates b (Dominates bs as) = Dominates (b : bs) as
src/full/Agda/Utils/FileName.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}  {-| Operations on file names. -} module Agda.Utils.FileName@@ -25,6 +26,7 @@ import Data.ByteString.Char8 (ByteString) import qualified Data.ByteString.Char8 as ByteString import Data.Function+import Data.Hashable import Data.Typeable (Typeable)  import Agda.Utils.Pretty@@ -46,7 +48,7 @@ -- of the standard library!  newtype AbsolutePath = AbsolutePath { byteStringPath :: ByteString }-  deriving (Eq, Ord, Typeable)+  deriving (Eq, Ord, Typeable, Hashable)  -- | Extract the 'AbsolutePath' to be used as 'FilePath'. filePath :: AbsolutePath -> FilePath
src/full/Agda/Utils/Function.hs view
@@ -2,6 +2,20 @@  module Agda.Utils.Function where +-- | Repeat a state transition @f :: a -> (b, a)@ with output @b@+--   while condition @cond@ on the output is true.+--   Return all intermediate results and the final result+--   where @cond@ is @False@.+--+--   Postconditions (when it terminates):+--   @fst (last (iterWhile cond f a)) == False@.+--   @all fst (init (interWhile cond f a))@.++iterWhile :: (b -> Bool) -> (a -> (b, a)) -> a -> [(b,a)]+iterWhile cond f = loop where+  loop a = r : if cond b then loop a' else []+    where r@(b, a') = f a+ -- | Repeat something while a condition on some state is true. --   Return the last state (including the changes of the last --   transition, even if the condition became false then).
src/full/Agda/Utils/Functor.hs view
@@ -9,10 +9,11 @@   )   where +import Control.Applicative ( Const(Const), getConst )+ import Data.Functor import Data.Functor.Identity import Data.Functor.Compose-import Data.Functor.Constant import Data.Functor.Classes  -- Andreas, 2015-05-06, see issue 1501.@@ -70,7 +71,7 @@  -- | Any decoration is a lens.  @set@ is a special case of @dmap@. dget :: Decoration t => t a -> a-dget = getConstant . traverseF Constant+dget = getConst . traverseF Const  -- | The identity functor is a decoration. instance Decoration Identity where
− src/full/Agda/Utils/Graph/AdjacencyMap.hs
@@ -1,390 +0,0 @@-{-# LANGUAGE DeriveFunctor #-}-{-# LANGUAGE GeneralizedNewtypeDeriving #-}-{-# LANGUAGE TupleSections #-}---- | Directed graphs (can of course simulate undirected graphs).------   Represented as adjacency maps.------   Each source node maps to a adjacency map, which is a map from---   target nodes to edges.------   This allows to get the outgoing edges in O(log n) time where---   @n@ is the number of nodes in the graph.  However, the set---   of incoming edges can only be obtained in O(n log n),---   or O(e) where @e@ is the total number of edges.---- used for positivity checker--module Agda.Utils.Graph.AdjacencyMap-  ( Graph(..)-  , invariant-  , edges-  , edgesFrom-  , nodes-  , filterEdges-  , fromNodes-  , fromList-  , empty-  , singleton-  , insert-  , removeNode-  , removeEdge-  , union-  , unions-  , lookup-  , neighbours-  , sccs'-  , sccs-  , acyclic-  , transitiveClosure1-  , transitiveClosure-  , findPath-  , allPaths-  , nodeIn-  , edgeIn-  , tests-  )-  where--import Prelude hiding (lookup)--import Control.Applicative ((<$>), (<*>))--import Data.Function-import qualified Data.Graph as Graph-import qualified Data.List as List-import qualified Data.Map as Map-import Data.Map (Map)-import qualified Data.Maybe as Maybe-import Data.Maybe (maybeToList)-import qualified Data.Set as Set-import Data.Set (Set)--import Agda.Utils.Function (iterateUntil)-import Agda.Utils.Functor (for)-import Agda.Utils.QuickCheck-import Agda.Utils.SemiRing-import Agda.Utils.TestHelpers---- | @Graph n e@ is a directed graph with nodes in @n@ and edges in @e@.------   Only one edge between any two nodes.------   Represented as "adjacency list", or rather, adjacency map.---   This allows to get all outgoing edges for a node in @O(log n)@ time---   where @n@ is the number of nodes of the graph.---   Incoming edges can only be computed in @O(n + e)@ time where---   @e@ is the number of edges.-newtype Graph n e = Graph { unGraph :: Map n (Map n e) }-  deriving (Eq, Functor, Show)---- | A structural invariant for the graphs.------   The set of nodes is obtained by @Map.keys . unGraph@---   meaning that each node, be it only the target of an edge,---   must be assigned an adjacency map, albeit it could be empty.------   See 'singleton'.-invariant :: Ord n => Graph n e -> Bool-invariant g = connectedNodes `Set.isSubsetOf` nodes g-  where-  connectedNodes =-    Set.fromList $ concatMap (\(a, b, _) -> [a, b]) $ edges g---- | Turn a graph into a list of edges.  @O(n + e)@--edges :: Ord n => Graph n e -> [(n, n, e)]-edges g = [ (from, to, w) | (from, es) <- Map.assocs (unGraph g)-                          , (to, w)    <- Map.assocs es ]--- edges g = concatMap onNode $ Map.assocs $ unGraph g---   where---     onNode (from, es) = map (onNeighbour from) $ Map.assocs es---     onNeighbour from (to, w) = (from, to, w)---- | All edges originating in the given nodes.---   (I.e., all outgoing edges for the given nodes.)------   Roughly linear in the length of the result list @O(result)@.--edgesFrom :: Ord n => Graph n e -> [n] -> [(n, n, e)]-edgesFrom (Graph g) ns =-  [ (n1, n2, w) | n1 <- ns-                , m <- maybeToList $ Map.lookup n1 g-                , (n2, w) <- Map.assocs m-                ]-  -- concat $-  -- Maybe.catMaybes $-  -- map (\n1 -> fmap (\m -> map (\(n2, w) -> (n1, n2, w)) (Map.assocs m))-  --                  (Map.lookup n1 g))-  --     ns---- | Returns all the nodes in the graph.  @O(n)@.--nodes :: Ord n => Graph n e -> Set n-nodes g = Map.keysSet (unGraph g)---- | Constructs a completely disconnected graph containing the given---   nodes. @O(n)@.--fromNodes :: Ord n => [n] -> Graph n e-fromNodes = Graph . Map.fromList . map (, Map.empty)--prop_nodes_fromNodes :: Ord n => [n] -> Bool-prop_nodes_fromNodes ns = nodes (fromNodes ns) == Set.fromList ns---- | Constructs a graph from a list of edges.  O(e)--fromList :: (SemiRing e, Ord n) => [(n, n, e)] -> Graph n e-fromList es = unions [ singleton a b w | (a, b, w) <- es ]---- | Empty graph (no nodes, no edges).--empty :: Graph n e-empty = Graph Map.empty---- | A graph with two nodes and a single connecting edge.--singleton :: Ord n => n -> n -> e -> Graph n e-singleton a b w =-  Graph $ Map.insert a (Map.singleton b w) $ Map.singleton b Map.empty---- | Insert an edge into the graph.---- Andreas, 2014-02-12 For my taste, this relies a bit--- too much on the efficieny of union.--- In Data.Map (hedge union) it is described as linear in g, which is--- probably too pessimistic.--- I prefer an implementation of insert in terms of Map.insertWith.--insert :: (SemiRing e, Ord n) => n -> n -> e -> Graph n e -> Graph n e-insert from to w g = union g (singleton from to w)---- | Removes the given node, and all corresponding edges, from the--- graph.--removeNode :: Ord n => n -> Graph n e -> Graph n e-removeNode n (Graph g) =-  Graph $ Map.delete n $ Map.map (Map.delete n) g---- | @removeEdge n1 n2 g@ removes the edge going from @n1@ to @n2@, if--- any.--removeEdge :: Ord n => n -> n -> Graph n e -> Graph n e-removeEdge n1 n2 (Graph g) =-  Graph $ Map.adjust (Map.delete n2) n1 g--filterEdges :: Ord n => (e -> Bool) -> Graph n e -> Graph n e-filterEdges f (Graph g) = Graph $ Map.mapMaybe filt g-  where filt m =-         let m' = Map.filter f m-         in  if Map.null m' then Nothing else Just m'--union :: (SemiRing e, Ord n) => Graph n e -> Graph n e -> Graph n e-union (Graph g1) (Graph g2) =-  Graph $ Map.unionWith (Map.unionWith oplus) g1 g2--unions :: (SemiRing e, Ord n) => [Graph n e] -> Graph n e-unions = List.foldl' union empty--lookup :: Ord n => n -> n -> Graph n e -> Maybe e-lookup a b g = Map.lookup b =<< Map.lookup a (unGraph g)--neighbours :: Ord n => n -> Graph n e -> [(n, e)]-neighbours a g = maybe [] Map.assocs $ Map.lookup a $ unGraph g---- | The graph's strongly connected components, in reverse topological--- order.--sccs' :: Ord n => Graph n e -> [Graph.SCC n]-sccs' (Graph g) =-  Graph.stronglyConnComp [ (n, n, Map.keys m) | (n, m) <- Map.assocs g ]---- sccs' :: Ord n => Graph n e -> [Graph.SCC n]--- sccs' g =---   Graph.stronglyConnComp .---   map (\n -> (n, n, map fst $ neighbours n g)) .---   Set.toList .---   nodes $---   g---- | The graph's strongly connected components, in reverse topological--- order.--sccs :: Ord n => Graph n e -> [[n]]-sccs = map Graph.flattenSCC . sccs'---- | Returns @True@ iff the graph is acyclic.--acyclic :: Ord n => Graph n e -> Bool-acyclic = all isAcyclic . sccs'-  where-  isAcyclic Graph.AcyclicSCC{} = True-  isAcyclic Graph.CyclicSCC{}  = False---- | Computes the transitive closure of the graph.------ Note that this algorithm is not guaranteed to be correct (or--- terminate) for arbitrary semirings.------ This function operates on the entire graph at once.--transitiveClosure1 :: (Eq e, SemiRing e, Ord n) =>-                      Graph n e -> Graph n e-transitiveClosure1 = iterateUntil (==) growGraph  where--  -- @growGraph g@ unions @g@ with @(s --> t) `compose` g@ for each-  -- edge @s --> t@ in @g@-  growGraph g = List.foldl' union g $ for (edges g) $ \ (s, t, e) ->-    case Map.lookup t (unGraph g) of-      Just es -> Graph $ Map.singleton s $ Map.map (otimes e) es-      Nothing -> empty---- transitiveClosure1 = loop---   where---   loop g | g == g'   = g---          | otherwise = loop g'---     where g' = growGraph g----   growGraph g = List.foldl' union g $ map newEdges $ edges g---     where---     newEdges (a, b, w) = case Map.lookup b (unGraph g) of---       Just es -> Graph $ Map.singleton a $ Map.map (otimes w) es---       Nothing -> empty---- | Computes the transitive closure of the graph.------ Note that this algorithm is not guaranteed to be correct (or--- terminate) for arbitrary semirings.------ This function operates on one strongly connected component at a--- time.--transitiveClosure :: (Eq e, SemiRing e, Ord n) => Graph n e -> Graph n e-transitiveClosure g = List.foldl' extend g $ sccs' g-  where-  edgesFrom' g ns = (g, edgesFrom g ns)--  extend g (Graph.AcyclicSCC scc) = fst $ growGraph [scc] (edgesFrom' g [scc])-  extend g (Graph.CyclicSCC  scc) = loop (edgesFrom' g scc)-    where-    loop g | equal g g' = fst g-           | otherwise  = loop g'-      where g' = growGraph scc g--    equal = (==) `on` snd--  growGraph scc (g, es) =-    edgesFrom' (List.foldl' union g $ map newEdges es) scc-    where-    newEdges (a, b, w) = case Map.lookup b (unGraph g) of-      Just es -> Graph $ Map.singleton a $ Map.map (otimes w) es-      Nothing -> empty--prop_transitiveClosure :: (Eq e, SemiRing e, Ord n) => Graph n e -> Property-prop_transitiveClosure g = label sccInfo $-  transitiveClosure g == transitiveClosure1 g-  where-  sccInfo =-    (if noSCCs <= 3 then "   " ++ show noSCCs-                    else ">= 4") ++-    " strongly connected component(s)"-    where noSCCs = length (sccs g)--findPath :: (SemiRing e, Ord n) => (e -> Bool) -> n -> n -> Graph n e -> Maybe e-findPath good a b g = case filter good $ allPaths good a b g of-  []    -> Nothing-  w : _ -> Just w---- | @allPaths classify a b g@ returns a list of pathes (accumulated edge weights)---   from node @a@ to node @b@ in @g@.---   Alternative intermediate pathes are only considered if they---   are distinguished by the @classify@ function.-allPaths :: (SemiRing e, Ord n, Ord c) => (e -> c) -> n -> n -> Graph n e -> [e]-allPaths classify a b g = paths Set.empty a-  where-    paths visited a = concatMap step $ neighbours a g-      where-        step (c, w)-          | Set.member tag visited = []-          | otherwise = found ++-                        map (otimes w)-                          (paths (Set.insert tag visited) c)-          where tag = (c, classify w)-                found | b == c    = [w]-                      | otherwise = []----------------------------------------------------------------------------- Utilities used to test the code above--instance (Ord n, SemiRing e, Arbitrary n, Arbitrary e) =>-         Arbitrary (Graph n e) where-  arbitrary = do-    nodes <- sized $ \n -> resize (isqrt n) arbitrary-    edges <- mapM (\(n1, n2) -> (n1, n2,) <$> arbitrary) =<<-                  listOfElements ((,) <$> nodes <*> nodes)-    return (fromList edges `union` fromNodes nodes)-    where-    isqrt :: Int -> Int-    isqrt = round . sqrt . fromIntegral--  shrink g =-    [ removeNode n g     | n <- Set.toList $ nodes g ] ++-    [ removeEdge n1 n2 g | (n1, n2, _) <- edges g ]---- | Generates a node from the graph. (Unless the graph is empty.)--nodeIn :: (Ord n, Arbitrary n) => Graph n e -> Gen n-nodeIn g = elementsUnlessEmpty (Set.toList $ nodes g)---- | Generates an edge from the graph. (Unless the graph contains no--- edges.)--edgeIn :: (Ord n, Arbitrary n, Arbitrary e) =>-          Graph n e -> Gen (n, n, e)-edgeIn g = elementsUnlessEmpty (edges g)---- | Used to test 'transitiveClosure' and 'transitiveClosure1'.--type G = Graph Int E---- | Used to test 'transitiveClosure' and 'transitiveClosure1'.--newtype E = E { unE :: Bool }-  deriving (Arbitrary, Eq, Show)--instance SemiRing E where-  oplus  (E x) (E y) = E (x || y)-  otimes (E x) (E y) = E (x && y)---- | All tests.--tests :: IO Bool-tests = runTests "Agda.Utils.Graph"--    -- Make sure that the invariant is established/preserved.-  [ quickCheck' invariant'-  , quickCheck' (all invariant' . shrink)-  , quickCheck' (invariant' . fromNodes)-  , quickCheck' (invariant' . fromList)-  , quickCheck' (invariant' empty)-  , quickCheck' (\n1 n2 w -> invariant' (singleton n1 n2 w))-  , quickCheck' (\n1 n2 w g -> invariant' (insert n1 n2 w g))-  , quickCheck' (\g n -> invariant' (removeNode n g))-  , quickCheck' (\g -> forAll (nodeIn g) $ \n ->-                    invariant' (removeNode n g))-  , quickCheck' (\g n1 n2 -> invariant' (removeEdge n1 n2 g))-  , quickCheck' (\g -> forAll (edgeIn g) $ \(n1, n2, _) ->-                    invariant' (removeEdge n1 n2 g))-  , quickCheck' (\g1 g2 -> invariant' (union g1 g2))-  , quickCheck' (invariant' . unions)-  , quickCheck' (invariant' . transitiveClosure1)-  , quickCheck' (invariant' . transitiveClosure)--    -- Other properties.-  , quickCheck' (prop_nodes_fromNodes :: [Int] -> Bool)-  , quickCheck' (prop_transitiveClosure :: G -> Property)-  ]-  where-  invariant' :: G -> Bool-  invariant' = invariant
src/full/Agda/Utils/Graph/AdjacencyMap/Unidirectional.hs view
@@ -1,8 +1,11 @@-{-# LANGUAGE DeriveFunctor #-}-{-# LANGUAGE DoAndIfThenElse #-}-{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE BangPatterns               #-}+{-# LANGUAGE CPP                        #-}+{-# LANGUAGE DeriveFunctor              #-}+{-# LANGUAGE DoAndIfThenElse            #-}+{-# LANGUAGE FlexibleInstances          #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-}-{-# LANGUAGE TupleSections #-}+{-# LANGUAGE ScopedTypeVariables        #-}+{-# LANGUAGE TupleSections              #-}  -- | Directed graphs (can of course simulate undirected graphs). --@@ -13,6 +16,9 @@ -- --   This allows to get outgoing edges in O(log n) time where --   @n@ is the number of nodes in the graph.+--+--   However, the set of incoming edges can only be obtained in+--   @O(n log n)@ or @O(e)@ where @e@ is the total number of edges.  module Agda.Utils.Graph.AdjacencyMap.Unidirectional   ( Graph(..)@@ -23,13 +29,15 @@   , edgesTo   , diagonal   , lookup-  , neighbours+  , neighbours, neighboursMap   , sourceNodes, targetNodes   , Nodes(..)   , computeNodes, nodes   , fromNodes   , fromList, fromListWith   , toList+  , discrete+  , clean   , empty   , singleton   , insert, insertWith@@ -40,41 +48,62 @@   , removeEdge   , filterEdges   , unzip+  , mapWithEdge   , sccs'   , sccs+  , DAG(..)+  , dagInvariant+  , oppositeDAG+  , reachable+  , sccDAG'+  , sccDAG   , acyclic   , composeWith-  , transitiveClosure1-  , transitiveClosure+  , complete+  , gaussJordanFloydWarshallMcNaughtonYamadaReference+  , gaussJordanFloydWarshallMcNaughtonYamada   , findPath   , allPaths-  , nodeIn-  , edgeIn-  , tests+  -- , allTrails  -- Exponential, don't use!  See issue 1612.   )   where -import Prelude hiding (lookup, unzip)+import Prelude hiding (lookup, unzip, null) -import Control.Applicative ((<$>), (<*>))+import Control.Applicative hiding (empty)+import Control.Monad +import qualified Data.Array.IArray as Array import Data.Function import qualified Data.Graph as Graph+import Data.IntMap.Strict (IntMap)+import qualified Data.IntMap.Strict as IntMap+import qualified Data.IntSet as IntSet import qualified Data.List as List-import qualified Data.Map as Map-import Data.Map (Map)+import qualified Data.Map.Strict as Map+import Data.Map.Strict (Map) import qualified Data.Maybe as Maybe-import Data.Maybe (maybeToList)+import Data.Maybe (maybeToList, fromMaybe, catMaybes) import qualified Data.Set as Set import Data.Set (Set)+import qualified Data.Tree as Tree -import Agda.Utils.Function (iterateUntil)-import Agda.Utils.Functor (for)+import Test.QuickCheck hiding (label)++import Agda.Utils.Function+import Agda.Utils.Functor import Agda.Utils.List (headMaybe)-import Agda.Utils.QuickCheck as QuickCheck+import Agda.Utils.Null (Null(null))+import qualified Agda.Utils.Null as Null import Agda.Utils.SemiRing+import Agda.Utils.Singleton (Singleton)+import qualified Agda.Utils.Singleton as Singleton import Agda.Utils.TestHelpers+import Agda.Utils.Tuple +#include "undefined.h"+import Agda.Utils.Impossible+ -- | @Graph s t e@ is a directed graph with --   source nodes in @s@ --   target nodes in @t@@@ -86,6 +115,9 @@ --   Represented as "adjacency list", or rather, adjacency map. --   This allows to get all outgoing edges for a node --   in @O(log n)@ time where @n@ is the number of nodes of the graph.+--+--   Incoming edges can only be computed in @O(n + e)@ time where+--   @e@ is the number of edges.  newtype Graph s t e = Graph   { graph :: Map s (Map t e) -- ^ Forward edges.@@ -160,10 +192,11 @@ neighbours :: (Ord s, Ord t) => s -> Graph s t e -> [(t, e)] neighbours s (Graph g) = maybe [] Map.assocs $ Map.lookup s g -prop_neighbours :: (Ord s, Ord t, Eq e) => s -> Graph s t e -> Bool-prop_neighbours s g =-  neighbours s g == map (\ (Edge s t e) -> (t, e)) (edgesFrom g [s])+-- | Get a list of outgoing edges with target. +neighboursMap :: (Ord s, Ord t) => s -> Graph s t e -> Map t e+neighboursMap s (Graph g) = fromMaybe Map.empty $ Map.lookup s g+ -- * Node queries  -- | Returns all the nodes with outgoing edges.  @O(n)@.@@ -208,9 +241,6 @@ fromNodes :: Ord n => [n] -> Graph n n e fromNodes ns = Graph $ Map.fromList $ map (, Map.empty) ns -prop_nodes_fromNodes :: Ord n => [n] -> Bool-prop_nodes_fromNodes ns = sourceNodes (fromNodes ns) == Set.fromList ns- -- | Constructs a graph from a list of edges.  O(e log n) -- --   Later edges overwrite earlier edges.@@ -230,6 +260,20 @@ toList :: (Ord s, Ord t) => Graph s t e -> [Edge s t e] toList (Graph g) = [ Edge s t a | (s,m) <- Map.assocs g, (t,a) <- Map.assocs m ] +-- | Check whether the graph is discrete (no edges).+--   This could be seen as an empty graph.+--   Worst-case (is discrete): @O(e)@.+discrete :: Null e => Graph s t e -> Bool+discrete = all' (all' null) . graph+  where all' p = List.all p . Map.elems++-- | Remove 'Null' edges.+clean :: (Ord s, Ord t, Null e) => Graph s t e -> Graph s t e+clean = Graph . filt . fmap filt . graph+  where+    filt :: (Ord k, Null a) => Map k a -> Map k a+    filt = Map.fromAscList . List.filter (not . null . snd) . Map.toAscList+ -- | Empty graph (no nodes, no edges).  empty :: Graph s t e@@ -276,17 +320,6 @@ unionsWith :: (Ord s, Ord t) => (e -> e -> e) -> [Graph s t e] -> Graph s t e unionsWith f = List.foldl' (unionWith f) empty -prop_insertWith :: (Eq e, Ord s, Ord t) =>-                   (e -> e -> e) -> s -> t -> e -> Graph s t e -> Bool-prop_insertWith f s t e g =-  insertWith f s t e g == unionWith (flip f) g (singleton s t e)--{- This property only holds only if the edge is new.--prop_insert ::  (Ord s, Ord t) => s -> t -> e -> Graph s t e -> Bool-prop_insert s t e g = insert s t e g == union g (singleton s t e)--}- -- * Graph reversal  -- | The opposite graph (with all edges reversed).@@ -340,14 +373,24 @@ unzip :: Graph s t (e, e') -> (Graph s t e, Graph s t e') unzip g = (fst <$> g, snd <$> g) +-- | Maps over a graph under availability of positional information,+--   like 'Map.mapWithKey'.++mapWithEdge :: (Ord s, Ord t) => (Edge s t e -> e') -> Graph s t e -> Graph s t e'+mapWithEdge f (Graph g) = Graph $ flip Map.mapWithKey g $ \ s m ->+  flip Map.mapWithKey m $ \ t e -> f (Edge s t e)+ -- * Strongly connected components.  -- | The graph's strongly connected components, in reverse topological -- order.  sccs' :: Ord n => Graph n n e -> [Graph.SCC n]-sccs' (Graph g) =-  Graph.stronglyConnComp [ (n, n, Map.keys m) | (n, m) <- Map.assocs g ]+sccs' g =+  Graph.stronglyConnComp+    [ (n, n, map target (edgesFrom g [n]))+    | n <- Set.toList (nodes g)+    ]  -- | The graph's strongly connected components, in reverse topological -- order.@@ -355,6 +398,128 @@ sccs :: Ord n => Graph n n e -> [[n]] sccs = map Graph.flattenSCC . sccs' +-- | SCC DAGs.+--+-- The maps map SCC indices to and from SCCs/nodes.++data DAG n = DAG+  { dagGraph        :: Graph.Graph+  , dagComponentMap :: IntMap (Graph.SCC n)+  , dagNodeMap      :: Map n Int+  }++-- | 'DAG' invariant.++dagInvariant :: Ord n => DAG n -> Bool+dagInvariant g =+  Set.fromList (concatMap Graph.flattenSCC+                          (IntMap.elems (dagComponentMap g)))+    ==+  Map.keysSet (dagNodeMap g)+    &&+  IntSet.fromList (Map.elems (dagNodeMap g))+    ==+  IntMap.keysSet (dagComponentMap g)+    &&+  and [ n `elem` Graph.flattenSCC+                   (dagComponentMap g IntMap.! (dagNodeMap g Map.! n))+      | n <- Map.keys (dagNodeMap g)+      ]+    &&+  and [ dagNodeMap g Map.! n == i+      | i <- Graph.vertices (dagGraph g)+      , n <- Graph.flattenSCC (dagComponentMap g IntMap.! i)+      ]+    &&+  IntSet.fromList (Graph.vertices (dagGraph g))+    ==+  IntMap.keysSet (dagComponentMap g)+    &&+  all isAcyclic (Graph.scc (dagGraph g))+  where+  isAcyclic (Tree.Node r []) = not (r `elem` (dagGraph g Array.! r))+  isAcyclic _                = False++-- | The opposite DAG.++oppositeDAG :: DAG n -> DAG n+oppositeDAG g = g { dagGraph = Graph.transposeG (dagGraph g) }++-- | The nodes reachable from the given SCC.++reachable :: Ord n => DAG n -> Graph.SCC n -> [n]+reachable g scc = case scc of+  Graph.AcyclicSCC n      -> List.delete n (reachable' n)+  Graph.CyclicSCC (n : _) -> reachable' n+  Graph.CyclicSCC []      -> __IMPOSSIBLE__+  where+  lookup' g k = case IntMap.lookup k g of+    Nothing -> __IMPOSSIBLE__+    Just x  -> x++  lookup'' g k = case Map.lookup k g of+    Nothing -> __IMPOSSIBLE__+    Just x  -> x++  reachable' n =+    concatMap (Graph.flattenSCC . lookup' (dagComponentMap g)) $+    Graph.reachable (dagGraph g) (lookup'' (dagNodeMap g) n)++-- | Constructs a DAG containing the graph's strongly connected+-- components.++sccDAG' ::+  forall n e. Ord n+  => Graph n n e+  -> [Graph.SCC n]+     -- ^ The graph's strongly connected components.+  -> DAG n+sccDAG' g sccs = DAG theDAG componentMap secondNodeMap+  where+  components :: [(Int, Graph.SCC n)]+  components = zip [1..] sccs++  firstNodeMap :: Map n Int+  firstNodeMap = Map.fromList+    [ (n, i)+    | (i, c) <- components+    , n      <- Graph.flattenSCC c+    ]++  targets :: Int -> [n] -> [Int]+  targets i ns =+    IntSet.toList $ IntSet.fromList+      [ j+      | e <- edgesFrom g ns+      , let j = case Map.lookup (target e) firstNodeMap of+                  Nothing -> __IMPOSSIBLE__+                  Just j  -> j+      , j /= i+      ]++  (theDAG, _, toVertex) =+    Graph.graphFromEdges+      [ (i, i, targets i (Graph.flattenSCC c))+      | (i, c) <- components+      ]++  convertInt :: Int -> Graph.Vertex+  convertInt i = case toVertex i of+    Nothing -> __IMPOSSIBLE__+    Just i  -> i++  componentMap :: IntMap (Graph.SCC n)+  componentMap = IntMap.fromList (map (mapFst convertInt) components)++  secondNodeMap :: Map n Int+  secondNodeMap = fmap convertInt firstNodeMap++-- | Constructs a DAG containing the graph's strongly connected+-- components.++sccDAG :: Ord n => Graph n n e -> DAG n+sccDAG g = sccDAG' g (sccs' g)+ -- | Returns @True@ iff the graph is acyclic.  acyclic :: Ord n => Graph n n e -> Bool@@ -383,89 +548,156 @@       , (u, d) <- Map.assocs m'       ] --- | Computes the transitive closure of the graph.------ Note that this algorithm is not guaranteed to be correct (or--- terminate) for arbitrary semirings.+-- | Transitive closure ported from "Agda.Termination.CallGraph". ----- This function operates on the entire graph at once.+--   Relatively efficient, see Issue 1560. -transitiveClosure1 :: (Eq e, SemiRing e, Ord n) =>-                      Graph n n e -> Graph n n e-transitiveClosure1 = completeUntilWith (==) otimes oplus-{-- iterateUntil (==) growGraph  where+complete :: (Eq e, Null e, SemiRing e, Ord n) => Graph n n e -> Graph n n e+complete g = repeatWhile (mapFst (not . discrete) . combineNewOld' g) g+  where+    combineNewOld' new old = unzip $ unionWith comb new' old'+      where+      -- The following procedure allows us to check if anything new happened:+      -- Pair the composed graphs with an empty graph.+      -- The empty graph will remain empty.  We only need it due to the typing+      -- of Map.unionWith.+      new' = (,Null.empty) <$> composeWith otimes oplus new old+      -- Pair an empty graph with the old graph.+      old' = (Null.empty,) <$> old+      -- Combine the pairs.+      -- Update 'old' with 'new'.  This will be the new 'old'. No new 'new' if no change.+      comb (new, _) (_, old) = (if x == old then Null.empty else x, x)+        where x = old `oplus` new -  -- @growGraph g@ unions @g@ with @(s --> t) `compose` g@ for each-  -- edge @s --> t@ in @g@-  growGraph g = List.foldl' (unionWith oplus) g $ for (edges g) $ \ (Edge s t e) ->-    case Map.lookup t (graph g) of-      Just es -> Graph $ Map.singleton s $ Map.map (otimes e) es-      Nothing -> empty--}+-- | Version of 'complete' that produces a list of intermediate results+--   paired to the left with a difference that lead to the new intermediat result.+--+--   The last element in the list is the transitive closure, paired with the empty graph.+--+--   @complete g = snd $ last $ completeIter g@ +completeIter :: (Eq e, Null e, SemiRing e, Ord n) => Graph n n e -> [(Graph n n e, Graph n n e)]+completeIter g = iterWhile (not . discrete) (combineNewOld' g) g+  where+    combineNewOld' new old = unzip $ unionWith comb new' old'+      where+      -- The following procedure allows us to check if anything new happened:+      -- Pair the composed graphs with an empty graph.+      -- The empty graph will remain empty.  We only need it due to the typing+      -- of Map.unionWith.+      new' = (,Null.empty) <$> composeWith otimes oplus new old+      -- Pair an empty graph with the old graph.+      old' = (Null.empty,) <$> old+      -- Combine the pairs.+      -- Update 'old' with 'new'.  This will be the new 'old'. No new 'new' if no change.+      comb (new, _) (_, old) = (if x == old then Null.empty else x, x)+        where x = old `oplus` new+ -- | Computes the transitive closure of the graph. ----- Note that this algorithm is not guaranteed to be correct (or--- terminate) for arbitrary semirings.+-- Uses the Gauss-Jordan-Floyd-Warshall-McNaughton-Yamada algorithm+-- (as described by Russell O'Connor in \"A Very General Method of+-- Computing Shortest Paths\"+-- <http://r6.ca/blog/20110808T035622Z.html>), implemented using+-- matrices. ----- This function operates on the entire graph at once.+-- The resulting graph does not contain any zero edges.+--+-- This algorithm should be seen as a reference implementation. In+-- practice 'gaussJordanFloydWarshallMcNaughtonYamada' is likely to be+-- more efficient. -completeUntilWith :: (Ord n) => (Graph n n e -> Graph n n e -> Bool) ->-  (e -> e -> e) -> (e -> e -> e) -> Graph n n e -> Graph n n e-completeUntilWith done otimes oplus = iterateUntil done growGraph  where+gaussJordanFloydWarshallMcNaughtonYamadaReference ::+  forall n e. (Ord n, Eq e, StarSemiRing e) =>+  Graph n n e -> Graph n n e+gaussJordanFloydWarshallMcNaughtonYamadaReference g =+  toGraph (foldr step initialMatrix nodeIndices)+  where+  indicesAndNodes = zip [1..] $ Set.toList $ nodes g+  nodeMap         = Map.fromList $ map swap indicesAndNodes+  indexMap        = Map.fromList            indicesAndNodes -  -- @growGraph g@ unions @g@ with @(s --> t) `compose` g@ for each-  -- edge @s --> t@ in @g@-  growGraph g = List.foldl' (unionWith oplus) g $ for (edges g) $ \ (Edge s t e) ->-    case Map.lookup t (graph g) of-      Just es -> Graph $ Map.singleton s $ Map.map (otimes e) es-      Nothing -> empty+  noNodes      = Map.size nodeMap+  nodeIndices  = [1 .. noNodes]+  matrixBounds = ((1, 1), (noNodes, noNodes)) +  initialMatrix :: Array.Array (Int, Int) e+  initialMatrix =+    Array.accumArray+      oplus ozero+      matrixBounds+      [ ((nodeMap Map.! source e, nodeMap Map.! target e), label e)+      | e <- edges g+      ]++  rightStrictPair i !e = (i , e)++  step k !m =+    Array.array+      matrixBounds+      [ rightStrictPair+          (i, j)+          (oplus (m Array.! (i, j))+                 (otimes (m Array.! (i, k))+                         (otimes (ostar (m Array.! (k, k)))+                                 (m Array.! (k, j)))))+      | i <- nodeIndices, j <- nodeIndices+      ]++  toGraph m =+    fromList [ Edge (indexMap Map.! i) (indexMap Map.! j) e+             | ((i, j), e) <- Array.assocs m+             , e /= ozero+             ]+ -- | Computes the transitive closure of the graph. ----- Note that this algorithm is not guaranteed to be correct (or--- terminate) for arbitrary semirings.+-- Uses the Gauss-Jordan-Floyd-Warshall-McNaughton-Yamada algorithm+-- (as described by Russell O'Connor in \"A Very General Method of+-- Computing Shortest Paths\"+-- <http://r6.ca/blog/20110808T035622Z.html>), implemented using+-- 'Graph', and with some shortcuts: ----- This function operates on one strongly connected component (SCC)--- at a time.+-- * Zero edge differences are not added to the graph, thus avoiding+--   some zero edges. ----- For each SCC, it uses a saturation algorithm on state @(g, es)@--- where initially @es@ is the set of edges of the SCC and @g@ the graph.--- The algorithm finishes if @es@ has not changed in an iteration.--- At each step, all @es@ are composed with @g@, the resulting--- new graphs are unioned with @g@.  The new @es@ is then computed--- as the edges of the SCC in the new @g@.+-- * Strongly connected components are used to avoid computing some+--   zero edges. -transitiveClosure :: (Eq e, SemiRing e, Ord n) => Graph n n e -> Graph n n e-transitiveClosure g = List.foldl' extend g $ sccs' g+gaussJordanFloydWarshallMcNaughtonYamada ::+  forall n e. (Ord n, Eq e, StarSemiRing e) =>+  Graph n n e -> Graph n n e+gaussJordanFloydWarshallMcNaughtonYamada g = loop components g   where-  -- extend the graph by new edges generated from a scc-  -- until there are no-  extend g (Graph.AcyclicSCC scc) = fst $ growGraph [scc] (edgesFrom' [scc] g)-  extend g (Graph.CyclicSCC  scc) = fst $-    iterateUntil ((==) `on` snd) (growGraph scc) (edgesFrom' scc g)--  edgesFrom' ns g = (g, edgesFrom g ns)+  components = sccs' g+  forwardDAG = sccDAG' g components+  reverseDAG = oppositeDAG forwardDAG -  growGraph scc (g, es) = edgesFrom' scc $-    -- the new graph:-    List.foldl' (unionWith oplus) g $ for es $ \ (Edge s t e) ->-      case Map.lookup t (graph g) of-        Just es -> Graph $ Map.singleton s $ Map.map (e `otimes`) es-        Nothing -> empty+  loop :: [Graph.SCC n] -> Graph n n e -> Graph n n e+  loop []           !g = g+  loop (scc : sccs)  g =+    loop sccs (foldr step g (Graph.flattenSCC scc))+    where+    -- All nodes that are reachable from the SCC.+    canBeReached = reachable forwardDAG scc+    -- All nodes that can reach the SCC.+    canReach     = reachable reverseDAG scc --- | Correctness of the optimized algorithm that proceeds by SCC.+    step :: n -> Graph n n e -> Graph n n e+    step k !g =+      foldr (insertEdgeWith oplus) g+        [ Edge i j e+        | i <- canReach+        , j <- canBeReached+        , let e = otimes (lookup' i k) (starTimes (lookup' k j))+        , e /= ozero+        ]+      where+      starTimes = otimes (ostar (lookup' k k)) -prop_transitiveClosure :: (Eq e, SemiRing e, Ord n) => Graph n n e -> Property-prop_transitiveClosure g = QuickCheck.label sccInfo $-  transitiveClosure g == transitiveClosure1 g-  where-  sccInfo =-    (if noSCCs <= 3 then "   " ++ show noSCCs-                    else ">= 4") ++-    " strongly connected component(s)"-    where noSCCs = length (sccs g)+      lookup' s t = case lookup s t g of+        Nothing -> ozero+        Just e  -> e  -- | Find a path from a source node to a target node. --@@ -488,9 +720,123 @@       else if s' == t then e : recurse       else recurse +-- THE FOLLOWING IMPLEMENTATION OF allTrails is in practice worse+-- then the naive depth-first search with backtracking. +-- -- | A trail is a non-empty list of consecutive edges with no duplicate.+-- --   We store a set of edges for more efficient trail composition.+-- --+-- --   Invariants for @Trail tr s@:+-- --+-- --   1. nonempty+-- --   @not $ null tr@.+-- --+-- --   2. consecutive+-- --   @List.and $ zipWith (\ (Edge _ t1 _) (Edge s2 _ _) -> t1 == s2) tr (tail tr)@.+-- --+-- --   3. coherence+-- --   @Set.toAscList s == sort $ map (\ (Edges s t _) -> (s,t)) tr@.++-- data Trail n e = Trail { trail :: [Edge n n e], trailEdgeSet :: Set (n, n) }+--   deriving (Show)++-- instance (Eq n, Eq e) => Eq (Trail n e) where+--   (==) = (==) `on` trail++-- instance (Ord n, Ord e) => Ord (Trail n e) where+--   compare = compare `on` trail++-- singletonTrail :: Edge n n e -> Trail n e+-- singletonTrail e@(Edge s t _) = Trail [e] $ Set.singleton (s,t)++-- trailSource :: Trail n e -> n+-- trailSource (Trail (Edge s _ _ : _) _) = s+-- trailSource _ = __IMPOSSIBLE__++-- trailTarget :: Trail n e -> n+-- trailTarget (Trail (Edge _ t _ : _) _) = t+-- trailTarget _ = __IMPOSSIBLE__++-- -- | Precondition for @composeTrails t1 t2@:+-- --   @trailTarget t1 == trailSource t2@.+-- composeTrails :: (Ord n) => Trail n e -> Trail n e -> Maybe (Trail n e)+-- composeTrails (Trail t1 s1) (Trail t2 s2) =+--   if null (Set.intersection s1 s2) then Just $ Trail (t1 ++ t2) $ Set.union s1 s2+--   else Nothing++-- composeTrails_alt :: (Ord n) => Trail n e -> Trail n e -> Maybe (Trail n e)+-- composeTrails_alt t (Trail [] _) = Just t+-- composeTrails_alt (Trail [] _) t = Just t+-- composeTrails_alt (Trail t1 s1) (Trail t2 s2) =+--   foldr cons (return t2) t1 <&> \ t12 -> Trail t12 $ Set.union s1 s2+--   where+--     cons e@(Edge s t _) mt12 = do+--       t12 <- mt12+--       guard $ (s,t) `Set.notMember` s2+--       return $ e : t12++-- -- | A possibly empty set of trails with same source and same target.+-- --+-- --   Invariants for @Tails ts@:+-- --   Same source: @length (group (map trailSource ts)) == 1@.+-- --   Same target: @length (group (map trailTarget ts)) == 1@.++-- newtype Trails n e = Trails { trails :: Set (Trail n e) }+--   deriving (Eq, Ord, Show, Null, Singleton (Trail n e))++-- instance (Ord n, Ord e) => SemiRing (Trails n e) where+--   ozero = Null.empty+--   oone  = __IMPOSSIBLE__+--   oplus  (Trails t1s) (Trails t2s) = Trails $ Set.union t1s t2s+--   otimes (Trails t1s) (Trails t2s) = Trails $ Set.fromList $+--     catMaybes [ composeTrails t1 t2 | t1 <- Set.toList t1s, t2 <- Set.toList t2s ]++-- -- | We compute @allTrails@ by a transitive closure algorithm.+-- --   In practice, we are only interested in the first trail+-- --   with a specific property, so it is important+-- --   to compute @allTrails@ lazily.+-- --+-- --   We use a graph with edges labelled by 'Trails'.+-- allTrails :: forall e n. (Eq e, Ord e, SemiRing e, Ord n) =>+--   n -> n -> Graph n n e -> [e]+-- allTrails s t g = map collapse st+--   where+--     -- Construct a graph of singleton trails+--     init :: Graph n n (Trails n e)+--     init = mapWithEdge (Singleton.singleton . singletonTrail) g+--     -- Compute transitive closure iteratively and keep the diffs.+--     diffs = init : map fst (completeIter init)+--     -- Extract a sequence of trails from s to t from the diff sequence.+--     -- Each diff may contain several or no trails from s to t.+--     st    = concat $ map (maybe [] (Set.toList . trails) . lookup s t) diffs+--     -- Multiply the edge weights a long a trail.+--     collapse (Trail tr _) = foldr1 otimes $ map label tr++-- | @allTrails a b g@ returns all trails (walks where all edges are+-- distinct) from node @a@ to node @b@ in @g@. The trails are returned+-- in the form of accumulated edge weights.+--+-- This definition can perhaps be optimised through the use of+-- memoisation.+--+-- Andreas, 2015-07-21 Issue 1612: This function is worst-case exponential+-- as the @k@-complete graph has @k!@ many trails.  DON'T USE!++allTrails :: forall e n. (SemiRing e, Ord n) =>+             n -> n -> Graph n n e -> [e]+allTrails s t g = paths Set.empty s+  where+    paths :: Set (n, n) -> n -> [e]+    paths traversed s = do+      (s', e) <- neighbours s g+      let edge    = (s, s')+          recurse = (e `otimes`) <$> paths (Set.insert edge traversed) s'+      if edge `Set.member` traversed then []+      else if s' == t then e : recurse+      else recurse+ --------------------------------------------------------------------------- Utilities used to test the code above+-- Generators  instance (Arbitrary s, Arbitrary t, Arbitrary e) => Arbitrary (Edge s t e) where   arbitrary = Edge <$> arbitrary <*> arbitrary <*> arbitrary@@ -501,10 +847,14 @@ instance (Ord n, SemiRing e, Arbitrary n, Arbitrary e) =>          Arbitrary (Graph n n e) where   arbitrary = do-    nodes <- sized $ \ n -> resize (isqrt n) arbitrary+    nodes <- sized $ \ n -> resize (2 * isqrt n) arbitrary     edges <- mapM (\ (n1, n2) -> Edge n1 n2 <$> arbitrary) =<<                   listOfElements ((,) <$> nodes <*> nodes)-    return (fromList edges `union` fromNodes nodes)+    let g1 = fromList edges+        g2 = g1 `union` fromNodes nodes+    elements [ g1  -- Does not contain empty outermost node maps.+             , g2  -- May contain empty outermost node maps.+             ]     where     isqrt :: Int -> Int     isqrt = round . sqrt . fromIntegral@@ -512,52 +862,3 @@   shrink g =     [ removeNode n g     | n <- Set.toList $ nodes g ] ++     [ removeEdge n1 n2 g | Edge n1 n2 _ <- edges g ]---- | Generates a node from the graph. (Unless the graph is empty.)--nodeIn :: (Ord n, Arbitrary n) => Graph n n e -> Gen n-nodeIn g = elementsUnlessEmpty (Set.toList $ nodes g)---- | Generates an edge from the graph. (Unless the graph contains no--- edges.)--edgeIn :: (Ord n, Arbitrary n, Arbitrary e) =>-          Graph n n e -> Gen (Edge n n e)-edgeIn g = elementsUnlessEmpty (edges g)---- | Sample graph type used to test 'transitiveClosure' and 'transitiveClosure1'.--type G = Graph N N E---- | Sample node type used to test 'transitiveClosure' and 'transitiveClosure1'.--newtype N = N (Positive Int)-  deriving (Arbitrary, Eq, Ord)--n :: Int -> N-n = N . Positive--instance Show N where-  show (N (Positive n)) = "n " ++ show n---- | Sample edge type used to test 'transitiveClosure' and 'transitiveClosure1'.--newtype E = E Bool-  deriving (Arbitrary, Eq, Show)---- instance Show E where---   show = show . unE--instance SemiRing E where-  oplus  (E x) (E y) = E (x || y)-  otimes (E x) (E y) = E (x && y)---- | All tests.--tests :: IO Bool-tests = runTests "Agda.Utils.Graph.AdjacencyMap.Unidirectional"-  -- Other properties.-  [ quickCheck' (prop_nodes_fromNodes :: [Int] -> Bool)-  , quickCheck' (prop_transitiveClosure :: G -> Property)-  ]-
+ src/full/Agda/Utils/Graph/AdjacencyMap/Unidirectional/Tests.hs view
@@ -0,0 +1,372 @@+{-# OPTIONS_GHC -fno-warn-missing-signatures #-}++{-# LANGUAGE CPP #-}+{-# LANGUAGE DoAndIfThenElse #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE NoMonomorphismRestriction #-}+{-# LANGUAGE TemplateHaskell #-}++-- | Properties for graph library.++module Agda.Utils.Graph.AdjacencyMap.Unidirectional.Tests (tests) where++import Prelude hiding (null)++import Control.Monad++import Data.Function+import qualified Data.Graph as Graph+import qualified Data.List as List+import Data.Maybe+import Data.Map (Map)+import qualified Data.Map as Map+import Data.Set (Set)+import qualified Data.Set as Set++import Test.QuickCheck as QuickCheck++import Agda.TypeChecking.Positivity.Occurrence hiding (tests)++import Agda.Utils.Function (iterateUntil)+import Agda.Utils.Functor+import Agda.Utils.Graph.AdjacencyMap.Unidirectional as Graph+import Agda.Utils.List (distinct)+import Agda.Utils.Null as Null+import Agda.Utils.SemiRing+import Agda.Utils.Singleton (Singleton)+import qualified Agda.Utils.Singleton as Singleton+import Agda.Utils.TestHelpers++#include "undefined.h"+import Agda.Utils.Impossible++------------------------------------------------------------------------+-- * Generating random graphs+------------------------------------------------------------------------++-- | Generates a node from the graph. (Unless the graph is empty.)++nodeIn :: (Ord n, Arbitrary n) => Graph n n e -> Gen n+nodeIn g = elementsUnlessEmpty (Set.toList $ nodes g)++-- | Generates an edge from the graph. (Unless the graph contains no+-- edges.)++edgeIn :: (Ord n, Arbitrary n, Arbitrary e) =>+          Graph n n e -> Gen (Edge n n e)+edgeIn g = elementsUnlessEmpty (edges g)++-- | Sample graph type used to test some graph algorithms.++type G = Graph N N E++-- | Sample edge type used to test some graph algorithms.++type E = Occurrence++-- | Sample node type used to test some graph algorithms.++newtype N = N (Positive Int)+  deriving (Arbitrary, Eq, Ord)++n :: Int -> N+n = N . Positive++instance Show N where+  show (N (Positive n)) = "n " ++ show n++-- | 'gaussJordanFloydWarshallMcNaughtonYamada' can be used to check+-- if any two nodes in a graph are connected.++data Connected = Disconnected | Connected+  deriving (Eq, Show)++instance SemiRing Connected where+  ozero = Disconnected+  oone  = Connected++  Disconnected `oplus` c = c+  Connected    `oplus` _ = Connected++  Disconnected `otimes` _ = Disconnected+  Connected    `otimes` c = c++instance StarSemiRing Connected where+  ostar _ = Connected++connectivityGraph :: Ord n => Graph n n e -> Graph n n Connected+connectivityGraph =+  gaussJordanFloydWarshallMcNaughtonYamada .+  fmap (const oone)++connected :: Ord n => Graph n n Connected -> n -> n -> Bool+connected g i j = Graph.lookup i j g == Just Connected++------------------------------------------------------------------------+-- * Graph properties+------------------------------------------------------------------------++-- prop_neighbours :: (Ord s, Ord t, Eq e) => s -> Graph s t e -> Bool+prop_neighbours :: N -> G -> Bool+prop_neighbours s g =+  neighbours s g == map (\ (Edge s t e) -> (t, e)) (edgesFrom g [s])++-- prop_nodes_fromNodes :: Ord n => [n] -> Bool+prop_nodes_fromNodes :: [N] -> Bool+prop_nodes_fromNodes ns = sourceNodes (fromNodes ns) == Set.fromList ns++prop_clean_discrete :: G -> Bool+prop_clean_discrete g =+  discrete g == (null . graph . clean) g++-- prop_insertWith :: (Eq e, Ord s, Ord t) =>+--                    (e -> e -> e) -> s -> t -> e -> Graph s t e -> Bool+prop_insertWith :: (E -> E -> E) -> N -> N -> E -> G -> Bool+prop_insertWith f s t e g =+  insertWith f s t e g == unionWith (flip f) g (singleton s t e)++-- -- This property only holds only if the edge is new.+-- prop_insert ::  (Ord s, Ord t) => s -> t -> e -> Graph s t e -> Bool+-- prop_insert s t e g = insert s t e g == union g (singleton s t e)++prop_sccs' :: G -> Bool+prop_sccs' g =+  nodes g == Set.fromList (concat components)+    &&+  all distinct components+    &&+  all (not . null) components+    &&+  disjoint (map Set.fromList components)+    &&+  all stronglyConnected components'+    &&+  noMissingStronglyConnectedNodes components+    &&+  reverseTopologicalOrder+  where+  components' = sccs' g+  components  = map Graph.flattenSCC components'++  disjoint []       = True+  disjoint (s : ss) = all (Set.null . Set.intersection s) ss+                        &&+                      disjoint ss++  connected' = connected (connectivityGraph g)++  stronglyConnected (Graph.AcyclicSCC n) = not (connected' n n)+  stronglyConnected (Graph.CyclicSCC ns) = and+    [ connected' i j+    | i <- ns+    , j <- ns+    ]++  noMissingStronglyConnectedNodes []         = True+  noMissingStronglyConnectedNodes (ns : nss) =+    and [ not (connected' j i && connected' i j)+        | i <- ns+        , j <- concat nss+        ]+      &&+    noMissingStronglyConnectedNodes nss++  reverseTopologicalOrder = and+    [ component i <= component j+    | Edge i j _ <- edges g+    ]+    where+    component k =+      head [ i+           | (i, ns) <- zip [1..] (reverse components)+           , k `elem` ns+           ]++prop_sccDAG :: G -> Bool+prop_sccDAG g =+  dagInvariant dag+    &&+  nodes g == Map.keysSet (dagNodeMap dag)+  where+  dag = sccDAG g++prop_oppositeDAG :: G -> Bool+prop_oppositeDAG g =+  dagInvariant (oppositeDAG (sccDAG g))++-- | Computes the transitive closure of the graph.+--+-- Note that this algorithm is not guaranteed to be correct (or+-- terminate) for arbitrary semirings.+--+-- This function operates on the entire graph at once.++transitiveClosure1 :: (Eq e, SemiRing e, Ord n) =>+                      Graph n n e -> Graph n n e+transitiveClosure1 = completeUntilWith (==) otimes oplus++-- | Computes the transitive closure of the graph.+--+-- Note that this algorithm is not guaranteed to be correct (or+-- terminate) for arbitrary semirings.+--+-- This function operates on the entire graph at once.++completeUntilWith :: (Ord n) => (Graph n n e -> Graph n n e -> Bool) ->+  (e -> e -> e) -> (e -> e -> e) -> Graph n n e -> Graph n n e+completeUntilWith done otimes oplus = iterateUntil done growGraph  where++  -- @growGraph g@ unions @g@ with @(s --> t) `compose` g@ for each+  -- edge @s --> t@ in @g@+  growGraph g = List.foldl' (unionWith oplus) g $ for (edges g) $ \ (Edge s t e) ->+    case Map.lookup t (graph g) of+      Just es -> Graph $ Map.singleton s $ Map.map (otimes e) es+      Nothing -> Graph.empty++-- | Equality modulo empty edges.+(~~) :: (Eq e, Ord s, Ord t, Null e) => Graph s t e -> Graph s t e -> Bool+(~~) = (==) `on` clean++prop_gaussJordanFloydWarshallMcNaughtonYamadaReference :: G -> Bool+prop_gaussJordanFloydWarshallMcNaughtonYamadaReference g =+  gaussJordanFloydWarshallMcNaughtonYamadaReference g ~~+  transitiveClosure1 g++prop_gaussJordanFloydWarshallMcNaughtonYamada :: G -> Property+prop_gaussJordanFloydWarshallMcNaughtonYamada g =+  QuickCheck.label sccInfo $+    gaussJordanFloydWarshallMcNaughtonYamada g ~~ transitiveClosure1 g+  where+  sccInfo =+    (if noSCCs <= 3 then "   " ++ show noSCCs+                    else ">= 4") +++    " strongly connected component(s)"+    where noSCCs = length (sccs g)++prop_complete :: G -> Bool+prop_complete g =+  complete g ~~ transitiveClosure1 g++-- Andreas, 2015-07-21 Issue 1612:+-- May take forever due to exponential time of allTrails.+--+-- prop_allTrails_existence :: Property+-- prop_allTrails_existence =+--   forAll (scale (`div` 2) arbitrary :: Gen G) $ \g ->+--   forAll (nodeIn g) $ \i ->+--   forAll (nodeIn g) $ \j ->+--     null (allTrails i j g)+--       ==+--     not (connected (connectivityGraph g) i j)++-- | The 'Integer's should be non-negative.++data ExtendedNatural = Finite Integer | Infinite+  deriving (Eq, Ord, Show)++instance SemiRing ExtendedNatural where+  ozero = Finite 0+  oone  = Finite 1++  oplus (Finite m) (Finite n) = Finite (m + n)+  oplus Infinite   _          = Infinite+  oplus _          Infinite   = Infinite++  otimes (Finite m) (Finite n) = Finite (m * n)+  otimes (Finite 0) _          = Finite 0+  otimes _          (Finite 0) = Finite 0+  otimes Infinite   _          = Infinite+  otimes _          Infinite   = Infinite++instance StarSemiRing ExtendedNatural where+  ostar (Finite 0) = Finite 1+  ostar _          = Infinite+++-- Andreas, 2015-07-21 Issue 1612:+-- May take forever due to exponential time of allTrails.+--+-- prop_allTrails_number :: Property+-- prop_allTrails_number =+--   forAll (scale (`div` 2) arbitrary :: Gen G) $ \g ->+--   forAll (nodeIn g) $ \i ->+--   forAll (nodeIn g) $ \j ->+--     Finite (List.genericLength (allTrails i j g))+--       <=+--     case Graph.lookup i j+--            (gaussJordanFloydWarshallMcNaughtonYamada+--               (fmap (const oone) g)) of+--       Just n  -> n+--       Nothing -> Finite 0++-- Node 10 is unreachable, so @allTrails _ 10 g1612@ takes forever+g1612 :: Graph N N E+g1612 = Graph $ Map.fromList+  [ (n  1,Map.fromList [(n 1,Unused   ),(n  9,StrictPos),(n 12,JustPos),(n 15,JustPos)])+  , (n  3,Map.fromList [(n 3,Unused   ),(n  8,StrictPos)])+  , (n  8,Map.fromList [(n 1,GuardPos ),(n  3,Mixed    ),(n 8,Unused),(n 9,JustPos),(n 11,StrictPos),(n 12,GuardPos),(n 15,JustPos)])+  , (n  9,Map.fromList [(n 1,JustNeg  ),(n  8,Mixed    ),(n 9,JustNeg),(n 11,StrictPos),(n 12,StrictPos)])+  , (n 10,Map.fromList [(n 1,JustPos  ),(n  8,StrictPos)])+  , (n 11,Map.fromList [(n 1,StrictPos),(n  8,JustNeg  ),(n 9,JustNeg),(n 11,JustNeg)])+  , (n 12,Map.fromList [(n 1,JustPos  ),(n 15,StrictPos)])+  , (n 15,Map.fromList [(n 1,JustPos  ),(n  8,GuardPos ),(n 11,Mixed),(n 12,Mixed)])+  ]++-- t1612t = allTrails (n 9) (n 10) g1612 -- FOREVER++g1612a = Graph $ Map.fromList+  [(n  1,Map.fromList [(n 2,JustNeg),(n 11,Mixed)])+  ,(n  2,Map.fromList [(n 1,JustNeg),(n 2,GuardPos),(n 4,GuardPos),(n 8,Unused),(n 11,Unused)])+  ,(n  4,Map.fromList [(n 2,GuardPos),(n 8,JustPos),(n 12,GuardPos)])+  ,(n  6,Map.fromList [(n 1,StrictPos),(n 11,Unused),(n 12,JustNeg)])+  ,(n  8,Map.fromList [(n 1,GuardPos),(n 4,JustPos),(n 8,JustPos)])+  ,(n 11,Map.fromList [(n 4,GuardPos),(n 12,StrictPos)])+  ,(n 12,Map.fromList [(n 1,Mixed),(n 4,Mixed),(n 11,Mixed)])+  ]+++------------------------------------------------------------------------+-- * All tests+------------------------------------------------------------------------++-- Template Haskell hack to make the following $quickCheckAll work+-- under ghc-7.8.+return [] -- KEEP!++-- | All tests as collected by 'quickCheckAll'.+--+--   Using 'quickCheckAll' is convenient and superior to the manual+--   enumeration of tests, since the name of the property is+--   added automatically.++tests :: IO Bool+tests = do+  putStrLn "Agda.Utils.Graph.AdjacencyMap.Unidirectional"+  $quickCheckAll+++-- Abbreviations for testing in interpreter++g1, g2, g3, g4 :: Graph N N E+g1 = Graph $ Map.fromList+  [ (n 1, Map.fromList [(n 2,Unused)])+  , (n 2, Map.fromList [(n 1,Unused)])+  ]++g2 = Graph $ Map.fromList+  [ (n 1, Map.fromList [(n 2,StrictPos)])+  , (n 2, Map.fromList [(n 1,StrictPos)])+  ]++g3 = Graph $ Map.fromList+  [ (n 1, Map.fromList [(n 2,StrictPos)])+  , (n 2, Map.fromList [])+  , (n 4, Map.fromList [(n 1,StrictPos)])+  ]++g4 = Graph $ Map.fromList+  [ (n 1, Map.fromList [(n 6,Unused)])+  , (n 6, Map.fromList [(n 8,StrictPos)])+  , (n 8, Map.fromList [(n 3,Unused)])+  ]
src/full/Agda/Utils/HashMap.hs view
@@ -1,5 +1,29 @@ module Agda.Utils.HashMap-  ( module HashMap ) where+  ( module HashMap+  , mapMaybe+  , alter+  ) where +import Data.Hashable import Data.HashMap.Strict as HashMap+import qualified Data.Maybe as Maybe +-- | Like 'Data.Map.Strict.mapMaybe'.++-- This code has not been benchmarked. Other implementations may be+-- more efficient.++mapMaybe :: (a -> Maybe b) -> HashMap k a -> HashMap k b+mapMaybe f = fmap Maybe.fromJust . HashMap.filter Maybe.isJust . fmap f++-- | Like 'Data.Map.Strict.alter'.++alter :: (Eq k, Hashable k) =>+         (Maybe a -> Maybe a) -> k -> HashMap k a -> HashMap k a+alter f k m = case HashMap.lookup k m of+  Nothing -> case f Nothing of+    Nothing -> m+    Just v  -> HashMap.insert k v m+  Just v  -> case f (Just v) of+    Nothing -> HashMap.delete k m+    Just v  -> HashMap.insert k v m
src/full/Agda/Utils/IORef.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE CPP #-} --- | Provides @Data.IORef.modifyIORef'@ for @base < 4.6@.+-- | Utilities for Data.IORef.  module Agda.Utils.IORef   ( module Data.IORef@@ -8,18 +8,6 @@   ) where  import Data.IORef--#if !MIN_VERSION_base(4,6,0)---- | Strict version of 'modifyIORef'.------ /Since: 4.6.0.0/-modifyIORef' :: IORef a -> (a -> a) -> IO ()-modifyIORef' ref f = do-    x <- readIORef ref-    writeIORef ref $! f x--#endif  -- | Read 'IORef', modify it strictly, and return old value. readModifyIORef' :: IORef a -> (a -> a) -> IO a
src/full/Agda/Utils/Lens.hs view
@@ -8,11 +8,11 @@   , (<&>) -- reexported from Agda.Utils.Functor   ) where +import Control.Applicative ( Const(Const), getConst ) import Control.Monad.State import Control.Monad.Reader import Control.Monad.Writer -import Data.Functor.Constant import Data.Functor.Identity  import Agda.Utils.Functor ((<&>))@@ -29,7 +29,7 @@ infixl 8 ^. -- | Get inner part @i@ of structure @o@ as designated by @Lens' i o@. (^.) :: o -> Lens' i o -> i-o ^. l = getConstant $ l Constant o+o ^. l = getConst $ l Const o  -- | Set inner part @i@ of structure @o@ as designated by @Lens' i o@. set :: Lens' i o -> i -> o -> o@@ -79,4 +79,3 @@ -- | Modify a part of the state in a subcomputation. locally :: MonadReader o m => Lens' i o -> (i -> i) -> m a -> m a locally l = local . over l-
src/full/Agda/Utils/List.hs view
@@ -1,3 +1,5 @@+{-# OPTIONS_GHC -fno-warn-missing-signatures #-}+ {-# LANGUAGE CPP #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE TemplateHaskell #-}@@ -84,11 +86,32 @@ downFrom n | n <= 0     = []            | otherwise = let n' = n-1 in n' : downFrom n' --- | Update the last element of a list, if it exists+-- | Update the first element of a list, if it exists.+updateHead :: (a -> a) -> [a] -> [a]+updateHead f [] = []+updateHead f (a : as) = f a : as++spec_updateHead f as = let (bs, cs) = splitAt 1 as in map f bs ++ cs+prop_updateHead f as = updateHead f as == spec_updateHead f as++-- | Update the last element of a list, if it exists. updateLast :: (a -> a) -> [a] -> [a] updateLast f [] = [] updateLast f [a] = [f a] updateLast f (a : as@(_ : _)) = a : updateLast f as++spec_updateLast f as = let (bs, cs) = splitAt (length as - 1) as in bs ++ map f cs+prop_updateLast f as = updateLast f as == spec_updateLast f as++-- | Update nth element of a list, if it exists.+--   Precondition: the index is >= 0.+updateAt :: Int -> (a -> a) -> [a] -> [a]+updateAt _ f [] = []+updateAt 0 f (a : as) = f a : as+updateAt n f (a : as) = a : updateAt (n-1) f as++spec_updateAt n f as = let (bs, cs) = splitAt n as in bs ++ updateHead f cs+prop_updateAt (NonNegative n) f as = updateAt n f as == spec_updateAt n f as  -- | A generalized version of @partition@. --   (Cf. @mapMaybe@ vs. @filter@).
src/full/Agda/Utils/ListT.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-}@@ -66,11 +67,42 @@  -- | Monadic cons. consMListT :: Monad m => m a -> ListT m a -> ListT m a-consMListT ma l = runMListT $ liftM (`consListT` l) ma+consMListT ma l = ListT $ (Just . (,l)) `liftM` ma+-- consMListT ma l = runMListT $ liftM (`consListT` l) ma +-- simplification:+-- consMListT ma l = ListT $ runListT =<< liftM (`consListT` l) ma+-- consMListT ma l = ListT $ runListT =<< (`consListT` l) <$> ma+-- consMListT ma l = ListT $ runListT =<< do a <- ma; return $ a `consListT` l+-- consMListT ma l = ListT $ do a <- ma; runListT =<< do return $ a `consListT` l+-- consMListT ma l = ListT $ do a <- ma; runListT $ a `consListT` l+-- consMListT ma l = ListT $ do a <- ma; runListT $ ListT $ return $ Just (a, l)+-- consMListT ma l = ListT $ do a <- ma; return $ Just (a, l)+-- consMListT ma l = ListT $ Just . (,l) <$> ma+ -- | Monadic singleton. sgMListT ::  Monad m => m a -> ListT m a sgMListT ma = consMListT ma nilListT++-- | Extending a monadic function to 'ListT'.+mapMListT :: ( Monad m+#if __GLASGOW_HASKELL__ <= 708+             , Functor m+#endif+             ) => (a -> m b) -> ListT m a -> ListT m b+mapMListT f (ListT ml) = ListT $ do+  caseMaybeM ml (return Nothing) $ \ (a, as) -> do+    b  <- f a+    return $ Just (b , mapMListT f as)++-- | Alternative implementation using 'foldListT'.+mapMListT_alt :: ( Monad m+#if __GLASGOW_HASKELL__ <= 708+                 , Functor m+#endif+                 ) => (a -> m b) -> ListT m a -> ListT m b+mapMListT_alt f = runMListT . foldListT cons (return nilListT)+  where cons a ml = consMListT (f a) <$> ml  -- Instances 
src/full/Agda/Utils/ListT/Tests.hs view
@@ -1,6 +1,5 @@ {-# OPTIONS_GHC -fno-warn-missing-signatures #-} -{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TemplateHaskell #-}  -- | Quickcheck properties for 'Agda.Utils.ListT'.@@ -31,9 +30,6 @@  toList :: List a -> [a] toList = foldList (:) []--instance Arbitrary a => Arbitrary (List a) where-  arbitrary = fromList <$> arbitrary  prop_concat xxs = toList (concatListT (fromList (map fromList xxs))) == concat xxs 
− src/full/Agda/Utils/Map/Compat.hs
@@ -1,20 +0,0 @@-{- We need to keep the dependency on containers below 5.0 in-   order to avoid giving rise to unsolvable constraints on-   older versions of GHC (7.4.2 at the moment) -}--{-# LANGUAGE CPP #-}--module Agda.Utils.Map.Compat where--import Control.Applicative-import Data.Traversable-import qualified Data.Map as Map-import Data.Map (Map, fromList, toList)--traverseWithKey :: (Ord k, Applicative t) => (k -> a -> t b) -> Map k a -> t (Map k b)-#if !MIN_VERSION_containers(5,0,0)-traverseWithKey f m = fromList <$> traverse (\ (k, v) -> (,) k <$> f k v) (toList m)-#else-traverseWithKey = Map.traverseWithKey-#endif-
src/full/Agda/Utils/Maybe.hs view
@@ -1,4 +1,4 @@--- {-# LANGUAGE CPP #-}+{-# LANGUAGE CPP #-}  -- | Extend 'Data.Maybe' by common operations for the 'Maybe' type. --@@ -11,8 +11,15 @@     , module Data.Maybe     ) where +import Control.Monad+import Control.Monad.Trans.Maybe+ import Data.Maybe+import Data.Functor +#include "undefined.h"+import Agda.Utils.Impossible+ -- * Collection operations.  -- | @unionWith@ for collections of size <= 1.@@ -48,9 +55,9 @@ --   in the 'Just' case, but only a default action in the 'Nothing' --   case.  Then, the argument ordering of @caseMaybe@ is preferable. -----   @caseMaybe m err f = flip (maybe err) m f@+--   @caseMaybe m d f = flip (maybe d) m f@ caseMaybe :: Maybe a -> b -> (a -> b) -> b-caseMaybe m err f = maybe err f m+caseMaybe m d f = maybe d f m  -- * Monads and Maybe. @@ -67,7 +74,7 @@ -- | Monadic version of 'caseMaybe'. --   That is, 'maybeM' with a different argument ordering. caseMaybeM :: Monad m => m (Maybe a) -> m b -> (a -> m b) -> m b-caseMaybeM mm err f = maybeM  err f mm+caseMaybeM mm d f = maybeM d f mm  -- | 'caseMaybeM' with flipped branches. ifJustM :: Monad m => m (Maybe a) -> (a -> m b) -> m b -> m b@@ -78,6 +85,39 @@ whenJust :: Monad m => Maybe a -> (a -> m ()) -> m () whenJust m k = caseMaybe m (return ()) k +-- | 'caseMaybe' without the 'Just' case.+whenNothing :: Monad m => Maybe a -> m () -> m ()+whenNothing m d = caseMaybe m d (\_ -> return ())+ -- | 'caseMaybeM' without the 'Nothing' case. whenJustM :: Monad m => m (Maybe a) -> (a -> m ()) -> m () whenJustM c m = c >>= (`whenJust` m)++-- | 'caseMaybeM' without the 'Just' case.+whenNothingM :: Monad m => m (Maybe a) -> m () -> m ()+whenNothingM mm d = mm >>= (`whenNothing` d)++-- | Lazy version of @allJust <.> sequence@.+--   (@allJust = mapM@ for the @Maybe@ monad.)+--   Only executes monadic effect while @isJust@.+allJustM :: Monad m => [m (Maybe a)] -> m (Maybe [a])+allJustM = runMaybeT . mapM MaybeT+-- allJustM []         = return $ Just []+-- allJustM (mm : mms) = caseMaybeM mm (return Nothing) $ \ a ->+--   fmap (a:) <$> allJust mms++-- | Precondition: list not empty.+--   @+--     allJustsOrNothings [Nothing, Nothing] = Just Nothing+--     allJustsOrNothings [Just 0, Just 1]   = Just $ Just [0,1]+--     allJustsOrNothings [Just 0, Nothing]  = Nothing+--   @+allJustsOrNothings :: [Maybe a] -> Maybe (Maybe [a])+allJustsOrNothings [] = __IMPOSSIBLE__+allJustsOrNothings [ma] = return $ (:[]) <$> ma+allJustsOrNothings (ma : mas) = do+  res <- allJustsOrNothings mas+  case (ma, res) of+    (Nothing, Nothing) -> return Nothing+    (Just a, Just as)  -> return $ Just (a : as)+    _                  -> mzero
src/full/Agda/Utils/Maybe/Strict.hs view
@@ -28,12 +28,10 @@   , module Agda.Utils.Maybe.Strict   ) where -import Data.Strict.Maybe- -- The following code is copied from -- http://hackage.haskell.org/package/strict-base-types-0.3.0/docs/src/Data-Maybe-Strict.html -import           Prelude             hiding (Maybe (..), maybe)+import           Prelude             hiding (Maybe (..), maybe, null) import qualified Prelude             as Lazy  import           Control.Applicative (pure, (<$>))@@ -55,6 +53,7 @@ #endif import           Test.QuickCheck     (Arbitrary (..)) +import Agda.Utils.Null  toStrict :: Lazy.Maybe a -> Maybe a toStrict Lazy.Nothing  = Nothing@@ -74,6 +73,10 @@ #if __GLASGOW_HASKELL__ >= 706 deriving instance Generic  (Maybe a) #endif++instance Null (Maybe a) where+  empty = Nothing+  null = isNothing  instance Monoid a => Monoid (Maybe a) where   mempty = Nothing
src/full/Agda/Utils/Monad.hs view
@@ -1,9 +1,8 @@ {-# LANGUAGE CPP #-}-{-# LANGUAGE FlexibleContexts #-}  module Agda.Utils.Monad     ( module Agda.Utils.Monad-    , module Control.Monad+    , when, unless, MonadPlus(..)     , (<$>), (<*>)     , (<$) #if MIN_VERSION_mtl(2,2,0)@@ -123,16 +122,16 @@ mapMaybeM :: (Monad m, Functor m) => (a -> m (Maybe b)) -> [a] -> m [b] mapMaybeM f xs = catMaybes <$> Trav.mapM f xs +-- | The @for@ version of 'mapMaybeM'.+forMaybeM :: (Monad m, Functor m) => [a] -> (a -> m (Maybe b)) -> m [b]+forMaybeM = flip mapMaybeM+ -- | A monadic version of @'dropWhile' :: (a -> Bool) -> [a] -> [a]@. dropWhileM :: Monad m => (a -> m Bool) -> [a] -> m [a] dropWhileM p []       = return [] dropWhileM p (x : xs) = ifM (p x) (dropWhileM p xs) (return (x : xs))  -- Error monad ---------------------------------------------------------------- | To simulate @MaybeT@ by @ExceptT@.-instance Error () where-  noMsg = ()  -- | Finally for the 'Error' class. Errors in the finally part take -- precedence over prior errors.
src/full/Agda/Utils/Null.hs view
@@ -1,3 +1,6 @@+{-# OPTIONS_GHC -fno-warn-orphans #-}++{-# LANGUAGE CPP               #-} {-# LANGUAGE DefaultSignatures #-}  -- | Overloaded @null@ and @empty@ for collections and sequences.@@ -10,6 +13,11 @@  import Data.ByteString.Char8 (ByteString) import qualified Data.ByteString.Char8 as ByteString+import Data.Function+import Data.HashMap.Strict (HashMap)+import qualified Data.HashMap.Strict as HashMap+import Data.HashSet (HashSet)+import qualified Data.HashSet as HashSet import Data.IntMap (IntMap) import qualified Data.IntMap as IntMap import Data.IntSet (IntSet)@@ -17,16 +25,27 @@ import qualified Data.List as List import Data.Map (Map) import qualified Data.Map as Map+import Data.Monoid import Data.Sequence (Seq) import qualified Data.Sequence as Seq import Data.Set (Set) import qualified Data.Set as Set +import Text.PrettyPrint (Doc, render)+ import Agda.Utils.Bag (Bag) import qualified Agda.Utils.Bag as Bag import Agda.Utils.Functor import Agda.Utils.Monad +-- Andreas, 2015-06-24 orphan instance has to go here+-- to be able to define instance Null Doc++#if !MIN_VERSION_pretty(1,1,2)+instance Eq Doc where+  (==) = (==) `on` render+#endif+ class Null a where   empty :: a   null  :: a -> Bool@@ -67,6 +86,14 @@   empty = Map.empty   null  = Map.null +instance Null (HashMap k a) where+  empty = HashMap.empty+  null  = HashMap.null++instance Null (HashSet a) where+  empty = HashSet.empty+  null  = HashSet.null+ instance Null (Seq a) where   empty = Seq.empty   null  = Seq.null@@ -81,6 +108,10 @@   null Nothing  = True   null (Just a) = False +instance Null Doc where+  empty = mempty+  null  = (== mempty)+ -- * Testing for null.  ifNull :: (Null a) => a -> b -> (a -> b) -> b@@ -100,4 +131,3 @@  unlessNullM :: (Monad m, Null a) => m a -> (a -> m ()) -> m () unlessNullM ma k = ma >>= (`unlessNull` k)-
src/full/Agda/Utils/PartialOrd.hs view
@@ -133,12 +133,6 @@   mempty  = POEQ   mappend = seqPO --- | Partial ordering forms a semiring under supremum (disjunction)---   and composition (transitivity, sequencing)-instance SemiRing PartialOrdering where-  oplus  = orPO-  otimes = seqPO- -- | Embed 'Ordering'. fromOrdering :: Ordering -> PartialOrdering fromOrdering LT = POLT
src/full/Agda/Utils/Permutation.hs view
@@ -21,6 +21,9 @@ import Data.Traversable (Traversable) import Data.Typeable (Typeable) +import Test.QuickCheck++import Agda.Syntax.Position (KillRange(..)) import Agda.Utils.Functor import Agda.Utils.List ((!!!)) import Agda.Utils.Null@@ -58,6 +61,9 @@   empty = Perm 0 []   null (Perm _ picks) = null picks +instance KillRange Permutation where+  killRange = id+ -- | @permute [1,2,0] [x0,x1,x2] = [x1,x2,x0]@ --   More precisely, @permute indices list = sublist@, generates @sublist@ --   from @list@ by picking the elements of list as indicated by @indices@.@@ -101,6 +107,9 @@   inversePermute p@(Perm n _) = tabulate . inversePermute p     where tabulate m = for [0..n-1] $ \ i -> IntMap.lookup i m +instance InversePermute (Int -> a) [Maybe a] where+  inversePermute (Perm n xs) f = for [0..n-1] $ \ x -> f <$> findIndex (x ==) xs+ -- | Identity permutation. idP :: Int -> Permutation idP n = Perm n [0..n - 1]@@ -165,9 +174,24 @@ --     == reverse $ permute (Perm 4 [1,3,0]) [x3,x2,x1,x0] --     == reverse $ permute (Perm 4 [1,3,0]) $ reverse [x0,x1,x2,x3] --   @+--+--   With @reverseP@, you can convert a permutation on de Bruijn indices+--   to one on de Bruijn levels, and vice versa. reverseP :: Permutation -> Permutation reverseP (Perm n xs) = Perm n $ map ((n - 1) -) $ reverse xs+                  -- = flipP $ Perm n $ reverse xs +-- | @permPicks (flipP p) = permute p (downFrom (permRange p))@+--   or+--   @permute (flipP (Perm n xs)) [0..n-1] = permute (Perm n xs) (downFrom n)@+--+--   Can be use to turn a permutation from (de Bruijn) levels to levels+--   to one from levels to indices.+--+--   See 'Agda.Syntax.Internal.Patterns.numberPatVars'.+flipP :: Permutation -> Permutation+flipP (Perm n xs) = Perm n $ map (n - 1 -) xs+ -- | @expandP i n π@ in the domain of @π@ replace the /i/th element by /n/ elements. expandP :: Int -> Int -> Permutation -> Permutation expandP i n (Perm m xs) = Perm (m + n - 1) $ concatMap expand xs@@ -208,6 +232,9 @@   }   deriving (Eq, Ord, Show, Typeable, Functor, Foldable, Traversable) +instance KillRange a => KillRange (Drop a) where+  killRange = fmap killRange+ -- | Things that support delayed dropping. class DoDrop a where @@ -229,6 +256,16 @@     Perm (n + m) $ [0..m-1] ++ map (+ m) (List.drop k xs)     where m = -k   unDrop m = dropMore (-m) -- allow picking up more than dropped++------------------------------------------------------------------------+-- * Test data generator+------------------------------------------------------------------------++instance Arbitrary Permutation where+  arbitrary = do+    is <- nub . map getNonNegative <$> arbitrary+    NonNegative n <- arbitrary+    return $ Perm (if null is then n else maximum is + n + 1) is  ------------------------------------------------------------------------ -- * Properties, see "Agda.Utils.Permutation.Tests".
src/full/Agda/Utils/Permutation/Tests.hs view
@@ -1,12 +1,12 @@-{-# OPTIONS_GHC -fno-warn-missing-signatures #-}--{-# LANGUAGE CPP #-}+{-# LANGUAGE CPP                #-} {-# LANGUAGE DeriveDataTypeable #-}-{-# LANGUAGE DeriveFoldable #-}-{-# LANGUAGE DeriveFunctor #-}-{-# LANGUAGE DeriveTraversable #-}-{-# LANGUAGE TemplateHaskell #-}+{-# LANGUAGE DeriveFoldable     #-}+{-# LANGUAGE DeriveFunctor      #-}+{-# LANGUAGE DeriveTraversable  #-}+{-# LANGUAGE TemplateHaskell    #-} +{-# OPTIONS_GHC -fno-warn-missing-signatures #-}+ module Agda.Utils.Permutation.Tests (tests) where  import Data.Functor@@ -16,18 +16,13 @@ import Test.QuickCheck import Test.QuickCheck.All +import Agda.Utils.List (downFrom) import Agda.Utils.Permutation  ------------------------------------------------------------------------ -- * Properties ------------------------------------------------------------------------ -instance Arbitrary Permutation where-  arbitrary = do-    is <- nub . map getNonNegative <$> arbitrary-    NonNegative n <- arbitrary-    return $ Perm (if null is then n else maximum is + n + 1) is- data ComposablePermutations = ComposablePermutations Permutation Permutation   deriving (Eq, Show) @@ -81,6 +76,9 @@ prop_composeP (ComposablePermutations p1 p2) = withStream $ \ xs ->   permute (composeP p1 p2) xs == permutePartial p1 (permute p2 xs) +prop_flipP :: Permutation -> Bool+prop_flipP p = permPicks (flipP p) == permute p (downFrom $ permRange p)+ -- | @p ∘ p⁻¹ ∘ p = p@ prop_invertP_left :: Permutation -> Int -> [A] -> A -> Bool prop_invertP_left p err = withStream $ \ xs -> let ys = permute p xs in@@ -105,6 +103,10 @@   let xs = take (length is) xs0       ys = inversePermute p xs   in  permute p ys == xs++prop_inversePermute_invertP :: Permutation -> Bool+prop_inversePermute_invertP p =+  inversePermute p (id :: Int -> Int) == safePermute (invertP (-1) p) [(0::Int)..]  -- Template Haskell hack to make the following $quickCheckAll work -- under ghc-7.8.
src/full/Agda/Utils/Pretty.hs view
@@ -16,10 +16,6 @@  import Agda.Utils.Null -instance Null Doc where-  empty = mempty-  null  = (== mempty)- -- * Pretty class  -- | While 'Show' is for rendering data in Haskell syntax,@@ -58,11 +54,6 @@   pretty = text  -- * 'Doc' utilities--#if !MIN_VERSION_pretty(1,1,2)-instance Eq Doc where-  (==) = (==) `on` render-#endif  pwords :: String -> [Doc] pwords = map text . words
src/full/Agda/Utils/SemiRing.hs view
@@ -1,10 +1,17 @@ module Agda.Utils.SemiRing where +-- | Semirings (<https://en.wikipedia.org/wiki/Semiring>).+ class SemiRing a where+  ozero  :: a+  oone   :: a   oplus  :: a -> a -> a   otimes :: a -> a -> a  instance SemiRing a => SemiRing (Maybe a) where+  ozero = Nothing+  oone  = Just oone+   oplus Nothing y = y   oplus x Nothing = x   oplus (Just x) (Just y) = Just (oplus x y)@@ -12,3 +19,13 @@   otimes Nothing _ = Nothing   otimes _ Nothing = Nothing   otimes (Just x) (Just y) = Just (otimes x y)++-- | Star semirings+-- (<https://en.wikipedia.org/wiki/Semiring#Star_semirings>).++class SemiRing a => StarSemiRing a where+  ostar :: a -> a++instance StarSemiRing a => StarSemiRing (Maybe a) where+  ostar Nothing  = oone+  ostar (Just x) = Just (ostar x)
src/full/Agda/Utils/Size.hs view
@@ -10,6 +10,10 @@  import Prelude hiding (null) +import Data.HashMap.Strict (HashMap)+import qualified Data.HashMap.Strict as HashMap+import Data.HashSet (HashSet)+import qualified Data.HashSet as HashSet import Data.IntMap (IntMap) import qualified Data.IntMap as IntMap import Data.IntSet (IntSet)@@ -45,6 +49,12 @@  instance Sized (Set a) where   size = fromIntegral . Set.size++instance Sized (HashMap k a) where+  size = fromIntegral . HashMap.size++instance Sized (HashSet a) where+  size = fromIntegral . HashSet.size  instance Sized (Seq a) where   size = fromIntegral . Seq.length
src/full/Agda/Utils/Time.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE CPP #-}+{-# LANGUAGE CPP                        #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-}  -- To avoid warning on derived Integral instance for CPUTime.@@ -9,40 +9,28 @@ module Agda.Utils.Time   ( ClockTime   , getClockTime+  , getCPUTime   , measureTime   , CPUTime(..)   ) where  import Control.Monad.Trans-import System.CPUTime+import qualified System.CPUTime as CPU -#if MIN_VERSION_directory(1,1,1)+import Data.Functor import qualified Data.Time-#else-import qualified System.Time-#endif  import Agda.Utils.Pretty import Agda.Utils.String  -- | Timestamps. -type ClockTime =-#if MIN_VERSION_directory(1,1,1)-  Data.Time.UTCTime-#else-  System.Time.ClockTime-#endif+type ClockTime = Data.Time.UTCTime  -- | The current time.  getClockTime :: IO ClockTime-getClockTime =-#if MIN_VERSION_directory(1,1,1)-  Data.Time.getCurrentTime-#else-  System.Time.getClockTime-#endif+getClockTime = Data.Time.getCurrentTime  -- | CPU time in pico (10^-12) seconds. @@ -55,11 +43,15 @@   pretty (CPUTime ps) =     text $ showThousandSep (div ps 1000000000) ++ "ms" --- | Measure the time of a computation. Returns the+{-# SPECIALIZE getCPUTime :: IO CPUTime #-}+getCPUTime :: MonadIO m => m CPUTime+getCPUTime = liftIO $ CPUTime <$> CPU.getCPUTime++-- | Measure the time of a computation.+--   Of course, does not work with exceptions. measureTime :: MonadIO m => m a -> m (a, CPUTime) measureTime m = do   start <- liftIO $ getCPUTime   x     <- m   stop  <- liftIO $ getCPUTime-  return (x, CPUTime $ stop - start)-+  return (x, stop - start)
src/full/Agda/Utils/Trie.hs view
@@ -13,24 +13,20 @@   , lookupPath   ) where -import Prelude hiding (Maybe(..), maybe)+import Prelude hiding (Maybe(..), maybe, null) import qualified Prelude as Lazy  import Data.Function import Data.Functor import Data.List (nubBy, sortBy, isPrefixOf)-#if MIN_VERSION_containers(0,5,0) import Data.Map.Strict (Map) import qualified Data.Map.Strict as Map-#else-import Data.Map (Map)-import qualified Data.Map as Map-#endif  import Test.QuickCheck  import Agda.Utils.List (mcons) import Agda.Utils.Maybe.Strict+import Agda.Utils.Null  -- | Finite map from @[k]@ to @v@. --@@ -39,8 +35,9 @@   deriving Show  -- | Empty trie.-empty :: Trie k v-empty = Trie Nothing Map.empty+instance Null (Trie k v) where+  empty = Trie Nothing Map.empty+  null (Trie v t) = null v && null t  -- | Singleton trie. singleton :: [k] -> v -> Trie k v
src/full/Agda/Utils/VarSet.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE CPP #-}  -- | Var field implementation of sets of (small) natural numbers. @@ -19,11 +18,6 @@  subtract :: Int -> VarSet -> VarSet subtract n = IntSet.map (Prelude.subtract n)--#if !MIN_VERSION_containers(0,5,0)-toDescList :: VarSet -> [Int]-toDescList = reverse . toList-#endif  {- import Data.Bits
src/full/Agda/Utils/Warshall.hs view
@@ -82,6 +82,9 @@   Finite a <= Finite b = a <= b  instance SemiRing Weight where+  ozero = Infinite+  oone  = Finite 0+   oplus = min    otimes Infinite _ = Infinite@@ -439,16 +442,11 @@       , (100 - k, return [])       ] -newtype Distance = Dist Nat-  deriving (Eq, Ord, Num, Integral, Show, Enum, Real)--instance SemiRing Distance where-  oplus  (Dist a) (Dist b) = Dist (min a b)-  otimes (Dist a) (Dist b) = Dist (a + b)+type Distance = Weight  genGraph_ :: Nat -> Gen (AdjList Nat Distance) genGraph_ n =-  genGraph 0.2 (Dist <$> natural) [0..n - 1]+  genGraph 0.2 (Finite <$> natural) [0..n - 1]  lookupEdge :: Ord n => n -> n -> AdjList n e -> Maybe e lookupEdge i j g = lookup j =<< Map.lookup i g@@ -484,7 +482,7 @@   return $ addPath i (es ++ [(j, v)]) g   where     edge :: Gen Distance-    edge = Dist <$> natural+    edge = Finite <$> natural      node :: Gen Nat     node = choose (0, n - 1)