Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Annotating even the last bit of code that uses type class methods until the error message becomes clear is very cumbersome. For example, I can't say (traverse :: The List instance), but have to dig out the whole annoying signature, or go look for a more strategic value where the same information can be put in fewer characters. For another thing, it often duplicates the amount of lines needed (or more if you like to put in whitespace before types). It's definitely very annoying.


> I can't say (traverse :: The List instance)

Actually, in GHC 8.0 you can do exactly that, with the TypeApplictions extension.

    Prelude> :set -XTypeApplications
    Prelude> :t traverse @[]
    traverse @[] :: Applicative f => (a -> f b) -> [a] -> f [b]




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: