feat: starmelon reads files or stdin
This commit is contained in:
parent
287e59c566
commit
ee7ce47f48
7 changed files with 293 additions and 55 deletions
0
examples/single-page/src/Empty.elm
Normal file
0
examples/single-page/src/Empty.elm
Normal file
1
examples/single-page/src/InvalidModule.elm
Normal file
1
examples/single-page/src/InvalidModule.elm
Normal file
|
|
@ -0,0 +1 @@
|
|||
not a valid module exposing (..)
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue