Lazy minimum

Chung-chieh Shan ccshan at post.harvard.edu
Fri Nov 21 09:06:17 EST 2008


Dave Bayer <bayer at cpw.math.columbia.edu> wrote in article <CE720B3D-32CD-4A75-9D3D-0821AACD9490 at math.columbia.edu> in gmane.comp.lang.haskell.glasgow.user:
> So to summarize the responses, there's no GHC language support for  
> introspecting lazy structures, allowing one to write a generic bounded  
> compare that only evaluates lazy structures to a specified depth. One  
> can however write a class, and solve this problem type-by-type with a  
> common interface.

You might like how Lazy SmallCheck does it (then again, maybe not)
http://www.cs.york.ac.uk/fp/smallcheck/smallcheck.pdf (Section 4.6)

It might also help to use discriminators instead of Ord for comparison:
http://portal.acm.org/citation.cfm?id=1411220

-- 
Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig
2008-11-20 Universal Children's Day              http://unicef.org/
1948-12-10 Universal Declaration of Human Rights http://everyhumanhasrights.org



More information about the Glasgow-haskell-users mailing list