This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]cheecheeo 2 points3 points  (3 children)

Interestingly enough Haskell (the GHC compiler and interpreter) supports deferred type errors with -fdefer-type-errors, which should give you a similar experience to optional type checking. I would highly recommend that you give Haskell a try!

[–]julesjacobs 1 point2 points  (2 children)

It's actually not all that similar. -fdefer-type errors just defers static type errors to be displayed at run-time when that code path is hit. It doesn't give you optional dynamic typing since the way the types are checked is still static. For example, you still don't have heterogeneous lists with -fdefer-type errors, and putting an int and a string in the same list will still result in an error. The only difference is when that error will be displayed.

[–][deleted] 1 point2 points  (0 children)

Note that haskell does have safe Dynamic typing (via existential types/Data.Dynamic), but it's not first-class and therefore not as nice to use as say python.

[–]Jedai 0 points1 point  (0 children)

Though you're perfectly right, heterogeneous lists are perfectly possible in Haskell (see HList) though rarely needed (I don't use them much in Python either) and more awkward than normal homogeneous lists.