CurryInfo: spicey-4.2.0 / Spicey.GenerationHelper.domainDefaultValue

definition:
 
domainDefaultValue :: CExpr -> Domain -> CExpr
domainDefaultValue defaultctime domain = case domain of
    IntDom    _  -> CLit (CIntc 0)
    FloatDom  _  -> CLit (CFloatc 0)
    CharDom   _  -> CLit (CCharc ' ')
    StringDom _  -> string2ac []
    BoolDom   _  -> constF (pre "False")
    DateDom   _  -> defaultctime
    UserDefined _ _ -> list2ac [] -- no support of user-defined default values
    KeyDom _    -> CLit (CIntc 0)
    _ -> error "GenerationHelper.domainDefaultValue: unknown domain"
demand:
 argument 2
deterministic:
 deterministic operation
documentation:
 
Generates Curry expressions representing a default values
for a given domain.
The first argument contains an expression that is used for
ClockTime attributes (it is set to the current
time as a default value).
failfree:
 (_, _)
indeterministic:
 referentially transparent operation
infix:
 no fixity defined
iotype:
 {(_,{IntDom}) |-> {CLit} || (_,{FloatDom}) |-> {CLit} || (_,{CharDom}) |-> {CLit} || (_,{StringDom}) |-> {CLit} || (_,{BoolDom}) |-> _ || (_,{DateDom}) |-> _ || (_,{UserDefined}) |-> _ || (_,{KeyDom}) |-> {CLit}}
name:
 domainDefaultValue
precedence:
 no precedence defined
result-values:
 _
signature:
 AbstractCurry.Types.CExpr -> Database.ERD.Domain -> AbstractCurry.Types.CExpr
solution-complete:
 operation might suspend on free variables
terminating:
 yes
totally-defined:
 reducible on all ground data terms