You can google for haskell "double colon" or similar things; this, unfortunately, is a bit difficult for Google to syntax, but in this case you can name it.
In Haskell, your programs will work fine without it (although you will want to use it to hone the specification of any functions that you define, which is good practice).
The idea is that you can insert :: ... anywhere (even in the middle of an expression) to say "by the way, Mr. Compiler, this expression must be of type ... ". Then the compiler will throw an error if it can be proven that it may not be so.
I think you can also use it to "throw" functions into the versions you need; for example, if a function is "polymorphic" (has a common type signature), and you really want, say, Integer , then you could do :: Integer by the resulting value; I'm a little rusty though.
ninjagecko May 08 '11 at 10:25 2011-05-08 10:25
source share