feat: transpile hello world view function

This commit is contained in:
YetAnotherMinion 2021-12-13 04:31:53 +00:00 committed by nobody
commit 2f335b02ae
Signed by: GrocerPublishAgent
GPG key ID: D460CD54A9E3AB86
6 changed files with 385 additions and 81 deletions

View file

@ -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

View file

@ -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