[Haskell] hs2lhs

2004-02-14 Thread Stenio
I need to convert some scripts (hs) to lhs (literate script) and lhs
(literate script) to hs using GHC. Can someone help me. ThanksStenio

___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] hs2lhs

2004-02-14 Thread Derek Elkins
On Sat, 14 Feb 2004 15:25:07 -
Stenio [EMAIL PROTECTED] wrote:

 I need to convert some scripts (hs) to lhs (literate script) and lhs
 (literate script) to hs using GHC. Can someone help me.

GHC comes with an unlit program that will convert lhs to hs files,
there's probably also some flag you can give to GHC to have it spit out
the .hs file after processing it.  As for hs to lhs, there doesn't seem
much point nor is tool support necessary.  You can either add
\begin{code} \end{code} to the beginning and ending of the file
respectively to get a LaTeX style lhs file or one way or another (e.g.
:%s/^/ / in vim) get Bird style lhs files.  You can make such a
program in one line of Haskell,
main = getContents = mapM_ (putStrLn . ( ++)) . lines

___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] hs2lhs

2004-02-14 Thread Wolfgang Jeltsch
Am Samstag, 14. Februar 2004 19:54 schrieb Derek Elkins:
 [...]

 GHC comes with an unlit program that will convert lhs to hs files, there's
 probably also some flag you can give to GHC to have it spit out the .hs file
 after processing it.

ghc -E Module.lhs, maybe.

 [...]

Wolfgang

___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell