h*$~I      !"#$%&'()*+,-./0123456789:;< = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                                                                                                                                                            ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % & & & & & & & & & & & & & & & & & & & & ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + + + + + + + + + + + + + + + + + + + + + + + , , , , , , , , , , , , ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,------...............////0000000011111111111111111111111222222222222222333333333340.27disco team and contributorsbyorgey@gmail.com Safe-Inferred()*0167<%disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred()*-01<'disco$Return the next integer in sequence.disco$Return the next integer in sequence.discoDispatch a counter effect, starting the counter from the given Integer. disco:Dispatch a counter effect, starting the counter from zero.  disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred()*01<(7 disco8Run an input effect in terms of an ambient state effect. discoUse a function to (contravariantly) transform the input value in an input effect.   disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred()*-01<)  disco/Use a lens to zoom into a component of a state.  44disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred()*-01<)discoDispatch a store effect.disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred()*01<-%disco8List all possible paths through the list of PossibilitesEx. > allCombinations [ Possibilities [1] , Possibilities [2,3] , Possibilities [4] , Possibilities [5,6,7] ] === Possibilities {getPossibilities = [[1,2,4,5] ,[1,2,4,6] ,[1,2,4,7] ,[1,3,4,5] ,[1,3,4,6] ,[1,3,4,7] ]}2 5  5 1 4 --6 / 3 7If any any of the Possibilities is empty, an empty Possibility is returnedIn other words, this lists all elements of the cartesian product of multiple sets !$%"# $%"#!disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred()*01</-disco,Enumeration of optional language extensions..discoAllow primitives, i.e. $prim/disco3Don't automatically import standard library modules0disco/Allow randomness. This is not implemented yet.2discoThe default set of language extensions (currently, the empty set).3discoA set of all possible language extensions, provided for convenience.4disco7All possible language extensions in the form of a list.5disco%Add an extension to an extension set. -./012345 -./012345 disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred()*01<0 =BCDEFGH =BCDEFGH disco team and contributorsbyorgey@gmail.com Safe-Inferred()*017<>;4JdiscoAn OpInfo record contains information about an operator, such as the operator itself, its fixity, a list of concrete syntax representations, and a numeric precedence level.Odisco%Operators together with their fixity.RdiscoFixity/associativity of infix binary operators (either left, right, or non-associative).SdiscoLeft-associative infix.TdiscoRight-associative infix.UdiscoInfix.Vdisco5Fixities of unary operators (either pre- or postfix).Wdisco Unary prefix.XdiscoUnary postfix.YdiscoType operators.ZdiscoList all values of a type[disco)Count how many values there are of a type\discoBinary operators.]disco Addition (+)^disco Subtraction (-)_discoSaturating Subtraction (.- / D)`discoMultiplication (*)adisco Division (/)bdiscoExponentiation (^)cdiscoInteger division (//)ddiscoEquality test (==)edisco Not-equal (/=)fdisco Less than (<)gdiscoGreater than (>)hdiscoLess than or equal (<=)idiscoGreater than or equal (>=)jdisco Logical and (&& / and)kdisco Logical or (|| / or)ldiscoLogical implies (-> / implies)mdiscoLogical biconditional ( - / iff)ndiscoModulo (mod)odiscoDivisibility test (|)pdisco'Binomial and multinomial coefficients (choose)qdisco List cons (::)rdiscoCartesian product of sets (** / T)sdiscoUnion of two sets (union / D)tdiscoIntersection of two sets ( intersect / D)udisco Difference between two sets (@@)vdiscoElement test (D)wdisco Subset test (E)xdisco:Make a binary boolean operator into a testable propositionydiscoUnary operators.zdiscoArithmetic negation (-){discoLogical negation (not)|disco Factorial (!)}discoThe opTable lists all the operators in the language, in order of precedence (highest precedence first). Operators in the same list have the same precedence. This table is used by both the parser and the pretty-printer.~disco3A map from all unary operators to their associated J records.disco5A map from all binary operators to their associatied J records.discoA convenient function for looking up the precedence of a unary operator.discoA convenient function for looking up the precedence of a binary operator.discoLook up the "fixity" (i.e.% associativity) of a binary operator.discoThe precedence level of function application (higher than any other precedence level).;y{|z\djbqnamv^ok`]ups_cefghilrtwxY[ZVXWRSTUOPQJKNLM}~;y{|z\djbqnamv^ok`]ups_cefghilrtwxY[ZVXWRSTUOPQJKNLM}~ disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred()*01<< disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred()*01<= disco team and contributorsbyorgey@gmail.com Safe-Inferred()*017<>Gb.discoAn info record for a single primitive name, containing the primitive itself, its concrete syntax, and whether it is "exposed", i.e. available to be used in the surface syntax of the basic language. Unexposed prims can only be referenced by enabling the Primitives language extension and prefixing their name by $.disco Primitives, i.e. built-in constants.discoUnary operatordiscoBinary operatordiscoLeft injection into a sum type.disco Right injection into a sum type.discoInteger square root (sqrt)discoFloor of fractional type (floor)discoCeiling of fractional type (ceiling)discoAbsolute value (abs)discoMindiscoMaxdiscoPower set (XXX or bag?)discoContainer -> list conversiondiscoContainer -> bag conversiondiscoContainer -> set conversiondiscobag -> set of counts conversiondiscoset of counts -> bag conversiondiscounsafe set of counts -> bag conversion that assumes all distinctdiscoMap k v -> Set (k  v)discoSet (k  v) -> Map k vdiscoGet Adjacency list of GraphdiscoConstruct a graph Vertexdisco Empty graphdiscoOverlay two Graphsdisco,Connect Graph to another with directed edgesdiscoInsert into mapdisco$Get value associated with key in mapdiscoEach operation for containersdiscoReduce operation for containersdiscoFilter operation for containersdiscoMonadic join for containersdisco%Generic merge operation for bags/setsdiscoEfficient primality testdisco Factorizationdisco(Turn a rational into a pair (num, denom)discoCrashdisco [x, y, z .. e]disco Test whether a proposition holdsdiscoLookup OEIS sequencediscoExtend OEIS sequencedisco)Generates a pseudorandom number generatordisco6Given a range and a generator, generates random numberdiscoA table containing a " record for every non-operator  recognized by the language.disco+Find any exposed prims with the given name.discoA convenient map from each  to its info record.22disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred()*01<My discoA synonym for pairing which makes convenient syntax for constructing literal maps via M.fromList.discoFlipped variant of .disco A variant of Map indexing that throws a custom error message in case the key is not found, to help with debugging.discoFind the maximum of a list of positive numbers, yielding 0 in the case of an empty list.disco A variant of  that returns a Maybe (NonEmpty a) instead of a regular list.disco A variant of  partition that returns Maybe (NonEmpty a)s instead of regular lists.disco A variant of partitionEithers for nonempty lists. If the result is Left, it means all the inputs were Left. If the result is Right, we definitely have some Rights, and possibly some Lefts as well. This properly encodes the fact that at least one result list must be nonempty.discoIterate a function until finding the first value that satisfies the given predicate.  iterUntil f p is equivalent to head . filter p . iterate f. but does not trigger a partiality warning.disco?Allow a value through only if it satisfies the given predicate.  1disco team and contributorsbyorgey@gmail.com Safe-Inferred()*01<Pdisco A reference for further reading.disco>An enumeration of different types of documentation references.disco/A reference to the Gentle Introduction (https:/disco-lang.readthedocs.ioenlatestintroduction/index.html)disco.A reference to the Language Reference (https:/disco-lang.readthedocs.ioenlatestreference/index.html)discoAn arbitrary free-form URLdiscoLookup keys for documentation.discoA map storing documentation for various things that can be looked up with :doc. Each key is mapped to a short descriptive string, plus references for further reading.5 Safe-Inferred()*01<Q$6 Safe-Inferred()*/01<RkdiscoThis function can be used to locally introduce typeclass instances for . See 67" for an example of how to use it.discoReified dictionarydisco This parameter should always be   disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred()*-01<Udisco#Local fresh name generation effect.discoWrapper for a monadic action with phantom type parameter for reflection. Locally defined so that the instance we are going to build with reflection must be coherent, that is there cannot be orphans.disco Dispatch an  effect via a 4 effect to keep track of a set of in-scope names.discoOpen a binder, automatically freshening the names of the bound variables, and providing the opened pattern and term to the provided continuation. The bound variables are also added to the set of in-scope variables within in the continuation.disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred"()*01<^F discoConvenience function combining  and , since we often want to simultaneously indicate what the precedence and associativity of a term is, and optionally surround it with parentheses depending on the precedence and associativity of its parent.discoLocally set the precedence and associativity within a subcomputation.discoMark a subcomputation as pretty-printing a term on the left of an operator (so parentheses can be inserted appropriately, depending on the associativity).discoMark a subcomputation as pretty-printing a term on the right of an operator (so parentheses can be inserted appropriately, depending on the associativity).discoOptionally surround a pretty-printed term with parentheses, depending on its precedence and associativity (given as the  argument) and that of its context (given by the ambient 'Reader PA' effect).disco-Pretty-print a rational number as a fraction.discoPretty-print a rational number using its decimal expansion, in the format nnn.prefix[rep]...;, with any repeating digits enclosed in square brackets.discodigitalExpansion b n d takes the numerator and denominator of a fraction n/d between 0 and 1, and returns a pair of (1) a list of digits ds,, and (2) a nonnegative integer k such that splitAt k ds = (prefix, rep)5, where the infinite base-b expansion of n/d is 0.(prefix ++ cycle rep). For example, digitalExpansion 10 1 4 = ([2,5,0], 2) digitalExpansion 10 1 7 = ([1,4,2,8,5,7], 0) digitalExpansion 10 3 28 = ([1,0,7,1,4,2,8,5], 2) digitalExpansion 2 1 5 = ([0,0,1,1], 0)It works by performing the standard long division algorithm, and looking for the first time that the remainder repeats.discoPretty-print a binary operator, by looking up its concrete syntax in the .discoPretty-print a unary operator, by looking up its concrete syntax in the ~.4disco team and contributorsbyorgey@gmail.com Safe-Inferred"()*01<>e discoA  represents a set of qualifiers, and also represents a set of types (in general, the intersection of the sets corresponding to the qualifiers).discoA "qualifier" is kind of like a type class in Haskell; but unlike Haskell, disco users cannot define their own. Rather, there is a finite fixed list of qualifiers supported by disco. For example, QSub denotes types which support a subtraction operation. Each qualifier corresponds to a set of types which satisfy it (see hasQual and  qualRules).These qualifiers generally arise from uses of various operations. For example, the expression  \x y. x - y% would be inferred to have a type a -> a -> a [subtractive a]!, that is, a function of type  a -> a -> a where a* is any type that supports subtraction.!These qualifiers can appear in a CQual constraint; see Disco.Typecheck.Constraint.disco+Numeric, i.e. a semiring supporting + and *discoSubtractive, i.e. supports -discoDivisive, i.e. supports /discoComparable, i.e. supports decidable ordering/comparison (see Note [QCmp])disco4Enumerable, i.e. supports ellipsis notation [x .. y]disco2Boolean, i.e. supports and, or, not (Bool or Prop)disco Things that do not involve Prop.disco7Things for which we can derive a *Haskell* Ord instancediscoA helper function that returns the appropriate qualifier for a binary arithmetic operation.discoThe special sort \top which includes all types.  disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred"()*01<n disco+Directed graphs, with vertices labelled by a and unlabelled edges.discoCreate a graph with the given set of vertices and directed edges. If any edges refer to vertices that are not in the given vertex set, they will simply be dropped.disco.Return the set of vertices (nodes) of a graph.disco,Return the set of directed edges of a graph.disco2Map a function over all the vertices of a graph. Graph is not a Functor instance because of the Ord constraint on b.discoDelete a vertex.discoThe  condensation of a graph is the graph of its strongly connected components, i.e. each strongly connected component is compressed to a single node, labelled by the set of vertices in the component. There is an edge from component A to component B in the condensed graph iff there is an edge from any vertex in component A to any vertex in component B in the original graph.discoGet a list of the weakly connected components of a graph, providing the set of vertices in each. Equivalently, return the strongly connected components of the graph when considered as an undirected graph.discoDo a topological sort on a DAG.disco+A miscellaneous utility function to turn a  Graph Maybe into a  Maybe Graph: the result is Just0 iff all the vertices in the input graph are.discoGet a list of all the  successors" of a given node in the graph, i.e. all the nodes reachable from the given node by a directed path. Does not include the given node itself.discoGet a list of all the  predecessors" of a given node in the graph, i.e. all the nodes from which from the given node is reachable by a directed path. Does not include the given node itself.discoGiven a graph, return two mappings: the first maps each vertex to its set of successors; the second maps each vertex to its set of predecessors. Equivalent to (M.fromList *** M.fromList) . unzip . map (\a -> ((a, suc g a), (a, pre g a))) . nodes $ gbut much more efficient.disco team and contributorsbyorgey@gmail.com Safe-Inferred"()*01<x discoA value of type Substitution a8 is a substitution which maps some set of names (the domain, see ) to values of type a. Substitutions can be applied to certain terms (see ), replacing any free occurrences of names in the domain with their corresponding values. Thus, substitutions can be thought of as functions of type  Term -> Term (for suitable Term3s that contain names and values of the right type).-Concretely, substitutions are stored using a Map. See also  Disco.Types, which defines S as an alias for substitutions on types (the most common kind in the disco codebase).discoThe domain of a substitution is the set of names for which the substitution is defined.discoThe identity substitution, i.e. the unique substitution with an empty domain, which acts as the identity function on terms.discoConstruct a singleton substitution, which maps the given name to the given value.disco%Compose two substitutions. Applying s1 @@ s2" is the same as applying first s2, then s1; that is, semantically, composition of substitutions corresponds exactly to function composition when they are considered as functions on terms.8As one would expect, composition is associative and has  as its identity.disco=Compose a whole container of substitutions. For example, %compose [s1, s2, s3] = s1 @@ s2 @@ s3.discoApply a substitution to a term, resulting in a new term in which any free variables in the domain of the substitution have been replaced by their corresponding values. Note this requires a  Subst b a< constraint, which intuitively means that values of type a contain variables of type b we can substitute for.discoCreate a substitution from an association list of names and values.disco0Convert a substitution into an association list.discoLook up the value a particular name maps to under the given substitution; or return Nothing5 if the name being looked up is not in the domain.  disco team and contributorsbyorgey@gmail.com Safe-Inferred"()*017<>">disco;A type class for things whose type can be extracted or set.discoGet the type of a thing.discoSet the type of a thing, when that is possible; the default implementation is for  to do nothing.discoDefine S as a substitution on types (the most common kind) for convenience.disco Strictness represents the strictness (either strict or lazy) of a function application or let-expression.disco+ represents a polymorphic type of the form forall a1 a2 ... an. ty (note, however, that n may be 0, that is, we can have a "trivial" polytype which quantifies zero variables).discoA  is a mapping from type names to their corresponding definitions.disco/The definition of a user-defined type contains:The actual names of the type variable arguments used in the definition (we keep these around only to help with pretty-printing)A function representing the body of the definition. It takes a list of type arguments and returns the body of the definition with the type arguments substituted.We represent type definitions this way (using a function, as opposed to a chunk of abstract syntax) because it makes some things simpler, and we don't particularly need to do anything more complicated.discoThe main data type for representing types in the disco language. A type can be either an atomic type, or the application of a type constructor to one or more type arguments.Type"s are broken down into two cases (TyAtom and TyCon) for ease of implementation: there are many situations where all atoms can be handled generically in one way and all type constructors can be handled generically in another. However, using this representation to write down specific types is tedious; for example, to represent the type N -> a" one must write something like 2TyCon CArr [TyAtom (ABase N), TyAtom (AVar (U a))]0. For this reason, pattern synonyms such as ,  , and  are provided so that one can use them to construct and pattern-match on types when convenient. For example, using these synonyms the foregoing example can be written TyN :->: TyVar a.disco)Atomic types (variables and base types), e.g. N, Bool, etc.disco5Application of a type constructor to type arguments, e.g.  N -> Bool is the application of the arrow type constructor to the arguments N and Bool.discoCompound types, such as functions, product types, and sum types, are an application of a type constructor" to one or more argument types.discoFunction type constructor, T1 -> T2.discoProduct type constructor, T1 * T2.discoSum type constructor, T1 + T2.discoContainer type (list, bag, or set) constructor. Note this looks like it could contain any ?, but it will only ever contain either a type variable or a , , or . See also , , and .discoKey value maps, Map k vdiscoGraph constructor, Graph adisco.The name of a user defined algebraic datatype.disco Unifiable atomic types are the same as atomic types but without skolem variables. Hence, a unifiable atomic type is either a base type or a unification variable.Again, the reason this has its own type is that at some stage of the typechecking/constraint solving process, these should be the only things around; we can get rid of skolem variables because either they impose no constraints, or result in an error if they are related to something other than themselves. After checking these things, we can just focus on base types and unification variables.discoAn  atomic type is either a base type or a type variable. The alternative is a  compound type which is built out of type constructors. The reason we split out the concept of atomic types into its own data type  is because constraints involving compound types can always be simplified/translated into constraints involving only atomic types. After that simplification step, we want to be able to work with collections of constraints that are guaranteed to contain only atomic types.disco represents type variables2, that is, variables which stand for some type.disco represents type variables, that is, variables which stand for some type. There are two kinds of type variables:Unification variables stand for an unknown type, about which we might learn additional information during the typechecking process. For example, given a function of type List a -> List a, if we typecheck an application of the function to the list [1,2,3], we would learn that List a has to be List N, and hence that a has to be N.Skolem variables stand for a fixed generic type, and are used to typecheck universally quantified type signatures (i.e. type signatures which contain type variables). For example, if a function has the declared type  List a -> N, it amounts to a claim that the function will work no matter what type is substituted for a<. We check this by making up a new skolem variable for a. Skolem variables are equal to themselves, but nothing else. In contrast to a unification variable, "learning something" about a skolem variable is an error: it means that the function will only work for certain types, in contradiction to its claim to work for any type at all.discoBase types are the built-in types which form the basis of the disco type system, out of which more complex types can be built.disco#The void type, with no inhabitants.disco#The unit type, with one inhabitant.disco Booleans.disco Propositions.discoNatural numbers.disco Integers.disco)Fractionals (i.e. nonnegative rationals).disco Rationals.discoUnicode characters.discoSet container type. It's a bit odd putting these here since they have kind * -> * and all the other base types have kind *; but there's nothing fundamentally wrong with it and in particular this allows us to reuse all the existing constraint solving machinery for container subtyping.discoBag container type.discoList container type.disco&An application of a user-defined type.disco is provided for convenience; it represents a set type constructor (i.e. Set a).disco is provided for convenience; it represents a bag type constructor (i.e. Bag a).disco is provided for convenience; it represents a list type constructor (i.e. List a).discoTest whether a $ is a container (set, bag, or list).discoIs this atomic type a variable?disco Is this atomic type a base type?disco&Is this atomic type a skolem variable?disco7Is this unifiable atomic type a (unification) variable?disco;Convert a unifiable atomic type into a regular atomic type.disco/Convert a unifiable atomic type to an explicit Either type.discoIs this a type variable?discoConvert a monotype into a trivial polytype that does not quantify over any type variables. If the type can contain free type variables, use  instead.discoConvert a monotype into a polytype by quantifying over all its free type variables.disco.Compute the number of inhabitants of a type. Nothing) means the type is countably infinite.disco(Check whether a type is a numeric type (N, Z, F, Q, or Zn).disco Decide whether a type is empty, i.e. uninhabited.disco Decide whether a type is finite.discoDecide whether a type is searchable, i.e. effectively enumerable.disco*Numeric types are strict; others are lazy.discoDecompose a nested product T1 * (T2 * ( ... )) into a list of types.disco=Convert a substitution on atoms into a substitution on types.discoConvert a substitution on unifiable atoms into a substitution on types.disco;Return a set of all the free container variables in a type.discoPretty-print a type definition.discoPretty-print a polytype. Note that we never explicitly print forall,; quantification is implicit, as in Haskell.675disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred()*01<discoA "direction" for the subtyping relation (either subtype or supertype).discoA particular type argument can be either co- or contravariant with respect to subtyping.discoThe arity of a type constructor is a list of variances, expressing both how many type arguments the constructor takes, and the variance of each argument. This is used to decompose subtyping constraints. For example, arity CArr = [Contra, Co] since function arrow is contravariant in its first argument and covariant in its second. That is,  S1 -> T1  :S2 - T2 (<:, means "is a subtype of") if and only if S2 <: S1 and T1 <: T2.discoSwap directions.discoCheck whether one atomic type is a subtype of the other. Returns True< if either they are equal, or if they are base types and  returns true.disco4Check whether one base type is a subtype of another.disco>Check whether one base type is a sub- or supertype of another.disco-List all the supertypes of a given base type.disco+List all the subtypes of a given base type.disco5List all the sub- or supertypes of a given base type.disco6Check whether a given base type satisfies a qualifier.discoCheck whether a base type has a certain sort, which simply amounts to whether it satisfies every qualifier in the sort.disco encodes some of the rules by which applications of type constructors can satisfy various qualifiers.Each constructor maps to a set of rules. Each rule is a mapping from a qualifier to the list of qualifiers needed on the type constructor's arguments for the bigger type to satisfy the qualifier.Note in Disco we can get away with any given qualifier requiring  at most one= qualifier on each type argument. Then we can derive the  by combining . In general, however, you could imagine some particular qualifier requiring a set of qualifiers (i.e. a general sort) on a type argument. In that case one would just have to encode  directly.discoGiven a constructor T and a qualifier we want to hold of a type T t1 t2 ..., return a list of qualifiers that need to hold of t1, t2, ...discosortRules T s = [s1, ..., sn] means that sort s holds of type  (T t1 ... tn) if and only if s1 t1  ...  sn tn0. For now this is just derived directly from . This is the arity7 function described in section 4.1 of Traytel et al.discoPick a base type (generally the "simplest") that satisfies a given sort.disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred"()*01<>discoConstraints are generated as a result of type inference and checking. These constraints are accumulated during the inference and checking phase and are subsequently solved by the constraint solver.  disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred()*01<discoGiven a list of equations between types, return a substitution which makes all the equations satisfied (or fail if it is not possible).This is not the most efficient way to implement unification but it is simple.discoGiven a list of equations between types, return a substitution which makes all the equations equal *up to* identifying all base types. So, for example, Int = Nat weakly unifies but Int = (Int -> Int) does not. This is used to check whether subtyping constraints are structurally sound before doing constraint simplification/solving, to ensure termination.discoGiven a list of equations between types, return a substitution which makes all the equations satisfied (or fail if it is not possible), up to the given comparison on base types.disco team and contributorsbyorgey@gmail.com Safe-Inferred"()*017<>discoA QName, or qualified name, is a  paired with its .discoWhere did a name come from?discoThe name is locally bounddisco(The name is exported by the given modulediscoThe name of a module.discoThe special top-level "module" consisting of what has been entered at the REPL.disco-A named module, with its name and provenance.discoWhere did a module come from?disco-From a particular directory (relative to cwd)discoFrom the standard librarydisco-Does this name correspond to a free variable?disco&Create a locally bound qualified name.disco%Create a module-bound qualified name.discoThe unbound-generics library gives us free variables for free. But when dealing with typed and desugared ASTs, we want all the free s instead of just s.disco team and contributorsbyorgey@gmail.com Safe-Inferred()*019:;<disco;A context maps qualified names to things. In particular a  Ctx a b maps qualified names for as to values of type b.discoThe empty context.disco9A singleton context, mapping a qualified name to a thing.disco>Create a context from a list of (qualified name, value) pairs.disco3Create a context for bindings from a single module.disco%Create a context with local bindings.discoInsert a new binding into a context. The new binding shadows any old binding for the same qualified name.discoRun a computation under a context extended with a new binding. The new binding shadows any old binding for the same name.discoRun a computation in a context extended with an additional context. Bindings in the additional context shadow any bindings with the same names in the existing context.discoCheck if a context is empty.disco/Look up a qualified name in an ambient context.disco&Look up a qualified name in a context.discoLook up all the non-local bindings of a name in an ambient context.disco:Look up all the non-local bindings of a name in a context.discoLook up all the bindings of an (unqualified) name in an ambient context.disco?Look up all the bindings of an (unqualified) name in a context.disco2Return a list of the names defined by the context.disco5Return a list of all the values bound by the context.discoReturn a list of the qualified name-value associations in the context.disco3Return a set of all qualified names in the context.disco8Coerce the type of the qualified name keys in a context.disco5Restrict a context to only the keys in the given set.disco Join two contexts (left-biased, i.e. if the same qualified name exists in both contexts, the result will use the value from the first context, and throw away the value from the second.).disco&Join a list of contexts (left-biased).disco#Filter a context using a predicate.disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred()*019<qdisco team and contributorsbyorgey@gmail.com Safe-Inferred"()*/01679:;<>disco)A property is just a term (of type Prop).discoA quantifier: , D, or DdiscoA binder represents the stuff between the quantifier and the body of a lambda, D, or D abstraction, as in  x : N, r : F.discoA type family specifying what the binder in an abstraction can be. Should have at least variables in it, but how many variables and what other information is carried along may vary.disco Patterns.disco:Variable pattern: matches anything and binds the variable.discoWildcard pattern _: matches anything.discoType ascription pattern pat : ty.disco Unit pattern () : matches ().discoLiteral boolean pattern.discoTuple pattern (pat1, .. , patn).discoInjection pattern (inl pat or inr pat).discoLiteral natural number pattern.discoUnicode character patterndiscoString pattern.disco Cons pattern p1 :: p2.disco List pattern  [p1, .., pn].discoAddition pattern, p + t or t + pdiscoMultiplication pattern, p * t or t * pdiscoSubtraction pattern, p - tdiscoNegation pattern, -pdiscoFraction pattern, p1/p2discoA special placeholder node for a nonlinear occurrence of a variable; we can only detect this at parse time but need to generate an error later.discoExpansion slot.discoGuards in case expressions.discoBoolean guard (if test)discoPattern guard (when term = pat)discoLet ( let x = term)discoA branch of a case is a list of guards with an accompanying term. The guards scope over the term. Additionally, each guard scopes over subsequent guards.discoA binding is a name along with its definition, and optionally its type.discoA container comprehension consists of a head term and then a list of qualifiers. Each qualifier either binds a variable to some collection or consists of a boolean guard.discoA binding qualifier (i.e. x in t).discoA boolean guard qualfier (i.e.  x + y > 4).discoA "link" is a comparison operator and a term; a single term followed by a sequence of links makes up a comparison chain, such as 2 < x < y < 10.discoNote that although the type of  says it can hold any \2, it should really only hold comparison operators.discoThe base generic AST representing terms in the disco language. e is a type index indicating the kind of term, i.e. the phase (for example, surface, typed, or desugared). Type families like  and so on use the phase index to determine what extra information (if any) should be stored in each constructor. For example, in the typed phase many constructors store an extra type, giving the type of the term.discoA term variable.disco A primitive, i.e. a constant which is interpreted specially at runtime. See Disco.Syntax.Prims.disco"A (non-recursive) let expression, let x1 = t1, x2 = t2, ... in t.discoExplicit parentheses. We need to keep track of these in the surface syntax in order to syntactically distinguish multiplication and function application. However, note that these disappear after the surface syntax phase.disco!The unit value, (), of type Unit.discoA boolean value.discoA natural number.discoA nonnegative rational number, parsed as a decimal. (Note syntax like 3/5 does not parse as a rational, but rather as the application of a division operator to two natural numbers.)discoA literal unicode character, e.g. d.discoA string literal, e.g. "disco".disco#A binding abstraction, of the form  Q vars. expr where Q is a quantifier and vars is a list of bound variables and optional type annotations. In particular, this could be a lambda abstraction, i.e. an anonymous function (e.g. x, (y:N). 2x + y), a universal quantifier (forall x, (y:N). x^2 + y > 0!), or an existential quantifier ( exists x, (y:N). x^2 + y == 0).discoFunction application, t1 t2.disco An n-tuple,  (t1, ..., tn).discoA case expression.discoA chained comparison, consisting of a term followed by one or more "links", where each link is a comparison operator and another term.disco"An application of a type operator.disco)A containter literal (set, bag, or list).discoA container comprehension.discoType ascription, (Term_ e : type).discoA data constructor with an extension descriptor that a "concrete" implementation of a generic AST may use to carry extra information.discoAn ellipsis is an "omitted" part of a literal container (such as a list or set), of the form .. t. We don't have open-ended ellipses since everything is evaluated eagerly and hence containers must be finite.disco5 represents an ellipsis with a given endpoint, as in  [3 .. 20].discoAn enumeration of the different kinds of containers in disco: lists, bags, and sets.discoInjections into a sum type (inl or inr) have a "side" (L or R).discoA telescope is essentially a list, except that each item can bind names in the rest of the list.discoThe empty telescope.discoA binder of type b followed by zero or more b 's. This b) can bind variables in the subsequent b's.disco%Add a new item to the beginning of a .discoFold a telescope given a combining function and a value to use for the empty telescope. Analogous to  for lists.disco.Apply a function to every item in a telescope.discoTraverse over a telescope.discoConvert a list to a telescope.discoConvert a telescope to a list.discoUse a ; to select one of two arguments (the first argument for , and the second for ).disco Convert a  to a boolean.disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred()*01<discoA DTerm is a term which has been typechecked and desugared, so it has fewer constructors and complex features than ATerm*, but still retains typing information.discoA test frame, recording a collection of variables with their types and their original user-facing names. Used for legible reporting of test failures inside the enclosed term.disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred()*016<_discoA declaration is either a type declaration, a term definition, or a type definition.disco,A user-defined type (potentially recursive).@type T arg1 arg2 ... = bodydisco*A group of definition clauses of the form name pat1 .. patn = term;. The patterns bind variables in the term. For example, f n (x,y) = n*x + y.discoA type declaration,  name : type.disco;A property is a universally quantified term of the form forall v1 : T1, v2 : T2. term.discoAn item of documentation.disco+A documentation string, i.e. a block of ||| text itemsdisco An exampledoctestproperty of the form "!!! forall (x1:ty1) ... . propertydisco!Convenient synonym for a list of s.discoA TopLevel is either documentation (a ) or a declaration ().discoA module contains all the information from one disco source file.discoEnabled extensionsdiscoModule importsdisco Declarationsdisco DocumentationdiscoTop-level (bare) termsdisco8The extension descriptor for Surface specific AST types.disco Pretty-print a type declaration.disco0Pretty-print a term with guaranteed parentheses.disco5Print appropriate delimiters for a container literal.disco3Pretty-print a pattern with guaranteed parentheses.disco3Pretty-print a single qualifier in a comprehension.disco/Pretty-print the qualifiers in a comprehension.discoPretty-print a binding, i.e. a pairing of a name (with optional type annotation) and term.disco2Pretty-print a single branch in a case expression.discoPretty-print the guards in a single branch of a case expression.disco-Pretty-print a single clause in a definition.disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred()*017<odiscoAn ATerm is a typechecked term where every node in the tree has been annotated with the type of the subterm rooted at that node.disco6The extension descriptor for Typed specific AST types.;;!(c) 2016 disco team (see LICENSE)BSD-style (see LICENSE)byorgey@gmail.com Safe-Inferred()*01<(disco+Erase all the type annotations from a term.   disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred"()*017<>{discoOperators that can show up in the core language. Note that not all surface language operators show up here, since some are desugared into combinators of the operators here.disco Addition (+)discoArithmetic negation (-)discoInteger square root (sqrt)discoFloor of fractional type (floor)discoCeiling of fractional type (ceiling)discoAbsolute value (abs)discoMultiplication (*)disco Division (/)discoExponentiation (^)discoModulo (mod)discoDivisibility test (|) discoMultinomial coefficient (choose) disco Factorial (!) discoEquality test (==) disco Less than (<) discoEnumerate the values of a type. discoCount the values of a type. disco Power setbag of a given setbag (power). discoSet/bag element test. discoList element test. discoMap a function over a bag. Carries the output type of the function. discoMap a function over a set. Carries the output type of the function. disco Filter a bag. discoMerge two bags/sets. disco#Bag join, i.e. union a bag of bags. discoAdjacency List of given graph disco Empty graph disco#Construct a vertex with given value disco Graph overlay disco Graph connect disco Map insert disco Map lookup discoContinue until end, [x, y, z .. e] disco&set -> list conversion (sorted order). disco*bag -> set conversion (forget duplicates). disco&bag -> list conversion (sorted order). disco2list -> set conversion (forget order, duplicates). disco&list -> bag conversion (forget order). discobag -> set of counts discoset of counts -> bag disco5unsafe set of counts -> bag, assumes all are distinct discoMap k v -> Set (k  v) discoSet (k  v) -> Map k v discoPrimality test disco Factorization disco(Turn a rational into a (num, denom) pair disco2Universal quantification. Applied to a closure t1, ..., tn -> Prop it yields a Prop. disco4Existential quantification. Applied to a closure t1, ..., tn -> Prop it yields a Prop. disco+Convert Prop -> Bool via exhaustive search. disco$Flip success and failure for a prop. discoComparison assertion disco&Error for non-exhaustive pattern match disco"Crash with a user-supplied message discoNo-op/identity function discoLookup OEIS sequence discoExtend a List via OEIS discoNot the Boolean j, but instead a propositional BOp | Should only be seen and used with Props. discoNot the Boolean k, but instead a propositional BOp | Should only be seen and used with Props. discoNot the Boolean l, but instead a propositional BOp | Should only be seen and used with Props. disco-AST for the desugared, untyped core language. disco A variable. discoA rational number. discoA built-in constant. discoAn injection into a sum type, i.e. a value together with a tag indicating which element of a sum type we are in. For example, false is represented by  CSum L CUnit; right(v) is represented by CSum R v. Note we do not need to remember which type the constructor came from; if the program typechecked then we will never end up comparing constructors from different types. disco5A primitive case expression on a value of a sum type. discoThe unit value. discoA pair of values. disco'A projection from a product type, i.e. fst or snd. discoAn anonymous function. discoFunction application. discoA "test frame" under which a test case is run. Records the types and legible names of the variables that should be reported to the user if the test fails. discoA type. discoIntroduction form for a lazily evaluated value of type Lazy T for some type T. We can have multiple bindings to multiple terms to create a simple target for compiling mutual recursion. disco!Force evaluation of a lazy value. discoGet the arity (desired number of arguments) of a function constant. A few constants have arity 0; everything else is uncurried and hence has arity 1.   !disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred()*-01< discoFresh name generation effect, supporting raw generation of fresh names, and opening binders with automatic freshening. Simply increments a global counter every time  < is called and makes a variable with that numeric suffix. discoWrapper for a monadic action with phantom type parameter for reflection. Locally defined so that the instance we are going to build with reflection must be coherent, that is there cannot be orphans. discoDispatch the fresh name generation effect, starting at a given integer. discoRun a computation requiring fresh name generation, beginning with 0 for the initial freshly generated name. discoRun a computation requiring fresh name generation, beginning with 1 instead of 0 for the initial freshly generated name. discoOpen a binder, automatically creating fresh names for the bound variables. discoGenerate a fresh (local, free) qualified name based on a given string. discoRun a  computation requiring a  constraint (from the unbound-generics# library) in terms of an available   effect.  "disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred"()*01<>2 discoInformation about a particular type variable. More information may be added in the future (e.g. polarity). disco9The ilk (unification or skolem) of the variable, if known disco2The sort (set of qualifiers) of the type variable. disco$Max number of solutions to generate. discoType of errors which can be generated by the constraint solving process. discoRun a list of actions, and return the results from those which do not throw an error. If all of them throw an error, rethrow the first one. discoRegister the fact that we found one solution, by decrementing the solution limit. discoRun a subcomputation conditional on the solution limit still being positive. If the solution limit has reached zero, stop early. discoA   records what we know about each type variable; it is a mapping from type variable names to   records. disco Create a   given an  and a . disco!Utility function for acting on a   by acting on the underlying . disco#Look up a given variable name in a  . discoRemove the mapping for a particular variable name (if it exists) from a  . disco y)  :(z - Int), then we can decompose it into two constraints, (z <: x) and (y <: Int); if we have a constraint v <: (a,b), then we substitute v C (x,y) (where x and y are fresh type variables) and continue; and so on.After this step, the remaining constraints will all be atomic constraints, that is, only of the form (v1 <: v2), (v <: b), or (b <: v), where v is a type variable and b is a base type. discoGiven a list of atoms and atomic subtype constraints (each pair (a1,a2) corresponds to the constraint a1 <: a2.) build the corresponding constraint graph. discoCheck for any weakly connected components containing more than one skolem, or a skolem and a base type, or a skolem and any variables with nontrivial sorts; such components are not allowed. If there are any WCCs with a single skolem, no base types, and only unsorted variables, just unify them all with the skolem and remove those components. discoEliminate cycles in the constraint set by collapsing each strongly connected component to a single node, (unifying all the types in the SCC). A strongly connected component is a maximal set of nodes where every node is reachable from every other by a directed path; since we are using directed edges to indicate a subtyping constraint, this means every node must be a subtype of every other, and the only way this can happen is if all are in fact equal.Of course, this step can fail if the types in a SCC are not unifiable. If it succeeds, it returns the collapsed graph (which is now guaranteed to be acyclic, i.e. a DAG) and a substitution. disco Modify a RelMap to record the fact that we have solved for a type variable. In particular, delete the variable from the RelMap as a key, and also update the relative sets of every other variable to remove this variable and add the base type we chose for it. discoEssentially dirtypesBySort vm rm dir t s x finds all the dir-types (sub- or super-) of t which have sort s, relative to the variables in x. This is overbar{T}_S^X (resp. underbar...) from Traytel et al. discoSort-aware infimum or supremum. discoFrom the constraint graph, build the sets of sub- and super- base types of each type variable, as well as the sets of sub- and supertype variables. For each type variable x in turn, try to find a common supertype of its base subtypes which is consistent with the sort of x and with the sorts of all its sub-variables, as well as symmetrically a common subtype of its supertypes, etc. Assign x one of the two: if it has only successors, assign it their inf; otherwise, assign it the sup of its predecessors. If it has both, we have a choice of whether to assign it the sup of predecessors or inf of successors; both lead to a sound & complete algorithm. We choose to assign it the sup of its predecessors in this case, since it seems nice to default to "simpler" types lower down in the subtyping chain. #!(c) 2016 disco team (see LICENSE)BSD-style (see LICENSE)byorgey@gmail.com Safe-Inferred()*01<"$ discoPotential typechecking errors. discoEncountered an unbound variable. The offending variable together with some suggested in-scope names with small edit distance. discoEncountered an ambiguous name. disco%No type is specified for a definition discoThe type of the term should have an outermost constructor matching Con, but it has type  instead discoCase analyses cannot be empty. discoThe given pattern should have the type, but it doesn't. instead it has a kind of type given by the Con. discoDuplicate declarations. discoDuplicate definitions. discoDuplicate type definitions. discoCyclic type definition. disco/# of patterns does not match type in definition discoDuplicate variable in a pattern discoType can't be quantified over. disco/The constraint solver couldn't find a solution. disco An undefined type name was used. disco#Wildcards are not allowed in terms. disco2Not enough arguments provided to type constructor. disco0Too many arguments provided to type constructor. disco4Unbound type variable, together with suggested edits disco$Polymorphic recursion is not allowed disco&Not an error. The identity of the Monoid TCError instance. discoA typechecking error, wrapped up together with the name of the thing that was being checked when the error occurred. disco7A typing context is a mapping from term names to types. discoWrap a TCError into a  LocTCError, with no explicit provenance information. discoEmit a constraint. discoEmit a list of constraints. disco0Close over the current constraint with a forall. discoRun two constraint-generating actions and combine the constraints via disjunction. discoRun a computation that generates constraints, returning the generated  along with the output. Note that this locally dispatches the constraint writer effect.This function is somewhat low-level; typically you should use  6 instead, which also solves the generated constraints. discoRun a computation and solve its generated constraint, returning up to the requested number of possible resulting substitutions (or failing with an error). Note that this locally dispatches the constraint writer and solution limit effects. disco1Look up the definition of a named type. Throw a   error if it is not found. disco>Run a subcomputation with an extended type definition context. disco+Generate a type variable with a fresh name. disco%Generate a fresh variable as an atom. disco 5 is a monoid where we simply discard the first error.$ $ $!(c) 2019 disco team (see LICENSE) BSD-3-Clausebyorgey@gmail.com Safe-Inferred()*0167<>, discoType checking a module yields a value of type ModuleInfo which contains mapping from terms to their relavent documenation, a mapping from terms to properties, and a mapping from terms to their types. discoA clause in a definition consists of a list of patterns (the LHS of the =) and a term (the RHS). For example, given the concrete syntax f n (x,y) = n*x + y, the corresponding   would be something like [n, (x,y)] (n*x + y). discoA definition consists of a name being defined, the types of any pattern arguments (each clause must have the same number of patterns), the type of the body of each clause, and a list of clauses. For example, 1 f x (0,z) = 3*x + z > 5 f x (y,z) = z == 9 might look like .Defn f [Z, Z*Z] B [clause 1 ..., clause 2 ...] discoWhen loading a module, we could be loading it from code entered at the REPL, or from a standalone file. The two modes have slightly different behavior. discoA data type indicating where we should look for Disco modules to be loaded. disco>Load only from the stdlib (standard lib modules) disco/Load only from a specific directory (:load) disco8Load from current working dir or stdlib (import at REPL) disco8Load from specific dir or stdlib (import in file) disco3Get something from a module and its direct imports. discoGet the types of all names bound in a module and its direct imports. disco>Get all type definitions from a module and its direct imports. discoThe empty module info record. discoAdd the possibility of loading imports from the stdlib. For example, this is what we want to do after a user loads a specific file using `:load` (for which we will NOT look in the stdlib), but then we need to recursively load modules which it imports (which may either be in the stdlib, or the same directory as the `:load`ed module). discoGiven a module resolution mode and a raw module name, relavent directories are searched for the file containing the provided module name. Returns Nothing if no module with the given name could be found.( ( %disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred()*01<Jdisco"Extra custom state for the parser.disco(Currently required level of indentation.discoSet of enabled language extensions (some of which may affect parsing).disco Currently required indent level.disco1Results from parsing a block of top-level things. discoA parser is a megaparsec parser of strings, with an extra layer of state to keep track of the current indentation level and language extensions, and some custom error messages. disco$Run a parser from the initial state.discoRun a parser under a specified . disco indented p is just like p, except that every token must not start in the first column. disco indented p is just like p, except that every token after the first must not start in the first column.discorequireIndent p possibly requires p- to be indented, depending on the current  . Used in the definition of   and  . disco6Locally set the enabled extensions within a subparser.disco=Locally enable some additional extensions within a subparser.disco9Ensure that a specific extension is enabled, fail if not. disco3Generically consume whitespace, including comments. discoParse a lexeme, that is, a parser followed by consuming whitespace. disco!Parse a given string as a lexeme. discoParse a reserved operator.disco0Characters that can occur in an operator symbol.disco(A literal ellipsis of two or more dots, .. discoThe symbol that starts an anonymous function (either a backslash or a Greek ). discoParse a natural number.disco(Parse a nonnegative decimal of the form  xxx.yyyy[zzz], where the ys and bracketed zs are both optional as long as the other is present. (In other words, there must be something after the period.) For example, this parser accepts all of the following: 2.0 2.333 2.33[45] 2.[45]The idea is that brackets surround an infinitely repeating sequence of digits.We used to accept 2.3 with no trailing digits, but no longer do. See  .https://github.com/disco-lang/disco/issues/245 and Note [Trailing period]. discoParse a reserved word. discoThe list of all reserved words.discoParse an identifier, i.e. any non-reserved string beginning with a given type of character and continuing with alphanumerics, underscores, and apostrophes. disco Parse an  and turn it into a . discoParse the entire input as a module (with leading whitespace and no leftovers). discoParse an entire module (a list of declarations ended by semicolons). The   parameter tells us whether to include or replace any language extensions enabled at the top level. We include them when parsing a module entered at the REPL, and replace them when parsing a standalone module.discoParse an extension. disco:Parse the name of a language extension (case-insensitive). discoParse an import, of the form import modulename. discoParse the name of a module. discoParse a top level item (either documentation or a declaration), which must start at the left margin.discoParse a documentation item: either a group of lines beginning with |||1 (text documentation), or a group beginning with !!!" (checked examples/properties).disco/Parse one line of documentation beginning with |||.disco4Parse a top-level property/unit test, which is just !!!" followed by an arbitrary term. discoParse a single top-level declaration (either a type declaration or single definition clause).disco/Parse a top-level type declaration of the form x : ty.discoParse a definition of the form x pat1 .. patn = t.disco;Parse the definition of a user-defined algebraic data type. discoParse the entire input as a term (with leading whitespace and no leftovers). discoParse a term, consisting of a  parseTerm') optionally followed by an ascription. disco&Parse a non-atomic, non-ascribed term. discoParse an atomic term.discoParse a wildcard, which is an underscore that isn't the start of an identifier.discoParse a standalone operator name with tildes indicating argument slots, e.g. ~+~ for the addition operator.disco)Parse a primitive name starting with a $. discoParse a container, like a literal list, set, bag, or a comprehension (not including the square or curly brackets).  container-contents ::=  nonempty-container | empty  nonempty-container ::=  term  container-end  container-end ::= '|'  comprehension | (','  term)* [  ellipsis ]  comprehension ::=  qual [ ','  qual ]*  qual ::=  ident 'in'  term |  term  ellipsis ::= [ ',' ] '..' [ ',' ]  term disco?Parse an ellipsis at the end of a literal list, of the form .. t4. Any number > 1 of dots may be used, just for fun. discoParse the part of a list comprehension after the | (without square brackets), i.e. a list of qualifiers. q [,q]* disco6Parse a qualifier in a comprehension: either a binder x in t or a guard t.discoTurn a parenthesized list of zero or more terms into the appropriate syntax node: one term (t) is just the term itself (but we record the fact that it was parenthesized, in order to correctly turn juxtaposition into multiplication); two or more terms  (t1,t2,...) are a tuple.disco)Parse a quantified abstraction (, D, D).disco6Parse a quantifier symbol (lambda, forall, or exists). discoParse a let expression (let x1 = t1, x2 = t2, ... in t).discoParse a single binding (x [ : ty ] = t). discoParse a case expression. disco&Parse one branch of a case expression. disco'Parse the list of guards in a branch.  otherwise= can be used interchangeably with an empty list of guards. discoParse a single guard (if,  if ... is ..., or let) discoParse an atomic pattern, by parsing a term and then attempting to convert it to a pattern. discoParse a pattern, by parsing a term and then attempting to convert it to a pattern. The Bool parameter says whether to require a type ascription.discoDoes a pattern either have a top-level ascription, or consist of a tuple with each component recursively having ascriptions? This is required for patterns bound by D and D quantifiers.discoLazy monadic variant of find.disco>Does a pattern have the same variable repeated more than once?disco'Attempt converting a term to a pattern. disco Value. It is a newtype just so we can have a custom Show& instance for it and then derive a Show instance for the rest of the Value type. discoValues which can be used as keys in a map, i.e. those for which a Haskell Ord instance can be easily created. These should always be of a type for which the QSimple qualifier can be constructed. At the moment these are always fully evaluated (containing no indirections) and thus don't need memory management. At some point in the future constructors for simple graphs and simple maps could be created, if the value type is also QSimple. The only reason for actually doing this would be constructing graphs of graphs or maps of maps, or the like. discoDifferent types of values which can result from the evaluation process. discoA numeric value. discoA built-in function constant. discoAn injection into a sum type. discoThe unit value. discoA pair of values. discoA closure, i.e. a function body together with its environment. discoA disco type can be a value. For now, there are only a very limited number of places this could ever show up (in particular, as an argument to  enumerate or count). discoA reference, i.e. a pointer to a memory cell. This is used to implement (optional, user-requested) laziness as well as recursion. discoA literal function value. VFun is only used when enumerating function values in order to decide comparisons at higher-order function types. For example, in order to compare two values of type (Bool -> Bool) -> Bool= for equality, we have to enumerate all functions of type Bool -> Bool as VFun values.We assume that all VFun values are strict, that is, their arguments should be fully evaluated to RNF before being passed to the function. discoA proposition. discoA literal bag, containing a finite list of (perhaps only partially evaluated) values, each paired with a count. This is also used to represent sets (with the invariant that all counts are equal to 1). disco1A graph, stored using an algebraic repesentation. discoA map from keys to values. Differs from functions because we can actually construct the set of entries, while functions only have this property when the key type is finite. disco!Convenient pattern for list cons. disco&Convenient pattern for the empty list. disco.A convenience function for creating a default VNum value with a default ( Fractional) flag. disco6Whether the property test resulted in a runtime error. disco.Whether the property test resulted in success. disco-The reason the property test had this result. discoAllocate a new memory cell containing an unevaluated expression with the current environment. Return the index of the allocated cell. discoAllocate new memory cells for a group of mutually recursive bindings, and return the indices of the allocate cells. disco"Look up the cell at a given index. discoSet the cell at a given index.discoPretty-print a value with guaranteed parentheses. Do nothing for tuples; add an extra set of parens for other values.disco: pretty-prints a lists of values separated by a delimiter.disco!Pretty-print a literal bag value. (disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred()*01<nF discoEnumerate all values of type Void (none). discoEnumerate all values of type Unit (the single value unit). discoEnumerate the values of type Bool as  [false, true]. discoEnumerate all values of type Nat (0, 1, 2, ...). discoEnumerate all values of type Integer (0, 1, -1, 2, -2, ...). discoEnumerate all values of type  Fractional" in the Calkin-Wilf order (1, 12, 2, 13, 32, 2 3, 3, ...). discoEnumerate all values of type Rational in the Calkin-Wilf order, with negatives interleaved (0, 1, -1, 12, -12, 2, -2, ...). disco!Enumerate all Unicode characters. discoEnumerate all *finite* sets over a certain element type, given an enumeration of the elements. If we think of each finite set as a binary string indicating which elements in the enumeration are members, the sets are enumerated in order of the binary strings. discoEnumerate all *finite* lists over a certain element type, given an enumeration of the elements. It is very difficult to describe the order in which the lists are generated.discoEnumerate all functions from a finite domain, given enumerations for the domain and codomain.discoEnumerate all values of a product type, given enumerations of the two component types. Uses a fair interleaving for infinite component types.discoEnumerate all values of a sum type, given enumerations of the two component types. disco%Enumerate the values of a given type. disco$Enumerate a finite product of types. disco/Produce an actual list of the values of a type. discoProduce an actual list of values enumerated from a finite product of types.  )disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred"()*01<9% discoTypechecking can be in one of two modes: inference mode means we are trying to synthesize a valid type for a term; checking mode means we are trying to show that a term has a given type. discoInfer the type of a telescope, given a way to infer the type of each item along with a context of variables it binds; each such context is then added to the overall context when inferring subsequent items in the telescope. discoCheck all the types and extract all relevant info (docs, properties, types) from a module, returning a   record on success. This function does not handle imports at all; any imports should already be checked and passed in as the second argument. disco'Turn a list of type definitions into a , checking for duplicate names among the definitions and also any type definitions already in the context. disco(Check the validity of a type definition. disco(Check if a given type is cyclic. A type ty is cyclic if: ty$ is the name of a user-defined type.Repeated expansions of the type yield nothing but other user-defined types.An expansion of one of those types yields another type that has been previously encountered.In other words, repeatedly expanding the definition can get us back to exactly where we started.The function returns the set of TyDefs encountered during expansion if the TyDef is not cyclic. discoEnsure that a type definition does not use any unbound type variables or undefined types. discoCheck for polymorphic recursion: starting from a user-defined type, keep expanding its definition recursively, ensuring that any recursive references to the defined type have only type variables as arguments. disco-Keep only the duplicate elements from a list.filterDups [1,3,2,1,1,4,2][1,2] discoGiven a list of type declarations from a module, first check that there are no duplicate type declarations, and that the types are well-formed; then create a type context containing the given declarations. disco0Check that all the types in a context are valid. disco6Type check a top-level definition in the given module. discoGiven a context mapping names to documentation, extract the properties attached to each name and typecheck them. disco4Check the types of the terms embedded in a property. disco.Check that a sigma type is a valid type. See  . discoDisco doesn't need kinds per se, since all types must be fully applied. But we do need to check that every type is applied to the correct number of arguments. discoCheck that a term has the given type. Either throws an error, or returns the term annotated with types for all subterms.>This function is provided for convenience; it simply calls   with an appropriate  . disco1Check that a term has the given polymorphic type. discoInfer the type of a term. If it succeeds, it returns the term with all subterms annotated.>This function is provided for convenience; it simply calls   with an appropriate  . discoTop-level type inference algorithm, returning only the first possible result. discoTop-level type inference algorithm: infer up to the requested max number of possible (polymorphic) types for a term by running type inference, solving the resulting constraints, and quantifying over any remaining type variables. discoTop-level type checking algorithm: check that a term has a given polymorphic type by running type checking and solving the resulting constraints. discoThe main workhorse of the typechecker. Instead of having two functions, one for inference and one for checking,   takes a  . This cuts down on code duplication in many cases, and allows all the checking and inference code related to a given AST node to be placed together. discoCheck that a pattern has the given type, and return a context of pattern variables bound in the pattern along with their types. discoConstraints needed on a function type for it to be the type of the absolute value function. discoConstraints needed on a function type for it to be the type of the container size operation. discoGiven an input type ty, return a type which represents the output type of the absolute value function, and generate appropriate constraints. discoGiven an input type ty, return a type which represents the output type of the floor or ceiling functions, and generate appropriate constraints. discoGiven input types to the exponentiation operator, return a type which represents the output type, and generate appropriate constraints. discoGet the argument (element) type of a (known) container type. Returns a fresh variable with a suitable constraint if the given type is not literally a container type. discoEnsure that a type's outermost constructor matches the provided constructor, returning the types within the matched constructor or throwing a type error. If the type provided is a type variable, appropriate constraints are generated to guarantee the type variable's outermost constructor matches the provided constructor, and a list of fresh type variables is returned whose count matches the arity of the provided constructor. discoA variant of ensureConstr that expects to get exactly one argument type out, and throws an error if we get any other number. discoA variant of ensureConstr that expects to get exactly two argument types out, and throws an error if we get any other number. disco A variant of   that works on  s instead of s. Behaves similarly to   if the   is  ?; otherwise it generates an appropriate number of copies of  . disco A variant of  ! that expects to get a single  7 and throws an error if it encounters any other number. disco A variant of   that expects to get two  ;s and throws an error if it encounters any other number. discoEnsure that two types are equal: 1. Do nothing if they are literally equal 2. Generate an equality constraint otherwise. . *disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred()*01< disco - constructors are used in the LYG checker   constructors are used when reporting examples of uncovered patterns, we only pick out a few of them discoAssuming type aliases have been resolved, this function converts Disco types into lists of DataCons that are compatible with the LYG checker.A list of constructors is   if the only way to fully match against the type is with a wildcard or variable pattern. Otherwise, it is  .The LYG checker only reads the list of constructors if a type is  ,. From the point of view of the checker,   is a synonym for opaque, and the constructors are discarded. The dataconstructors in an   list are only used when generating the 3 positive examples of what you haven't matched against. This will probably need to change a bit when bringing exhaustiveness checking to the new arithmetic patterns.Notice the last case of this function, which a wildcard handling the types: (_ Ty.:->: _) (Ty.TySet _) (Ty.TyBag _) (Ty.TyVar _) (Ty.TySkolem _) (Ty.TyProp) (Ty.TyMap _ _) (Ty.TyGraph _)I believe all of these are impossible to pattern match against with anything other than a wildcard (or variable pattern) in Disco, so they should always be fully covered. But if they are in a pair, for example, Set(Int)*Int, we still need to generate 3 examples of the pair if that Int part isn't covered. So how do we fill the concrete part of Set(Int), (or a generic type "a", or a function, etc.)? I'm calling that  2, and printing an underscore. (Also, I'm using   for reasons metioned above).( ( +disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred()*01< discoReturns a predicate that returns true if another constraint conflicts with the one given. This alone is not sufficient to test if a constraint can be added, but it filters out the easy negatives early on discoSearch for a MatchDataCon that is matching on k specifically (there should be at most one, see I4 in section 3.4) and if it exists, return the variable ids of its arguments discosubstituting y *for* x ie replace the second with the first, replace x with y discoDeals with I2 from section 3.4 if a variable in the context has a resolvable type, there must be at least one constructor which can be instantiated without contradiction of the refinement type This function tests if this is true discoAttempts to "instantiate" a match of the dataconstructor k on x If we can add the MatchDataCon constraint to the normalized refinement type without contradiction (a Nothing value), then x is inhabited by k and we return true  ,disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred()*01<\discoThis exhaustiveness checking algorithm is based on the paper "Lower Your Guards: A Compositional Pattern-Match Coverage Checker": https://www.microsoft.com/en-us/research/uploads/prod/2020/03/lyg.pdfSome simplifications were made to adapt the algorithm to suit Disco. The most notable change is that here we always generate (at most) 3 concrete examples of uncovered patterns, instead of finding the most general complete description of every uncovered input.discoConvert a Disco APattern into a list of Guards which cover that patternThese patterns are currently not handled: , APNeg --still need to handle rational case , APFrac --required for rationals? algebraic (probably will be eventually replaced anyway): , APAdd , APMul , APSub These (or some updated version of them) may be handled eventually, once updated arithmetic patterns are merged.We treat unhandled patterns as if they are exhaustively matched against (aka, they are seen as wildcards by the checker). This necessarily results in some false negatives, but no false positives.discoLess general version of the above inhabitant finding function returns a maximum of 3 possible args lists that haven't been matched against, as to not overwhelm new users of the language. This is essentially a DFS, and it has a bad habit of trying to build infinite lists whenever it can, so we give it a max depth of 32 If we reach 32 levels of nested dataconstructors in this language, it is pretty safe to assume we were chasing after an infinite structure. .    -disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred()*01<WdiscoRun a desugaring computation.discoDesugar a definition (consisting of a collection of pattern clauses with bodies) into a core language term.discoDesugar an abstraction -- that is, a collection of clauses with their corresponding patterns. Definitions are abstractions (which happen to be named), and source-level lambdas are also abstractions (which happen to have only one clause).discoDesugar the application of a "bag from counts" primitive on a list, either a safe or unsafe variant.disco Desugar the min and max( functions into conditional expressions.discoDesugar a typechecked term.discoDesugar a property by wrapping its corresponding term in a test frame to catch its exceptions & convert booleans to props.discoTest whether a given unary operator is one that needs to be desugared, given the type of the argument and result.discoTest whether a given binary operator is one that needs to be desugared, given the two types of the arguments and the type of the result.disco6Desugar a primitive binary operator at the given type.discoDesugar a saturated application of a unary operator. The first argument is the type of the result.discoDesugar a saturated application of a binary operator. The first argument is the type of the result.discoDesugar a container comprehension. First translate it into an expanded ATerm and then recursively desugar that.disco:Expand a container comprehension into an equivalent ATerm.discoDesugar a let into applications of a chain of nested lambdas. e.g. let x = s, y = t in q desugars to (x. (y. q) t) sdiscoDesugar a lambda from a list of argument names and types and the desugared DTerm expression for its body. It will be desugared to a chain of one-argument lambdas. e.g. x y z. q desugars to  x. y. z. qdisco!Desugar a tuple to nested pairs, e.g. (a,b,c,d) ==> (a,(b,(c,d))).adiscoExpand a chain of comparisons into a sequence of binary comparisons combined with and*. Note we only expand it into another 3 (which will be recursively desugared), because and itself also gets desugared. For example, a  b<= c d becomes a  band b <= c and c d.disco&Desugar a branch of a case expression.discoDesugar the list of guards in one branch of a case expression. Pattern guards essentially remain as they are; boolean guards get turned into pattern guards which match against true.disco$Desugar a container literal such as [1,2,3] or {1,2,3}.2667444.disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred()*01< discoUtility function to desugar and compile a thing, given a desugaring function for it.discoCompile a typechecked term () directly to a  + term, by desugaring and then compiling.disco Compile a typechecked property () directly to a  , term, by desugaring and then compilling.disco.Compile a context of typechecked definitions ( ) to a sequence of compiled   bindings, such that the body of each binding depends only on previous ones in the list. First topologically sorts the definitions into mutually recursive groups, then compiles recursive definitions specially in terms of delay and force.disco9Compile a group of mutually recursive definitions, using delay8 to compile recursion via references to memory cells.disco!Compile a typechecked, desugared  to an untyped   term.discoCompile a natural number. A separate function is needed in case the number is of a finite type, in which case we must mod it by its type. compileNat :: Member Fresh r => Type -> Integer -> Sem r Core compileNat (TyFin n) x = return $ CNum Fraction ((x  n) % 1) compileNat _ x = return $ CNum Fraction (x % 1)Compile a primitive. Typically primitives turn into a corresponding function constant in the core language, but sometimes the particular constant it turns into may depend on the type.discoCompile a case expression of type  to a core language expression of type (Unit C ), in order to delay evaluation until explicitly applying it to the unit value.discoCompile a branch of a case expression of type  to a core language expression of type (Unit C ) C . The idea is that it takes a failure continuation representing the subsequent branches in the case expression. If the branch succeeds, it just returns the associated expression of type ; if it fails, it calls the continuation to proceed with the case analysis.disco takes a list of guards, the name of the failure continuation of type (Unit C ), and a Core term of type  to return in the case of success, and compiles to an expression of type  which evaluates the guards in sequence, ultimately returning the given expression if all guards succeed, or calling the failure continuation at any point if a guard fails.disco takes a pattern, the compiled scrutinee, the name of the failure continuation, and a Core term representing the compilation of any guards which come after this one, and returns a Core expression of type  that performs the match and either calls the failure continuation in the case of failure, or the rest of the guards in the case of success.discoCompile a unary operator.discoCompile a binary operator. This function needs to know the types of the arguments and result since some operators are overloaded and compile to different code depending on their type. /arg1 ty -> arg2 ty -> result ty -> op -> resultdiscoType of the operator argument8 Safe-Inferred()*01<discoWrapper for a monadic action with phantom type parameter for reflection. Locally defined so that the instance we are going to build with reflection must be coherent, that is there cannot be orphans.discoA dictionary of the functions we need to supply to make an instance of ErrordiscoLike # but applies a given function from  to some other type, typically something less opaque. e.g.:  runMonadCatch C.displayExceptiondiscoIntroduce a local 9: constraint on 3 --- allowing it to interop nicely with exceptionsdiscoIntroduce a local 9; constraint on 3 --- allowing it to interop nicely with exceptionsdiscoGiven a reifiable mtl Error dictionary, we can make an instance of  MonadError for the action wrapped in Action.disco+A computation that requires an instance of  or  for $. This might be something with type  e m => m a.disco+A computation that requires an instance of  or  for $. This might be something with type  e m => m a. < Safe-Inferred()*01<discoAn effect capable of providing  values.discoRun a  effect with an explicit .discoRun a  effect by using the  random generator./disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred"()*01<6discoToggles which outcome (finding or not finding the thing being searched for) qualifies as success, without changing the thing being searched for.disco)Flips the success or failure status of a  PropResult', leaving the explanation unchanged.discoSelect samples from an enumeration according to a search type. Also returns a  & describing the results, which may be   if the enumeration is no larger than the number of samples requested.0disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred()*01<ѳ disco/The CESK machine has two basic kinds of states.discoThe  constructor represents the state when we are recursing "into" a term. There is a currently focused expression which is to be evaluated in the given context. Generally, evaluation proceeds by pattern-matching on the focused expression and either immediately turning it into a value (if it is simple), or focusing on a subexpression and pushing a new frame on the continuation stack indicating how to continue evaluating the whole expression once finished with the subexpression.discoThe  constructor represents the state when we have completed evaluating an expression and are now on our way back "out" of the recursion. Generally, evaluation proceeds by pattern-matching on the top frame of the continuation stack (and sometimes on the value as well), to see what is to be done with the value.discoThere is also an  constructor representing an exception that is propagating up the continuation stack. Disco does not have user-level exceptions or try/catch blocks etc., but exceptions may be caught by test frames and turned into a test result rather than crashing the entire computation.discoA frame represents a single step of the context, explaining what to do with a value in that context (ultimately transforming it into another value, which may in turn be handed to the next frame in the continuation stack, and so on).As an invariant, any  containing unevaluated  # expressions must also carry an   in which to evaluate them.disco!Inject the value into a sum type.disco Do a case analysis on the value.discoEvaluate the right-hand value of a pair once we have finished evaluating the left-hand side.discoPut the value into the right-hand side of a pair together with this previously evaluated left-hand side.disco(Project one or the other side of a pair.discoEvaluate the argument of an application once we have finished evaluating the function.disco?Apply an evaluated function to this already-evaluated argument.disco3Apply a previously evaluated function to the value.disco2Force evaluation of the contents of a memory cell.disco9Update the contents of a memory cell with its evaluation.discoRecord the results of a test.discoGiven the index of a memory cell and a function's arguments, memoize the results of a function.disco)A continuation is just a stack of frames.disco%Is the CESK machine in a final state?disco!Run a CESK machine to completion.disco%Advance the CESK machine by one step.discoPerform a square root operation. If the program typechecks, then the argument and output will really be Natural.discoimplementation of ! taken from the Haskell wiki: 7https://wiki.haskell.org/Generic_number_type#squareRootdiscoExtend a sequence infinitely by interpolating it as a polynomial sequence, via forward differences. Essentially the same algorithm used by Babbage's famous Difference Engine.discoCompute the forward difference of the given sequence, that is, differences of consecutive pairs of elements.discoTake forward differences until the result is constant, and return the constant. The sign of the constant difference tells us the limiting behavior of the sequence.discoLooks up a sequence of integers in OEIS. Returns 'left()' if the sequence is unknown in OEIS, otherwise 'right " %https://oeis.org/"'discoExtends a Disco integer list with data from a known OEIS sequence. Returns a list of integers upon success, otherwise the original list (unmodified).discoGiven a list of disco values, sort and collate them into a list pairing each unique value with its count. Used to construct/normalize bags and sets. Prerequisite: the values must be comparable.discoNormalize a list of values where each value is paired with a count, but there could be duplicate values. This function uses merge sort to sort the values, adding the counts of multiple instances of the same value. Prerequisite: the values must be comparable.discoGeneric function for merging two sorted, count-annotated lists of type  [(a,Integer)] a la merge sort, using the given comparison function, and using the provided count combining function to decide what count to assign to each element of the output. For example, (+) corresponds to bag union; min+ corresponds to intersection; and so on.disco Convert a Value to a ValProp", embedding booleans if necessary.1disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred"()*01<.discoA record of information about the current top-level environment.discoInfo about the top-level module collecting stuff entered at the REPL.disco:Top-level environment mapping names to values. Set by loadDefs.disco*Mapping from loaded module names to their   records.disco3The most recent file which was :loaded by the user.disco-The initial (empty) record of top-level info.disco2All effects needed for the top level + evaluation.discoEffects needed for evaluation.disco Effects needed at the top level.discoAppend two effect rows.discoSettings for running the InputT monad from  haskeline:. Just uses the defaults and sets the history file to .disco_history.discoRun a top-level computation.discoRun a computation that needs an input environment, grabbing the current top-level environment from the  records.discoParse a module from a file, re-throwing a parse error if it fails.discoRun a typechecking computation, providing it with local contexts (initialized to the provided arguments) for variable types and type definitions.disco A variant of  that requires only a   instead of a  .discoRun a typechecking computation in the context of the top-level REPL module, re-throwing a wrapped error if it fails.discoRecursively loads a given module by first recursively loading and typechecking its imported modules, adding the obtained   records to a map from module names to info records, and then typechecking the parent module in an environment with access to this map. This is really just a depth-first search.The  : argument specifies where to look for imported modules.discoLike #, but start with an already parsed  instead of loading a module from disk by name. Also, check it in a context that includes the current top-level context (unlike a module loaded from disk). Used for e.g. blocks/modules entered at the REPL prompt.discoRecursively load a Disco module while keeping track of an extra Map from module names to   records, to avoid loading any imported module more than once. Resolve the module, load and parse it, then call .discoA list of standard library module names, which should always be loaded implicitly.discoRecursively load an already-parsed Disco module while keeping track of an extra Map from module names to   records, to avoid loading any imported module more than once. Typecheck it in the context of the top-level type context iff the   parameter is  :. Recursively load all its imports, then typecheck it.discoTry loading the contents of a file from the filesystem, emitting an error if it's not found.discoAdd things from the given module to the set of currently loaded things.discoSet the given   record as the currently loaded module. This also includes updating the top-level state with new term definitions, documentation, types, and type definitions. Replaces any previously loaded module.discoPopulate various pieces of the top-level info record (docs, type context, type and term definitions) from the   record corresponding to the currently loaded module, and load all the definitions into the current top-level environment.2disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred"()*016<_!disco;An existential wrapper around any REPL command info record.discoData type to represent all the information about a single REPL command.discoName of the commanddisco5Help text showing how to use the command, e.g. ":ann  term"discoShort free-form text explaining the command. We could also consider adding long help text as well.disco!Is the command for users or devs?disco*Is it a built-in command or colon command?disco8The action to execute, given the input to the command.disco#Parser for the command argument(s).disco8Tags used at the type level to denote each REPL command.disco2Things that don't start with a colon: eval and nopdiscoParse one of the colon commands in the given list of commands.discoGiven a list of available commands and a string seen after a colon, return a parser for its arguments.discoParse a file name.disco2A parser for something entered at the REPL prompt.discoGiven a list of available REPL commands and the currently enabled extensions, parse a string entered at the REPL prompt, returning either a parse error message or a parsed REPL expression.discoParses, typechecks, and loads a module by first recursively loading any imported modules by calling loadDiscoModule. If no errors are thrown, any tests present in the parent module are executed. Disco.Interactive.CmdLine uses a version of this function that returns a Bool.disco B -> ... -> Y -> Z into the pair of types (A * B * ... * Y * Unit, Z). Note we do not optimize away the Unit at the end of the chain, since this needs to be an isomorphism. Otherwise we would not be able to distinguish between e.g. Z and Unit -> Z.discoEvaluate the application of a curried function to an uncurried input.discoStrip the unit type from the end of a chain like (tA :*: (tB :*: (tC :*: Unit))), which is an output of , and return a function to make the corresponding change to a value of that type.discoTurn a value into a list of formatted columns in a type-directed way. Lists and tuples are only split out into columns if they occur at the top level; lists or tuples nested inside of other data structures are simply pretty-printed. However, note we have to make a special case for nested tuples: if a pair type occurs at the top level we keep recursively splitting out its children into columns as long as they are also pair types.Any value of a type other than a list or tuple is simply pretty-printed.discoDefault formatting of a typed column value by simply pretty-printing it, and using the alignment appropriate for its type.discoRender a table, given as a list of rows, formatting it so that each column is aligned.3disco team and contributors BSD-3-Clausebyorgey@gmail.com Safe-Inferred()*01<discoCommand-line options for disco.disco!Should we just print the version?discoA single expression to evaluatedisco$Execute the commands in a given filediscoCheck a file and then exitdisco;Parse and run the command corresponding to some REPL input.  =>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz { | } ~                                                                                                                                                                                                              99                                                                                                   ! ! !!! ! ! ! ! ! ! ! ! ! ! !!!" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ % % % % % % % % % % % % % % %%% %% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % & & & & & & & & & & & & & & & & & & & & ' ' ' '' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) * * * * * * * * * * * * * * * * * * * * * ** * * * ** * * * * * * * * * * * * * * * * * * * * * + + ++ + + + + + + + + + + + + + + + + ++ + , , , , , , , ,, , , , , , ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,------...............////00000000111111111111111111111112222222222222223333333333555555556 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%''''(((----------------------888888:;8<<<<<<<000000000000000000000000000001111111111112222222222222222222222222222223 disco-0.2-Ic5OYLGQ1QL1sNsEHodldc Disco.Pretty Disco.DataDisco.Effects.CounterDisco.Effects.InputDisco.Effects.StateDisco.Effects.Store"Disco.Exhaustiveness.PossibilitiesDisco.Extensions Disco.ReportDisco.Syntax.OperatorsDisco.Pretty.PrecDisco.Pretty.DSLDisco.Syntax.Prims Disco.Util Disco.DocDisco.Effects.LFreshDisco.Types.QualifiersDisco.Typecheck.Graph Disco.Subst Disco.TypesDisco.Types.RulesDisco.Typecheck.ConstraintsDisco.Typecheck.Unify Disco.Names Disco.ContextDisco.MessagesDisco.AST.GenericDisco.AST.DesugaredDisco.AST.SurfaceDisco.AST.TypedDisco.Typecheck.EraseDisco.AST.CoreDisco.Effects.FreshDisco.Typecheck.SolveDisco.Typecheck.Util Disco.Module Disco.Parser Disco.Error Disco.ValueDisco.EnumerateDisco.TypecheckDisco.Exhaustiveness.TypeInfoDisco.Exhaustiveness.ConstraintDisco.Exhaustiveness Disco.Desugar Disco.CompileDisco.PropertyDisco.Interpret.CESK Disco.EvalDisco.Interactive.CommandsDisco.Interactive.CmdLinedisco Paths_discoPolysemy.ConstraintAbsorber MonadState&Polysemy.ConstraintAbsorber.MonadCatchS MonadCatch MonadThrowPolysemy.Random*prettyprinter-1.7.1-5e7OiMaiyLWFEOfH8r8oT4Prettyprinter.InternalDoc $fDataName $fDataRebind $fDataEmbed $fDataBindCounterNextnext runCounter' runCounter inputToStatemapInputzoomuse.=%=Store ClearStoreNew LookupStore InsertStoreMapStore AssocsStoreKeepKeys clearStorenew lookupStore insertStoremapStore assocsStorekeepKeysrunStore PossibilitiesgetPossibilitiesanyOfnone retSingleallCombinations$fShowPossibilities$fEqPossibilities$fOrdPossibilities$fFunctorPossibilities$fSemigroupPossibilities$fMonoidPossibilities$fApplicativePossibilitiesExt PrimitivesNoStdLib RandomnessExtSet defaultExtsallExts allExtsList addExtension$fEqExt$fOrdExt $fShowExt $fReadExt $fEnumExt $fBoundedExtReportRTxtRSeqRVSeqRListRNesttexthcathsepvcatvseplistnest $fShowReportOpInfoopFixityopSynsopPrecOpFixityUOpFBOpFBFixityInLInRInUFixityPrePostTyOp EnumerateCountBOpAddSubSSubMulDivExpIDivEqNeqLtGtLeqGeqAndOrImplIffModDividesChooseConsCartProdUnionInterDiffElemSubsetShouldUOpNegNotFactopTableuopMapbopMapopNamesuPrecbPrecassocfunPrec $fShowOpInfo $fEqOpFixity$fShowOpFixity$fGenericOpFixity $fEqBFixity $fOrdBFixity $fEnumBFixity$fBoundedBFixity $fShowBFixity$fGenericBFixity $fEqUFixity $fOrdUFixity $fEnumUFixity$fBoundedUFixity $fShowUFixity$fGenericUFixity $fShowTyOp$fEqTyOp $fOrdTyOp $fGenericTyOp $fDataTyOp $fAlphaTyOp $fSubsttTyOp $fShowBOp $fReadBOp$fEqBOp$fOrdBOp $fGenericBOp $fDataBOp $fAlphaBOp $fSubsttBOp $fShowUOp $fReadUOp$fEqUOp$fOrdUOp $fGenericUOp $fDataUOp $fAlphaUOp $fSubsttUOpPAPrec lowerPrecinitPAascrPAfunPArPAtarrPAtaddPAtmulPAtfunPAugetPAgetPA$fShowPA$fEqPAparensbracketsbracesbagquotes doubleQuotesintegerindenthangempty<+><>$+$ punctuate intercalate bulletList renderDoc renderDoc' $fIsStringSemPrimInfothePrim primSyntax primExposedPrimPrimUOpPrimBOpPrimLeft PrimRightPrimSqrt PrimFloorPrimCeilPrimAbsPrimMinPrimMax PrimPowerPrimListPrimBagPrimSetPrimB2CPrimC2BPrimUC2B PrimMapToSet PrimSetToMap PrimSummary PrimVertexPrimEmptyGraph PrimOverlay PrimConnect PrimInsert PrimLookupPrimEach PrimReduce PrimFilterPrimJoin PrimMerge PrimIsPrime PrimFactorPrimFrac PrimCrash PrimUntil PrimHolds PrimLookupSeq PrimExtendSeqPrimSeed PrimRandom primTabletoPrimprimMap $fShowPrim $fReadPrim$fEqPrim $fOrdPrim $fGenericPrim $fAlphaPrim $fSubsttPrim $fDataPrim==>for!maximum0filterNE partitionNEpartitionEithersNE iterUntilgate ReferencerefTyperefRefTypeIntroRefURLDocKeyPrimKeyOtherKeymkRefmkIntrodocMap $fEqReference$fOrdReference$fShowReference $fEqRefType $fOrdRefType $fShowRefType $fReadRefType$fBoundedRefType $fEnumRefType $fEqDocKey $fOrdDocKey $fShowDocKeyLFreshLfreshAvoid GetAvoidsAction LFreshDictlfresh_avoid_ getAvoids_lfreshavoid getAvoids runLFresh runLFresh'lunbind absorbLFresh$fLFreshAction$fFunctorAction$fApplicativeAction $fMonadActionPrettyprettywithPAsetPAltrtmparens prettyStrpretty'prettyRational prettyDecimalfindRepfindRep'digitalExpansion $fPrettyBOp $fPrettyUOp $fPrettyTyOp $fPrettyName $fPrettySet $fPrettyMap$fPrettyNonEmpty $fPrettyListSort QualifierQNumQSubQDivQCmpQEnumQBoolQBasicQSimplebopQualtopSort$fPrettyQualifier$fShowQualifier $fEqQualifier$fOrdQualifier$fGenericQualifier$fAlphaQualifierGraphGmkGraphnodesedgesmapdelete condensationwccwccIDstopsort sequenceGraphsucprecessors $fPrettyGraph $fShowGraph SubstitutiongetSubstdomidS|->@@compose applySubstfromListtoListlookup$fPrettySubstitution$fFunctorSubstitution$fEqSubstitution$fOrdSubstitution$fShowSubstitutionHasTypegetTypesetType StrictnessStrictLazyPolyTypeForallTyDefCtx TyDefBodyTypeTyAtomTyConConCArrCProdCSum CContainerCMapCGraphCUserUAtomUBUVAtomAVarABaseVarVIlkSkolem UnificationBaseTyVoidUnitBPNZFQCGenCtrSetCtrBagCtrListTyStringTyUserTyMapTyGraph TyContainerTySetTyBagTyList:+::*::->:TyGenTyCTyQTyFTyZTyNTyPropTyBoolTyUnitTyVoidTySkolemTyVarCSetCBagCListUisCtrisVarisBaseisSkolemuisVar uatomToAtom uatomToEitherisTyVar toPolyType closeType countTypeisNumTy isEmptyTy isFiniteTy isSearchable strictnessunpairatomToTypeSubstuatomToTypeSubst containerVars $fSubsttMap $fSubsttSet$fSubstTypeType$fSubstTypeCon$fSubstTypeVoid$fSubstTypeRatio$fSubstTypeQualifier $fPrettyType $fPrettyCon $fPrettyUAtom$fSubstUAtomUAtom $fPrettyAtom$fSubstAtomAtom $fPrettyIlk$fPrettyBaseTy $fPretty(,)$fShowTyDefBody$fPrettyPolyType$fEqStrictness$fShowStrictness$fGenericStrictness$fAlphaStrictness$fShowPolyType$fGenericPolyType$fDataPolyType$fAlphaPolyType$fSubstTypePolyType $fShowType$fEqType $fOrdType $fGenericType $fDataType $fAlphaType $fShowCon$fEqCon$fOrdCon $fGenericCon $fDataCon $fAlphaCon $fShowAtom$fEqAtom $fOrdAtom $fGenericAtom $fDataAtom $fAlphaAtom$fSubstTypeAtom $fShowVar$fEqVar$fOrdVar $fGenericVar $fDataVar $fAlphaVar$fSubstAtomVar$fSubstTypeVar$fEqIlk$fOrdIlk $fReadIlk $fShowIlk $fGenericIlk $fDataIlk $fAlphaIlk$fSubstAtomIlk$fSubstTypeIlk $fShowBaseTy $fEqBaseTy $fOrdBaseTy$fGenericBaseTy $fDataBaseTy $fAlphaBaseTy$fSubstBaseTyBaseTy$fSubstAtomBaseTy$fSubstUAtomBaseTy$fSubstTypeBaseTy $fShowUAtom $fEqUAtom $fOrdUAtom$fGenericUAtom $fAlphaUAtom$fSubstBaseTyUAtomDirSubTySuperTyVarianceCoContraarityotherisSubAisSubBisDirB supertypessubtypesdirtypeshasQualhasSort qualRules sortRulespickSortBaseTy$fEqDir$fOrdDir $fReadDir $fShowDir$fShowVariance$fReadVariance $fEqVariance $fOrdVariance ConstraintCSubCEqCQualCAndCTrueCOrCAllcAndcOr$fMonoidConstraint$fSemigroupConstraint$fPrettyConstraint$fShowConstraint$fGenericConstraint$fAlphaConstraint$fSubstTypeConstraintunify weakUnifyunify'equateoccurs unifyAtoms unifyUAtomsQNameqnameProvenanceqnameNameProvenance LocalName QualifiedName ModuleName REPLModuleNamedModuleProvenanceStdlibisFree localName.-fvQsubstQsubstsQ$fPrettyModuleName $fPrettyQName $fEqQName $fOrdQName $fShowQName$fGenericQName $fDataQName $fAlphaQName$fSubstTypeQName$fEqNameProvenance$fOrdNameProvenance$fShowNameProvenance$fGenericNameProvenance$fDataNameProvenance$fAlphaNameProvenance$fSubstTypeNameProvenance$fEqModuleName$fOrdModuleName$fShowModuleName$fGenericModuleName$fDataModuleName$fAlphaModuleName$fSubstTypeModuleName$fEqModuleProvenance$fOrdModuleProvenance$fShowModuleProvenance$fGenericModuleProvenance$fDataModuleProvenance$fAlphaModuleProvenance$fSubstTypeModuleProvenanceCtxemptyCtx singleCtx ctxForModulelocalCtxinsertextendextendsnulllookup'lookupNonLocallookupNonLocal' lookupAll lookupAll'nameselemsassocskeysSet coerceKeys restrictKeysjoinCtxjoinCtxsfilter $fMonoidCtx$fSemigroupCtx$fEqCtx $fShowCtx $fFunctorCtx $fFoldableCtx$fTraversableCtxMessage _messageType_message MessageTypeInfoWarningErrMsgDebug $fShowMessage$fShowMessageType$fReadMessageType$fEqMessageType$fOrdMessageType$fEnumMessageType$fBoundedMessageTypemessage messageType handleMsgprintMsgmsginfo infoPrettywarndebug debugPrettyerr Property_ QuantifierLamExAllBinder_X_Binder ForallPatternPattern_PVar_PWild_PAscr_PUnit_PBool_PTup_PInj_PNat_PChar_PString_PCons_PList_PAdd_PMul_PSub_PNeg_PFrac_ PNonlinear_ XPattern_ X_PatternX_PFracX_PNegX_PSubX_PMulX_PAddX_PListX_PCons X_PStringX_PCharX_PNatX_PInjX_PTupX_PBoolX_PUnitX_PAscrX_PWildX_PVar ForallGuardGuard_GBool_GPat_GLet_X_GLetX_GPatX_GBoolBranch_Binding_ ForallQualQual_QBind_QGuard_X_QGuardX_QBind ForallLinkLink_TLink_X_TLink ForallTermTerm_TVar_TPrim_TLet_TParens_TUnit_TBool_TNat_TRat_TChar_TString_TAbs_TApp_TTup_TCase_TChain_TTyOp_ TContainer_TContainerComp_TAscr_XTerm_X_TermX_TAscrX_TContainerComp X_TContainerX_TTyOpX_TChainX_TCaseX_TTupX_TAppX_TAbs X_TStringX_TCharX_TRatX_TNatX_TBoolX_TUnit X_TParensX_TLetX_TPrimX_TVarEllipsisUntil Container ListContainer BagContainer SetContainerSideLR TelescopeTelEmptyTelConstelCons foldTelescope mapTelescopetraverseTelescope toTelescope fromTelescope selectSidefromSide $fAlphaVoid $fPrettySide$fAlphaBinding_$fSubstTypeBinding_$fAlphaPattern_$fSubstTypePattern_ $fAlphaGuard_$fSubstTypeGuard_ $fAlphaQual_$fSubstTypeQual_ $fAlphaLink_$fSubstTypeLink_ $fPlatedTerm_ $fAlphaTerm_$fSubstTypeTerm_$fGenericTerm_$fGenericGuard_$fGenericPattern_$fGenericBinding_$fGenericQual_$fGenericLink_$fGenericQuantifier$fDataQuantifier$fEqQuantifier$fOrdQuantifier$fShowQuantifier$fAlphaQuantifier$fSubstTypeQuantifier$fShowEllipsis$fGenericEllipsis$fFunctorEllipsis$fFoldableEllipsis$fTraversableEllipsis$fAlphaEllipsis$fSubstaEllipsis$fDataEllipsis$fShowContainer $fEqContainer$fEnumContainer$fGenericContainer$fDataContainer$fAlphaContainer$fSubsttContainer $fShowSide$fEqSide $fOrdSide $fEnumSide $fBoundedSide $fGenericSide $fDataSide $fAlphaSide $fSubsttSide$fShowTelescope$fGenericTelescope$fAlphaTelescope$fSubsttTelescope$fDataTelescope$fDataPattern_$fShowPattern_ $fDataGuard_ $fShowGuard_$fDataBinding_$fShowBinding_ $fDataQual_ $fShowQual_ $fDataLink_ $fShowLink_ $fDataTerm_ $fShowTerm_DPatternDGuardDBranchDBindingDTerm DPropertyDPInjDPPairDPUnitDPWildDPVarDGPatDTTestDTNilDTTyOpDTCaseDTPairDTAppDTAbsDTCharDTRatDTNatDTBoolDTUnitDTPrimDTVar$fHasTypeTerm_$fAlphaX_DTerm$fSubstTypeX_DTerm$fHasTypePattern_ $fShowX_DTerm$fGenericX_DTermPatternGuardBranchBindingQualLinkTermDeclDTypeDDefnDTyDefTypeDefnTermDefnTypeDeclPropertyDocThing DocString DocPropertyDocsTopLevelTLDocTLDeclTLExprModulemodExts modImportsmodDeclsmodDocsmodTermsUD PNonlinearPFracPNegPSubPMulPAddPListPConsPNatPInjPTupPStringPCharPBoolPUnitPAscrPWildPVarGLetGPatGBoolQGuardQBindTLink TListCompTListTWildTAscrTContainerComp TContainerTTyOpTChainTCaseTTupTAppTAbsTStringTCharTRatTNatTBoolTUnitTParensTLetTBinTUnTPrimTVar emptyModulepartitionDecls prettyTyDeclprettyPatternP $fPrettyTerm_ $fPrettyQual_$fPrettyTelescope$fPrettyBinding_ $fPrettyBind$fPrettyGuard_$fPrettyTelescope0$fPrettyPattern_ $fPrettyDecl$fShowTypeDefn $fShowDecl$fShowTermDefn$fShowTypeDecl$fShowDocThing$fShowTopLevel $fShowModuleAPatternAGuardABranchABindingAQualALinkATerm APropertyAPFracAPNegAPSubAPMulAPAddAPListAPConsAPNatAPInjAPTupAPStringAPCharAPBoolAPUnitAPWildAPVarAGLetAGPatAGBoolAQGuardAQBindATLink ATListCompATListATTestATContainerComp ATContainerATTyOpATChainATCaseATTupATAppATAbsATStringATCharATRatATNatATBoolATUnitATLetATPrimATVar varsBoundsubstQT $fHasTypeBind$fDataTYerase eraseBinding erasePattern eraseBranch eraseGuard eraseLink eraseQual eraseProperty eraseDTerm eraseDBranch eraseDGuard eraseDPatternOpOAddONegOSqrtOFloorOCeilOAbsOMulODivOExpOModODivides OMultinomOFactOEqOLtOEnumOCountOPowerOBagElem OListElemOEachBagOEachSet OFilterBagOMerge OBagUnionsOSummary OEmptyGraphOVertexOOverlayOConnectOInsertOLookupOUntil OSetToList OBagToSet OBagToList OListToSet OListToBag OBagToCounts OCountsToBagOUnsafeCountsToBag OMapToSet OSetToMapOIsPrimeOFactorOFracOForallOExistsOHoldsONotPropOShould OMatchErrOCrashOId OLookupSeq OExtendSeqOAndOOrOImplOSeedORandomCoreCVarCNumCConstCInjCCaseCUnitCPairCProjCAbsCAppCTestCTypeCDelayCForce ShouldMemoMemoNoMemoopAritysubstQCsubstsQC $fPrettyOp $fPrettyCore $fPlatedCore $fShowCore $fGenericCore $fDataCore $fAlphaCore$fShowOp $fGenericOp$fDataOp $fAlphaOp$fEqOp$fOrdOp$fShowShouldMemo$fGenericShouldMemo$fDataShouldMemo$fAlphaShouldMemoFresh FreshDictfresh_fresh runFresh'runFresh runFresh1unbindfreshQ absorbFresh $fFreshAction TyVarInfoTVI _tyVarIlk _tyVarSortSimpleConstraint:<::=: SolutionLimitgetSolutionLimit SolveError NoWeakUnifierNoUnify UnqualBaseUnqual QualSkolemrunSolve filterErrors countSolutionwithSolutionLimit$fSemigroupSolveError$fPrettySimpleConstraint$fShowTyVarInfo$fShowSimpleConstraint$fEqSimpleConstraint$fOrdSimpleConstraint$fGenericSimpleConstraint$fAlphaSimpleConstraint$fSubstTypeSimpleConstraint$fShowSolveError SimplifyStateSS _ssVarMap_ssConstraints_ssSubst_ssSeen TyVarInfoMapVMunVMtyVarIlk tyVarSortmkTVIonVMlookupVMdeleteVM addSkolemsgetSortgetIlk extendSort$fSemigroupTyVarInfo$fPrettyTyVarInfo$fMonoidTyVarInfoMap$fSemigroupTyVarInfoMap$fPrettyTyVarInfoMap$fShowTyVarInfoMapRelMapunRelMapRelsbaseRelsvarRels ssConstraintsssSeenssSubstssVarMaplkupsolveConstraintsolveConstraintChoicedecomposeConstraint decomposeQual checkQualsimplifymkConstraintGraph checkSkolems elimCycles elimCyclesGen isBaseEdge checkBaseEdgecheckBaseEdgessubstReldirtypesBySort limBySort lubBySort glbBySort allBySort ubsBySort lbsBySort solveGraph$fPrettyRelMap $fShowRelMap $fShowRels$fEqRelsTCErrorUnbound AmbiguousNoTypeNotCon EmptyCase PatternTypeDuplicateDeclsDuplicateDefnsDuplicateTyDefns CyclicTyDef NumPatternsNonlinearPatternNoSearch UnsolvableNotTyDefNoTWild NotEnoughArgs TooManyArgs UnboundTyVar NoPolyRecNoError LocTCErrorTyCtxnoLoc constraint constraintsforAllorElsewithConstraintsolve lookupTyDefn withTyDefnsfreshTy freshAtom$fMonoidTCError$fSemigroupTCError$fShowLocTCError $fShowTCError ModuleInfo_miName _miImports_miNames_miDocs_miProps_miTys _miTydefs _miTermdefs_miTerms_miExtsClauseDefn LoadingModeREPL Standalone eraseClause $fPrettyDefn$fShowModuleInfo $fShowDefn $fGenericDefn $fAlphaDefn $fDataDefn$fSubstTypeDefnResolver FromStdlibFromDirFromCwdOrStdlibFromDirOrStdlibmiDocsmiExts miImportsmiNamemiNamesmiProps miTermdefsmiTermsmiTydefsmiTys withImportsallTys allTydefsemptyModuleInfo withStdlib resolveModule$fMonoidModuleInfo$fSemigroupModuleInfoParserDiscoParseErrorReservedVarNameInvalidPattern MissingAscrMultiArgLambda runParserindented thenIndentedwithExtssclexemesymbol reservedOpanglessemicommacolondotpipelambdanaturalreserved reservedWordsident$fOrdOpaqueTerm$fEqOpaqueTerm$fShowOpaqueTerm#$fShowErrorComponentDiscoParseError$fShowDiscoParseError$fEqDiscoParseError$fOrdDiscoParseError wholeModule parseModule parseExtName parseImportparseModuleName parseTopLevel parseDeclterm parseTerm parseTerm' parseAtomparseContainer parseEllipsisparseContainerComp parseQualparseLet parseCase parseBranch parseGuards parseGuardparseAtomicPattern parsePattern parseExprparseAtomicType parsePolyTy parseType parseTypeOp EvalError UnboundError UnboundPanic DivByZeroOverflow NonExhaustive InfiniteLoopCrash DiscoErrorModuleNotFound CyclicImport TypeCheckErrParseErrEvalErrPanicpanicoutputDiscoErrors$fPrettyDiscoError$fShowDiscoError$fShowEvalErrorCell BlackholeEMemEnvValPropVPDoneVPSearchVPBin TestResult TestReason TestReason_TestBoolTestCmp TestNotFound TestFoundTestBinTestRuntimeErrorLOpLAndLOrLImplTestEnvTestVars SearchMotive SearchType Exhaustive Randomized SimpleValueSNumSUnitSInjSPairSBagSTypeValueVNumVConstVInjVUnitVPairVCloVTypeVRefVFun_VPropVBagVGraphVMapVGenSMExistsSMForallVFunVConsVNil toSimpleValuefromSimpleValueratvvratintvvintvcharcharvboolvvboolpairvvpairlistvvlistvgengenv emptyTestEnv mergeTestEnv getTestEnv interpLOp testIsErrortestIsOk testReasontestEnvresultIsCertain extendPropEnvextendResultEnvemptyMemallocate allocateValue allocateRecset memoLookupmemoSet prettyValue' prettyValue $fShowValFun $fShowMem $fShowCell $fShowValue $fShowValProp$fShowTestResult$fShowTestReason_$fFunctorTestReason_$fFoldableTestReason_$fTraversableTestReason_ $fShowTestEnv$fSemigroupTestEnv$fMonoidTestEnv$fEqLOp$fOrdLOp $fShowLOp $fEnumLOp $fBoundedLOp$fShowTestVars$fSemigroupTestVars$fMonoidTestVars$fShowSearchMotive$fShowSearchType$fShowSimpleValue$fEqSimpleValue$fOrdSimpleValueValueEnumerationenumVoidenumUnitenumBoolenumNenumZenumFenumQenumCenumSetenumListenumType enumTypes enumerateTypeenumerateTypesModeInferCheck containerTycontainerToConinferTelescopesuggestionsFrom checkModule makeTyDefnCtx checkTyDefn checkCyclicTycheckUnboundVars checkPolyRec filterDups makeTyCtxcheckCtx checkDefncheckProperties checkPropertycheckPolyTyValidcheckTypeValidconAritycheck checkPolyTyinfer inferTop1inferTopcheckTop typecheck checkPatterncAbscSizecPoscIntcExpgetEltTy ensureConstr ensureConstr1 ensureConstr2ensureConstrModeensureConstrMode1ensureConstrMode2ensureEq isSubPolyTypethinthin' $fShowMode ConstructorsFiniteInfiniteIdentKUnitKBoolKNatKIntKPairKConsKNilKCharKLeftKRightKUnknownDataCondcIdentdcTypesTypedVarunknownunitboolcharconsnilpairleftright tyDataCons resolveAliastyDataConsHelpernewNamenewVarnewNamesnewVars $fEqTypedVar $fEqDataCon $fOrdDataCon $fShowDataCon $fShowIdent $fEqIdent $fOrdIdent$fShowTypedVar $fOrdTypedVar NormRefType ConstraintForCMatchCNotCWasOriginallyposMatch negMatches lookupVar alistLookuponVaraddConstraints addConstraintaddConstraintHelperbreakIf conflictsWithgetConstructorArgssubstituteVarIDs inhabited instantiate$fEqConstraint$fOrdConstraint ExamplePatInhabPatIPIsIPNotAntAGrhsLitCondLitMatchLitNotLitWasOriginallyLiteralGuardConstraintGMatchGWasOriginallyGdtGrhsGuarded checkClausesprettyPrintExampleprettyPrintPatternexampleToDiscoPattern resugarPair resugarList resugarStringassumeExampleChar desugarClausedesugarTuplePats desugarMatchua addLitMulti addLiteral mkIPMatchfindInhabitantsfindAllForNreffindVarInhabitants findRedundantfindPosExamplesfindAllPosForNreffindVarPosExamples getPosFrommkExampleMatch$fShowExamplePat$fShowInhabPat $fEqInhabPat $fOrdInhabPat $fShowAnt $fShowLitCond $fEqLitCond $fOrdLitCond $fShowGdt$fEqGdt$fShowGuardConstraint$fEqGuardConstraint runDesugar desugarDefn desugarTermdesugarProperty desugarBranch desugarGuards compileThing compileTermcompileProperty compileDefnscompileDefnGroup compileDTerm compilePrimcompilePrimErrdesugaredPrimErr compileCase compileBranch compileGuards compileMatch compileUOp compileBOp invertMotiveinvertPropResultgenerateSamplesprettyTestResultCESKrunCESKstepevalApprunTesteval $fShowCESK $fShowFrame DiscoConfigTopInfo debugModeinitDiscoConfig DiscoEffects EvalEffects discoConfiglastFile replModInfotopEnv topModMaprunDisco inputTopEnvparseDiscoModulerunTCM typecheckToploadDiscoModuleloadParsedDiscoModuleloadFileaddToREPLModule setREPLModule loadDefsFromloadDefdispatch discoCommands parseLine handleLoad $fEqLevel $fOrdLevel $fShowLevel$fShowDocInput $fShowCmdTag $fEqCmdTag$fEqREPLCommandType$fShowREPLCommandType$fEqREPLCommandCategory$fShowREPLCommandCategory$fShowREPLExpr DiscoOpts onlyVersionevaluatecmdFile checkFile debugFlag discoOpts discoInfo discoMain'polysemy-1.9.2.0-5g1DuK9jYWhLqTtHv0yCL5Polysemy.InputInputinputsinput runInputConst runInputList runInputSemPolysemy.StateStateGetPutgetputrunState evalState execStatemodifygetsmodify' runLazyState evalLazyState execLazyState runStateIORef stateToIO runStateSTRef stateToSThoistStateIntoStateTbaseGHC.BaseGHC.Listversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDirgetDataFileName getSysconfDir absorbWithSemPolysemy.InternalSem)constraints-0.14.2-GkfraT5TmhsCDAMZkxtv7UData.ConstraintDict'reflection-2.1.9-G2YmRKGuOf4AXgeam6fXjIData.ReflectionReifiesreflect:- Data.ProxyProxyPolysemy.ReaderReader qualRulesMap-unbound-generics-0.4.4-IBlOdyQyL9IFY6Y9MkCzOw%Unbound.Generics.LocallyNameless.NameName Data.Foldablefoldr prettyTermPcontainerDelimsTY&Unbound.Generics.LocallyNameless.Freshcontainers-0.6.7Data.Map.InternalMap Semigroup ParserState _indentMode _enabledExts IndentMode TLResultswithIndentMode requireIndentwithAdditionalExts ensureEnabledopCharellipsisdecimal identifierparseExtension parseDocThingparseDocString parseProperty parseTyDecl parseDefn parseTyDefn parseWildparseStandaloneOp parsePrimtupleparseQuantifiedparseQuantifier parseBindinghasAscrfindMfindDuplicatePVar termToPatternNoIndent ThenIndentIndentValFunprettyVPprettySequence prettyBag enumFunctionenumProdenumSum desugarAbsdesugarCList2B desugarMinMax uopDesugars bopDesugarsdesugarPrimBOp desugarUnApp desugarBinApp desugarComp expandComp desugarLetmkLambda desugarTuples expandChaindesugarContainer||.-.+./.<.>=.==.GHC.Realmod CatchDict runMonadCatchPolysemy.ErrorrunErrorGHC.Exception.Type SomeExceptionabsorbMonadCatchabsorbMonadThrow$fMonadThrowActionexceptions-0.10.7Control.Monad.CatchrunMonadCatchAsText Exception toException fromExceptiondisplayExceptionRandom%random-1.2.1.3-AwrbfZH7ypbLpmBroxRsdI System.Random runRandomSystem.Random.Internal RandomGen runRandomIOghc-prim GHC.TypesIORandomRrandomrandomROutUpFrameFInjFCaseFPairRFPairLFProjFArgFArgVFAppFForceFUpdateFTestFMemoContisFinal integerSqrt integerSqrt'babbagediff constdiff oeisLookup oeisExtend countValues sortNCountmerge ensureProp _replModInfo_topEnv _topModMap _lastFile initTopInfo TopEffects AppendEffects inputSettingsrunTCM'loadDiscoModule'loadParsedDiscoModule'stdLibSomeREPLCommand REPLCommandnamehelpcmd shortHelpcategorycmdtypeactionparserCmdTagBuiltInColonCmdUserDev SomeREPLExprREPLExpr byCmdType commandParserparseCommandArgs fileParser lineParserhandleLoadWrapper handleNamesmaxFunTableRows uncurryTy evalCurriedstripFinalUnit formatColsformatColDefault renderTable handleCMD