Skip to content

Wrap known prime numbers #214

Open
Open
@hacatu

Description

@hacatu

Currently, as far as I can tell there is no way to use externally sourced prime numbers. If I use primesieve or some other method to make a bunch of prime numbers, but then I want to call sqrtsModPrime or one of its related functions, I cannot do this unless I wrap the number in fromJust $ isPrime p or something like that.

Why?

Just exposing the type constructor would allow users to circumvent the guarantees arithmoi itself has, but this is necessary for neat integration with other libraries. Plus, wrapping primes could be exposed as a function with a name like unsafeWrapPrime so people totally wouldn't use it unless they needed it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions