-\begin{code}
-data MonoBinds id
- = EmptyMonoBinds
-
- | AndMonoBinds (MonoBinds id)
- (MonoBinds id)
-
- | FunMonoBind id -- Used for both functions f x = e
- -- and variables f = \x -> e
- -- Reason: the Match stuff lets us have an optional
- -- result type sig f :: a->a = ...mentions a...
- --
- -- This also means that instance decls can only have
- -- FunMonoBinds, so if you change this, you'll need to
- -- change e.g. rnMethodBinds
- Bool -- True => infix declaration
- [Match id]
- SrcLoc
-
- | PatMonoBind (Pat id) -- The pattern is never a simple variable;
- -- That case is done by FunMonoBind
- (GRHSs id)
- SrcLoc
-
- | VarMonoBind id -- TRANSLATION
- (HsExpr id)
+type LIPBind id = Located (IPBind id)
+
+-- | Implicit parameter bindings.
+data IPBind id
+ = IPBind
+ (IPName id)
+ (LHsExpr id)
+
+instance (OutputableBndr id) => Outputable (IPBind id) where
+ ppr (IPBind id rhs) = pprBndr LetBind id <+> equals <+> pprExpr (unLoc rhs)
+
+-- -----------------------------------------------------------------------------
+
+type LHsBinds id = Bag (LHsBind id)
+type LHsBind id = Located (HsBind id)
+
+pprLHsBinds :: OutputableBndr id => LHsBinds id -> SDoc
+pprLHsBinds binds = lbrace <+> vcat (map ppr (bagToList binds)) <+> rbrace
+
+data HsBind id
+ = FunBind (Located id)
+ -- Used for both functions f x = e
+ -- and variables f = \x -> e
+ -- Reason: the Match stuff lets us have an optional
+ -- result type sig f :: a->a = ...mentions a...
+ --
+ -- This also means that instance decls can only have
+ -- FunBinds, so if you change this, you'll need to
+ -- change e.g. rnMethodBinds
+ Bool -- True => infix declaration
+ [LMatch id]
+
+ | PatBind (LPat id) -- The pattern is never a simple variable;
+ -- That case is done by FunBind
+ (GRHSs id)
+
+ | VarBind id (Located (HsExpr id)) -- Dictionary binding and suchlike;
+ -- located only for consistency