aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/domain.spad.pamphlet
diff options
context:
space:
mode:
Diffstat (limited to 'src/algebra/domain.spad.pamphlet')
-rw-r--r--src/algebra/domain.spad.pamphlet10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/algebra/domain.spad.pamphlet b/src/algebra/domain.spad.pamphlet
index 64415657..4d0cb784 100644
--- a/src/algebra/domain.spad.pamphlet
+++ b/src/algebra/domain.spad.pamphlet
@@ -70,11 +70,19 @@ ConstructorCategory(): Category == OperatorCategory Identifier with
++ Basic Operations: name, kind, arity.
++ Description:
++ This domain provides implementations for constructors.
-Constructor(): ConstructorCategory == add
+Constructor(): ConstructorCategory with
+ findConstructor: Symbol -> Maybe %
+ ++ \spad{findConstructor(s)} attempts to find a constructor
+ ++ named \spad{s}. If successful, returns that constructor;
+ ++ otherwise, returns \spad{nothing}.
+ == add
Rep == Identifier
name x == rep x
kind x == getConstructorKind(x)$Lisp
arity x == getConstructorArity(x)$Lisp
+ findConstructor s ==
+ isConstructorName(s)$Lisp => just per(s pretend Identifier)
+ nothing
@