On Saturday, February 4, 2017 at 11:29:44 PM UTC, Pierre-Henri Trivier 
wrote:
>
> To anyone reading, I might have solved it myself : 
> https://phtrivier.github.io/2017/02/05/elm-tail-end-part-5.html
>

I think it is good that the Period module that you pulled out is completely 
hidden behind Tailend. So Main is just importing Tailend, it is not ending 
up having to import Period and Tailend. This is my objection to the 
Type/State/View pattern - it basically means you import 3 things when it 
would be neater to just import 1.

One thing I have found helpful when trying to refactor into modules is to 
avoid importing and exposing using (..). I now always explicitly expose 
what I want the public interface of a module to be, even if it is never 
going to be a published library. I find this very a helpful design tool 
that gets me to focus on what the purpose and main responsibilities of a 
module are and to avoid binding other modules to internals that they should 
not see.

Refactoring to improve the modular design is an aspect of Elm that 
interests me at the moment - mostly because I am still getting to grips 
with it myself. My suggestions may not be optimal, please don't take them 
as criticism, just another set of ideas to share as we learn together.

-- 
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 elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to