
16 May
2011
16 May
'11
3:12 p.m.
On Mon, May 16, 2011 at 3:49 PM, austin seipp
I don't know why GHC doesn't have this rule by default, though. We can at least rig it with a RULES pragma, however:
$ cat concatmap.hs module Main where
{-# RULES "concatMap/foldr" forall x k. concatMap k x = foldr ((++) . k) [] x #-}
Well, that's the definition of concatMap :) [1], at least since as long as Hackage can go [2]. So the problem seems something else. Cheers, [1] http://hackage.haskell.org/packages/archive/base/4.3.1.0/doc/html/src/GHC-Li... [2] http://hackage.haskell.org/packages/archive/base/3.0.3.1/doc/html/src/GHC-Li... -- Felipe.