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

Main.elm — first linesElm
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

Size
985 B (985 bytes)
MIME type
text/plain
SHA-256
420673e1942dbabdf0736bdd54c4d1e7e4f7fa5fc52da289c409f586f47cde4a
MD5
8b1de0d99975c6b886b6db044eebcc9f

Download from the command line

curl -L -o Main.elm https://files.samplefiles.com/code/elm/Main.elm

Or check the download in your browser with the checksum calculator.