Code · 1 file
Sample Elm File
Elm, a functional language for web front ends, rendering HTML. Every language sample implements the same small program so you can compare them side by side.
Elm · 985 B
Sample Elm file
An idiomatic Elm example — the same customer program (or, for hardware languages, a small counter design) we offer in every language.
CC0 · free for any use · Verified by an independent tool · Report a problem
module Main exposing (main)
{-| Sample Elm program — samplefiles.com -}
import Html exposing (Html, div, li, p, text, ul)
type alias Customer =
{ id : Int
, name : String
, balance : Float
}
isVip : Customer -> Bool
isVip customer =
customer.balance >= 10000
customers : List Customer
customers =
[ Customer 1 "Ada" 12500
, Customer 2 "Grace" 830.5
, Customer 3 "Linus" 10000
]File details
Download from the command line
curl -L -o Main.elm https://files.samplefiles.com/code/elm/Main.elmwget https://files.samplefiles.com/code/elm/Main.elmhttps://files.samplefiles.com/code/elm/Main.elmprintf '%s %s\n' 420673e1942dbabdf0736bdd54c4d1e7e4f7fa5fc52da289c409f586f47cde4a Main.elm | shasum -a 256 -cOr check the download in your browser with the checksum calculator.