CurryInfo: ertools-3.0.0 / Database.ERD.Generic.unique

definition: Info
 
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: Info
 no demanded arguments
deterministic: Info
 deterministic operation
documentation: Info
 
Test whether an attribute value does not yet exist
failfree: Info
 <FAILING>
indeterministic: Info
 referentially transparent operation
infix: Info
 no fixity defined
iotype: Info
 {(_,_,_,_,_,_,_,_,_) |-> _}
name: Info
 unique
precedence: Info
 no precedence defined
result-values: Info
 _
signature: Info
 (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: Info
 operation might suspend on free variables
terminating: Info
 possibly non-terminating
totally-defined: Info
 possibly non-reducible on same data term