CurryInfo: spicey-4.2.0 / Spicey.EntitiesToHtmlGeneration.toShortView

definition: Info
 
toShortView :: ToHtmlGenerator
toShortView erdname (Entity entityName attrlist) _ _ =
  stCmtFunc
  ("The short view of a " ++ entityName ++ " entity as a string.\n"++
   "This view is used in menus and comments to refer to a " ++ entityName ++
   " entity.")
  (thisModuleName erdname, (lowerFirst entityName)++"ToShortView")
  2
  Public
  (baseType (model erdname, entityName) ~> stringType)
  [simpleRule [CPVar (1,eName)]
     (case attributeDomain firstKeyAttribute of
         StringDom _ -> accessFirstKeyAttribute
         _           -> applyF (pre "show") [accessFirstKeyAttribute]
     )]
  where
    eName = lowerFirst entityName

    accessFirstKeyAttribute =
      applyF (model erdname, eName ++ attributeName firstKeyAttribute)
             [cvar eName]

    firstKeyAttribute = findKeyAttribute attrlist attrlist
    
    findKeyAttribute (attr@(Attribute _ _ key _):attrList) fullList =
      if key == Unique then attr
                       else findKeyAttribute attrList fullList
    findKeyAttribute [] fullList = head fullList
demand: Info
 argument 2
deterministic: Info
 deterministic operation
failfree: Info
 <FAILING>
indeterministic: Info
 referentially transparent operation
infix: Info
 no fixity defined
iotype: Info
 {(_,{Entity},_,_) |-> _}
name: Info
 toShortView
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