@razzy_ar@sampocino@devabram Oh does it? I don't use it often and was thinking that the syntax was <some function applied implicitly> -> <pattern>
@devabram@sampocino@MaineFrameworks It just happens that in your example, the argument is being pattern matched on "in-line", but it is orthogonal ton the "repeated function" or "table" syntax.
@devabram@sampocino@MaineFrameworks Interestingly, this is, in a way, the most "natural" and certainly most basic syntax for defining functions. It makes it explicit, that a function is essentially a table of a value and its corresponding other value:
next 0 = 1
next 1 = 2
next 2 = ...
@awelonblue@abdimoalim_ Yet, replacing occurences of something like 'print "Hello"' with 'p' defined by equation 'p = print "Hello"' works only because 'print' is pure and its referential transparency. 'get' just happens to be "nullary".
@awelonblue@abdimoalim_ I don't understand, the definition of 'get' does not occur anywhere in my example?.. I replaced 'get' with 'm' just like we would replace '5 + 3' with '8'.
@awelonblue@abdimoalim_ I still don't understand the preprocessor argument and whether it is an argument at all and not a joke. It does not explain the equivalence of the two programs from my other tweet. Referential transparency does.
@awelonblue@abdimoalim_ Rather, "from the design which ensures RT for =, it follows that IO is refentially transparent", unless we do not agree on what the outcome of an expression means, for example in 'get'.
@awelonblue@abdimoalim_ We only ever pretend that if we had an 'a', without any properties of how it is "produced" from 'IO a', then we might use it like this when chaining it into the next action. And everything around this os referentially transparent.
@awelonblue@abdimoalim_ In 'IO a' the 'a' is not the same kind of outcome as evaluating a function. We simply cannot obtain the 'a' without 'runIO', which we choose not to have. Somit makes no sense to say that 'IO a' is not referentially transparent wrt 'a': this is also a category error.
@awelonblue@abdimoalim_ 's <- some action' is not an equation and so, trivially, referential transparency was never promised for this syntactical form.
@awelonblue@abdimoalim_ 'get' can absolutely be replaced by its outcome, I suspect you mean that the outcome is 's' in 'get :: m s'. I mean that 'm s' is the outcome. The following programs are equivalent:
s <- get
E(s)
and
let ms = get
s <- ms
E(s)