3 ms·
> use of monadic IO in a purely functional language will force you to have `unsafePerformIO` in the language.
by klibertp 11y ago
> use of monadic IO in a purely functional language will force you to
have `unsafePerformIO` in the language.
- TazeTSchnitzel 11y agoGHC has `unsafePerformIO` in order to implement pure abstractions. It's an implementation detail, Haskell proper does not support it, and you wouldn't use it in your code.
- deleted 11y ago[deleted]
- klibertp 11y ago> and you wouldn't use it in your code Speak for yourself. I don't see any value in not using a tool when it's available and seems to do the job: http://science.raphael.poss.name/haskell-for-ocaml-programmers.html#print-debugging http://science.raphael.poss.name/haskell-for-ocaml-programme... Personally I don't believe in 100% pure FP, it's both a pain in the ass and doesn't really give you more than 85% FP already would. Actually, most of the FP world seems to agree: out of many Lisps, Scala, OCaml, SML, F#, Erlang/Elixir etc. only Haskell is that hell-bent on purity. Even things like PureScript are more pragmatic than Haskell in this regard. Here's a great talk on getting what's best from FP without also taking all the problems: http://www.infoq.com/presentations/functional-pros-cons http://www.infoq.com/presentations/functional-pros-cons
- tome 11y ago> Even things like PureScript are more pragmatic than Haskell in this regard Interesting. In what way?
- TazeTSchnitzel 11y ago> Personally I don't believe in 100% pure FP, it's both a pain in the ass and doesn't really give you more than 85% FP already would. How so? Having a pure language has some significant benefits, like laziness. Data structures as control flow is awesome.