Skip to content

Instance for Numeric.Natural #16

@dschrempf

Description

@dschrempf

Hi! I was wondering if we could provide an orphan instance for Numeric.Natural? At the moment, I am using something naive like:

fToMemoize :: Natural -> a
fToMemoize = ...

fToMemoizeI :: Integer -> a
fToMemoizeI = fToMemoize . fromIntegral

fMemoized :: Natural -> a
fMemoized = memoize fToMemoizeI . fromIntegral

I had a look at the definition of Natural, and it is either a simple WordXX, or a big natural. The big natural is, as far as I can see, similarly built as 'Integers, and could be converted to a list (like it is done for the Memoizableinstance ofInteger`). Could you please help out here? Thank you!

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