News for hackers. Stuff that matters.
Re:Monad Confusion and the Blurry Line Between Data and Comp... by foldr on Saturday August 06, 2022 @09:48AM (#32368055)
To build on this, it's worth noting that you can't implement your own IO monad in Haskell (or at least, not Haksell 98) on top of unsafePerformIO. At root you need some special magic to ensure that A's side effects are sequenced before B's in (A >> B). The type of (>>) does not guarantee this.
Re:Monad Confusion and the Blurry Line Between Data and Comp... by nextaccountic on Sunday August 07, 2022 @09:41AM (#32376395)
Well, you have seq. The type of seq also doesn't guarantee this, but the implementation does
Re:Monad Confusion and the Blurry Line Between Data and Comp... by foldr on Sunday August 07, 2022 @10:42AM (#32376856)
I don’t think so? Seq is strict in its first argument, but that doesn’t provide a way of guaranteeing the order of side effects that I can see.

Edit: You may be thinking of pseq, but I don't think that's in the Haskell 98 report.