Haskell socket action invocation syntax -


in code snippet s <- socket :: io (socket inet stream tcp) sub-expression starting "::" mean?

i can understand when "::" used in function signature in socket :: (family f, type t, protocol p) => io (socket f t p), not when "::" used in action invocation in case.

this listed in example code @ the haskell socket manual

it means "take expression produce type". convoluted? not really, consider

x = 0 

what type x of? num => a. if wanted int?

x = 0 :: int 

that's there it. it's not specific sockets @ all, it's part of standard haskell syntax.


Comments