Maybe I’m wrong but for me “side-effect“ is when you cannot apply referential transparency in A -> B or C, then you use Either, Option and so on. And “effect” is when you change the state of the world so you need to move it with you, and for that you use IO or Higher kinded types
-
This Tweet is unavailable.
-
-
Replying to @politrons @jdegoes
but IO does not do that, in the same way that this string "touch" did not modify any files.
1 reply 0 retweets 2 likes -
In fact it turns out that several compilers have agreed in use the IO data type as the main way to generate some sort of low level code (assembly, java, js, ...) that, executed, make changes in our beloved "real" world
1 reply 0 retweets 0 likes -
I'm not quite sure what that means. IO as it is in Haskell, and as we implemented in Scala, maintains referential transparency of expressions.
1 reply 0 retweets 2 likes -
Yeah and you can apply equational reasoning as others data types like list but coincidentally (and arbitrarily) ghc and other compiles use it as the main point entry to do ffi, right? Other compilers could use other data types (like Eff in purescript)
1 reply 0 retweets 0 likes
Yes they do, since the denotational semantics of IO is "whatever." This is a valid criticism of IO. But IO is as referential transparent as [], Maybe, ((->) t), etc.. If the focus were shifted to the correct properties of IO, we could all work toward something better imo.
-
-
This Tweet is unavailable.
-
This Tweet is unavailable.
- Show replies
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.