Is there a way to DRY this?
I don’t want to repeat contents : List Nav
and wrapperId : String
type alias InputModel =
{ contents : List Nav
, containerClassName : Maybe String
, wrapperId : String
}
type alias Model =
{ contents : List Nav
, containerClassName : String
, wrapperId : String
}
modelWithDefaults : InputModel -> Model
modelWithDefaults input =
{ input | containerClassName = withDefault "" input.containerClassName }