1
1
mirror of https://github.com/github/semantic.git synced 2025-01-02 12:23:08 +03:00

🔥 runTaskF.

This commit is contained in:
Rob Rix 2019-09-30 15:42:01 -04:00
parent b5177fc94e
commit 6ebfb5c9ac
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7
2 changed files with 3 additions and 6 deletions

View File

@ -70,7 +70,7 @@ repl proxy parser paths =
. Files.runFiles
. runResolution
. runParse
. runTaskF $ do
. runTaskC $ do
blobs <- catMaybes <$> traverse readBlobFromFile (flip File (Language.reflect proxy) <$> paths)
package <- fmap (fmap quieterm) <$> parsePackage parser (Project (takeDirectory (maybe "/" fst (uncons paths))) blobs (Language.reflect proxy) [])
modules <- topologicalSort <$> runImportGraphToModules proxy (snd <$> package)

View File

@ -45,7 +45,7 @@ module Semantic.Task
, withOptions
, TaskSession(..)
, runTraceInTelemetry
, runTaskF
, runTaskC
-- * Exceptions
, ParserCancelled(..)
-- * Re-exports
@ -155,7 +155,7 @@ runTask taskSession@TaskSession{..} task = do
. Files.runFiles
. runResolution
. runParse
. runTaskF
. runTaskC
run task
queueStat statter stat
pure result
@ -224,9 +224,6 @@ instance HFunctor Task where
instance Effect Task where
handle state handler (Semantic.Task.Diff terms k) = Semantic.Task.Diff terms (handler . (<$ state) . k)
-- | Run a 'Task' effect by performing the actions in 'IO'.
runTaskF :: TaskC m a -> m a
runTaskF = runTaskC
newtype TaskC m a = TaskC { runTaskC :: m a }
deriving (Applicative, Functor, Monad, MonadIO)