<div dir="ltr">Yeah, maybe I've been a little too enthusiastic about code golfing. I've noticed that haskell programs usually have short functions (compared to imperative languages). I love this---I love how when you get a function down to four or fewer lines, you can tell its structure in a glance. Yes, some Haskell structures can look confusing at first, but I find that with practice looking at them, they start to look natural. Like the way that your mind pictures &&& splitting the input---I'm sure you find that doesn't take any effort and feels like a common and natural pattern. It seems to work like that with much of Haskell.<div><br></div><div>Oh, can I bring up one other intermediate variable elimination situation?</div><div><br></div><div>I used to do things like</div><div><br></div><div>func :: IO MyData</div><div>func = do</div><div>  x <- readMyData</div><div>  return $ someProcessing x</div><div><br></div><div>When I first encountered Monads, I was confused by functions that move things into Monads, like 'liftM'. But I am starting to see the light. I realized I could do</div><div><br></div><div>func = someProcessing `liftM` readMyData</div><div><br></div><div>Or </div><div><br></div><div>func = readMyData >>= someProcessing</div><div><br></div><div>I was explaining to a friend that Haskell's abstracted patterns seem confusing to me, coming from an imperative background. She only has a little experience programming, so I tried giving some analogies. Say you are an imperative programmer and you are do a physical simulation of automobiles. You see that they all have an engine, so you write some code that handles abstracted common features of engines. </div><div><br></div><div>In Haskell, abstracted patterns are more like this--say you have a a forklift that manipulates boxes. say that's your "function." Then you write a function that produces a forklift that manipulates boxes that are inside trucks. In the imperative world, it's like "huh? where does that get you?" But it makes more sense now.</div><div><br></div><div>D</div><div><br></div></div>