ela>x=[1,2,3,4]  
ela>x  
[1,2,3,4]
ela>y=5::x  
[5,1,2,3,4]
ela>6::y  
[6,5,1,2,3,4]
ela>1 :: [2,3,4]  
[1,2,3,4]
ela>1 :: 2 :: [3,4]  
[1,2,3,4]
ela>4::3::2::[1]  
[4,3,2,1]
ela>4::3::2::1::[]  
[4,3,2,1]
ela>[x,y,z]=[1,2,3]  
ela>x  
1  
ela>y  
2  
ela>x+y+z  
6
ela>(x :: [y,z]) = [4,5,6]  
ela>x  
4  
ela>y  
5  
ela>z  
6
ela>(x:yz)=[1,2,3]  
ela>x  
1  
ela>yz  
[2,3]
ela>(first :: second :: rest) = [5,4,3,2,1]  
ela>first  
5  
ela>second  
4  
ela>rest  
[3,2,1]
ela>x=[1,2,3]  
ela>x:1  
2  
ela>x:0  
1  
ela>y=[5,6]  
ela>z=x++y  
ela>z  
[1,2,3,4,5,6]
ela>[1,2]++[3,4]  
[1,2,3,4]
ela>head [1,2,3,4]  
1  
ela>tail [1,2,3,4]  
[2,3,4]
ela>tail (tail [1,2,3,4])  
[3,4]
ela>tail [3,4]  
[4]
ela>tail [4]  
[]
ela>tail []  
Error: Empty list.  
ela>isnil []  
true
ela>sum lst = (head lst) + sum (tail lst)  
ela>sum [1,2]  
Error: Empty list.
ela>sum lst = if isnil lst then 0 else (head lst) + sum(tail lst)  
ela>sum [1,2]  
3
ela>sum (x::xs) = x + sum(xs)  
ela>sum [1,2]  
Error: Matched failed.
ela>x=1;y=2  
ela>x  
1  
ela>y  
2
ela>sum [] = 0; sum (x::xs) = x + sum(xs)  
ela>sum [1,2]  
3