2

My code is here

marketConstraints :: Market -> TxConstraints (RedeemerType -> ScriptContext -> Bool) (DatumType, ())
marketConstraints market = mustValidateIn (to $ scriptAddress market)

I am not sure how to do to correct this errors.

src/MarketState.hs:58:87: error:
   • Expecting one more argument to ‘RedeemerType’
      Expected a type, but ‘RedeemerType’ has kind ‘* -> *’
    • In the first argument of ‘TxConstraints’, namely
        ‘(RedeemerType -> ScriptContext -> Bool)’
      In the type signature:
        marketConstraints :: Market
                             -> TxConstraints (RedeemerType
                                               -> ScriptContext -> Bool) (DatumType, ())
   |
58 | marketConstraints :: Market -> TxConstraints (RedeemerType -> ScriptContext -> Bool) (DatumType, ())
   |                                               ^^^^^^^^^^^^

src/MarketState.hs:58:87: error:
    • Expecting one more argument to ‘DatumType’
      Expected a type, but ‘DatumType’ has kind ‘* -> *’
    • In the second argument of ‘TxConstraints’, namely
        ‘(DatumType, ())’
      In the type signature:
        marketConstraints :: Market
                             -> TxConstraints (RedeemerType
                                               -> ScriptContext -> Bool) (DatumType, ())

1 Answer 1

0

This is entirely related to Haskell. The kind of (->) is * -> * -> * thus in your type signature, both left-hand & right-hand side of -> must have kind * but some of your parameters such as RedeemerType & DatumType are higher kinded. If you are new to all this "kind" jargon, I would suggest this blog post on it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.