mirror of
https://github.com/unisonweb/unison.git
synced 2024-11-11 17:16:30 +03:00
Noncompiling wip of eval
This commit is contained in:
parent
3a34bfae8f
commit
f7ea984479
@ -84,6 +84,7 @@ import Unison.Util.SyntaxText (SyntaxText)
|
||||
import qualified Unison.Util.SyntaxText as SyntaxText
|
||||
import Unison.Var (Var)
|
||||
import qualified Unison.Server.Doc as Doc
|
||||
import qualified Unison.UnisonFile as UF
|
||||
|
||||
data ShallowListEntry v a
|
||||
= ShallowTermEntry (TermEntry v a)
|
||||
@ -602,7 +603,17 @@ prettyDefinitionsBySuffixes relativeTo root renderWidth suffixifyBindings codeba
|
||||
fmap Term.unannotate <$> lift (Codebase.getTerm codebase r)
|
||||
|
||||
typeOf r = fmap void <$> lift (Codebase.getTypeOfReferent codebase r)
|
||||
eval tm = undefined tm
|
||||
eval tm = do
|
||||
let ppes = PPE.suffixifiedPPE ppe
|
||||
let codeLookup = Codebase.toCodeLookup codebase
|
||||
let cache = Codebase.lookupWatchCache codebase
|
||||
r <- Runtime.evaluateTerm' codeLookup cache ppes rt tm
|
||||
lift $ case r of
|
||||
Right tmr -> Codebase.putWatch codebase UF.RegularWatch (Term.hashClosedTerm tm)
|
||||
(Term.amap (const Parser.External) tmr)
|
||||
Left _ -> pure ()
|
||||
pure $ r <&> Term.amap (const Parser.External)
|
||||
|
||||
decls (Reference.DerivedId r) = fmap (DD.amap (const ())) <$> lift (Codebase.getTypeDeclaration codebase r)
|
||||
decls _ = pure Nothing
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user