mirror of
https://github.com/mdgriffith/elm-optimize-level-2.git
synced 2024-11-29 12:46:32 +03:00
33 lines
650 B
Elm
33 lines
650 B
Elm
module Suite exposing (suite)
|
|
|
|
{-| -}
|
|
|
|
import V8.Benchmark.Runner.Json exposing (..)
|
|
|
|
|
|
|
|
type MyType
|
|
= Zero
|
|
| One Int
|
|
| Two String String
|
|
|
|
|
|
{-| This is an interesting case becase the function be being applied both fully, and partially.
|
|
-}
|
|
weird : (Bool -> MyType -> Bool) -> ( MyType, List MyType ) -> List Bool
|
|
weird fn ( top, remaining ) =
|
|
fn True top :: List.map (fn False) remaining
|
|
|
|
|
|
alwaysFalse one two =
|
|
False
|
|
|
|
|
|
suite : Benchmark
|
|
suite =
|
|
describe "Arity"
|
|
[ benchmark "Passed function being used fully and partially" <|
|
|
\_ ->
|
|
weird alwaysFalse ( Zero, [ Zero, Zero, Zero ] )
|
|
]
|