-
-
Save evancz/ee696a87a644a3d1fa02 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- when someone wants to use our widget | |
-- they don't need to know any facts about anything! | |
import Update (step) | |
import Model (initialize) | |
import View (view) | |
-- nothing gives access to any details, and things | |
-- will work as they need to. One trick here is to | |
-- make sure the view function takes a (Handle Action) | |
-- as an argument such that it can be wired up later. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Model (initialize) where | |
import UnderlyingModel (..) | |
initialize : Int -> ... -> State | |
noop : Action |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module UnderlyingModel where | |
type State = { count:Int, ... } | |
data Action = ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Update (step) where | |
import UnderlyingModel (..) | |
step : Action -> State -> State |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module View (view) where | |
import UnderlyingModel (..) | |
view : Handle Action -> State -> Element |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment