Skip to content

Instantly share code, notes, and snippets.

@evancz

evancz/User.elm Secret

Last active March 30, 2016 10:02
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evancz/ee696a87a644a3d1fa02 to your computer and use it in GitHub Desktop.
Save evancz/ee696a87a644a3d1fa02 to your computer and use it in GitHub Desktop.
-- 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.
module Model (initialize) where
import UnderlyingModel (..)
initialize : Int -> ... -> State
noop : Action
module UnderlyingModel where
type State = { count:Int, ... }
data Action = ...
module Update (step) where
import UnderlyingModel (..)
step : Action -> State -> State
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