A better way of putting this: Haskell's IO monad structures a particular set of interactions with the outside world. By making all foreign interactions go through tasks, Elm could use its task monad to structure interactions with the outside world. The difference then is that Haskell has more syntactic sugar around monads than Elm does.
Mark On Mon, Dec 12, 2016 at 8:19 PM, Mark Hamburg <mhamburg...@gmail.com> wrote: > One doesn't need them to be asynchronous but making them asynchronous > helps reinforce the notion that this is happening outside the Elm universe. > And if you want monads, Elm's tasks are monadic. > > Mark > > On Mon, Dec 12, 2016 at 6:16 AM, 'Rupert Smith' via Elm Discuss < > elm-discuss@googlegroups.com> wrote: > >> On Friday, December 9, 2016 at 8:07:33 PM UTC, Mark Hamburg wrote: >>> >>> While there are certainly times when synchronous calls would have been >>> nice, I recognize that having synchronous behavior for potentially mutable >>> external state also tends to imply a lot about execution order — something >>> that a pure functional language expects to be more free about. Hence, I >>> think it's reasonable to force operations that need to deal with the >>> external world to be asynchronous. >>> >> >> Consider monads in other fp langauges. You don't need to have an >> asynchronous model to work with external state and side effects. >> >> I suppose you could describe Elm's event driven loop as a monad, in the >> sense that it chains together sequences of functions over messages. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Elm Discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to elm-discuss+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.