import CmdLineOpts ( opt_IrrefutableTuples )
import DataCon ( DataCon, dataConFieldLabels, dataConSourceArity )
import PrelNames ( eqStringName, eqName, geName, negateName, minusName,
- integralClassName, cCallableClassName )
+ integralClassName )
import BasicTypes ( isBoxed )
import Bag
import Outputable
%************************************************************************
\begin{code}
-tcPat tc_bndr (LitPat lit@(HsLitLit s _)) pat_ty
- -- cf tcExpr on LitLits
- = zapExpectedType pat_ty `thenM` \ pat_ty' ->
- tcLookupClass cCallableClassName `thenM` \ cCallableClass ->
- newDicts (LitLitOrigin (unpackFS s))
- [mkClassPred cCallableClass [pat_ty']] `thenM` \ dicts ->
- extendLIEs dicts `thenM_`
- returnM (LitPat (HsLitLit s pat_ty'), emptyBag, emptyBag, [])
-
tcPat tc_bndr pat@(LitPat lit@(HsString _)) pat_ty
= zapExpectedType pat_ty `thenM` \ pat_ty' ->
unifyTauTy pat_ty' stringTy `thenM_`
Nothing -> returnM pos_lit_expr -- Positive literal
Just neg -> -- Negative literal
-- The 'negate' is re-mappable syntax
- tcSyntaxName origin pat_ty' negateName neg `thenM` \ (neg_expr, _) ->
- returnM (HsApp neg_expr pos_lit_expr)
+ tcSyntaxName origin pat_ty' (negateName, HsVar neg) `thenM` \ (_, neg_expr) ->
+ returnM (HsApp neg_expr pos_lit_expr)
) `thenM` \ lit_expr ->
let
newMethodFromName origin pat_ty' geName `thenM` \ ge ->
-- The '-' part is re-mappable syntax
- tcSyntaxName origin pat_ty' minusName minus_name `thenM` \ (minus_expr, _) ->
+ tcSyntaxName origin pat_ty' (minusName, HsVar minus_name) `thenM` \ (_, minus_expr) ->
-- The Report says that n+k patterns must be in Integral
-- We may not want this when using re-mappable syntax, though (ToDo?)