3 ms·
"Roughly equivalent" isn't equivalent at all. > I’m saying that async functions do the same thing as the io monad. > The <$> operator in Haskell is just sugar
by instig007 2y ago
"Roughly equivalent" isn't equivalent at all.
> I’m saying that async functions do the same thing as the io monad.
> The <$> operator in Haskell is just sugar for patterns to stop the pollution from occurring.
No they don't. Async functions aren't IO actions in Haskell terms, and for the latter argument of <$>, you need referential transparency (via laziness) too, otherwise your attempt at "sugaring" your async functions will break at the first binding expression in a local scope for future processing elsewhere:
...
let arg = processData <$> ioAction
in ...
Do you want to wrap-and-call-later all of these cases into lambdas by hand? :) Show me an example of that being done in a type-safe way in typescript, and I'll point you at the layers that will break composition at the next binding.
- ninetyninenine 2y agoIf You want to redefine the meaning of roughly equivalent then that’s your prerogative. There’s an isomorphism I’m referring to here and if you fail to see it that’s not my problem. As for the rest of your argument, the point is to not use async functions locally in the context of pure logic. The pattern is imperative shell, functional core.
- instig007 2y agoAdding a property-changing prefix to "equivalent" makes it non-equivalent, I thought you would understand it if you were using the word "isomorphism". > the point is to not use async functions locally in the context of pure logic. The pattern is imperative shell, functional core. The point is that IO actions aren't `async defs`, because async defs don't have two important properties to hold eqivalence to IO actions in Haskell. I'm not sure why you're trying to cherry pick arguments to see your argument fit into the slots that don't accept coloring keywords where they don't belong to: seamless composition.
- ninetyninenine 2y agoYou’re just playing pedantic games. By roughly equivalent I mean isomorphic. Do you not get it? Isomorphism isn’t equivalency. Sure thanks for pointing the obvious out. Why don’t we get with the program rather than state pedantic details? IO actions aren’t equivalent to async defs. I never said that. I said roughly equivalent which means isomorphic. I’m not sure why you’re trying to say I’m cherry picking my argument when I am the one dictating the point here. I made the first statement and you responded to it and you started out your previous response by trying to turn the conversation to your point. Bro I made the point. I’m not changing the point. You need to not change the topic. In the very beginning I said functional core imperative shell. That’s the point. I guess the io monad doesn’t prevent people from writing shit code in Haskell. You’re weaving in and out of io constantly with almost everything polluted with IO. Pure functions are scattered randomly in a patchwork of compositions without delineation between purity and IO. You don’t see that there needs to be a layer between the two.
- instig007 2y ago> You’re just playing pedantic games. I see you've been cultured by typescript and js. > I said roughly equivalent which means isomorphic. "roughly equivalent" isn't the definition of isomorphic, and I hinted which properties a type system and the runtime have to support for that isomorphism to be manifested in a language implementation, which isn't there for all of the mainstream languages, unless you're willing to provide that conversion by hand. > when I am the one dictating the point here. I made the first statement and you responded to it and you started out your previous response by trying to turn the conversation to your point. You're simply wrong, that happens. > In the very beginning I said functional core imperative shell. That’s the point. That terminology only exists as a coping mechanism for those on the mainstream languages. In Haskell everything is functional composition, and `IO a` is neither exempt from it, nor is made into a special case. When you realise this I'll congratulate you on becoming less ignorant.
- jitl 2y agoThis thread is a good reminder not to try to become a Haskell Programmer
- instig007 2y ago> This thread is a good reminder not to try to become a Haskell programmer Many people say the same when they see pro players in their game at the NFL's Super Bowl. Others get excited and pursuit the career.
- deleted 2y ago[deleted]
- ninetyninenine 2y agoIt’s eye opening if you get it. I realize this thread is childish and arrogant but that’s largely orthogonal to the epiphany you gain from grokking Haskell.
- ninetyninenine 2y ago