Commit f745b6e8 authored by thomie's avatar thomie
Browse files

Typechecker: refactoring only

* don't call `nlHsPar`, as `genOpApp` already does so.
* don't reimplement `isUnboxedTupleTyCon` and `isBoxedTupleTyCon`.

Reviewed By: austin

Differential Revision: https://phabricator.haskell.org/D798
parent 93f3a64e
......@@ -1137,8 +1137,8 @@ gen_Show_binds get_fixity loc tycon
([a_Pat, con_pat], nlHsPar (nested_compose_Expr show_thingies))
| otherwise =
([a_Pat, con_pat],
showParen_Expr (nlHsPar (genOpApp a_Expr ge_RDR
(nlHsLit (HsInt "" con_prec_plus_one))))
showParen_Expr (genOpApp a_Expr ge_RDR
(nlHsLit (HsInt "" con_prec_plus_one)))
(nlHsPar (nested_compose_Expr show_thingies)))
where
data_con_RDR = getRdrName data_con
......
......@@ -1189,9 +1189,7 @@ isPrimTyCon _ = False
-- only be true for primitive and unboxed-tuple 'TyCon's
isUnLiftedTyCon :: TyCon -> Bool
isUnLiftedTyCon (PrimTyCon {isUnLifted = is_unlifted}) = is_unlifted
isUnLiftedTyCon (TupleTyCon {tyConTupleSort = sort})
= not (isBoxed (tupleSortBoxity sort))
isUnLiftedTyCon _ = False
isUnLiftedTyCon tc = isUnboxedTupleTyCon tc
-- | Returns @True@ if the supplied 'TyCon' resulted from either a
-- @data@ or @newtype@ declaration
......@@ -1217,8 +1215,7 @@ isDataTyCon (AlgTyCon {algTcRhs = rhs})
NewTyCon {} -> False
DataFamilyTyCon {} -> False
AbstractTyCon {} -> False -- We don't know, so return False
isDataTyCon (TupleTyCon {tyConTupleSort = sort}) = isBoxed (tupleSortBoxity sort)
isDataTyCon _ = False
isDataTyCon tc = isBoxedTupleTyCon tc
-- | 'isDistinctTyCon' is true of 'TyCon's that are equal only to
-- themselves, even via coercions (except for unsafeCoerce).
......
......@@ -4,7 +4,7 @@ T9576: T9576.hs:6:31:
In the second argument of ‘showParen’, namely
‘((.) (showString "MkBar ") (showsPrec 11 b1))’
In the expression:
showParen ((a >= 11)) ((.) (showString "MkBar ") (showsPrec 11 b1))
showParen (a >= 11) ((.) (showString "MkBar ") (showsPrec 11 b1))
When typechecking the code for ‘showsPrec’
in a derived instance for ‘Show Bar’:
To see the code I am typechecking, use -ddump-deriv
......
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