I don’t think that there are too many issues with having a bunch of Maybes in your model, but very often, if I have a group of them that are required to render a page (or Results/RemoteData etc), I’ll use a custom type for the model because it’s a bit more ergonomic once you have all the data. For example:
type Model
= LoadingData { mToken : Maybe String, remoteData : RemoteData Http.Error MyPageData }
| Page { token : String, pageData : MyPageData }
| FailedToLoadData
view : Model -> Html Msg
view model =
case model of
LoadingData {mToken, remoteData } ->
loadingView mToken remoteData
Page token pageData ->
pageView token pageData
FailedToLoad ->
failedToLoadView
This way, down in your pageView
, you don’t need to check for maybes (or Results or RemoteData etc) everywhere.