Re:Why Functional Programming Matters (1984) [pdf]
by marcosdumay on Thursday December 08, 2016 @09:29AM
(#13130441)
I think he was talking about something like unsafePerformIO. There are plenty of tricks you can not write on pure monads, and there are many Haskell libs that use the unsafePerformIO trick too.
[ Parent
| on HN ]
Re:Why Functional Programming Matters (1984) [pdf]
by pka on Thursday December 08, 2016 @09:57AM
(#13130626)
> There are plenty of tricks you can not write on pure monads
This made me curious, could you list some?
Re:Why Functional Programming Matters (1984) [pdf]
by marcosdumay on Thursday December 08, 2016 @11:56AM
(#13131733)
Anything that needs rewriting a memory address without losing time by allocation and garbage collection.
Handling IO exceptions and masking them as different errors.
Thread, process, or machine coordination in parallel execution.
Re:Why Functional Programming Matters (1984) [pdf]
by pka on Thursday December 08, 2016 @03:21PM
(#13133909)
You don't need unsafePerformIO for any of these.
> Anything that needs rewriting a memory address without losing time by allocation and garbage collection.
ST gives you mutable references. Or just use IO.
Re:Why Functional Programming Matters (1984) [pdf]
by marcosdumay on Thursday December 08, 2016 @07:03PM
(#13135544)
You need it for doing what the OP is talking about.