Hacker News new | past | comments | ask | show | jobs | submit login

I still don't get it, could someone smarter than me explain?

helloWorld : '{IO, Exception} () helloWorld _ = printLine "Hello World"

The example above is followed by explanation "{IO, Exception} indicates which abilities the program needs to do I/O and throw exceptions." Well, which abilities does it need then? No idea.




>Well, which abilities does it need then? No idea.

Abilities called IO and Exception.

I am sure you are familiar with effect systems and algebraic effects, right? Abilities are what algebraic effects are called in Unison: https://www.unison-lang.org/docs/fundamentals/abilities/

So, in Haskell you would have IO monad and Exception monad, but in Unison you have an IO ability and an Exception ability.

If you want to know more: https://www.unison-lang.org/docs/language-reference/abilitie... and: Convent, L., Lindley, S., McBride, C. and McLaughlin, C., 2020. Doo bee doo bee doo. Journal of Functional Programming, 30, p.e9. https://arxiv.org/pdf/1611.09259.pdf


> I am sure you are familiar with effect systems and algebraic effects, right?

Probably not, based on their question!

These are pretty esoteric concepts. I think it was one of a few bullet points on "other interesting ideas" in the functional programming portion of my programming languages course, and I doubt that most working programmers have taken an academic PL course like that at all.

But effects are indeed an awesome concept, and thanks for the excellent links! The parent is one of today's lucky 10,000: https://xkcd.com/1053/


As a junior that did not do CS at uni, a lot of stuff around here goes right over my head. I often do feel that I might never catch up. I just about understand what functional programming is in terms of a one line definition let alone any concepts that fall under it. To be fair, I only really use Object Oriented.


Thank you!


>I still don't get it, could someone smarter than me explain?

It is not about smartness, but it is probably you not having encountered these concepts before.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: