3 ms·
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 sho
by masklinn 15y ago
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)
- eru 15y agoYes, 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.