random gremlin
Conor McBride
conor at strictlypositive.org
Wed Oct 6 17:30:54 EDT 2010
Hi Daniel
On 6 Oct 2010, at 21:33, Daniel Fischer wrote:
> On Wednesday 06 October 2010 22:02:57, Conor McBride wrote:
>> tell me
>> where to go.
>
> http://hackage.haskell.org/trac/ghc/newticket?type=bug
>
> Component: libraries(other)
OK, I signed up and did that.
> Decide whether you regard it as a documentation bug or a wrong
> result at
> runtime.
>
> (Documentation bug seems more reasonable)
Of the options available, yes.
>
>>
>> Exhibit A, from
>> http://haskell.org/ghc/docs/6.12.2/html/libraries/random-1.0.0.2/System-
>> Random.html
>>
>> "In addition, read may be used to map an arbitrary string
>> (not necessarily one produced by show) onto a value of type
>> StdGen. In general, the read instance of StdGen has the
> ^^^^
> Note that that should be uppercase, Read.
Never the less, the first sentence makes it clear that my expectations
were in conformance with the documentation, so...
>
>> following properties:
>>
>> * It guarantees to succeed on any string."
>
> It does in the sense that
>
> reads foo :: [(StdGen,[Char])] /= []
>
> for all foo. The way it's formulated invites wrong interpretations,
> though.
...I beg to differ. The way it's formulated is clear, but not what
happens.
It seems that there's an unexpected tension between the use of Read for
serialization (in which you want *reads* to be compositional) and the
utility of making a StdGen from some sort of identifier.
Perhaps the better fix is to separate the latter functionality.
All the best
Conor
More information about the Libraries
mailing list