Idris2 icon indicating copy to clipboard operation
Idris2 copied to clipboard

Double IEEE constants: infinity, NaN, epsilon ... where are they?

Open edwinb opened this issue 4 years ago • 6 comments

Issue by nicolabotta Tuesday Oct 29, 2019 at 07:48 GMT Originally opened as https://github.com/edwinb/Idris2-boot/issues/146


Is there a way of accessing these values in Idris 2? Something like Numeric.IEEEin Haskell? At lest epsilon, infinity and NaN are badly needed, e.g., to implement interval arithmetics! Thanks, Nicola

edwinb avatar May 20 '20 12:05 edwinb

Comment by edwinb Saturday Dec 07, 2019 at 15:13 GMT


I've labelled this with "Feature request" - we ought to have them really. If anyone wants pointers on where to start implementing it, please let me know.

edwinb avatar May 20 '20 12:05 edwinb

@edwinb I'd like to start contributing to Idris 2 and I find this issue interesting. Could you give me a hint on where to start?

mr-infty avatar Aug 22 '20 15:08 mr-infty

I think the right places to start would be:

libs/prelude/Prelude/Num.idr

where you'll need to add binding for the primitive constants, and also the places where the primitives are defined, e.g.

support/chez/support.ss

where you'll need to define primitive Scheme / Racket primitives to bind to.

ohad avatar Aug 22 '20 15:08 ohad

The primitives should be defined in support/chez/support.ss (and racket and gambit), if needed (they might not need anything but what's put out in codegen). The bootstrap files shouldn't have to be updated by hand.

melted avatar Aug 22 '20 16:08 melted

Ah, sorry for misleading. I've removed my incorrect text.

ohad avatar Aug 22 '20 17:08 ohad

@ohad @melted Thanks for your help!

mr-infty avatar Aug 23 '20 11:08 mr-infty