Re:Hindley-Milner Type Inference (2012)
by a1369209993 on Saturday July 11, 2020 @01:11AM
(#23799695)
> You can't get away without writing out that definition.
Not in Haskell as far as I know, but (assuming MonomorphismRestriction) there's no technical reason why
data Qwe = Q a
qwe_eps :: Qwe
qwe_eps = Q ""
couldn't infer a ~ String in the type definition for Qwe. It's just annoying and pointless, because you never actually care about having to write a explicit type annotation there. (Which was my point.) But it's still a explicit type annotation that you're required to write. (Which was (kind of) chrisseaton's point.)
If you wanted to, you could use
in your code and rely on type inference to do all the work.