git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Speed improvement for tidyUp.
commit7492b71e72c6a5808b8c145d5446f1c02bc92e95 authorPhil Freeman <paf31@cantab.net> dateTue 8 Apr 2014, 15:43 (13 years ago) parente62efe1
1 file changed+8−3
src/Language/PureScript/TypeChecker/Types.hs+8−3
src/Language/PureScript/TypeChecker/Types.hs+8−3
@@ -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