CurryInfo: spicey-4.2.0 / Spicey.GenerationHelper.widgetFor

definition: Info
 
widgetFor :: Domain -> Bool -> CExpr
widgetFor domain null =
  case domain of
    IntDom _    -> addMaybe (constF (wuiModule "wInt"))
    FloatDom _  -> addMaybe (constF (wuiModule "wFloat"))
    CharDom _   -> addMaybe (constF (wuiModule "wString"))
    StringDom _ -> if null then constF (spiceyModule,"wString")
                           else constF (wuiModule "wRequiredString")
         --constF (wuiModule (if null then "wString" else "wRequiredString"))
    BoolDom _   -> addMaybe (constF (wuiModule "wBoolean"))
    DateDom _   -> addMaybe (constF (spiceyModule, "wDateType"))
    UserDefined _ _ -> addMaybe (applyF (wuiModule "wCheckBool")
                                        [applyF (html "htxt") [string2ac ""]])
    KeyDom _    -> addMaybe (constF (wuiModule "wInt"))
    _ -> error "widgetFor: unknown domain for attribute"
 where
  -- adds a Maybe WUI if null values are allowed
  addMaybe e =
    if null
     then applyF (spiceyModule,"wUncheckMaybe")
            [domainDefaultValue
               (applyF (timeModule, "toClockTime")
                 [applyF (timeModule, "CalendarTime")
                         (map (CLit . CIntc) [2018,1,1,0,0,0,0])])
               domain, e]
     else e
demand: Info
 arguments 1 2
deterministic: Info
 deterministic operation
failfree: Info
 (_, _)
indeterministic: Info
 referentially transparent operation
infix: Info
 no fixity defined
iotype: Info
 {({IntDom},_) |-> _ || ({FloatDom},_) |-> _ || ({CharDom},_) |-> _ || ({StringDom},{True}) |-> _ || ({StringDom},{False}) |-> _ || ({BoolDom},_) |-> _ || ({DateDom},_) |-> _ || ({UserDefined},_) |-> _ || ({KeyDom},_) |-> _}
name: Info
 widgetFor
precedence: Info
 no precedence defined
result-values: Info
 _
signature: Info
 Database.ERD.Domain -> Prelude.Bool -> AbstractCurry.Types.CExpr
solution-complete: Info
 operation might suspend on free variables
terminating: Info
 yes
totally-defined: Info
 reducible on all ground data terms