Raul Miller wrote:
>  Simplicity is powerful.
>  As things currently stand, I feel that Monads are too
>  complex for a language like J.

I think the best kind of simplicity is well-packaged complexity.  For example, 
when I type

           1+1
        2

in J, all sorts of arcane things happen between the time I hit enter and the 
time I see the 2.  But I don't have to know about any
of it.

So if monads allow me to express complex topics simply (i.e. I can outsource 
detail management to them), then I'm all for them.
And this thread (and Viktor's previous related thread) is of great interest to 
me.  So much so that I haven't even read it yet,
because I haven't had the time to give it the attention I want to.  
Unfortunately I'm completely ignorant when it comes to monads in
the Haskell sense, as I am about all Haskell or functional programming topics 
outside of J.

I've tried dipping my toe in the topic before, but I was never able to find a 
clear, concise definition of what a monad even is.
Every article on them seems to start with "Monads are such and such, but not 
really", and everyone seems to define them differently
(of course, this could just be because monads are a very abstract things that 
can be viewed multiple ways, or because different
people have different perspectives on the same topic, or both).  

My current understanding is along the lines Raul quoted: that is, a monad is a 
way to package up "the state of the world" as an
input, to be (explicitly?) passed to a function, so that we can say the 
function has no hidden inputs, and its output is fully
determined by its inputs (so that if you called the function again with the 
same inputs, including that snapshot of "the state of
the world", you'd get the same output).  In addition to this, I have the vague 
sense that monads are a syntactic convenience (but
not knowing Haskell or what its syntactic hurdles are, I can't know this).   

I would be very excited and grateful if someone in this thread posted a clear, 
and more or less comprehensive, definition of a
monad, in a way someone who's familiar with J but not other types of functional 
programming could relate to.  Or maybe a more
concrete and direct approach would be to say "here's the kind of thing we could 
express in J, if it had monads" (forgive me if
someone already did this). 

For my part, I'm going to go read the Wikipedia article Raul quoted (for all my 
toe-dipping, I never read the WP article on monads,
which is silly, seeing as how WP consciously tries to present topics in a way 
accessible to the layman unfamiliar with the topic),
then the previous posts in this thread (which I hope the WP sheds light on).

-Dan

PS:  I know Tracy Harms studied monads for a while after learning J, and tried 
relating them to the J world; I kept meaning to ask
him for his thoughts, but never did.



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

Reply via email to