exposing (style) import Html.Events exposing (onClick) -- MODEL type alias Model = Int -- UPDATE type Action = Increment | Decrement update : Action -> Model -> Model update action model = COUNTER.ELM
Action -> Model -> Model update action model = case action of Increment -> model + 1 Decrement -> model - 1 -- VIEW view : Signal.Address Action -> Model -> Html view address model = div [] [ button [ onClick address Decrement ] [ text "-" ] , div [ countStyle ] [ text (toString model) ] 30 COUNTER.ELM
exposing (..) tests : Test tests = describe "A Test Suite" [ it "adds two numbers" <| expect (3 + 7) toBe 10 , it "fails for non-sense stuff" <| expect True toBe False ]
import Check.Investigator exposing (..) tests : Test tests = describe "A Test Suite" [ it "adds two numbers" <| expect (3 + 7) toBe 10 , it "fails for non-sense stuff" <| expect True toBe False , itAlways "ends up with the same list when reversing twice" <| expectThat (\list -> List.reverse (List.reverse list)) isTheSameAs (identity) forEvery (list int) ]