[Haskell-cafe] Execution order in IO

Ben hyarion at iinet.net.au
Wed Apr 15 13:35:31 UTC 2015


And this is because the implementation of IO is *specifically* crafted to guarantee this ordering. It is not a property of monads in general, or do syntax in general.

On 15 April 2015 11:31:38 pm AEST, Ryan Yates <fryguybob at gmail.com> wrote:
>In your example a and b will be ordered as you would expect.
>
>On Wed, Apr 15, 2015 at 9:26 AM, Jon Schneider <haskell at jschneider.net>
>wrote:
>
>> Perhaps I need to be more specific.
>>
>> main = do
>>  a <- getLine
>>  b <- getLine
>>
>> Can we say "a" absolutely always receives the first line of input and
>if
>> so what makes this the case rather than "b" receiving it ? Or do
>things
>> need to be slightly more complicated to achieve this ?
>>
>> Sorry it's just the engineer in me. I think once I've got this clear
>I'll
>> be happy to move on.
>>
>> Jon
>>
>> _______________________________________________
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>>
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Haskell-Cafe mailing list
>Haskell-Cafe at haskell.org
>http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150415/65e3d9be/attachment.html>


More information about the Haskell-Cafe mailing list