1 port module Main exposing (..)
3 import IO exposing (..)
4 import Json.Decode exposing (decodeValue)
5 import Platform exposing (programWithFlags)
8 main : Program Flags Model Msg
14 \model -> input (decodeValue decodeIO >> Input)
29 = Input (Result String IO)
32 init : Flags -> ( Model, Cmd Msg )
34 ( flags, readLine prompt )
37 update : Msg -> Model -> ( Model, Cmd Msg )
40 Input (Ok (LineRead (Just line))) ->
41 ( model, writeLine (rep line) )
43 Input (Ok LineWritten) ->
44 ( model, readLine prompt )
46 Input (Ok (LineRead Nothing)) ->
53 Debug.crash msg ( model, Cmd.none )
61 read : String -> String
66 eval : String -> String
71 print : String -> String
76 rep : String -> String