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

It's about function composition.

How do you compose a function that returns an int or an error with a function that takes an int as parameter?

Yes you can split this in multiple steps, or you can use monads to handle the composition for you, making you type less code, giving more information to the typesystem (mypy for python for example) about what is valid and what's not.

This is a completely different programming style, it's functional programming, aka: "how to make functions by composing other functions".



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

Search: