mirror of
https://github.com/github/semantic.git
synced 2024-12-21 05:41:54 +03:00
Silence unspecialized exceptions.
This commit is contained in:
parent
a9c5955027
commit
587c078171
@ -1,7 +1,9 @@
|
||||
{-# LANGUAGE GeneralizedNewtypeDeriving, TypeFamilies #-}
|
||||
{-# LANGUAGE GeneralizedNewtypeDeriving, ScopedTypeVariables, TypeApplications, TypeFamilies #-}
|
||||
module Analysis.Abstract.Quiet where
|
||||
|
||||
import Control.Abstract.Analysis
|
||||
import Control.Monad.Effect.Resumable
|
||||
import Data.Abstract.Evaluatable
|
||||
import Prologue
|
||||
|
||||
newtype Quietly m term value (effects :: [* -> *]) a = Quietly (m term value effects a)
|
||||
@ -13,10 +15,14 @@ deriving instance MonadHeap value (m term value effects) => MonadHeap value (Qui
|
||||
deriving instance MonadModuleTable term value (m term value effects) => MonadModuleTable term value (Quietly m term value effects)
|
||||
deriving instance MonadEvaluator term value (m term value effects) => MonadEvaluator term value (Quietly m term value effects)
|
||||
|
||||
instance MonadAnalysis term value (m term value effects)
|
||||
instance ( Effectful (m term value)
|
||||
, Member (Resumable (Unspecialized value)) effects
|
||||
, MonadAnalysis term value (m term value effects)
|
||||
, MonadValue value (Quietly m term value effects)
|
||||
)
|
||||
=> MonadAnalysis term value (Quietly m term value effects) where
|
||||
type RequiredEffects term value (Quietly m term value effects) = RequiredEffects term value (m term value effects)
|
||||
|
||||
analyzeTerm = liftAnalyze analyzeTerm
|
||||
analyzeTerm eval term = resumeException @(Unspecialized value) (liftAnalyze analyzeTerm eval term) (\yield (Unspecialized _) -> unit >>= yield)
|
||||
|
||||
analyzeModule = liftAnalyze analyzeModule
|
||||
|
Loading…
Reference in New Issue
Block a user