Skip to content
This repository was archived by the owner on Aug 11, 2022. It is now read-only.
This repository was archived by the owner on Aug 11, 2022. It is now read-only.

Need an Integer -> Maybe Positive function #219

@blamario

Description

@blamario

https://github.com/Liqwid-Labs/plutus-extra/blob/master/plutus-numeric/src/PlutusTx/Positive.hs doesn't export any way to construct a Positive value except from a literal, using the quasiquoter. I'm currently using a ridiculous workaround of

toPositive :: Integer -> Positive
toPositive = unsafeFromBuiltinData . toBuiltinData

(in this case I ensure the argument is positive beforehand).

Alternatively, I could use

nonZero :: Natural -> Maybe Positive

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions