News for hackers. Stuff that matters.
Re:Static types in Python by minitech on Friday October 14, 2016 @12:30AM (#12706145)
You’re making out having to explicitly specify a type when type inference doesn’t do a satisfactory job as some kind of extremely painful thing, but it’s not. You just define the type of your object, which is something you had to know anyways; now it’s written down and people reading don’t have to guess at or remember what it is.
Re:Static types in Python by jstimpfle on Friday October 14, 2016 @01:17AM (#12706255)
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.
Re:Static types in Python by dllthomas on Friday October 14, 2016 @05:29AM (#12706970)
> 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]