mirror of
https://github.com/mdgriffith/elm-optimize-level-2.git
synced 2024-11-29 12:46:32 +03:00
simple test case
This commit is contained in:
parent
698d166bfe
commit
a4f96bcd7e
43
testcases/simple/Main.elm
Normal file
43
testcases/simple/Main.elm
Normal file
@ -0,0 +1,43 @@
|
||||
module Main exposing (main)
|
||||
|
||||
{-| -}
|
||||
|
||||
import Html
|
||||
|
||||
|
||||
type MyType
|
||||
= Zero
|
||||
| One Int
|
||||
| Two String String
|
||||
|
||||
|
||||
values =
|
||||
[ Zero
|
||||
, One 5
|
||||
, Two "Two" "two"
|
||||
]
|
||||
|
||||
|
||||
many =
|
||||
List.repeat 1000 values
|
||||
|> List.concat
|
||||
|
||||
|
||||
addMyType mine sum =
|
||||
case mine of
|
||||
Zero ->
|
||||
sum
|
||||
|
||||
One i ->
|
||||
i + sum
|
||||
|
||||
Two _ _ ->
|
||||
sum
|
||||
|
||||
|
||||
main =
|
||||
let
|
||||
sum =
|
||||
List.foldl addMyType 0 many
|
||||
in
|
||||
Html.text (String.fromInt sum)
|
22
testcases/simple/elm.json
Normal file
22
testcases/simple/elm.json
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"type": "application",
|
||||
"source-directories": ["."],
|
||||
"elm-version": "0.19.1",
|
||||
"dependencies": {
|
||||
"direct": {
|
||||
"elm/browser": "1.0.2",
|
||||
"elm/core": "1.0.5",
|
||||
"elm/html": "1.0.0"
|
||||
},
|
||||
"indirect": {
|
||||
"elm/json": "1.1.3",
|
||||
"elm/time": "1.0.0",
|
||||
"elm/url": "1.0.0",
|
||||
"elm/virtual-dom": "1.0.2"
|
||||
}
|
||||
},
|
||||
"test-dependencies": {
|
||||
"direct": {},
|
||||
"indirect": {}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user