wrengr / logfloat

Log-domain floating point numbers
BSD 3-Clause "New" or "Revised" License
8 stars 1 forks source link

Read instance for LogFloat #5

Closed zaxtax closed 7 years ago

zaxtax commented 7 years ago

It would be nice if there was a Read instance for LogFloat. As a first pass I have the following:

instance Read LogFloat where
    readsPrec p s = [(logFloat x, r) | (x, r) <- readsPrec p s]
wrengr commented 7 years ago

I just pushed 5f5150362ddaacf96910a4ccdcb8699a9ed137ea which does this more safely (i.e., without logFloat throwing an error). Test it out and make sure it works for you, then I'll publish it to Hackage

zaxtax commented 7 years ago

Works for me!

wrengr commented 7 years ago

FWIW, I'm going to try to get the Vector instances put in before I publish it. Feel free to harass me if it's not done by next weekend.

zaxtax commented 7 years ago

Interesting. What made you decide to include them?

zaxtax commented 7 years ago

Is the Vector instance stuff happening?