capabilities of GHC API
stefanor at cox.net
Sat May 19 13:49:19 EDT 2007
On Sat, May 19, 2007 at 06:09:45PM +0100, Frederik Eaton wrote:
> > If you have GHC-6.6 or greater, try: let n = 2 in GHC.Base.breakpoint
> > ()
> Interesting, apparently that statement also contains the word 'print': :)
> $ ghci fly:~
> ___ ___ _
> / _ \ /\ /\/ __(_)
> / /_\// /_/ / / | | GHC Interactive, version 6.6.20070420, for Haskell 98.
> / /_\\/ __ / /___| | http://www.haskell.org/ghc/
> \____/\/ /_/\____/|_| Type :? for help.
> Loading package base ... linking ... done.
> > let n = 2 in GHC.Base.breakpoint
> No instance for (Show (a -> a))
> arising from use of `print' at <interactive>:1:0-31
> Possible fix: add an instance declaration for (Show (a -> a))
> In the expression: print it
> In a 'do' expression: print it
You forgot the () at the end.
(And btw, ghci's autoprinting works by wrapping your code in print)
More information about the Glasgow-haskell-users