
I've been running into a relatively small but frequent annoyance with base >= 4.8 (GHC 7.10). `Control.Monad.foldM_`, `Control.Monad.mapM_` and `Control.Monad.forM_` are generalized traverse over any `Foldable a` rather than just arrays (`[a]`). This is great, except I'm finding that, for a lot of my code that works well in previous versions, I need to specialize the argument to `[a]` now. If other people are encoutering a similar patter, I wonder what are your best practices for doing this: ScopedTypeVariables? Deconstruct the reconstruct the array? ... The most common example is when I deserialize a JSON array with aeson and want to traverse over that array (say, to store the objects to a DB): ``` let objArray = eitherDecode myjson case objArray of Left err -> ... Right (objs :: [MyObjType]) -> forM_ objs $ \obj -> saveToDb obj ``` The above fix requires `ScopedTypeVariables` (which is probably OK). Another option is to deconstruct and reconstruct the list: ``` Right (o:objs) -> forM_ (o:objs) $ \obj -> saveToDb obj ``` Does this get optimized away? Penny for your thoughts? Cheers! Amit