<p>This is part of Template Haskell. It is the way to have Haskell compiled at runtime basically.</p>
<p>This link may help <a href="https://downloads.haskell.org/%7Eghc/7.8.4/docs/html/users_guide/template-haskell.html" rel="nofollow noreferrer">https://downloads.haskell.org/~ghc/7.8.4/docs/html/users_guide/template-haskell.html</a></p>
<p>$$ is considered a typed expression splice.  It also talks about [|| ... ||] which is a typed expression quotation.</p>

CC BY-SA 4.0
2021-06-08T21:05:51.920Z
2021-06-08T21:05:51.920Z
Chad Carter
<p>The purpose of the code is to produce compiled Plutus-Core code which can be used as a validator.  It is (more-or-less) boilerplate, so nearly the same for every program.</p>
<p>@ means we are giving types, not values</p>
<p>$$ is completely different to $ and it is used here to &quot;splice&quot; code into the program i.e. it inserts the compiled code 'syntax' into the program at this point.</p>
<p>See docs here : <a href="https://plutus.readthedocs.io/en/latest/plutus/tutorials/plutus-tx.html" rel="nofollow noreferrer">https://plutus.readthedocs.io/en/latest/plutus/tutorials/plutus-tx.html</a></p>

CC BY-SA 4.0
2021-08-27T00:41:52.147Z
2021-08-27T00:57:50.140Z
2021-08-27T00:57:50.140Z
ZachSweet
<p>I'm a little confused about the following code（from EnglishAuction.hs）:</p>
<pre><code>auctionInstance :: Scripts.ScriptInstance Auctioning
auctionInstance = Scripts.validator @Auctioning
    $$(PlutusTx.compile [|| mkAuctionValidator ||])
    $$(PlutusTx.compile [|| wrap ||])                                                                                                                         
  where
    wrap = Scripts.wrapValidator @AuctionDatum @AuctionAction
</code></pre>
<p>What does &quot;@&quot; means? and what does Scripts.validator do? Why did it use two $$ instead of one?</p>

CC BY-SA 4.0
2021-06-08T10:06:40.847Z
If you want to learn more about Haskell (which Plutus is based on) you can have a look here: http://learnyouahaskell.com/
eddex
CC BY-SA 4.0
2021-06-08T10:11:26.280Z
I have already learned Haskell from learnyouahaskell.com. But it doesn't include template haskell.
mackie
<plutus><smart-contract><plutus-pioneer-program><plutustx>
plutus pioneer week01 src code explain
# plutus pioneer week01 src code explain

(Asked by: username_0 on 2021-06-08)

I'm a little confused about the following code（from EnglishAuction.hs）:
auctionInstance :: Scripts.ScriptInstance Auctioning
auctionInstance = Scripts.validator @Auctioning
    $$(PlutusTx.compile [|| mkAuctionValidator ||])
    $$(PlutusTx.compile [|| wrap ||])                                                                                                                         
  where
    wrap = Scripts.wrapValidator @AuctionDatum @AuctionAction

What does "@" means? and what does Scripts.validator do? Why did it use two $$ instead of one?

**Tags:** plutus, smart-contract, plutus-pioneer-program, plutustx
> **Comments:**
> **username_1**: If you want to learn more about Haskell (which Plutus is based on) you can have a look here: http://learnyouahaskell.com/  
> **username_0**: I have already learned Haskell from learnyouahaskell.com. But it doesn't include template haskell.  

---

## 2 answers

### Answer by username_2 on 2021-06-08. Score: 1

This is part of Template Haskell. It is the way to have Haskell compiled at runtime basically.

This link may help [https://downloads.haskell.org/~ghc/7.8.4/docs/html/users\_guide/template-haskell.html](https://downloads.haskell.org/%7Eghc/7.8.4/docs/html/users_guide/template-haskell.html)

$$ is considered a typed expression splice. It also talks about [|| ... ||] which is a typed expression quotation.


---

### Answer by username_3 on 2021-08-27. Score: 0

The purpose of the code is to produce compiled Plutus-Core code which can be used as a validator. It is (more-or-less) boilerplate, so nearly the same for every program.

@ means we are giving types, not values

$$ is completely different to $ and it is used here to "splice" code into the program i.e. it inserts the compiled code 'syntax' into the program at this point.

See docs here : <https://plutus.readthedocs.io/en/latest/plutus/tutorials/plutus-tx.html>


---

