Skip to content

Commit 901578a

Browse files
committed
Remvoe use of prisms for error handling on typechecking/compilation pipeline (#7111)
1 parent 54a6737 commit 901578a

File tree

81 files changed

+556
-875
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+556
-875
lines changed

plutus-core/cost-model/budgeting-bench/Benchmarks/Nops.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import PlutusCore.Evaluation.Machine.BuiltinCostModel hiding (BuiltinCostModel)
2222
import PlutusCore.Evaluation.Machine.ExBudgetingDefaults
2323
import PlutusCore.Evaluation.Machine.ExMemoryUsage (ExMemoryUsage)
2424
import PlutusCore.Evaluation.Machine.MachineParameters
25-
import PlutusCore.Evaluation.Result (evaluationFailure)
2625
import PlutusCore.Pretty
2726
import PlutusPrelude
2827
import UntypedPlutusCore.Evaluation.Machine.Cek
@@ -137,7 +136,7 @@ infixr >:
137136
n >: k =
138137
case n of
139138
SomeConstant (Some (ValueOf DefaultUniInteger _)) -> k
140-
_ -> evaluationFailure
139+
_ -> builtinResultFailure
141140
{-# INLINE (>:) #-}
142141

143142
{- | The meanings of the builtins. Each one takes a number of arguments and

plutus-core/docs/BuiltinsOverview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ Here's an example instance (where `Term` is the type of TPLC terms):
402402
```haskell
403403
instance HasConstant (Term TyName Name uni fun ()) where
404404
asConstant (Constant _ val) = pure val
405-
asConstant _ = throwNotAConstant
405+
asConstant _ = throwError notAConstant
406406
```
407407

408408
Unlifting of constants then is just a matter of unwrapping a value as a constant and checking that the constant is of the right type, which is what the default implementation of `readKnown` does:
@@ -452,5 +452,5 @@ instance
452452
( TypeError ('Text "‘BuiltinResult’ cannot appear in the type of an argument")
453453
, uni ~ UniOf val
454454
) => ReadKnownIn uni val (BuiltinResult a) where
455-
readKnown _ = throwUnderTypeError
455+
readKnown _ = throwError underTypeError
456456
```

plutus-core/executables/plutus/AnyProgram/Compile.hs

Lines changed: 46 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ import UntypedPlutusCore qualified as UPLC
3232
import UntypedPlutusCore.Check.Uniques qualified as UPLC
3333

3434
import Control.Lens hiding ((%~))
35-
import Control.Monad.Error.Lens
36-
import Control.Monad.Except (MonadError)
35+
import Control.Monad.Except
3736
import Control.Monad.Reader
3837
import Data.Singletons.Decide
3938
import Data.Text
@@ -61,14 +60,14 @@ compileProgram = curry $ \case
6160
-- TODO: optimise
6261
>=> pirToOutName n1 n2
6362
>=> toOutAnn a1 a2
64-
(SPlc n1 a1, SPlc n2 a2) ->
65-
through (modifyError (fmap PIR.Original . PIR.PLCError) . plcTypecheck n1 a1)
66-
>=> plcToOutName n1 n2
63+
(SPlc n1 a1, SPlc n2 a2) -> -- TODO: modifyError ... is repeated multiple times
64+
through (modifyError (fmap PIR.Original) . plcTypecheck n1 a1)
65+
>=> modifyError (fmap PIR.Original . PIR.PLCError . PLC.FreeVariableErrorE) . plcToOutName n1 n2
6766
>=> toOutAnn a1 a2
6867
(SUplc n1 a1, SUplc n2 a2) ->
69-
through (modifyError (fmap PIR.Original) . uplcTypecheck n1 a1)
70-
>=> uplcOptimise n1
71-
>=> uplcToOutName n1 n2
68+
through (modifyError (fmap PIR.Original . PIR.PLCError) . uplcTypecheck n1 a1)
69+
>=> modifyError (fmap PIR.Original) . uplcOptimise n1
70+
>=> modifyError (fmap PIR.Original . PIR.PLCError . PLC.FreeVariableErrorE) . uplcToOutName n1 n2
7271
>=> toOutAnn a1 a2
7372
-- nothing to be done; seems silly, but can be used for later changing format of Data
7473
(SData, SData) -> pure
@@ -82,13 +81,13 @@ compileProgram = curry $ \case
8281
withA @Ord a1 $ withA @Pretty a1 $ withA @AnnInline a1 $
8382
-- Note: PIR.compileProgram subsumes pir typechecking
8483
(PLC.runQuoteT . flip runReaderT compCtx . PIR.compileProgram)
85-
>=> plcToOutName n1 n2
84+
>=> modifyError (fmap PIR.Original . PIR.PLCError . PLC.FreeVariableErrorE) . plcToOutName n1 n2
8685
-- completely drop annotations for now
8786
>=> pure . void
8887
where
8988
compCtx = PIR.toDefaultCompilationCtx $
9089
unsafeFromRight @(PIR.Error DefaultUni DefaultFun ()) $
91-
PLC.getDefTypeCheckConfig ()
90+
modifyError (PIR.PLCError . TypeErrorE) $ PLC.getDefTypeCheckConfig ()
9291

9392
-- note to self: this restriction is because of PIR.Provenance appearing in the output
9493
(SPir _n1@SName _, SPlc _ _) -> throwingPIR "only support unit-ann output for now"
@@ -139,7 +138,7 @@ compileProgram = curry $ \case
139138
embedProgram :: PLC.Program tyname name uni fun ann -> PIR.Program tyname name uni fun ann
140139
embedProgram (PLC.Program a v t) = PIR.Program a v $ embedTerm t
141140

142-
toOutAnn :: (Functor f, PIR.AsError e uni fun a, MonadError e m)
141+
toOutAnn :: (Functor f, MonadError (PIR.Error uni fun a) m)
143142
=> SAnn s1
144143
-> SAnn s2
145144
-> f (FromAnn s1)
@@ -152,76 +151,67 @@ toOutAnn _ _ = throwingPIR "cannot convert annotatio
152151
-- or by some singletons type-level programming
153152

154153
pirTypecheck
155-
:: ( PIR.AsTypeErrorExt e DefaultUni (FromAnn a)
156-
, PIR.AsTypeError e (PIR.Term UPLC.TyName UPLC.Name DefaultUni DefaultFun ())
157-
DefaultUni DefaultFun (FromAnn a), MonadError e m
158-
)
154+
:: (MonadError (PIR.Error DefaultUni DefaultFun (FromAnn a)) m)
159155
=> SAnn a
160156
-> PIR.Program PLC.TyName PLC.Name DefaultUni DefaultFun (FromAnn a)
161157
-> m ()
162158
pirTypecheck sngA p = PLC.runQuoteT $ do
163-
tcConfig <- withA @Monoid sngA $ PIR.getDefTypeCheckConfig mempty
159+
tcConfig <- withA @Monoid sngA $ modifyError (PIR.PLCError . PLC.TypeErrorE) $ PIR.getDefTypeCheckConfig mempty
164160
void $ PIR.inferTypeOfProgram tcConfig p
165161

166-
plcToUplcViaName :: (PLC.MonadQuote m, PLC.AsFreeVariableError e, MonadError e m)
162+
plcToUplcViaName :: (PLC.MonadQuote m, MonadError (PIR.Error uni fun ann) m)
167163
=> SNaming n
168164
-> (PLC.Program PLC.TyName PLC.Name uni fun a -> m (UPLC.Program PLC.Name uni fun a))
169165
-> PLC.Program (FromNameTy n) (FromName n) uni fun a
170166
-> m (UPLC.Program (FromName n) uni fun a)
171167
plcToUplcViaName sngN act = case sngN of
172168
SName -> act
173-
SNamedDeBruijn -> plcToName sngN act
174-
>=> UPLC.progTerm UPLC.deBruijnTerm
175-
SDeBruijn -> plcToName sngN act
176-
>=> UPLC.progTerm UPLC.deBruijnTerm
169+
SNamedDeBruijn ->
170+
plcToName sngN act >=>
171+
UPLC.progTerm (modifyError (PIR.PLCError . PLC.FreeVariableErrorE) . UPLC.deBruijnTerm)
172+
SDeBruijn ->
173+
plcToName sngN act
174+
>=> UPLC.progTerm (modifyError (PIR.PLCError . PLC.FreeVariableErrorE) . UPLC.deBruijnTerm)
177175
>=> pure . UPLC.programMapNames PLC.unNameDeBruijn
178176

179-
plcToName :: (PLC.MonadQuote m, PLC.AsFreeVariableError e, MonadError e m)
177+
plcToName :: (PLC.MonadQuote m, MonadError (PIR.Error uni fun ann) m)
180178
=> SNaming n
181179
-> (PLC.Program PLC.TyName PLC.Name uni fun a -> m x)
182180
-> (PLC.Program (FromNameTy n) (FromName n) uni fun a -> m x)
183181
plcToName sngN act = case sngN of
184182
SName -> act
185-
SNamedDeBruijn -> PLC.progTerm PLC.unDeBruijnTerm
183+
SNamedDeBruijn -> PLC.progTerm (modifyError (PIR.PLCError . PLC.FreeVariableErrorE) . PLC.unDeBruijnTerm)
186184
>=> act
187185
SDeBruijn -> pure . PLC.programMapNames PLC.fakeTyNameDeBruijn PLC.fakeNameDeBruijn
188186
>=> plcToName SNamedDeBruijn act
189187

190-
uplcViaName :: (PLC.MonadQuote m, PLC.AsFreeVariableError e, MonadError e m)
188+
uplcViaName :: (PLC.MonadQuote m, MonadError (PIR.Error uni fun ann) m)
191189
=> (UPLC.Program PLC.Name uni fun a -> m (UPLC.Program PLC.Name uni fun a))
192190
-> SNaming n
193191
-> UPLC.Program (FromName n) uni fun a
194192
-> m (UPLC.Program (FromName n) uni fun a)
195193
uplcViaName act sngN = case sngN of
196194
SName -> act
197-
SNamedDeBruijn -> UPLC.progTerm UPLC.unDeBruijnTerm
195+
SNamedDeBruijn -> UPLC.progTerm (modifyError (PIR.PLCError . PLC.FreeVariableErrorE) . UPLC.unDeBruijnTerm)
198196
>=> act
199-
>=> UPLC.progTerm UPLC.deBruijnTerm
197+
>=> UPLC.progTerm (modifyError (PIR.PLCError . PLC.FreeVariableErrorE) . UPLC.deBruijnTerm)
200198
SDeBruijn -> pure . UPLC.programMapNames UPLC.fakeNameDeBruijn
201199
>=> uplcViaName act SNamedDeBruijn
202200
>=> pure . UPLC.programMapNames UPLC.unNameDeBruijn
203201

204-
plcTypecheck :: (PLC.AsTypeError
205-
e
206-
-- errors remain with names
207-
(PLC.Term PLC.TyName PLC.Name DefaultUni DefaultFun ())
208-
DefaultUni
209-
DefaultFun
210-
(FromAnn a)
211-
, PLC.AsFreeVariableError e
212-
, MonadError e m
213-
)
202+
plcTypecheck :: (MonadError (PIR.Error DefaultUni DefaultFun (FromAnn a)) m)
214203
=> SNaming n
215204
-> SAnn a
216205
-> PLC.Program (FromNameTy n) (FromName n) DefaultUni DefaultFun (FromAnn a)
217206
-> m ()
218-
plcTypecheck sngN sngA p = PLC.runQuoteT $ do
219-
tcConfig <- withA @Monoid sngA $ PLC.getDefTypeCheckConfig mempty
220-
void $ plcToName sngN (PLC.inferTypeOfProgram tcConfig) p
207+
plcTypecheck sngN sngA p = PLC.runQuoteT $ do
208+
tcConfig <-
209+
withA @Monoid sngA $
210+
modifyError (PIR.PLCError . PLC.TypeErrorE) $ PLC.getDefTypeCheckConfig mempty
211+
void $ plcToName sngN (modifyError (PIR.PLCError . PLC.TypeErrorE) . PLC.inferTypeOfProgram tcConfig) p
221212

222213
uplcOptimise :: (?opts :: Opts
223-
, PLC.AsFreeVariableError e
224-
, MonadError e m
214+
, MonadError (PIR.Error DefaultUni DefaultFun a) m
225215
)
226216
=> SNaming n1
227217
-> UPLC.UnrestrictedProgram (FromName n1) DefaultUni DefaultFun a
@@ -238,31 +228,32 @@ uplcOptimise =
238228
. _Wrapped
239229
. uplcViaName (UPLC.simplifyProgram sOpts def)
240230

241-
242231
-- | We do not have a typechecker for uplc, but we could pretend that scopecheck is a "typechecker"
243-
uplcTypecheck :: forall sN sA uni fun e m
244-
. (PLC.AsFreeVariableError e, PLC.AsUniqueError e (FromAnn sA), MonadError e m)
232+
uplcTypecheck :: forall sN sA uni fun m
233+
. (MonadError (PLC.Error uni fun (FromAnn sA)) m)
245234
=> SNaming sN
246235
-> SAnn sA
247236
-> UPLC.UnrestrictedProgram (FromName sN) uni fun (FromAnn sA)
248237
-> m ()
249238
uplcTypecheck sngN sngA ast = case sngN of
250-
SName -> withA @Ord sngA $ UPLC.checkProgram (const True) (ast ^. _Wrapped)
239+
SName ->
240+
modifyError PLC.UniqueCoherencyErrorE $
241+
withA @Ord sngA $ UPLC.checkProgram (const True) (ast ^. _Wrapped)
251242
-- TODO: deduplicate
252-
SDeBruijn -> UPLC.checkScope (ast ^. _Wrapped. UPLC.progTerm)
253-
SNamedDeBruijn -> UPLC.checkScope (ast ^. _Wrapped. UPLC.progTerm)
243+
SDeBruijn -> modifyError PLC.FreeVariableErrorE $ UPLC.checkScope (ast ^. _Wrapped. UPLC.progTerm)
244+
SNamedDeBruijn -> modifyError PLC.FreeVariableErrorE $ UPLC.checkScope (ast ^. _Wrapped. UPLC.progTerm)
254245

255246

256247
-- | Placed here just for uniformity, not really needed
257-
pirToOutName :: (PIR.AsError e uni fun a, MonadError e m)
248+
pirToOutName :: (MonadError (PIR.Error uni fun a) m)
258249
=> SNaming s1
259250
-> SNaming s2
260251
-> PIR.Program (FromNameTy s1) (FromName s1) uni fun ann
261252
-> m (PIR.Program (FromNameTy s2) (FromName s2) uni fun ann)
262253
pirToOutName sng1 ((sng1 %~) -> Proved Refl) = pure
263254
pirToOutName _ _ = throwingPIR "we do not support name conversion for PIR atm"
264255

265-
plcToOutName :: (PLC.AsFreeVariableError e, MonadError e m)
256+
plcToOutName :: (MonadError FreeVariableError m)
266257
=> SNaming s1
267258
-> SNaming s2
268259
-> PLC.Program (FromNameTy s1) (FromName s1) uni fun ann
@@ -280,14 +271,14 @@ plcToOutName SDeBruijn SName = plcToOutName SDeBruijn SNamedDeBruijn
280271
>=> plcToOutName SNamedDeBruijn SName
281272
plcToOutName _ _ = error "this is complete, but i don't want to use -fno-warn-incomplete-patterns"
282273

283-
uplcToOutName :: (PLC.AsFreeVariableError e, MonadError e m)
274+
uplcToOutName :: (MonadError FreeVariableError m)
284275
=> SNaming s1
285276
-> SNaming s2
286277
-> UPLC.UnrestrictedProgram (FromName s1) uni fun ann
287278
-> m (UPLC.UnrestrictedProgram (FromName s2) uni fun ann)
288279
uplcToOutName = fmap _Wrapped . uplcToOutName'
289280

290-
uplcToOutName' :: (PLC.AsFreeVariableError e, MonadError e m)
281+
uplcToOutName' :: (MonadError FreeVariableError m)
291282
=> SNaming s1
292283
-> SNaming s2
293284
-> UPLC.Program (FromName s1) uni fun ann
@@ -304,18 +295,18 @@ uplcToOutName' SDeBruijn SName = uplcToOutName' SDeBruijn SNamedDeBruijn
304295
uplcToOutName' _ _ = error "this is complete, but i don't want to use -fno-warn-incomplete-patterns"
305296

306297
-- TODO: use better, more detailed erroring
307-
throwingPIR :: (PIR.AsError e uni fun a, MonadError e m)
298+
throwingPIR :: (MonadError (PIR.Error uni fun a) m)
308299
=> Text -> b -> m c
309-
throwingPIR = const . throwing PIR._Error . PIR.OptionsError
300+
throwingPIR = const . throwError . PIR.OptionsError
310301

311302
checkProgram :: (e ~ PIR.Provenance (FromAnn (US_ann s)),
312303
MonadError (PIR.Error DefaultUni DefaultFun e) m)
313304
=> SLang s
314305
-> FromLang s
315306
-> m ()
316307
checkProgram sng p = modifyError (fmap PIR.Original) $ case sng of
317-
SPlc n a -> modifyError PIR.PLCError $ plcTypecheck n a p
318-
SUplc n a -> uplcTypecheck n a p
308+
SPlc n a -> plcTypecheck n a p
309+
SUplc n a -> modifyError PIR.PLCError $ uplcTypecheck n a p
319310
SPir SName a -> pirTypecheck a p
320311
SData -> pure () -- data is type correct by construction
321312
SPir{} -> throwingPIR "PIR: Cannot typecheck non-names" ()

plutus-core/executables/plutus/AnyProgram/IO.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import AnyProgram.With
1212
import Common
1313
import GetOpt
1414
import PlutusCore.Default
15-
import PlutusCore.Error
1615
import PlutusCore.Pretty qualified as PP
1716
import PlutusPrelude hiding ((%~))
1817
import Types
@@ -43,7 +42,7 @@ readProgram sngS fileS =
4342
_ -> case fileS^.fType.fFormat of
4443
Text -> do
4544
bs <- readFileName (fromJust $ fileS^.fName)
46-
case parseProgram @ParserErrorBundle sngS $ T.decodeUtf8Lenient bs of
45+
case parseProgram sngS $ T.decodeUtf8Lenient bs of
4746
Left err -> failE $ show err
4847
Right res -> pure res
4948
Flat_ -> withLang @Flat sngS $ do

plutus-core/executables/plutus/AnyProgram/Parse.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ import PlutusCore.Data
2222
--
2323
-- This could alternatively be achieved by
2424
-- using a "Parsable" typeclass + withL @Parsable hasomorphism
25-
parseProgram :: (AsParserErrorBundle e
26-
, MonadError e m)
25+
parseProgram :: (MonadError ParserErrorBundle m)
2726
=> SLang n -> T.Text -> m (FromLang n)
2827
parseProgram s txt = PLC.runQuoteT $
2928
case s of

plutus-core/executables/plutus/Debugger/TUI/Main.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import Brick.Main qualified as B
4343
import Brick.Util qualified as B
4444
import Brick.Widgets.Edit qualified as BE
4545
import Control.Concurrent
46-
import Control.Monad.Except (runExcept)
46+
import Control.Monad.Except (runExcept, tryError)
4747
import Control.Monad.Primitive (unsafeIOToPrim)
4848
import Control.Monad.ST (RealWorld)
4949
import Data.Maybe

plutus-core/executables/src/PlutusCore/Executable/Common.hs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import PlutusCore qualified as PLC
4343
import PlutusCore.Builtin qualified as PLC
4444
import PlutusCore.Check.Uniques as PLC (checkProgram)
4545
import PlutusCore.Compiler.Erase qualified as PLC
46-
import PlutusCore.Error (AsUniqueError, ParserErrorBundle (..))
46+
import PlutusCore.Error (ParserErrorBundle (..))
4747
import PlutusCore.Evaluation.Machine.ExBudget (ExBudget (..), ExRestrictingBudget (..))
4848
import PlutusCore.Evaluation.Machine.ExBudgetingDefaults qualified as PLC
4949
import PlutusCore.Evaluation.Machine.ExMemory (ExCPU (..), ExMemory (..))
@@ -99,8 +99,7 @@ class ProgramLike p where
9999
-- Throws a @UniqueError@ when not all names are unique.
100100
checkUniques ::
101101
( Ord ann
102-
, AsUniqueError e ann
103-
, MonadError e m
102+
, MonadError (PLC.UniqueError ann) m
104103
) =>
105104
p ann ->
106105
m ()
@@ -401,8 +400,8 @@ toTypedTermExample term = TypedTermExample ty term
401400
where
402401
program = PLC.Program () PLC.latestVersion term
403402
errOrTy = PLC.runQuote . runExceptT $ do
404-
tcConfig <- PLC.getDefTypeCheckConfig ()
405-
PLC.inferTypeOfProgram tcConfig program
403+
tcConfig <- modifyError PLC.TypeErrorE $ PLC.getDefTypeCheckConfig ()
404+
modifyError PLC.TypeErrorE $ PLC.inferTypeOfProgram tcConfig program
406405
ty = case errOrTy of
407406
Left (err :: PLC.Error PLC.DefaultUni PLC.DefaultFun ()) ->
408407
error $ PP.displayPlc err

plutus-core/plutus-core/examples/PlutusCore/Examples/Builtins.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ import PlutusCore.Data
2424
import PlutusCore.Evaluation.Machine.BuiltinCostModel
2525
import PlutusCore.Evaluation.Machine.ExBudget
2626
import PlutusCore.Evaluation.Machine.ExBudgetStream
27-
import PlutusCore.Evaluation.Result (evaluationFailure)
2827
import PlutusCore.Pretty
2928

3029
import PlutusCore.StdLib.Data.ScottList qualified as Plc
3130

3231
import Control.Concurrent.MVar
3332
import Control.Exception
3433
import Control.Monad
34+
import Control.Monad.Except
3535
import Data.Default.Class
3636
import Data.Either
3737
import Data.Kind qualified as GHC (Type)
@@ -199,7 +199,7 @@ instance tyname ~ TyName => KnownTypeAst tyname DefaultUni Void where
199199
instance UniOf term ~ DefaultUni => MakeKnownIn DefaultUni term Void where
200200
makeKnown = absurd
201201
instance UniOf term ~ DefaultUni => ReadKnownIn DefaultUni term Void where
202-
readKnown _ = throwing _StructuralUnliftingError "Can't unlift to 'Void'"
202+
readKnown _ = throwError $ structuralUnliftingError "Can't unlift to 'Void'"
203203

204204
data BuiltinErrorCall = BuiltinErrorCall
205205
deriving stock (Show, Eq)
@@ -286,7 +286,7 @@ instance uni ~ DefaultUni => ToBuiltinMeaning uni ExtensionFun where
286286
idAssumeCheckBoolPlc val =
287287
case asConstant val of
288288
Right (Some (ValueOf DefaultUniBool b)) -> pure b
289-
_ -> evaluationFailure
289+
_ -> builtinResultFailure
290290

291291
toBuiltinMeaning _semvar IdSomeConstantBool =
292292
makeBuiltinMeaning
@@ -296,7 +296,7 @@ instance uni ~ DefaultUni => ToBuiltinMeaning uni ExtensionFun where
296296
idSomeConstantBoolPlc :: SomeConstant uni Bool -> BuiltinResult Bool
297297
idSomeConstantBoolPlc = \case
298298
SomeConstant (Some (ValueOf DefaultUniBool b)) -> pure b
299-
_ -> evaluationFailure
299+
_ -> builtinResultFailure
300300

301301
toBuiltinMeaning _semvar IdIntegerAsBool =
302302
makeBuiltinMeaning
@@ -306,7 +306,7 @@ instance uni ~ DefaultUni => ToBuiltinMeaning uni ExtensionFun where
306306
idIntegerAsBool :: SomeConstant uni Integer -> BuiltinResult (SomeConstant uni Integer)
307307
idIntegerAsBool = \case
308308
con@(SomeConstant (Some (ValueOf DefaultUniBool _))) -> pure con
309-
_ -> evaluationFailure
309+
_ -> builtinResultFailure
310310

311311
toBuiltinMeaning _semvar IdFInteger =
312312
makeBuiltinMeaning
@@ -397,7 +397,7 @@ instance uni ~ DefaultUni => ToBuiltinMeaning uni ExtensionFun where
397397

398398
toBuiltinMeaning _semvar ErrorPrime =
399399
makeBuiltinMeaning
400-
(evaluationFailure :: forall a. BuiltinResult a)
400+
(builtinResultFailure :: forall a. BuiltinResult a)
401401
whatever
402402

403403
toBuiltinMeaning _semvar Comma =

0 commit comments

Comments
 (0)