Skip to content

No floating point ranges #12

@pya

Description

@pya

Haskell allows floating point ranges:

Prelude> [0.1, 0.2 .. 0.5]
[0.1,0.2,0.30000000000000004,0.4000000000000001,0.5000000000000001]

This does not work in Hask:

>>> L[0.1, 0.2, ..., 0.5]
TypeError Traceback (most recent call last)
....
TypeError: No instance for 0.1

Because floating point ranges are tricky:

Prelude> [0.1, 0.3 .. 1]
[0.1,0.3,0.5,0.7,0.8999999999999999,1.0999999999999999]

it might not be a good idea to implement them at all. In this case a more descriptive error message or even a own, new exception type might be helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions