I have these types:
> type Affordance
> = Writable Form
> | Viewable Animal
>
> type alias Displayed =
> { view : Affordance
> , animalFlash : AnimalFlash
> }
… stored inside a Dict. So when I try to get what is the only possible case (a
Writable form), I have a nested structure. I’m hoping I don’t have to write
this nested case:
> case Dict.get id model.displayables of
> Nothing ->
> model |> noCmd -- Todo: a command to log the error
> Just {view} ->
> case view of
> Animal.Viewable _ ->
> model |> noCmd
> Animal.Writable form ->
> formOp op form model
… instead using syntax maybe something like what you’d do in Elixir:
> Nothing ->
> Just {view = Animal.Viewable _} ->
> Just {view = Animal.Writeable form} ->
I can’t find a syntax that works. Is there one?
--
You received this message because you are subscribed to the Google Groups "Elm
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.