feat: starmelon reads files or stdin

This commit is contained in:
YetAnotherMinion 2021-09-20 07:34:43 +01:00 committed by nobody
commit ee7ce47f48
Signed by: GrocerPublishAgent
GPG key ID: D460CD54A9E3AB86
7 changed files with 293 additions and 55 deletions

View file

View file

@ -0,0 +1 @@
not a valid module exposing (..)

View file

@ -1,8 +1,11 @@
module Main exposing (view, view2)
module Main exposing (view, view2, view3)
import Html exposing (Html, div, text)
import Svg exposing (Svg, svg)
import Array exposing (Array)
import Bytes exposing (Bytes)
import Bytes.Decode
type alias Model =
{ a : Int
@ -17,3 +20,21 @@ view : String -> Html msg
view model =
div []
[ text <| "Hello world" ++ model ]
view3: Bytes -> Html msg
view3 model =
case
Bytes.Decode.decode
(Bytes.Decode.string (Bytes.width model))
model
of
Just decoded ->
div []
[ text <| "Hello world" ++ decoded ]
Nothing ->
text "Failed to decode"
badReturnType : String -> Int
badReturnType _ =
42