definition: |
oneValue :: a -> Maybe a #ifdef __KICS2__ oneValue x = let vals = ST.allValuesWith ST.dfsStrategy (ST.someSearchTree x) in (if null vals then Nothing else Just (head vals)) |
demand: |
no demanded arguments |
deterministic: |
deterministic operation |
documentation: |
Returns just one value for an expression. If the expression has no value, `Nothing` is returned. Conceptually, the value is computed on a copy of the expression, i.e., the evaluation of the expression does not share any results. In PAKCS, the evaluation suspends as long as the expression contains unbound variables or the computed value contains unbound variables. Note that this operation is not purely declarative since the computed value depends on the ordering of the program rules. Thus, this operation should be used only if the expression has a single value. |
failfree: |
_ |
indeterministic: |
referentially transparent operation |
infix: |
no fixity defined |
iotype: |
{(_) |-> {Just,Nothing}} |
name: |
oneValue |
precedence: |
no precedence defined |
result-values: |
{Just,Nothing} |
signature: |
a -> Prelude.Maybe a |
solution-complete: |
operation might suspend on free variables |
terminating: |
yes |
totally-defined: |
possibly non-reducible on same data term |