<p>That error occurs because your code has a number literal (ie <code>10</code>) in a code position where a value of type <code>SlotCOnfig</code> is expected and the the compiler can't figure out how to convert the literal to a <code>SlotConfig</code> (ie &quot;No instance for (Num SlotConfig)&quot;).</p>
<p>I would need to see more of the code (possibly all of it) to figure out a solution.</p>
<p>Ah, so the type of <code>slotToEndPOSIXTime</code> is:</p>
<pre><code>slotToEndPOSIXTime :: SlotConfig -&gt; Slot -&gt; POSIXTime
</code></pre>
<p>Getting a correct <code>SlotConfig</code> value is going to be tricky, but the good news is that <code>Slot</code> does have a <code>Num</code> instance, so the literal <code>10</code> is a valid slot.</p>

CC BY-SA 4.0
2022-12-15T00:19:11.703Z
I'm not sure what other context to provide. The complete one-line command was simply that: `slotToEndPOSIXTime 10`
tyvan266
CC BY-SA 4.0
2022-12-15T00:57:51.953Z
Five lines, the like to error occurs on and two lines before and after. Also what is the type of the function `slotToEndPOSIXTime` ?
Erik de Castro Lopo
CC BY-SA 4.0
2022-12-15T04:17:39.663Z
I expanded the answer I gave above. Basically the problem is that you can calling the `slotToEndPOSIXTime` with one parameter (`10`) when it really needs two parameters; a `SlotConfig` type and then the `10` that you are currently giving it.
Erik de Castro Lopo
CC BY-SA 4.0
2022-12-14T01:13:48.467Z
2022-12-15T01:03:32.863Z
2022-12-15T01:03:32.863Z
Erik de Castro Lopo
<p>in my cabal repl, i'm getting the following error from trying to replicate the week1 demo of Plutus-pioneer-program. I'm also unable to simulate the example scenario in the playground (i can see genesis transaction, but none of the subsequent bids), but I'm hoping the issue lies here:</p>
<pre><code>Prelude Ledger.TimeSlot Week01.EnglishAuction&gt; slotToEndPOSIXTime 10

&lt;interactive&gt;:10:20: error:
    • No instance for (Num SlotConfig) arising from the literal ‘10’
    • In the first argument of ‘slotToEndPOSIXTime’, namely ‘10’
      In the expression: slotToEndPOSIXTime 10
      In an equation for ‘it’: it = slotToEndPOSIXTime 10
Prelude Ledger.TimeSlot Week01.EnglishAuction&gt; 
</code></pre>

<plutus-pioneer-program>
SlotToPOSIXTime in English Auction Demo
# SlotToPOSIXTime in English Auction Demo

(Asked by: username_0 on 2022-12-13)

in my cabal repl, i'm getting the following error from trying to replicate the week1 demo of Plutus-pioneer-program. I'm also unable to simulate the example scenario in the playground (i can see genesis transaction, but none of the subsequent bids), but I'm hoping the issue lies here:
Prelude Ledger.TimeSlot Week01.EnglishAuction> slotToEndPOSIXTime 10

:10:20: error:
    • No instance for (Num SlotConfig) arising from the literal ‘10’
    • In the first argument of ‘slotToEndPOSIXTime’, namely ‘10’
      In the expression: slotToEndPOSIXTime 10
      In an equation for ‘it’: it = slotToEndPOSIXTime 10
Prelude Ledger.TimeSlot Week01.EnglishAuction>

**Tags:** plutus-pioneer-program

---

## 1 answers

### Answer by username_1 on 2022-12-14. Score: 0

That error occurs because your code has a number literal (ie 10) in a code position where a value of type SlotCOnfig is expected and the the compiler can't figure out how to convert the literal to a SlotConfig (ie "No instance for (Num SlotConfig)").
I would need to see more of the code (possibly all of it) to figure out a solution.
Ah, so the type of slotToEndPOSIXTime is:
slotToEndPOSIXTime :: SlotConfig -> Slot -> POSIXTime

Getting a correct SlotConfig value is going to be tricky, but the good news is that Slot does have a Num instance, so the literal 10 is a valid slot.

> **Comments:**
> **username_0**: I'm not sure what other context to provide. The complete one-line command was simply that: `slotToEndPOSIXTime 10`  
> **username_1**: Five lines, the like to error occurs on and two lines before and after. Also what is the type of the function `slotToEndPOSIXTime` ?  
> **username_1**: I expanded the answer I gave above. Basically the problem is that you can calling the `slotToEndPOSIXTime` with one parameter (`10`) when it really needs two parameters; a `SlotConfig` type and then the `10` that you are currently giving it.  

---

