
Looks possible. But it'd depend on using '>>' not '>>= \_ -> ...', so a bit fragile. Simon | -----Original Message----- | From: haskell-cafe-bounces@haskell.org [mailto:haskell-cafe-bounces@haskell.org] On Behalf Of Neil | Mitchell | Sent: 23 July 2006 13:57 | To: Bulat Ziganshin | Cc: haskell-cafe@haskell.org | Subject: Re: Re[2]: [Haskell-cafe] Why Haskell? | | Hi, | | > sequence [] = return [] | > sequence (action:actions) = do x <- action | > xs <- sequence actions | > return (x:xs) | > | > sequence_ [] = return () | > sequence_ (action:actions) = do action | > sequence_ actions | | So, by appending an underscore at the end of a name, you massively | improve the runtime behaviour of the program. That to me sounds like a | hack :) | | Would it not be possible to add a GHC rule like the following: | | forall a b . sequence a >> b = sequence_ a >> b | | I'm not sure if thats correct, a valid rule definition, or semantics | preserving, but if it was it would be nice :) | | Thanks | | Neil | _______________________________________________ | Haskell-Cafe mailing list | Haskell-Cafe@haskell.org | http://www.haskell.org/mailman/listinfo/haskell-cafe