1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 01:47:01 +03:00

Parameterize runFile by the evaluator.

This commit is contained in:
Rob Rix 2019-07-29 12:19:10 -04:00
parent 7e7f33c6d1
commit 99d9a8d94d
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -1,4 +1,4 @@
{-# LANGUAGE DeriveGeneric, DeriveTraversable, DerivingVia, FlexibleContexts, FlexibleInstances, LambdaCase, OverloadedStrings, QuantifiedConstraints, RecordWildCards, ScopedTypeVariables, StandaloneDeriving, TypeApplications, TypeOperators #-}
{-# LANGUAGE DeriveGeneric, DeriveTraversable, DerivingVia, FlexibleContexts, FlexibleInstances, LambdaCase, OverloadedStrings, QuantifiedConstraints, RankNTypes, RecordWildCards, ScopedTypeVariables, StandaloneDeriving, TypeApplications, TypeOperators #-}
module Analysis.Typecheck
( Monotype (..)
, Meta
@ -93,16 +93,17 @@ typecheckingFlowInsensitive
. runFresh
. runHeap "__semantic_root"
. fmap (fmap (fmap (fmap generalize)))
. traverse runFile
. traverse (runFile eval)
runFile :: ( Carrier sig m
, Effect sig
, Member Fresh sig
, Member (State (Heap User (Term Monotype Meta))) sig
)
=> File (Term (Core.Ann :+: Core.Core) User)
=> (forall sig m . (Carrier sig m, Member (Reader Loc) sig, MonadFail m) => Analysis (Term (Core.Ann :+: Core.Core)) User (Term Monotype Meta) m -> (Term (Core.Ann :+: Core.Core) User -> m (Term Monotype Meta)) -> (Term (Core.Ann :+: Core.Core) User -> m (Term Monotype Meta)))
-> File (Term (Core.Ann :+: Core.Core) User)
-> m (File (Either (Loc, String) (Term Monotype Meta)))
runFile file = traverse run file
runFile eval file = traverse run file
where run
= (\ m -> do
(subst, t) <- m