feat: transpile hello world view function
This commit is contained in:
parent
8354d51ecb
commit
2f335b02ae
6 changed files with 385 additions and 81 deletions
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# generate a 10MB test file
|
||||
< /dev/urandom tr -dc "[:alnum:]" | head -c10000000 > file.txt
|
||||
< /dev/urandom tr -dc "[:alnum:]" | head -c10000000 > input.txt
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
module Main exposing (view, view2, view3, badReturnType)
|
||||
module Main exposing (view, view2, view3, view4, view5, badReturnType, true)
|
||||
|
||||
import Html exposing (Html, div, text)
|
||||
import Svg exposing (Svg, svg)
|
||||
|
|
@ -36,6 +36,24 @@ view3 model =
|
|||
Nothing ->
|
||||
text "Failed to decode"
|
||||
|
||||
view4 : String -> Html msg
|
||||
view4 model =
|
||||
if model == "bar" then
|
||||
div []
|
||||
[ text <| "Hello world" ++ model ]
|
||||
else
|
||||
div []
|
||||
[ text "Hello world" ]
|
||||
|
||||
view5 : { t | x : String } -> Html msg
|
||||
view5 { x } =
|
||||
div []
|
||||
[ text x ]
|
||||
|
||||
badReturnType : String -> Int
|
||||
badReturnType _ =
|
||||
42
|
||||
|
||||
true : Bool
|
||||
true =
|
||||
True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue