News for hackers. Stuff that matters.
Re:Static types in Python by jstimpfle on Friday October 14, 2016 @08:38AM (#12707652)
Granted it's difficult to remember the type of the casual e-mail address or of a list of integers. In Haskell, where there are a thousand ways of encoding the most trivial things, that is.

In my own practice, most transformations don't involve relations over more than 5 variables with mostly obvious types. Yes, this is hard to use:

https://tronche.com/gui/x/xlib/window/XCreateWindow.html

But then 1) there might be nicer ways to design an API and 2) at these few places the implementor of the API can just insert value assertions.

Re:Static types in Python by coldtea on Friday October 14, 2016 @09:07AM (#12707786)
>Granted it's difficult to remember the type of the casual e-mail address or of a list of integers.

It would be a toy project that only (or mainly) has those as all the types you need to remember -- so that just proves my point.

Also the 'type' of an email address is an unsolved problem -- if we're talking type checking. It's not a string, and it's not solvable with regex either. So bad example all around.

Re:Static types in Python by jstimpfle on Friday October 14, 2016 @09:30AM (#12707911)
This is the point. Encode email addresses as strings and be done. Not a problem in practice.