diff --git a/Pinafore/pinafore-language/lib/Pinafore/Language.hs b/Pinafore/pinafore-language/lib/Pinafore/Language.hs index 5c9e5ed3..0390f98b 100644 --- a/Pinafore/pinafore-language/lib/Pinafore/Language.hs +++ b/Pinafore/pinafore-language/lib/Pinafore/Language.hs @@ -10,7 +10,6 @@ module Pinafore.Language , LibraryContext(..) , mkLibraryContext , pinaforeLibrary - , QSpecialVals(..) , QError , fromParseResult , InterpretResult diff --git a/Pinafore/pinafore-language/lib/Pinafore/Language/Interpret.hs b/Pinafore/pinafore-language/lib/Pinafore/Language/Interpret.hs index ec381079..86a437e5 100644 --- a/Pinafore/pinafore-language/lib/Pinafore/Language/Interpret.hs +++ b/Pinafore/pinafore-language/lib/Pinafore/Language/Interpret.hs @@ -64,16 +64,8 @@ parseToValueSubsume t text = do val <- parseToValue text [] tsSubsumeValue @QTypeSystem t val -spvals :: (?library :: LibraryContext) => QSpecialVals -spvals = let - specialEvaluate :: forall t. QType 'Positive t -> Text -> IO (Result QError t) - specialEvaluate t text = do - ier <- evaluate $ runPinaforeScoped "" $ parseToValueSubsume t text - runInterpretResult ier - in MkQSpecialVals {..} - runPinaforeScoped :: (?library :: LibraryContext) => String -> QInterpreter a -> InterpretResult a runPinaforeScoped sourcename ma = - runInterpreter (initialPos sourcename) ?library spvals $ do + runInterpreter (initialPos sourcename) ?library $ do sd <- interpretImportDeclaration builtInModuleName withScopeDocs sd ma diff --git a/Pinafore/pinafore-language/lib/Pinafore/Language/Interpreter/Binding.hs b/Pinafore/pinafore-language/lib/Pinafore/Language/Interpreter/Binding.hs index 13c9fd58..430feeda 100644 --- a/Pinafore/pinafore-language/lib/Pinafore/Language/Interpreter/Binding.hs +++ b/Pinafore/pinafore-language/lib/Pinafore/Language/Interpreter/Binding.hs @@ -1,6 +1,5 @@ module Pinafore.Language.Interpreter.Binding - ( QSpecialVals(..) - , QSignature(..) + ( QSignature(..) , QRecordValue(..) , QRecordConstructor(..) , recordConstructorToValue @@ -21,11 +20,6 @@ import Pinafore.Language.Type.Family import Pinafore.Language.Type.Ground import Pinafore.Language.Type.Subtype () -newtype QSpecialVals = MkQSpecialVals - { specialEvaluate :: forall t. QType 'Positive t -> Text -> IO (Result QError t) - -- ^ in IO because this can do things like import files - } - data QSignature (polarity :: Polarity) (t :: Type) = ValueSignature (Maybe SomeFamilialType) Name diff --git a/Pinafore/pinafore-language/lib/Pinafore/Language/Interpreter/Interpreter.hs b/Pinafore/pinafore-language/lib/Pinafore/Language/Interpreter/Interpreter.hs index f0e5e08d..e6715e67 100644 --- a/Pinafore/pinafore-language/lib/Pinafore/Language/Interpreter/Interpreter.hs +++ b/Pinafore/pinafore-language/lib/Pinafore/Language/Interpreter/Interpreter.hs @@ -16,7 +16,6 @@ module Pinafore.Language.Interpreter.Interpreter , getRenderFullName , getBindingInfoLookup , getNamespaceWithScope - , getSpecialVals , exportScope , getModule , getSubtypeScope @@ -56,7 +55,6 @@ data InterpretContext = MkInterpretContext , icVarIDState :: VarIDState , icScope :: QScope , icCurrentNamespace :: Namespace - , icSpecialVals :: QSpecialVals , icModulePath :: [ModuleName] , icLoadModule :: LoadModule } @@ -170,9 +168,6 @@ currentNamespaceParam :: Param QInterpreter Namespace currentNamespaceParam = lensMapParam (\bfb a -> fmap (\b -> a {icCurrentNamespace = b}) $ bfb $ icCurrentNamespace a) contextParam -specialValsParam :: Param QInterpreter QSpecialVals -specialValsParam = lensMapParam (\bfb a -> fmap (\b -> a {icSpecialVals = b}) $ bfb $ icSpecialVals a) contextParam - modulePathParam :: Param QInterpreter [ModuleName] modulePathParam = lensMapParam (\bfb a -> fmap (\b -> a {icModulePath = b}) $ bfb $ icModulePath a) contextParam @@ -203,8 +198,8 @@ data LibraryContext = MkLibraryContext { lcLoadModule :: LoadModule } -runInterpreter :: SourcePos -> LibraryContext -> QSpecialVals -> QInterpreter a -> InterpretResult a -runInterpreter icSourcePos MkLibraryContext {..} icSpecialVals qa = let +runInterpreter :: SourcePos -> LibraryContext -> QInterpreter a -> InterpretResult a +runInterpreter icSourcePos MkLibraryContext {..} qa = let icVarIDState = szero icScope = emptyScope icModulePath = [] @@ -340,6 +335,3 @@ newIdentifiedType = Refl <- unsafeIdentifyKind @_ @(CCRVariancesKind dv) typeID Refl <- unsafeIdentify @_ @gt typeID return $ identifiedFamilialType typeID - -getSpecialVals :: QInterpreter QSpecialVals -getSpecialVals = paramAsk specialValsParam