On Sat, 14 Feb 2004 15:25:07 -0000 "Stenio" <stenio@uesb.br> 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
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
participants (3)
-
Derek Elkins -
Stenio -
Wolfgang Jeltsch