This file contains hidden or 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 Todo where | |
{-| TodoMVC implemented in Elm, using plain HTML and CSS for rendering. | |
This application is broken up into four distinct parts: | |
1. Model - a full definition of the application's state | |
2. Update - a way to step the application state forward | |
3. View - a way to visualize our application state with HTML | |
4. Inputs - the signals necessary to manage events | |
This clean division of concerns is a core part of Elm. You can read more about | |
this in the Pong tutorial: http://elm-lang.org/blog/Pong.elm | |
This program is not particularly large, so definitely see the following |
This file contains hidden or 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
import Html exposing (Html) | |
import Html.Attributes | |
import Time | |
import Mouse | |
import Signal | |
----------- | |
infixl 2 => | |
(=>) = (,) |
This file contains hidden or 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 Todo where | |
{-| TodoMVC implemented in Elm, using plain HTML and CSS for rendering. | |
This application is broken up into four distinct parts: | |
1. Model - a full definition of the application's state | |
2. Update - a way to step the application state forward | |
3. View - a way to visualize our application state with HTML | |
4. Inputs - the signals necessary to manage events | |
This clean division of concerns is a core part of Elm. You can read more about | |
this in the Pong tutorial: http://elm-lang.org/blog/Pong.elm | |
This program is not particularly large, so definitely see the following |
This file contains hidden or 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
import Html exposing (Html) | |
import Html.Attributes | |
import Html.Events | |
import Signal exposing (Address) | |
import Window | |
import Color exposing (Color) | |
------------ | |
type alias Vector = | |
{ x : Float , y : Float } |
This file contains hidden or 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
import Html exposing (Html, Attribute) | |
import Html.Attributes | |
import Html.Events | |
import Signal exposing (Address) | |
import List | |
import String | |
import StartApp | |
------------------ | |
--- HELPER CODE -- |
This file contains hidden or 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
import Html exposing (Html) | |
import Html.Attributes | |
import Html.Events | |
import Signal exposing (Address) | |
import Json.Decode exposing (Decoder, (:=)) | |
import List | |
------- |
This file contains hidden or 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
import Html exposing (Html) | |
import Html.Attributes | |
import Signal exposing (Address) | |
import List | |
infixl 2 => | |
(=>) = (,) | |
type alias Vector = | |
{ x : Float , y : Float } |
This file contains hidden or 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
import Html exposing (Html) | |
import Html.Attributes | |
import Html.Events | |
import Signal exposing (Address) | |
import List | |
import Window | |
----------------- | |
-- HELPER CODE -- |
This file contains hidden or 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
import Html exposing (Html, Attribute) | |
import Html.Attributes | |
import Html.Events | |
import Signal exposing (Address, Message) | |
import List | |
import Json.Decode exposing (Decoder, (:=)) | |
------------------- | |
--- HELPER CODE --- | |
------------------- | |
nth : Int -> List a -> Maybe a |
This file contains hidden or 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
import String | |
import List | |
infixl 2 => | |
(=>) = (,) | |
type Json | |
= Number Float | |
| String String |