printTypeAndContents :: Session -> [Id] -> GHCi ()
printTypeAndContents session ids = do
- terms <- mapM (io . GHC.obtainTermB session 10 False) ids
- docs_terms <- mapM (io . showTerm session) terms
- dflags <- getDynFlags
- let pefas = dopt Opt_PrintExplicitForalls dflags
- printForUser $ vcat $ zipWith (\ty cts -> ty <+> equals <+> cts)
- (map (pprTyThing pefas . AnId) ids)
- docs_terms
+ dflags <- getDynFlags
+ let pefas = dopt Opt_PrintExplicitForalls dflags
+ pcontents = dopt Opt_PrintBindContents dflags
+ if pcontents
+ then do
+ let depthBound = 100
+ terms <- mapM (io . GHC.obtainTermB session depthBound False) ids
+ docs_terms <- mapM (io . showTerm session) terms
+ printForUser $ vcat $ zipWith (\ty cts -> ty <+> equals <+> cts)
+ (map (pprTyThing pefas . AnId) ids)
+ docs_terms
+ else printForUser $ vcat $ map (pprTyThing pefas . AnId) ids
specialCommand :: String -> GHCi Bool
| Opt_BreakOnException
| Opt_BreakOnError
| Opt_PrintEvldWithShow
+ | Opt_PrintBindContents
| Opt_GenManifest
| Opt_EmbedManifest
| Opt_RunCPSZ
Opt_DoAsmMangling,
Opt_GenManifest,
- Opt_EmbedManifest
+ Opt_EmbedManifest,
+ Opt_PrintBindContents
]
++ [f | (ns,f) <- optLevelFlags, 0 `elem` ns]
-- The default -O0 options
( "break-on-exception", Opt_BreakOnException ),
( "break-on-error", Opt_BreakOnError ),
( "print-evld-with-show", Opt_PrintEvldWithShow ),
+ ( "print-bind-contents", Opt_PrintBindContents ),
( "run-cps", Opt_RunCPSZ ),
( "convert-to-zipper-and-back", Opt_ConvertToZipCfgAndBack),
( "vectorise", Opt_Vectorise ),
<entry>dynamic</entry>
<entry><option>-fno-print-bind-result</option></entry>
</row>
+ <row>
+ <entry><option>-fno-print-bind-contents</option></entry>
+ <entry><link linkend="breakpoints">Turn off printing of binding contents in GHCi</link></entry>
+ <entry>dynamic</entry>
+ <entry>-</entry>
+ </row>
+
</tbody>
</tgroup>
</informaltable>