#endif
#if __HASKELL1__ > 4
-#define FMAP fmap
-#define ISALPHANUM isAlphaNum
-#define IOERROR ioError
+# define FMAP fmap
+# define ISALPHANUM isAlphaNum
+# define IOERROR ioError
+# define PSEQ seq
+# define SAPPLY $!
#else
-#define FMAP map
-#define ISALPHANUM isAlphanum
-#define IOERROR fail
+# define FMAP map
+# define ISALPHANUM isAlphanum
+# define IOERROR fail
+# define PSEQ (\x y -> y)
+# define SAPPLY $
#endif
#endif
\begin{code}
setWorkerInfo info wk = wk `seq` info { workerInfo = wk }
-setSpecInfo info sp = sp `seq` info { specInfo = sp }
+setSpecInfo info sp = PSEQ sp (info { specInfo = sp })
setInlinePragInfo info pr = pr `seq` info { inlinePragInfo = pr }
setStrictnessInfo info st = st `seq` info { strictnessInfo = st }
-- Try to avoid spack leaks by seq'ing
boxedTypeKind, unboxedTypeKind, openTypeKind, -- Kind :: superKind
- mkArrowKind, mkArrowKinds, hasMoreBoxityInfo,
+ mkArrowKind, mkArrowKinds, -- mentioned below: hasMoreBoxityInfo,
funTyCon,
Just tv' -> TyVarTy tv'
go (TyConApp tycon tys) = let args = map go tys
in args `seqList` TyConApp tycon args
- go (NoteTy note ty) = (NoteTy $! (go_note note)) $! (go ty)
- go (AppTy fun arg) = (AppTy $! (go fun)) $! (go arg)
- go (FunTy fun arg) = (FunTy $! (go fun)) $! (go arg)
- go (ForAllTy tv ty) = ForAllTy tv' $! (tidyType env' ty)
- where
- (env', tv') = tidyTyVar env tv
+ go (NoteTy note ty) = (NoteTy SAPPLY (go_note note)) SAPPLY (go ty)
+ go (AppTy fun arg) = (AppTy SAPPLY (go fun)) SAPPLY (go arg)
+ go (FunTy fun arg) = (FunTy SAPPLY (go fun)) SAPPLY (go arg)
+ go (ForAllTy tv ty) = ForAllTy tvp SAPPLY (tidyType envp ty)
+ where
+ (envp, tvp) = tidyTyVar env tv
- go_note (SynNote ty) = SynNote $! (go ty)
+ go_note (SynNote ty) = SynNote SAPPLY (go ty)
go_note note@(FTVNote ftvs) = note -- No need to tidy the free tyvars
go_note note@(UsgNote _) = note -- Usage annotation is already tidy
go_note note@(UsgForAll _) = note -- Uvar binder is already tidy
\end{code}
-@tidyOpenType@ grabs the free type varibles, tidies them
+@tidyOpenType@ grabs the free type variables, tidies them
and then uses @tidyType@ to work over the type itself
\begin{code}