import Zipper exposing (..) import Color exposing (Color) import Dict exposing (Dict) import Html exposing (..) import Html.App as App import Html.Attributes exposing (style) import Html.Events exposing (onClick) import Random import Time main = App.program { init = init , view = view , update = update , subscriptions = subscriptions } size = 1000 -- MODEL type alias Model = Zipper Int init : (Model, Cmd Msg) init = (fromList 0 [1..size], Cmd.none) -- UPDATE type Msg = Update (Zipper Int) succ n = n + 1 update : Msg -> Model -> (Model, Cmd Msg) update msg model = case msg of Update grid -> (edit succ grid, Cmd.none) -- SUBSCRIPTIONS subscriptions : Model -> Sub Msg subscriptions model = Sub.none -- VIEW buttonView : Zipper Int -> Html Msg buttonView zppr = button [onClick (Update zppr)] [text <| toString <| extract zppr] view model = let butts = model =>> buttonView listm = List.intersperse (br [] []) (toList butts) in div [] listm