Re: What I wish someone had told me...

I'd like to thank everyone who replied to my OP, and also perhaps clarify one point. I wasn't trying to be argumentative or negative about any work people have done to make Haskell approachable for OO programmers (or any other programmers, for that matter). I simply wanted to know what others thought about one item that was misleading to me in particular, and to see if others either agreed with me or had similar experiences. That being said, I know that it's a great deal of work to put together a useful tutorial, and I appreciate every one I read. Especially the monad tutorials, of which it took a half dozen before I got it. Best, John

On Wed, Oct 15, 2008 at 8:08 AM, John Lato
I'd like to thank everyone who replied to my OP, and also perhaps clarify one point. I wasn't trying to be argumentative or negative about any work people have done to make Haskell approachable for OO programmers (or any other programmers, for that matter). I simply wanted to know what others thought about one item that was misleading to me in particular, and to see if others either agreed with me or had similar experiences.
That being said, I know that it's a great deal of work to put together a useful tutorial, and I appreciate every one I read. Especially the monad tutorials, of which it took a half dozen before I got it.
I've read a lot of the Monad tutorials, and I feel like I only get "most of it" to be 100% honest. The State Monad still boggles my mind a little bit. I understand what it's supposed to do and I get the idea about how it works. It's just that when I look at the implementation of >>= for it, I want to crawl into a corner and nibble my fingers. Ok, it's not that bad, but I'll admit I've gone cross-eyed a few times trying to keep all that state in my head about what's REALLY going on there. Perhaps if it were pulled apart step by step I'd have a better understanding. I even tried to implement it once, and failed, however, I never seem to fail to be able to *use* it if someone already implements it for me :-). Kind of like how I know how to operate a car, but I wouldn't trust driving one that I built :-) Dave

The (>>=) operation for the state monad can be implemented with no
understanding at all.
Just watch djinn make the code for it. And djinn doesn't understand
the state monad, I promise. :)
-- Lennart
2008/10/15 David Leimbach
On Wed, Oct 15, 2008 at 8:08 AM, John Lato
wrote: I'd like to thank everyone who replied to my OP, and also perhaps clarify one point. I wasn't trying to be argumentative or negative about any work people have done to make Haskell approachable for OO programmers (or any other programmers, for that matter). I simply wanted to know what others thought about one item that was misleading to me in particular, and to see if others either agreed with me or had similar experiences.
That being said, I know that it's a great deal of work to put together a useful tutorial, and I appreciate every one I read. Especially the monad tutorials, of which it took a half dozen before I got it.
I've read a lot of the Monad tutorials, and I feel like I only get "most of it" to be 100% honest. The State Monad still boggles my mind a little bit. I understand what it's supposed to do and I get the idea about how it works. It's just that when I look at the implementation of >>= for it, I want to crawl into a corner and nibble my fingers. Ok, it's not that bad, but I'll admit I've gone cross-eyed a few times trying to keep all that state in my head about what's REALLY going on there. Perhaps if it were pulled apart step by step I'd have a better understanding. I even tried to implement it once, and failed, however, I never seem to fail to be able to *use* it if someone already implements it for me :-). Kind of like how I know how to operate a car, but I wouldn't trust driving one that I built :-) Dave _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Hello David, Wednesday, October 15, 2008, 7:16:09 PM, you wrote:
I've read a lot of the Monad tutorials, and I feel like I only get "most of it" to be 100% honest. The State Monad still boggles my mind a little bit. I understand what it's supposed to do and I get the idea about how it works. It's just that when I look at the implementation of >>= for it, I want to crawl into a corner and nibble my fingers.
may be i can help? :) all those pure monads imho is rather straightforward - monad just carries some value inside (such as state, environment, or data logged) and >>=,>> operations bind actions while carrying this value hiddenly. only get/set operations interact with this value while for >>=,>> operations the only requirement is to pas input value into first operation, then pass value at the exit of first operation and pass it to second one and finally return value returned by second operation. smth like this: for state monad every action has its own (imparative) result of type a plus receives some State and returns some State: type StateAction a = State -> (a,State) (>>) :: StateAction a -> StateAction b -> StateAction () -- this means that >> is operation on two actions which joins them and -- return composed action action1 >> action2 = -- Result of joining two actions is action again -- i.e. it has type State -> ((),State) -- so we define it as a function which receives initial state -- and carries it through both actions sequentially -- finally returning state returned from last action \state0 -> let (_,state1) = action1 state0 (_,state2) = action2 state1 in ((),state2) then when we apply (action1 >> action2) to some state this is calculated as action1 calculation performed on this state and then action2 calculation pewrformed on the state returned from action1 if you are are easy with high-order functions, partial application and carrying you should have no problems mastering monads -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Hi
I didn't understand Monads until I read this:
http://www.haskell.org/haskellwiki/Monads_as_Containers
It took me quite a long time to "get" them too, but slowly over time it
will sink in.
Thanks
Neil
________________________________
From: haskell-cafe-bounces@haskell.org
[mailto:haskell-cafe-bounces@haskell.org] On Behalf Of David Leimbach
Sent: 15 October 2008 4:16 pm
To: John Lato
Cc: haskell-cafe@haskell.org
Subject: Re: [Haskell-cafe] Re: What I wish someone had told
me...
On Wed, Oct 15, 2008 at 8:08 AM, John Lato

On Wed, 2008-10-15 at 08:16 -0700, David Leimbach wrote:
On Wed, Oct 15, 2008 at 8:08 AM, John Lato
wrote: I'd like to thank everyone who replied to my OP, and also perhaps clarify one point. I wasn't trying to be argumentative or negative about any work people have done to make Haskell approachable for OO programmers (or any other programmers, for that matter). I simply wanted to know what others thought about one item that was misleading to me in particular, and to see if others either agreed with me or had similar experiences. That being said, I know that it's a great deal of work to put together a useful tutorial, and I appreciate every one I read. Especially the monad tutorials, of which it took a half dozen before I got it.
I've read a lot of the Monad tutorials, and I feel like I only get "most of it" to be 100% honest.
Maybe the problem isn't you, but what you are reading...

The best analogy I have found on Monads (written for Scala) is the one that
compared them to Elephants. The author was referring the the blind men and
elephant story: http://en.wikipedia.org/wiki/Blind_Men_and_an_Elephant
On Wed, Oct 15, 2008 at 6:40 PM, Derek Elkins
On Wed, 2008-10-15 at 08:16 -0700, David Leimbach wrote:
On Wed, Oct 15, 2008 at 8:08 AM, John Lato
wrote: I'd like to thank everyone who replied to my OP, and also perhaps clarify one point. I wasn't trying to be argumentative or negative about any work people have done to make Haskell approachable for OO programmers (or any other programmers, for that matter). I simply wanted to know what others thought about one item that was misleading to me in particular, and to see if others either agreed with me or had similar experiences. That being said, I know that it's a great deal of work to put together a useful tutorial, and I appreciate every one I read. Especially the monad tutorials, of which it took a half dozen before I got it.
I've read a lot of the Monad tutorials, and I feel like I only get "most
of it" to be 100% honest.
Maybe the problem isn't you, but what you are reading...
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Daryoush Weblog: http://perlustration.blogspot.com/
participants (7)
-
Bulat Ziganshin
-
Daryoush Mehrtash
-
David Leimbach
-
Derek Elkins
-
John Lato
-
Lennart Augustsson
-
Mitchell, Neil