[Haskell-cafe] Generating random tuples

Nick Bowler nbowler at elliptictech.com
Mon Nov 1 15:25:36 EDT 2010


On 2010-11-01 20:09 +0100, Daniel Fischer wrote:
> On Monday 01 November 2010 19:55:22, Nick Bowler wrote:
> > That being said, there is an Ord instance for tuples (a
> > lexicographic ordering) and for this case I think it would make the
> > most sense to use that: select an element from the set
> > { x : lo <= x <= hi }
> 
> Really bad for
> 
> lo, hi :: (Int,Integer)
> lo = (0,0)
> hi = (3,4)

Good point, that's not so hot.

> the product (partial) order seems much better to me.

Indeed it does.

-- 
Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/)


More information about the Haskell-Cafe mailing list