Re:Making Wrong Code Look Wrong
by masklinn on Tuesday August 23, 2011 @05:26AM
(#2915956)
Re. second one, wouldn't it also be possible to write
s = "My string literal" :: TaintedString
?
It's not shorter than the constructed version but it should work, you sometimes need it to get the "right" kind of number out of a literal when the type inference gets confused (or more commonly in the REPL)
Re:Making Wrong Code Look Wrong
by eru on Tuesday August 23, 2011 @12:31PM
(#2917223)
Yes, that's possible with the right compiler extensions. For this example it's essentially the same thing as giving the type on its own line, so I chose the more common syntax.
It's not shorter than the constructed version but it should work, you sometimes need it to get the "right" kind of number out of a literal when the type inference gets confused (or more commonly in the REPL)