r/purescript • • Jan 06 '18

Beginning Purescript: Dropping effect rows

https://alpacaaa.net/blog/post/purescript-drop-effect-rows/
12 Upvotes

8 comments sorted by

View all comments

Show parent comment

2

u/natefaubion Jan 07 '18

I think that, if it's for beginners, its helpful to explain

  • Here's the problem it was solving
  • Here's where it might be effective/straightforward
  • Here are cases where it's difficult/impossible/confusing/unintuitive to do what you want.

Then you can lead the reader into whether it's worth it or not. Is the power-to-weight ratio there? It's an infectious feature, so this is critical. If it isn't there, then maybe you can allude to how you might bump up the power side of it (maybe run, or maybe just MTL is better).

I'd greatly appreciate if you could provide an example where effect rows are actually useful.

An example might be purescript-react where it can track/prevent component state operations within certain restricted lifecycle methods. It's arguable whether this is worth it though for a low-level library. I don't think it is, but it does what it says on the box, even if it can be irritating.

I do think something like this is good for historical purposes, since Eff rows have been a core part of PS for most of it's life.