haskell-src type inference algorithm?

Anyone know of a type inference utility that can run right on haskell-src types? or one that could be easily adapted? I want to be able to pass in an HsExp and get back an HsQualType. It doesn't have to be fancy, plain Haskell98 types would do. It wouldn't be to hard to make one myself, but I figured there might be one floating around already and it'd be a shame to write it twice :) Thanks, - Job

Hello Job For Haskell 98 would the code from 'Typing Haskell in Haskell' paper suffice? A web search should find the code... Best wishes Stephen

http://web.cecs.pdx.edu/~mpj/thih/
Looks like its a type _checker_ though...
On 11 February 2010 17:39, Stephen Tetley
Hello Job
For Haskell 98 would the code from 'Typing Haskell in Haskell' paper suffice?
A web search should find the code...
Best wishes
Stephen

It does type inference, it's just not engineered to be part of a real compiler.
On Thu, Feb 11, 2010 at 6:41 PM, Stephen Tetley
http://web.cecs.pdx.edu/~mpj/thih/
Looks like its a type _checker_ though...
On 11 February 2010 17:39, Stephen Tetley
wrote: Hello Job
For Haskell 98 would the code from 'Typing Haskell in Haskell' paper suffice?
A web search should find the code...
Best wishes
Stephen
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

To do anything interesting you also to process modules, something
which I hope to contribute soon to haskell-src-exts.
On Thu, Feb 11, 2010 at 6:35 PM, Job Vranish
Anyone know of a type inference utility that can run right on haskell-src types? or one that could be easily adapted? I want to be able to pass in an HsExp and get back an HsQualType. It doesn't have to be fancy, plain Haskell98 types would do.
It wouldn't be to hard to make one myself, but I figured there might be one floating around already and it'd be a shame to write it twice :)
Thanks,
- Job
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Thu, Feb 11, 2010 at 9:35 AM, Job Vranish
Anyone know of a type inference utility that can run right on haskell-src types? or one that could be easily adapted? I want to be able to pass in an HsExp and get back an HsQualType. It doesn't have to be fancy, plain Haskell98 types would do.
It wouldn't be to hard to make one myself, but I figured there might be one floating around already and it'd be a shame to write it twice :)
I've never checked to know if this is true, but could you use the GHC API to have GHC do your type inference/checking? http://www.haskell.org/ghc/docs/latest/html/libraries/ghc-6.12.1/index.html If you figure out if this is possible (or not), I'd love to hear what you figure out. Jason

Anyone know of a type inference utility that can run right on haskell-src types? or one that could be easily adapted?
This is very high on my wish-list for haskell-src-exts, and I'm hoping the stuff Lennart will contribute will go a long way towards making it feasible. I believe I can safely say that no such tool exists (and if it does, why haven't you told me?? ;-)), but if you implement (parts of) one yourself I'd be more than interested to see, and incorporate, the results. Cheers, /Niklas

On 12 February 2010 10:13, Niklas Broberg
Anyone know of a type inference utility that can run right on haskell-src types? or one that could be easily adapted?
This is very high on my wish-list for haskell-src-exts, and I'm hoping the stuff Lennart will contribute will go a long way towards making it feasible. I believe I can safely say that no such tool exists (and if it does, why haven't you told me?? ;-)), but if you implement (parts of) one yourself I'd be more than interested to see, and incorporate, the results.
A long time ago I worked on hatchet: http://www.cs.mu.oz.au/~bjpop/hatchet/src/hatchet.tar.gz which I believe was incorporated into JHC. Hatchet was based on thih and haskell-src. I gave up on it when I figured out a way to do what I wanted without type information. If I was going to do it again then I'd consider using Chameleon as a starting point, (I don't know where the most up-to-date sources are). Cheers, Bernie.

On Fri, Feb 12, 2010 at 03:47:56PM +1100, Bernie Pope wrote:
On 12 February 2010 10:13, Niklas Broberg
wrote: Anyone know of a type inference utility that can run right on haskell-src types? or one that could be easily adapted?
This is very high on my wish-list for haskell-src-exts, and I'm hoping the stuff Lennart will contribute will go a long way towards making it feasible. I believe I can safely say that no such tool exists (and if it does, why haven't you told me?? ;-)), but if you implement (parts of) one yourself I'd be more than interested to see, and incorporate, the results.
A long time ago I worked on hatchet:
http://www.cs.mu.oz.au/~bjpop/hatchet/src/hatchet.tar.gz
which I believe was incorporated into JHC.
Yes, hatchet formed the base of the original type checker for jhc. It has since been fully replaced, probably twice over, but jhc could not have gotten off the ground without it. John -- John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/

Well, something like such a tool exists, but I can't give it away.
On Fri, Feb 12, 2010 at 12:13 AM, Niklas Broberg
Anyone know of a type inference utility that can run right on haskell-src types? or one that could be easily adapted?
This is very high on my wish-list for haskell-src-exts, and I'm hoping the stuff Lennart will contribute will go a long way towards making it feasible. I believe I can safely say that no such tool exists (and if it does, why haven't you told me?? ;-)), but if you implement (parts of) one yourself I'd be more than interested to see, and incorporate, the results.
Cheers,
/Niklas _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (7)
-
Bernie Pope
-
Jason Dagit
-
Job Vranish
-
John Meacham
-
Lennart Augustsson
-
Niklas Broberg
-
Stephen Tetley