Skip to content

Refined Types + Measures #655

@odavy37

Description

@odavy37

Dear Sir / Madam,

I'd like to create a newtype + Squant Type + Refined Type

For example : the cost (capex) of a power plant is a Money + Positive

opaque type PowerPlantCapex = Money Refined Positive
object PowerPlantCapex extends RefinedTypeOps[PowerPlantCapex, Money]

How ca I do : there is an error

No given instance of type eu.timepit.refined.api.RefinedType.AuxT[
org.odavy.powertycoon.domain.entities.PowerPlantCapex, squants.market.Money] was found for parameter rt of constructor RefinedTypeOps in class RefinedTypeOps.
I found:

eu.timepit.refined.api.RefinedType.instance[eu.timepit.refined.api.Refined,
squants.market.Money, eu.timepit.refined.numeric.Greater[(0 : Int)]](
eu.timepit.refined.api.RefType.refinedRefType,
eu.timepit.refined.numeric.Greater.greaterValidate[squants.market.Money,
(0 : Int)](eu.timepit.refined.internal.WitnessAs.singletonWitnessAs[B, A],
???)
)

But given instance singletonWitnessAs in object WitnessAs does not match type eu.timepit.refined.internal.WitnessAs[(0 : Int), squants.market.Money].


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