On Sun, Oct 04, 2009 at 01:55:11PM +0400, Eugene Kirpichov wrote:
> [x,y,t,b,l,r] <- mapM (getStdRandom . randomR) [(-10,10), (-70,70), ...]
> return (BoxBounds ...)

import Control.Applicative

let f = getStdRandom . randomR
    g1 = \x -> f (-x,x)
    g2 = f (5,10)
in BoxBounds <$> g1 10 <*> g1 70 <*> g2 <*> g2 <*> g2 <*> g2

--
Felipe.
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to