user1679: I have already learned haskell from http://learnyouahaskell.com/chapters, but it doesn't cover the type instance syntax, like this:
data Auctioning
instance Scripts.ValidatorTypes Auctioning where
    type instance RedeemerType Auctioning = AuctionAction
    type instance DatumType Auctioning = AuctionDatum
 

I known the first line is declared the Auctioning date type, the second line is make Auctioning instance of ValidatorTypes, but what does type instance means? I can't find this syntax from haskell.

user1130: This code is implementing the ValidatorTypes "Typeclass" for the Auctioning datatype.
Typeclasses are Haskell's way of handling polymorphism, like abstract classes in an OO language. In this case, the ValidatorTypes typeclass has two associated types, RedeemerType and DatumType, that need to be defined for our validator. Here is the definition of that typeclass.
Check out the "Typeclasses 102" section in the Learn You A Haskell tutorial (scroll down) to learn more.

1679: <p>I have already learned haskell from <a href="http://learnyouahaskell.com/chapters" rel="noreferrer">http://learnyouahaskell.com/chapters</a>, but it doesn't cover the type instance syntax, like this:</p>
<pre><code>data Auctioning
instance Scripts.ValidatorTypes Auctioning where
    type instance RedeemerType Auctioning = AuctionAction
    type instance DatumType Auctioning = AuctionDatum
 
</code></pre>
<p>I known the first line is declared the Auctioning date type, the second line is make Auctioning instance of ValidatorTypes, but what does type instance means? I can't find this syntax from haskell.</p>
 1130: <p>This code is implementing the <code>ValidatorTypes</code> <a href="https://en.wikipedia.org/wiki/Type_class" rel="nofollow noreferrer">&quot;Typeclass&quot;</a> for the <code>Auctioning</code> datatype.</p>
<p>Typeclasses are Haskell's way of handling polymorphism, like abstract classes in an OO language. In this case, the <code>ValidatorTypes</code> typeclass has two associated types, <code>RedeemerType</code> and <code>DatumType</code>, that need to be defined for our validator. <a href="https://github.com/input-output-hk/plutus/blob/master/plutus-ledger/src/Ledger/Typed/Scripts/Validators.hs#L45" rel="nofollow noreferrer">Here</a> is the definition of that typeclass.</p>
<p>Check out the &quot;Typeclasses 102&quot; section in the <a href="http://learnyouahaskell.com/making-our-own-types-and-typeclasses" rel="nofollow noreferrer">Learn You A Haskell</a> tutorial (scroll down) to learn more.</p>
