check out todo.elm for the full code.
importing Todo.Page.Login as LoginPageimporting Todo.Page.Todo as TodoPagetype Model =LoginPage LoginPage.Model| TodoPage TodoPage.Modeltype Msg =LoginSpecific LoginPage.Msg| TodoSpecific TodoPage.Msginit : () -> Modelupdate : Msg -> (Model, Cmd Msg) -> (Model, Cmd Msg)view : Model -> Html Msgsubscription : Model -> Sub Msg
How should I structure my Elm project?
Use the following file structure:
Main.elm - Contains the main code
Data.elm - Contains utility functions for types (like constants)
Data/.. - Contains types. Group them logically, for example
View.elm - Contains utility functions for views (like view specific constants and very general function.)
View/.. - Contains different Views. Sometimes a type has different views. A login page might have a special view for a wrong login.
Page.elm - Contains utility functions for pages. For page-transitions its handy to store the different models in here.
Page/.. - Contains a Model/View/Update for every page.
.. - in the same style you can add your project specific folders like a separate folder for validation.