-
Notifications
You must be signed in to change notification settings - Fork 479
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #5908. Unsure where to put this, it could go in its own module I guess.
- Loading branch information
Showing
4 changed files
with
80 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
346 | ||
343 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,21 @@ | ||
{-# LANGUAGE RankNTypes #-} | ||
{-# LANGUAGE TypeApplications #-} | ||
{-# OPTIONS_GHC -Wno-unused-foralls #-} | ||
module PlutusTx.Utils where | ||
|
||
-- We do not use qualified import because the whole module contains off-chain code | ||
import PlutusTx.Builtins.Internal qualified as BI | ||
import Prelude as Haskell | ||
|
||
mustBeReplaced :: String -> a | ||
mustBeReplaced placeholder = | ||
error $ | ||
"The " <> show placeholder <> " placeholder must have been replaced by the \ | ||
\core-to-plc plugin during compilation." | ||
|
||
-- | Delay evalaution of the expression inside the 'Delay' constructor. | ||
newtype Delay a = Delay (forall b. a) | ||
|
||
-- | Force the evaluation of the expression delayed by the 'Delay'. | ||
force :: Delay a -> a | ||
force (Delay a) = a @BI.BuiltinUnit |