Commit e8fe3a12 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Comments and layout

parent 940d1309
...@@ -1493,16 +1493,14 @@ rhsIsStatic :: (Name -> Bool) -> CoreExpr -> Bool ...@@ -1493,16 +1493,14 @@ rhsIsStatic :: (Name -> Bool) -> CoreExpr -> Bool
rhsIsStatic _is_dynamic_name rhs = is_static False rhs rhsIsStatic _is_dynamic_name rhs = is_static False rhs
where where
is_static :: Bool -- True <=> in a constructor argument; must be atomic is_static :: Bool -- True <=> in a constructor argument; must be atomic
-> CoreExpr -> Bool -> CoreExpr -> Bool
is_static False (Lam b e) = isRuntimeVar b || is_static False e is_static False (Lam b e) = isRuntimeVar b || is_static False e
is_static in_arg (Note n e) = notSccNote n && is_static in_arg e is_static in_arg (Note n e) = notSccNote n && is_static in_arg e
is_static in_arg (Cast e _) = is_static in_arg e is_static in_arg (Cast e _) = is_static in_arg e
is_static _ (Coercion {}) = True -- Behaves just like a literal
is_static _ (Lit lit) is_static _ (Lit (MachLabel {})) = False
= case lit of is_static _ (Lit _) = True
MachLabel _ _ _ -> False
_ -> True
-- A MachLabel (foreign import "&foo") in an argument -- A MachLabel (foreign import "&foo") in an argument
-- prevents a constructor application from being static. The -- prevents a constructor application from being static. The
-- reason is that it might give rise to unresolvable symbols -- reason is that it might give rise to unresolvable symbols
......
...@@ -148,8 +148,8 @@ data HsBindLR idL idR ...@@ -148,8 +148,8 @@ data HsBindLR idL idR
abs_ev_vars :: [EvVar], -- Includes equality constraints abs_ev_vars :: [EvVar], -- Includes equality constraints
-- AbsBinds only gets used when idL = idR after renaming, -- AbsBinds only gets used when idL = idR after renaming,
-- but these need to be idL's for the collect... code in HsUtil to have -- but these need to be idL's for the collect... code in HsUtil
-- the right type -- to have the right type
abs_exports :: [([TyVar], idL, idL, TcSpecPrags)], -- (tvs, poly_id, mono_id, prags) abs_exports :: [([TyVar], idL, idL, TcSpecPrags)], -- (tvs, poly_id, mono_id, prags)
abs_ev_binds :: TcEvBinds, -- Evidence bindings abs_ev_binds :: TcEvBinds, -- Evidence bindings
...@@ -378,7 +378,7 @@ data HsWrapper ...@@ -378,7 +378,7 @@ data HsWrapper
= WpHole -- The identity coercion = WpHole -- The identity coercion
| WpCompose HsWrapper HsWrapper | WpCompose HsWrapper HsWrapper
-- (wrap1 `WpCompse` wrap2)[e] = wrap1[ wrap2[ e ]] -- (wrap1 `WpCompose` wrap2)[e] = wrap1[ wrap2[ e ]]
-- --
-- Hence (\a. []) `WpCompose` (\b. []) = (\a b. []) -- Hence (\a. []) `WpCompose` (\b. []) = (\a b. [])
-- But ([] a) `WpCompose` ([] b) = ([] b a) -- But ([] a) `WpCompose` ([] b) = ([] b a)
......
...@@ -672,7 +672,6 @@ type HsRecordBinds id = HsRecFields id (LHsExpr id) ...@@ -672,7 +672,6 @@ type HsRecordBinds id = HsRecFields id (LHsExpr id)
\end{code} \end{code}
%************************************************************************ %************************************************************************
%* * %* *
\subsection{@Match@, @GRHSs@, and @GRHS@ datatypes} \subsection{@Match@, @GRHSs@, and @GRHS@ datatypes}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment