In SML, :: is called "cons", and is the infix operator for adding an element at the front of a list. For example, 5::[6,7] results in the list [5,6,7].

:: is right associative, so the expression 1::2::3::nil makes sense and means 1::(2::(3::nil)).

When performing pattern matching, :: is used to decompose a list into the first element (the head) and the rest of the list (the tail). Here is a small function that returns the sum of all elements in a list:

fun sum [] = 0
 |  sum (x::xs) = x + sum xs;

If x::xs is matched with a list then x is the first element in the list, and xs the rest of the list.