On Sun, 2008-11-02 at 19:34 +0000, Simon Richard Clarkstone wrote:
> Anatoly Yakovenko wrote:
> >>> is there a way to pretty print a module?
> >>> like:
> >>>
> >>> module Main where
> >>> import Language.Haskell.TH
> >>> main = do
> >>>  print $ pprint Main
> >>>
> >> haskell-src should be able to do that.
> > 
> > I think haskell-src requires you to read the module at run time.  I
> > want to embed the contents of the module in my program.  Basically a
> > program that can print itself.
> 
> This is rather like the idea of a quine; a program the prints itself out 
> without referring directly to its own source code.  The usual Haskell 
> quine is:
> 
> putStrLn$(\s->s++show s)"putStrLn$(\\s->s++show s)"
> 
> If merely returning the source code is enough then you can do:
> 
> (\s->s++show s)"(\\s->s++show s)"
> 
> It could be more elegant if \ weren't both lambda and string escape.

So get rid of the lambda, ap(++)show"ap(++)show"

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to