From 6050c5cf22564ca2f79956ab7a823467902d1341 Mon Sep 17 00:00:00 2001 From: Jonatan Borkowski Date: Tue, 5 Sep 2023 13:50:17 +0000 Subject: [PATCH] Add pattern by hand --- src/Language/PureScript/Constants/Libs.hs | 4 ++++ src/Language/PureScript/CoreFn/Optimizer.hs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Language/PureScript/Constants/Libs.hs b/src/Language/PureScript/Constants/Libs.hs index c51243f6fb..0b44d3e408 100644 --- a/src/Language/PureScript/Constants/Libs.hs +++ b/src/Language/PureScript/Constants/Libs.hs @@ -9,6 +9,7 @@ import Protolude qualified as P import Data.String (IsString) import Language.PureScript.Constants.TH qualified as TH import Language.PureScript.PSString (PSString) +import Language.PureScript.Names (Ident (..), Qualified (..), QualifiedBy (..)) -- Core lib values @@ -273,3 +274,6 @@ $(TH.declare do TH.var "hasFieldRecord" ) + +pattern IsSymbolDict :: Qualified Ident +pattern IsSymbolDict = Qualified (ByModuleName M_Data_Symbol) (Ident "IsSymbol$Dict") diff --git a/src/Language/PureScript/CoreFn/Optimizer.hs b/src/Language/PureScript/CoreFn/Optimizer.hs index 30838e14b2..9e2c9fa37c 100644 --- a/src/Language/PureScript/CoreFn/Optimizer.hs +++ b/src/Language/PureScript/CoreFn/Optimizer.hs @@ -39,7 +39,7 @@ optimizeRecordGetField (App _ (Var _ C.I_hasFieldRecord) (App _ - (Var _ C.I_IsSymbol) + (Var _ C.IsSymbolDict) (Literal _ (ObjectLiteral [ ("reflectSymbol", Abs _ _ (Literal _ (StringLiteral label)))