diff --git a/src/Semantic/Parse.hs b/src/Semantic/Parse.hs index 3b2f2119a..5da3c7e22 100644 --- a/src/Semantic/Parse.hs +++ b/src/Semantic/Parse.hs @@ -15,7 +15,7 @@ import Rendering.Renderer import Semantic.IO (NoLanguageForBlob(..)) import Semantic.Task -parseBlobs :: Output output => TermRenderer output -> [Blob] -> Task ByteString +parseBlobs :: Members '[Distribute WrappedTask, TaskF, Exc SomeException] effs => Output output => TermRenderer output -> [Blob] -> Eff effs ByteString parseBlobs renderer blobs = toOutput' <$> distributeFoldMap (WrapTask . parseBlob renderer) blobs where toOutput' = case renderer of JSONTermRenderer -> toOutput . renderJSONTerms @@ -23,7 +23,7 @@ parseBlobs renderer blobs = toOutput' <$> distributeFoldMap (WrapTask . parseBlo _ -> toOutput -- | A task to parse a 'Blob' and render the resulting 'Term'. -parseBlob :: TermRenderer output -> Blob -> Task output +parseBlob :: Members '[TaskF, Exc SomeException] effs => TermRenderer output -> Blob -> Eff effs output parseBlob renderer blob@Blob{..} | Just (SomeParser parser) <- someParser (Proxy :: Proxy '[ConstructorName, HasPackageDef, HasDeclaration, IdentifierName, Foldable, Functor, ToJSONFields1]) <$> blobLanguage = parse parser blob >>= case renderer of diff --git a/src/Semantic/Task.hs b/src/Semantic/Task.hs index 5f3f508fe..97483b211 100644 --- a/src/Semantic/Task.hs +++ b/src/Semantic/Task.hs @@ -1,6 +1,7 @@ {-# LANGUAGE GADTs, GeneralizedNewtypeDeriving, RankNTypes, TypeOperators, UndecidableInstances #-} module Semantic.Task ( Task +, TaskF , WrappedTask(..) , Level(..) , RAlgebra @@ -31,8 +32,12 @@ module Semantic.Task -- * Interpreting , runTask , runTaskWithOptions --- * Exceptions +-- * Re-exports +, Distribute +, Eff +, Exc , throwError +, SomeException ) where import qualified Analysis.Abstract.ImportGraph as Abstract