
#11815: Data.List: Add a function to get consecutive elements (mapConsecutives) -------------------------------------+------------------------------------- Reporter: holmisen | Owner: Type: feature request | Status: new Priority: low | Milestone: Component: libraries/base | Version: Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by dfeuer): For educational porpoises, note that GHC is quite good at recognizing that the recursive call always receives a `Just` value, so it can use a worker- wrapper transformation to avoid all the `Maybe` business. I don't know if the `seq` is strictly necessary here, but times I've left that out of similar forms I've ended up regretting it eventually. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11815#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler