An Elm type error that took me for a while to understand
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 Box (Model, init, Action, update, view) where | |
import Html exposing (..) | |
import Html.Attributes exposing (style) | |
import Html.Events exposing (onClick) | |
-- MODEL | |
type alias Model = () | |
init: () -> Model | |
init _ = () | |
-- UPDATE | |
type Action = Nothing | |
update : Action -> Model -> Model | |
update action model = () | |
-- VIEW | |
view : Signal.Address Action -> Model -> Html | |
view address model = | |
div [] | |
[ | |
div [ countStyle ] [ text "X" ] | |
] | |
countStyle : Attribute | |
countStyle = | |
style | |
[ ("font-size", "20px") | |
, ("font-family", "monospace") | |
, ("display", "inline-block") | |
, ("width", "50px") | |
, ("text-align", "center") | |
, ("border", "medium dashed green") | |
] |
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 OneBox where | |
import Box | |
import StartApp | |
main = StartApp.start | |
{ model = Box.init | |
, update = Box.update | |
, view = Box.view } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment