[Haskell-cafe] Who generates Haskell code and uses type information at runtime? (fwd)

Duane Johnson duane.johnson at gmail.com
Wed Mar 18 18:15:04 EDT 2009


Out of curiosity, do you know if HaRe works for 6.10?  The page only  
mentions GHC 6.6 and 6.8.

Duane Johnson
http://blog.inquirylabs.com/


On Mar 18, 2009, at 6:14 AM, Chris Brown wrote:

> I'm not sure if you got my previous message, as I was having some  
> problems posting to the list...
>
>> Putting in a nutshell, I generalize an extensional defined function
>> definition into a recursive one. This is done in a number of steps by
>> modifying expressions and exploiting type information of
>> sub-expressions. For example:
>> rev [] = []
>> rev [a] = [a]
>> rev [a,b] = [b,a]
>> rev [a,b,c] = [c,b,a]
>> ~~>
>> rev x = y
>> ~~>
>> rev [] = []
>> rev (x:xs) = (y:ys)
>> ~~>
>> rev [] = []
>> rev (x:xs) = (last (x:xs)) : (reverse (x:xs))
>> The initial set of rules is given by the user (in a file, via  
>> IO, ...).
>> The problem later is to infer the type of an intermediate variable,  
>> e.g.
>> 'y'.
>
> I'm still not entirely sure what you want to do here. But it sounds  
> like HaRe could already do most of this for you via a sequence of  
> folds, unfolds, introduce pattern matching and generative folding.  
> HaRe already has built-in support for some symbolic evaluation,  
> which is already used in the generative
> fold refactoring, and has type checking support too.
>
> http://www.cs.kent.ac.uk/projects/refactor-fp/hare.html
>
> If it doesn't do exactly what you want out of the tin, it does have  
> a large API for designing transformations over Haskell code.
>
> http://www.cs.kent.ac.uk/projects/refactor-fp/hare/haddock/RefacUtils.html
>
>
>
> Chris.
>
>
>
>
>> Thanks,
>> Martin
>> _______________________________________________
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>
>
> --
> Chris Brown
>
> Visualization Software Engineer, Peiriannydd Meddalwedd Delweddu.
>
> Cast Ltd., Technium CAST,
> Ffordd Penlan, Parc Menai,
> Bangor, Gwynedd UK. LL57 4HJ.
>
> Tel: +44 (0)1248 675038
> Fax: +44 (0)1248 675012
> Mobile: +44 (0)7917 763712
>
>
> -- 
> Centre for Advanced Software Technology Limited is a limited company  
> registered in England and Wales.
> Registered Number: 04473521, Registered Office: Finance Office,  
> Bangor University, College Road, Bangor, Gwynedd. LL57 2DG.
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090318/6af121ba/attachment.htm


More information about the Haskell-Cafe mailing list