|
definition: |
choose :: Eq a => Values a -> (a, Values a)
#ifdef __KICS2__
choose (Values vs) = (x, Values xs)
#else
choose (Values _ vs) =
(x, Values (if null xs then Nothing else Just (head xs)) xs)
#endif
where x = foldr1 (?) vs
xs = delete x vs
|
|
demand: |
argument 2 |
|
deterministic: |
possibly non-deterministic operation |
|
documentation: |
Chooses (non-deterministically) some value in a multiset of values
and returns the chosen value and the remaining multiset of values.
Thus, if we consider the operation `chooseValue` defined by
chooseValue x = fst (choose x)
then `(set1 chooseValue)` is the identity on value sets, i.e.,
`(set1 chooseValue s)` contains the same elements as the
value set `s`.
|
|
failfree: |
<FAILING> |
|
indeterministic: |
referentially transparent operation |
|
infix: |
no fixity defined |
|
iotype: |
{(_,{Values}) |-> {(,)}}
|
|
name: |
choose |
|
precedence: |
no precedence defined |
|
result-values: |
{(,)}
|
|
signature: |
Prelude.Eq a => Values a -> (a, Values a) |
|
solution-complete: |
operation might suspend on free variables |
|
terminating: |
yes |
|
totally-defined: |
possibly non-reducible on same data term |