It looks like you are duplicating knowledge. If your BuildingList can only
be connected to a ListView, adding that in the type is redundant. Same with
Elements.

Think in terms of: what is the minimal information that I can get in the
view in order to be able to render what I need to render and model only
that.

If you know that BuildingList uses a listView and Polymer, then only use
BuildingList. It is sufficient.




On Fri, Sep 30, 2016 at 4:47 PM, Ed Ilyin <[email protected]> wrote:

> I have watched a great talk "Making Impossible States Impossible" by
> Richard Feldman.
>
> But I can't figure out how to make impossible wrong modes of pages.
>
> Stright forward approach looks like following:
>
> ```elm
> type ListView = ListView
> type DetailsView = DetailsView
> type PolymerElement = PolymerElement
> type ElmElement = ElmElement
>
> type Page
>   = BuildingList ListView PolymerElement
>   | BuildingDetails DetailsView PolymerElement
>   | BulbList ListView PolymerElement
>   ...
>   | HorseDetails DetailsView ElmElement
> ```
>
> But then I can't write a pattern to match only DetailViews to add the back
> button to the view.
> Or match only PolymerElements to import Polymer element for specific page.
>
> Is it possible to achieve without writing case...of of all pages multiple
> times in code?
>
> --
> 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.
>



-- 
There is NO FATE, we are the creators.
blog: http://damoc.ro/

-- 
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.

Reply via email to