@@ -45,8 +45,8 @@ import Data.List
4545import Data.Maybe (maybeToList, isNothing, isJust, fromMaybe)
4646import qualified Data.Data as D
4747import Data.Generics
48− (everythingWithContext, mkM, everywhereM, everything, mkT,
49− something, everywhere, mkQ)
48+ (everythingWithContext, mkM, everywhereM,
49+ everything, mkT, something, everywhere, mkQ)
5050import Data.Generics.Extras
5151
5252import Language.PureScript.Declarations
@@ -253,7 +253,12 @@ isTyped (name, value) = (name, (value, Nothing))
253253-- Map a function over type annotations appearing inside a value
254254--
255255overTypes :: (Type -> Type) -> Value -> Value
256−overTypes f = everywhere (mkT f)
256+overTypes f = everywhere (mkT g)
257+ where
258+ g :: Value -> Value
259+ g (TypedValue checkTy val t) = TypedValue checkTy val (f t)
260+ g (TypeClassDictionary b (nm, tys) sco) = TypeClassDictionary b (nm, map f tys) sco
261+ g other = other
257262
258263-- |
259264-- Replace type class dictionary placeholders with inferred type class dictionaries