[Yhc] Haskell file to YHC.Core AST

José Miguel Vilaça jmvilaca at di.uminho.pt
Wed Jun 13 10:53:06 EDT 2007


Hi,

 

I want to do some Haskell manipulation and for that I intend to use the
YHC.Core.Type.

 

Lets say I have a function 
trans :: Core -> MyAST

 

 

I see that I can read a .hs file and output a .ycr by calling in a shell 
yhc File.hs –core

As said in http://yhc06.blogspot.com/2006/09/yhccore-api-available.html 

 

And supposidly I can write a tool whose main in Haskell is

 

main = system “yhc File.hs -core” >> loadcore “File.ycr” >>= writeFile
“File.txt” . show . trans 

 

First, the YHC documentation at
http://www.cs.york.ac.uk/fp/yhc/snapshot/docs/doc-index.html do not know
about a loadcore function. Is it available ? 

 

Second, is there a way of substituting the call to system by some Haskell
code?

 

Third. I’m having troubles with the binary version for windows given in
http://www.haskell.org/haskellwiki/Yhc/Snapshots .  For a Main.hs file
containing

 

import Yhc.Core

 

main = print 42

 

called like

D:\tmp>yhc Main

Error: File not found, Yhc.Core

Reason: imported from Main

Looked in:

  D:\tmp\

  .

  C:\Tools\yhc\lib\yhc\packages\haskell98\1.0

  C:\Tools\yhc\lib\yhc\packages\yhc-base\1.0

 

Where C:\tools\yhc is where I unpack the .zip file downloaded.

I would really appreciate some help on this.

 

Best

Miguel Vilaça

 

                

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/yhc/attachments/20070613/075cbaad/attachment-0001.htm


More information about the Yhc mailing list