Raul,
Apologies if my reply seemed unhelpful - that wasn't my intention. Rather -
as I tried to say - my feeling was that for the purposes of the current
discussion, Haskell monads weren't really pertinent and so it was best to
leave them to one side for now. (Not to mention that they seem to be rather
off-topic for this mailIng list).
I admit that I'm tempted by your invitation to give a better description of
monads - but I think that it's probably better not to:
- I still think that my original judgment was probably correct; I doubt
that getting into the intricacies of Haskell monads will advance this
conversation (interesting though it might be to do so)
- There are many monad tutorials already out there.
- It's a cliche that everyone who 'gets' monads immediately goes out
and writes a tutorial of his own
- Probably it makes more sense to point you towards some of the better
ones of those, rather than to try and write a new one.
So instead let me direct you towards some useful resources:
- First, I'd caution you against trying to run before you can walk. My
impression is that you're not that familiar with Haskell; and if that's
right, then there's lots of stuff going on that you should learn about first
- Many people would argue that the Haskell Monad has become unjustly
(in)famous: it's not really anything special and you're best approaching it
by learning about Haskell, and Haskell typeclasses, in general.
- http://learnyouahaskell.com/chapters is widely recommended, though I
confess that it came along a little too late for me, and to my mind it has
always looked a little twee
- Likewise http://book.realworldhaskell.org/read/ is highly rated
- If you insist on diving straight into monads, then I'd suggest:
-
http://blog.sigfpe.com/2006/08/you-could-have-invented-monads-and.html
- http://www.haskell.org/haskellwiki/Typeclassopedia
- googling "monad tutorial". There are millions of the things out
there; one of them will surely chime with you.
I hope this helps.
David
"Raul Miller" <[email protected]> wrote in
message news:[email protected]...
On Thu, Apr 7, 2011 at 4:29 PM, David Hotham
<[email protected]> wrote:
> Something weird seems to have happened to my posts - I sent one and then a
> reply to that one, but only the second got through.
>
> That being so, you may not have noticed the text in my first mail. So I'll
> repeat it here.
>
>>I think you have a mistaken idea about what a (Haskell) monad is. At the
>>start of this thread you wrote:
>>
>> "This means you can use Haskell's foldr with a function which combines
>> arguments of two different types without having to write a Haskell
>> Monad (which means: deriving a new function and type to let both of
>> the function argument types be consistent with each other)."
>>
>> This isn't what a Haskell monad is at all.
>>
>> While I'm not quite sure what your point is, I think it unlikely that
>> understanding Haskell monads will be relevant to it - so I won't go any
>> further into that.
>>
>> On your original post, as best I understand it, I think that you may just
>> have chosen the wrong Haskell analog for /\. You probably want one of the
>> scan variants that treats the first element of the list as the seed. So
>> for example:
>>
>> scanl1 (+) [1,2,3,4]
>> [1,3,6,10]
>>
>> Does this help?
If I have the wrong idea of what a monad is -- I currently believe
that it is a single, consistent type for dealing with what would
otherwise be incompatible type issues -- then it would help to have a
better description of it. A flat out statement that I am wrong with
no additional information does not help.
(Now, I understand, of course that Haskell's IO Monad is something
specific, but I was not suggesting that we needed the IO Monad.)
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm