I\'ve written a function similar to Data.Enumerator.List.map that makes an Iteratee compatible with an Enumerator that feeds a differe
You probably want that type, but with the ScopedTypeVariables extension enabled and with the variables from test's type signature in scope:
{-# LANGUAGE ScopedTypeVariables #-}
import Data.Enumerator
test :: forall m ai ao b. Monad m => (ao -> ai) -> Iteratee ai m b -> Iteratee ao m b
test f iter = go $$ iter
where go :: Step ai m b -> Iteratee ao m b
go (Continue k) = continue $
\stream -> go $$ k (fmap f stream)
go (Yield res _) = yield res EOF
See the GHC documentation for more information.