You can google for haskell "double colon"
or similar things; it's unfortunately a bit hard to google for syntax, but in this case you can name it.
In Haskell, your programs will often run fine without it (though you will want to use it to hone the specification of any functions you define, and it is good practice).
The idea is that you can insert a :: ...
anywhere (even in the middle of an expression) to say "by the way Mr. Compiler, this expression should be of type ...
". The compiler will then throw an error if it can be proved this may not be the case.
I think you can also use it to "cast" functions to the versions you want; e.g. if a function is "polymorphic" (has a general type signature) and you actually want, say an Integer
, then you could do :: Integer
on the resulting value perhaps; I'm a bit rusty though.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…