|
definition: |
leqEntity :: ViewGenerator
leqEntity erdname (Entity entityName attrlist) _ _ =
stCmtFunc
("Compares two "++entityName++" entities. This order is used in the list view.")
(viewModuleName entityName, "leq" ++ entityName) 2 Private
-- function type
(baseType (model erdname,entityName) ~> baseType (model erdname,entityName)
~> boolType)
[let ename = lowerFirst entityName
e1 = (1,"x1")
e2 = (2,"x2")
in simpleRule [CPVar e1,CPVar e2]
(applyF (pre "<=")
[tupleExpr (map (\ (Attribute a _ _ _) ->
applyF (model erdname,ename++a) [CVar e1])
(take 5 (filter notKey attrlist))),
tupleExpr (map (\ (Attribute a _ _ _) ->
applyF (model erdname,ename++a) [CVar e2])
(take 5 (filter notKey attrlist)))
])]
|
|
demand: |
argument 2 |
|
deterministic: |
deterministic operation |
|
documentation: |
Generate function to compare to entities in lexicographic order. To avoid useless component comparisons, only the first five non-key attributes are used for the comparison. |
|
failfree: |
<FAILING> |
|
indeterministic: |
referentially transparent operation |
|
infix: |
no fixity defined |
|
iotype: |
{(_,{Entity},_,_) |-> _}
|
|
name: |
leqEntity |
|
precedence: |
no precedence defined |
|
result-values: |
_ |
|
signature: |
String -> Database.ERD.Entity -> [Database.ERD.Relationship] -> [Database.ERD.Entity] -> AbstractCurry.Types.CFuncDecl |
|
solution-complete: |
operation might suspend on free variables |
|
terminating: |
possibly non-terminating |
|
totally-defined: |
possibly non-reducible on same data term |