CurryInfo: cdbi-3.2.0 / Database.CDBI.ER.combineDescriptions

definition:
combineDescriptions :: EntityDescription a ->
                       Int ->
                       EntityDescription b ->
                       Int ->
                       (a -> b -> c) ->
                       (c -> (a, b)) ->
                       CombinedDescription c
combineDescriptions ed1 rename1 ed2 rename2 f1 f2 =
  CD [(getTable ed1, rename1, getTypes ed1),
      (getTable ed2, rename2, getTypes ed2)]
     createFunction1 createFunction2 createFunction3
    where createFunction1 xs = f1 ((getToEntity ed1)
                                   (take lengthEd1 xs))
                                  ((getToEntity ed2)
                                   (drop lengthEd1 xs))
             where lengthEd1 = length (getTypes ed1)
          createFunction2 combEnt =
            let (ent1, ent2) = f2 combEnt in
              ((getToValues ed1) ent1) : [(getToValues ed2) ent2]
          createFunction3 combEnt =
            let (ent1, ent2) = f2 combEnt in
              ((getToInsertValues ed1) ent1) : [(getToInsertValues ed2) ent2]
demand:
no demanded arguments
deterministic:
deterministic operation
documentation:
--- A constructor for CombinedDescription.
--- @param ed1 - Description of the first Entity-Type that is to be combined
--- @param rename1 - The "rename-number" for ed1. If it is zero ed1 will
--- not be renamed in queries, otherwise is will be renamed as
--- follows: "table as ntable"
--- @param ed2 - Description of the second Entity-Type that is to be combined
--- @param rename2 - Same as rename1 for ed2
--- @param f - A function that describes how the combined entity is built.
--- Takes two entities that make up the combined entity as parameters
--- and combines those into the combined entity.
failfree:
(_, _, _, _, _, _)
indeterministic:
referentially transparent operation
infix:
no fixity defined
iotype:
{(_,_,_,_,_,_) |-> {CD}}
name:
combineDescriptions
precedence:
no precedence defined
result-values:
{CD}
signature:
EntityDescription a -> Prelude.Int -> EntityDescription b -> Prelude.Int -> (a
-> b -> c) -> (c -> (a, b)) -> CombinedDescription c
solution-complete:
operation might suspend on free variables
terminating:
possibly non-terminating
totally-defined:
reducible on all ground data terms