Viktor Cerovski wrote:
>  Let us check out the infamous IO monad,
>  in plain English, and with the minimum use 
>  of Haskell and J

That was enlightening (and very well written), thank you.  It more or less
corroborates the view I'd already developed about Monads (i.e. that they're
a way to "stay functional" in a non-functional world), which I tried to
describe at [1].

And I learned something I like about the IO monad: using it results in the
same effects, and the code is nearly identical; the only difference is the
function is decorated, or clearly marked, as IOish (I would say
side-effecting but if I understand you correctly, that is not true anymore).
I like this; it's similar to the practices I advocated in [2].

But let me ask a devilish question.   What if I didn't care about warning
other programmers that my function was IOish?  Other than that caveat, what
has changing the codomain from char to IO chat bought me? 

>  particularly why we do need parametric types

The reason I ask is this:  this statement more or less aligns with what Raul
said earlier, in [3]: that Monads and Haskell are essentially inextricable.
Now of course the two statements aren't identical: rather than Haskell, you
are identifying a dependency on type systems.  But for my purposes, that's
the same thing.

I say that because as I mentioned in those earlier threads, I'm looking for
a definition or understanding of Monads that can be implemented in J, which
has no type system (or any other functional language which doesn't also
happen to have an algebra of types).  Also, I'm a bit biased; I have no
particular affinity for type systems.

So, my question is really:  can Monads be defined independent of a type
system?  If so, can you describe the advantages they'd provide? 

-Dan


[1]  http://www.jsoftware.com/pipermail/chat/2010-January/002918.html 
[2]  http://www.jsoftware.com/pipermail/programming/2010-January/017918.html
[3]  http://www.jsoftware.com/pipermail/chat/2010-January/002917.html 


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

Reply via email to