Robert Raschke-5 wrote:
> 
> [...]
> "Luckily", category theory (upon which a lot of type theory is based) has
> the idea of monads. These allow you to create interesting types, one of
> which is a state monad (another is the io monad), which allow you to write
> types that include "stuff", not just plain old arrows etc. But the moment
> you write a function that makes use of a monadic type, you have to deal
> with
> the "stuff"; you now cannot easily get back to the pure idea of
> referentially transparent functions. 
> 
What you're saying is analogous (and, who knows, maybe isomorphic?) to 
saying that / allows us to avoid loops and just insert a given verb between 
items of an array, with / hiding the loop construct, but once we give a
particular 
verb, the (pure idea(?) of) referential transparency of / is lost because
now 
we have to fill in the body of the loop with some stuff.

I see Monads as allowing us to describe various classes of computations, 
including those that involve side-effects, by (monadic) constructs that 
have no side-effects, i.e remain referentially transparent.


> They're still functions, but the type
> system makes sure you don't get into trouble in your reasoning.
> 
Yes, but not just any kind of type systems.

-- 
View this message in context: 
http://www.nabble.com/xmonad--was-Re%3A--Jprogramming--tail-recursion-TCO---tp23636312s24193p23654482.html
Sent from the J Chat mailing list archive at Nabble.com.

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to