#4315: Generalize the 'RandomGen' and 'Random' classes
-------------------------------+--------------------------------------------
Reporter: TomMD | Owner:
Type: proposal | Status: closed
Priority: normal | Milestone: Not GHC
Component: libraries/random | Version: 6.12.3
Resolution: wontfix | Keywords:
Testcase: | Blockedby:
Difficulty: | Os: Unknown/Multiple
Blocking: | Architecture: Unknown/Multiple
Failure: None/Unknown |
-------------------------------+--------------------------------------------
Comment(by TomMD):
In summary to this proposal, I think the community agrees it is too
"cludgy". Perhaps people would have agreed on one of SPJs suggested
designs [1], so I might make another proposal when I again have time.
I'll mark the associated bug as closed, or whatever seems closest to
'reject'.
Cheers,
Thomas
[1]
{{{
class RandomGen g where
type GenVal g :: *
next :: g -> (GenVal g, g)
class Random a v where
randoms :: forall g. (RandomGen g, v ~ GenVal g) => g -> [a]
}}}
or
{{{
class RandomGen g where
nextInt :: g -> (Int, g)
nextByteString :: g -> (ByteString, g)
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4315#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs