xref: /Universal-ctags/Units/parser-elm.r/elm-expressions.d/input.elm (revision 94e964efcdb54004e666334f92f6bee597c7ab96)
1-- Expressions with parentheses
2
3funcA =
4    (23 + 34)
5
6-- Anonymous functions
7
8funcB = (\b1 b2 b3 -> 42)
9
10-- Allow us to call constructors as functions
11
12funcC =
13    Cons a b
14
15-- Allow us to functions and constructors using their module names
16
17funcD =
18    (List.Deep.Cons a b) + (Main.add a b)
19
20-- Basic lists
21
22funcE e1 e2 =
23    e1 :: [e2, e1 + e2]
24
25-- Empty lists
26
27funcF = []
28
29-- Tuples, including an empty tuple
30
31funcG =
32    (12, 0x034, ('a')) ++ ()
33
34-- Record names as function calls
35
36funcH h =
37    (3) + (.age h.family.person)
38
39-- Binary operators as function calls
40
41funcI i1 i2 =
42    (++) (i1 // i2) 99
43
44-- Records
45
46funcJ1 =
47    {x = 2 , y = 3 , z = 4}
48
49funcJ2 =
50    { point | x = point.x + 1 , y = Cons a b }
51
52funcJ3 =
53    {}
54
55-- Record with spaces
56
57funcJ4 =
58    { model
59    | width = width
60    }
61