curry package
The public surface is
installed beside the package as curry/__init__.pyi. It records the
names and signatures available in this version.
The public Python surface of Sprite.
Build typed terms with module calls, term and parse. Evaluate them
with eval or solve and print values with show. The installed
__init__.pyi describes the public names and their landed signatures.
- class curry.Answer(value: object, bindings: Bindings)[source]
Bases:
NamedTupleA value and its bindings. Its text is the REPL’s answer line.
- value: object
Alias for field number 0
- exception curry.ArityError(scheme, ntaken, ngiven, **kwds)[source]
Bases:
CurryTypeErrorS :: scheme takes N arguments, M given.
- class curry.Bindings(items=(), variables=())[source]
Bases:
MappingBindings in occurrence order, indexed by name, display name or Var.
- exception curry.CompileError(message, report=None, line=None, column=None)[source]
Bases:
CurryErrorRaised when an error occurs while compiling Curry code.
- class curry.ConstructorClass(interp, form, symbol=None, args=(), annotation=None)[source]
Bases:
DataClassThe base of the values of one loaded Curry constructor.
- exception curry.ConversionError(lines, where=None, symbol=None, expected=None, actual=None, value=None)[source]
Bases:
CurryTypeErrorA Python value under a type it cannot take:
cannot convert 2.5 to Int at argument N of S.Noneis such a value under every type.
- exception curry.CurryFileNotFoundError[source]
Bases:
CurryIOError,FileNotFoundErrorAn I/O action could not find its file.
- exception curry.CurryIOError[source]
Bases:
EvaluationError,OSErrorAn uncaught error of an I/O action.
- exception curry.CurryIndexError[source]
Bases:
CurryError,IndexErrorRaised when indexing into a Curry expression fails.
- exception curry.CurryTypeError(lines, where=None, symbol=None, expected=None, actual=None, value=None)[source]
Bases:
CurryError,TypeErrorRaised when a type error occurs while evaluating a Curry program.
- property first_line
- class curry.Data(interp, form, symbol=None, args=(), annotation=None)[source]
Bases:
TermA constructor value with converted arguments.
- property args
- class curry.DataClass(interp, form, symbol=None, args=(), annotation=None)[source]
Bases:
DataThe base of the values of one loaded Curry data type.
- class curry.DataType(datatype, module)[source]
Bases:
objectThe metadata of a data type in a module.
- property constructors
- property fullname
- property name
- exception curry.DefaultingError(message, scheme, predicate=None)[source]
Bases:
CurryTypeErrorThe table cannot default the constraints of a scheme.
- Variables:
scheme – The scheme.
predicate – The constraint the table rejected.
- exception curry.DivisionByZeroError[source]
Bases:
EvaluationError,ZeroDivisionErrorAn integral division has a zero divisor.
- exception curry.EvaluationError[source]
Bases:
CurryErrorSignals an error raised from a Curry program.
- exception curry.EvaluationTimeout[source]
Bases:
EvaluationErrorAn evaluation exceeded its time limit.
- exception curry.FlagError[source]
Bases:
CurryError,ValueErrorAn unknown flag or a value its validator refuses.
- exception curry.ForkError[source]
Bases:
CurryError,RuntimeErrorSprite was busy when this child process was forked.
- class curry.Function(interp, form, symbol=None, args=(), annotation=None)[source]
Bases:
TermA function value, including a partial constructor application.
- property args
- exception curry.InstantiationError[source]
Bases:
EvaluationErrorA free variable of function type could not be instantiated.
- exception curry.IntOverflowError[source]
Bases:
CurryError,OverflowErrorA bounded conversion is out of range, or a Float is not finite.
- exception curry.InterfaceError(lines, where=None, symbol=None, expected=None, actual=None, value=None)[source]
Bases:
CurryTypeErrorThe interface of a module cannot be read.
- exception curry.LoadError[source]
Bases:
CurryError,OSErrorAn object could not be written, read or replaced.
- exception curry.ManyValuesError[source]
Bases:
CurryError,ValueErrorResults.one found a second value.
- exception curry.MismatchError(lines, where=None, symbol=None, expected=None, actual=None, value=None)[source]
Bases:
CurryTypeErrorTwo arguments disagree, or an argument does not fit its parameter:
type mismatch in argument N of S :: scheme.
- curry.Module
alias of
CurryModule
- exception curry.ModuleExistsError[source]
Bases:
CurryError,ValueErrorA module of the given name is already loaded.
- exception curry.ModuleLookupError[source]
Bases:
CurryError,ModuleNotFoundErrorRaised when a Curry module is not found.
- exception curry.NoInstanceError(classname, typetext, where, **kwds)[source]
Bases:
CurryTypeErrorno instance for Show (a -> a) in argument 1 of Prelude.show.
- exception curry.NoValueError[source]
Bases:
CurryError,LookupErrorResults.one found no value.
- exception curry.NondetError(message='non-determinism in monadic actions occurred!')[source]
Bases:
EvaluationErrorA choice occurred inside an I/O action.
- CTOR_INDEX = 3
- exception curry.NotConstructorError(arg)[source]
Bases:
CurryError,ValueErrorRaised when a non-constructor value occurs where disallowed.
- exception curry.PrerequisiteError[source]
Bases:
CurryError,OSErrorRaised when a build prerequisite is invalid.
- exception curry.ReentrancyError[source]
Bases:
CurryError,RuntimeErrorA host callback entered Sprite while its thread held an internal lock.
- class curry.Reference(interp, name)[source]
Bases:
TermA binding reference, resolved only by its enclosing let.
- class curry.Results(values, text)[source]
Bases:
IteratorA lazy search. Closing it releases the evaluation.
- exception curry.StackLimitError[source]
Bases:
EvaluationError,RecursionErrorAn evaluation reached its stack limit.
- exception curry.StaleError[source]
Bases:
CurryError,RuntimeErrorAn object belongs to an earlier session or module version.
- class curry.Stream(values)[source]
Bases:
IteratorThe ordered values yielded by an I/O action; result is set at its end.
- exception curry.SuspensionError(message='Evaluation suspended')[source]
Bases:
EvaluationErrorEvaluation failed due to suspended constraints.
- class curry.Symbol(info, module)[source]
Bases:
objectThe metadata of a function or constructor, separate from its term.
- property arity
- property fields
- property fixity
- property fullname
- property info
- property kind
- property name
- property public
- property signature
- exception curry.SymbolLookupError[source]
Bases:
CurryError,AttributeErrorRaised when a Curry symbol is not found.
- class curry.Term(interp, form, symbol=None, args=(), annotation=None)[source]
Bases:
objectA typed Curry expression held by Python.
- property args
- property free_vars
- exception curry.TypeLookupError[source]
Bases:
CurryError,AttributeErrorRaised when a Curry type is not found.
- exception curry.TypeSyntaxError(lines, where=None, symbol=None, expected=None, actual=None, value=None)[source]
Bases:
CurryTypeErrorA type annotation cannot be parsed or has an invalid type or kind.
- class curry.Values(interp, form, symbol=None, args=(), annotation=None)[source]
Bases:
Term,CollectionThe finite multiset produced by a set function.
- class curry.Var(interp, name=None, type=None)[source]
Bases:
TermOne Python object, one free variable, with a persistent static type.
- curry.program_arguments
Arguments supplied to the Curry program; defaults to Python command arguments.
- curry.program_name
Curry program name; defaults to the Python invocation name.