CurryInfo: spicey-4.2.0 / Spicey.ViewGeneration.leqEntity

definition: Info
 
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: Info
 argument 2
deterministic: Info
 deterministic operation
documentation: Info
 
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: Info
 <FAILING>
indeterministic: Info
 referentially transparent operation
infix: Info
 no fixity defined
iotype: Info
 {(_,{Entity},_,_) |-> _}
name: Info
 leqEntity
precedence: Info
 no precedence defined
result-values: Info
 _
signature: Info
 String -> Database.ERD.Entity -> [Database.ERD.Relationship]
-> [Database.ERD.Entity] -> AbstractCurry.Types.CFuncDecl
solution-complete: Info
 operation might suspend on free variables
terminating: Info
 possibly non-terminating
totally-defined: Info
 possibly non-reducible on same data term