curry.objects package

Python wrappers for Curry objects.

These objects constitute the primary user interface to Curry from Python, and, as such, merge the Python and Curry worlds. A CurryModule, for example, contains not only attributes for all of the Curry objects in that module, but also special Python attributes such as __name__, __file__, and __path__, which are needed to convince Python to treat the object as a Python module.

When the interest is to interact with Curry – e.g., get symbols, form Curry expressions, and evaluate Curry goals – the objects in this module should be used directly. Alternatively, when the focus is on system-level activities, such as finding submodules, getting the ICurry, and so on, these objects should be wrapped in handle.Handle.

class curry.objects.CurryDataType(datatype, constructors, icurry=None)[source]

Bases: object

Static information for a Curry data type.

property fullname
property name
class curry.objects.CurryModule(interp, imodule)[source]

Bases: ModuleType

A Python module for interfacing with Curry modules.

This type of object is produced when Curry code is imported into Python. The public functions and constructors are attached as module attributes under their Curry names, operators included. A name that is not a Python identifier, or is a Python keyword, is reached with getattr. A private function is reached through curry.symbol, and a type through curry.type.

Special attributes beginning with ‘.’ (so as not to conflict with Curry names) contain information used by the Curry system. These should generally be accessed by other means, such as curry.symbol, curry.type, or curry.inspect.icurry.

property is_package
class curry.objects.CurryNodeInfo(info, icurry=None, typename=None, interp=None, module=None)[source]

Bases: object

Static information for a Curry function or constructor symbol.

property fullname
getimpl()[source]

The implementation code of the step function as text. See curry.inspect.getimpl().

property interpreter

The interpreter that loaded this symbol, or None.

property module

The module object that loaded this symbol, or None.

property name
property scheme

Scheme <curry.typecheck.Scheme> read from the FlatCurry interface of its module, or None when the symbol has none. See curry.typecheck.

Type:

The type scheme of this symbol, a

Type:

class

property signature

The type scheme of this symbol in Curry syntax, e.g., 'Num a => a -> a -> a', or None when the symbol has none.

class curry.objects.CurryPackage(interp, imodule)[source]

Bases: CurryModule

A Curry package. Submodules are available as module attributes.

property is_package

Submodules