|
definition: |
unique :: (Read t, Show t, Eq a, Show a) =>
String -> (Key -> t -> Dynamic) -> (Key -> t -> en) -> (en -> a) -> a
-> Transaction ()
unique ename entrypred info2entry selector attrval =
getDB (allDBKeyInfos entrypred) |>>= \kis ->
if null (filter (\e -> selector e == attrval)
(map (\(k,i) -> info2entry k i) kis))
then doneT
else errorT (TError UniqueError
(ename++" entry for unique attribute "
++show attrval++" already exists"))
|
|
demand: |
no demanded arguments |
|
deterministic: |
deterministic operation |
|
documentation: |
Test whether an attribute value does not yet exist |
|
failfree: |
<FAILING> |
|
indeterministic: |
referentially transparent operation |
|
infix: |
no fixity defined |
|
iotype: |
{(_,_,_,_,_,_,_,_,_) |-> _}
|
|
name: |
unique |
|
precedence: |
no precedence defined |
|
result-values: |
_ |
|
signature: |
(Prelude.Read a, Prelude.Show a, Prelude.Eq c, Prelude.Show c) => String -> (Prelude.Int -> a -> Database.KeyDatabaseSQLite.Dynamic) -> (Prelude.Int -> a -> b) -> (b -> c) -> c -> Database.KeyDatabaseSQLite.Transaction () |
|
solution-complete: |
operation might suspend on free variables |
|
terminating: |
possibly non-terminating |
|
totally-defined: |
possibly non-reducible on same data term |