3 ms·
That's a type definition. You can't get away without writing out that definition. If you wanted to, you could use Either (Int, String) [Int] in your cod
by eru 6y ago
That's a type definition. You can't get away without writing out that definition.
If you wanted to, you could use
Either (Int, String) [Int]
in your code and rely on type inference to do all the work.
- a1369209993 6y ago> 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.)