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

But I believe this is also with the spirit of the article. Your functions still assume something about input and are polymorphic over everything else in it.

AFAIK this can also be done in a type safe manner in languages which support extensible records/row polymorphism.



You don't need row polymorphism to write a function which operates on a collection of key/value pairs and expects a specific key to exist at runtime.

This works in Haskell, just as it does in Clojure.


Please write the Haskell type signature of such a function, as an example.


    f :: Map String String -> Map String String




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: