Closed olligobber closed 3 years ago
When an invalid literal is used to create an IO x in ghci, no error occurs.
IO x
Prelude> :set -XTemplateHaskell Prelude> :m Functional.Iota.Free ValidLiterals Prelude Functional.Iota.Free ValidLiterals> ($$(valid '(') :: IFree) <interactive>:3:5: error: • Invalid input used for type-safe validated literal! An error occured during compile-time validation! • In the Template Haskell splice $$(valid '(') In the expression: ($$(valid '(') :: IFree) In an equation for ‘it’: it = ($$(valid '(') :: IFree) <interactive>:3:5: error: • Exception when trying to run compile-time code: ValidationFailure "An error occured during compile-time validation!" Code: valid '(' • In the Template Haskell splice $$(valid '(') In the expression: ($$(valid '(') :: IFree) In an equation for ‘it’: it = ($$(valid '(') :: IFree) Prelude Functional.Iota.Free ValidLiterals> print ($$(valid '(') :: IFree) Prelude Functional.Iota.Free ValidLiterals> print ($$(valid 'a') :: IFree) IFree {fromIFree = 'a'} Prelude Functional.Iota.Free ValidLiterals>
This is an error in GHCi, not validated-literals. See bug report here: https://gitlab.haskell.org/ghc/ghc/-/issues/19470
When an invalid literal is used to create an
IO x
in ghci, no error occurs.