X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FsimplCore%2FOccurAnal.lhs;h=fc9104fb22b318b9bd0c15db78df1bae8bd7bf56;hb=84923cc7de2a93c22a2f72daf9ac863959efae13;hp=8b3d45e8e0c1a1a6bbde245c9da4279a6af60dd3;hpb=1dca158769225e58ec90d95526f968515e325378;p=ghc-hetmet.git diff --git a/compiler/simplCore/OccurAnal.lhs b/compiler/simplCore/OccurAnal.lhs index 8b3d45e..fc9104f 100644 --- a/compiler/simplCore/OccurAnal.lhs +++ b/compiler/simplCore/OccurAnal.lhs @@ -328,8 +328,13 @@ reOrderCycle bndrs (bind : binds) -- But we won't because constructor args are marked "Many". -- Cheap and cheerful; the simplifer moves casts out of the way + -- The lambda case is important to spot x = /\a. C (f a) + -- which comes up when C is a dictionary constructor and + -- f is a default method. + -- Example: the instance for Show (ST s a) in GHC.ST is_con_app (Var v) = isDataConWorkId v is_con_app (App f _) = is_con_app f + is_con_app (Lam b e) | isTyVar b = is_con_app e is_con_app (Note _ e) = is_con_app e is_con_app other = False