mirror of
https://github.com/github/semantic.git
synced 2024-12-25 07:55:12 +03:00
Stub out a Prologue with an implicit prelude
This commit is contained in:
parent
256f3ebea4
commit
89914a3556
@ -105,6 +105,8 @@ library
|
||||
, Language.Python.Assignment
|
||||
, Language.Python.Grammar
|
||||
, Language.Python.Syntax
|
||||
-- Custom Prelude
|
||||
, Prologue
|
||||
-- Parser glue
|
||||
, Parsing.CMark
|
||||
, Parsing.Parser
|
||||
@ -173,7 +175,15 @@ library
|
||||
, tree-sitter-ruby
|
||||
, tree-sitter-typescript
|
||||
default-language: Haskell2010
|
||||
default-extensions: DeriveFunctor, DeriveFoldable, DeriveTraversable, DeriveGeneric, FlexibleContexts, FlexibleInstances, OverloadedStrings, RecordWildCards, StrictData
|
||||
default-extensions: DeriveFoldable
|
||||
, DeriveFunctor
|
||||
, DeriveGeneric
|
||||
, DeriveTraversable
|
||||
, FlexibleContexts
|
||||
, FlexibleInstances
|
||||
, OverloadedStrings
|
||||
, RecordWildCards
|
||||
, StrictData
|
||||
ghc-options: -Wall -fno-warn-name-shadowing -O -j
|
||||
ghc-prof-options: -fprof-auto
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
{-# LANGUAGE ConstraintKinds, DataKinds, ScopedTypeVariables, TypeApplications #-}
|
||||
module Analysis.Abstract.Caching where
|
||||
|
||||
import Prologue
|
||||
import Analysis.Abstract.Collecting
|
||||
import Control.Applicative
|
||||
import Control.Effect
|
||||
import Control.Monad.Effect.Address
|
||||
import Control.Monad.Effect.Cache
|
||||
@ -22,11 +22,6 @@ import Data.Abstract.Eval
|
||||
import Data.Abstract.Live
|
||||
import Data.Abstract.Store
|
||||
import Data.Abstract.Value
|
||||
import Data.Function (fix)
|
||||
import Data.Functor.Foldable (Base, Recursive(..))
|
||||
import Data.Maybe
|
||||
import Data.Monoid (Alt(..))
|
||||
import Data.Semigroup
|
||||
import qualified Data.Set as Set
|
||||
|
||||
-- | The effects necessary for caching analyses.
|
||||
|
@ -1,13 +1,13 @@
|
||||
{-# LANGUAGE ScopedTypeVariables #-}
|
||||
module Analysis.Abstract.Collecting where
|
||||
|
||||
import Prologue
|
||||
import Control.Monad.Effect.GC
|
||||
import Control.Monad.Effect.Store
|
||||
import Data.Abstract.Address
|
||||
import Data.Abstract.Live
|
||||
import Data.Abstract.Store
|
||||
import Data.Abstract.Value
|
||||
import Data.Semigroup
|
||||
|
||||
-- | Small-step evaluation which garbage-collects any non-rooted addresses after evaluating each term.
|
||||
evCollect :: forall t v m
|
||||
|
@ -1,6 +1,7 @@
|
||||
{-# LANGUAGE DataKinds, ScopedTypeVariables, TypeApplications #-}
|
||||
module Analysis.Abstract.Dead where
|
||||
|
||||
import Prologue
|
||||
import Control.Effect
|
||||
import Control.Monad.Effect hiding (run)
|
||||
import Control.Monad.Effect.Address
|
||||
@ -13,11 +14,6 @@ import Data.Abstract.Environment
|
||||
import Data.Abstract.Eval
|
||||
import Data.Abstract.Store
|
||||
import Data.Abstract.Value
|
||||
import Data.Function (fix)
|
||||
import Data.Functor.Foldable
|
||||
import Data.Pointed
|
||||
import Data.Semigroup
|
||||
import Data.Set
|
||||
|
||||
-- | The effects necessary for dead code analysis.
|
||||
type DeadCodeEvaluating t v
|
||||
|
@ -1,6 +1,7 @@
|
||||
{-# LANGUAGE ConstraintKinds, DataKinds, ScopedTypeVariables, TypeApplications #-}
|
||||
module Analysis.Abstract.Evaluating where
|
||||
|
||||
import Prologue
|
||||
import Control.Effect
|
||||
import Control.Monad.Effect hiding (run)
|
||||
import Control.Monad.Effect.Address
|
||||
@ -12,9 +13,6 @@ import Data.Abstract.Environment
|
||||
import Data.Abstract.Eval
|
||||
import Data.Abstract.Store
|
||||
import Data.Abstract.Value
|
||||
import Data.Function (fix)
|
||||
import Data.Functor.Foldable (Base, Recursive(..))
|
||||
import Data.Semigroup
|
||||
|
||||
-- | The effects necessary for concrete interpretation.
|
||||
type Evaluating v
|
||||
|
@ -1,6 +1,7 @@
|
||||
{-# LANGUAGE AllowAmbiguousTypes, DataKinds, ScopedTypeVariables, TypeApplications, TypeFamilies #-}
|
||||
module Analysis.Abstract.Tracing where
|
||||
|
||||
import Prologue
|
||||
import Control.Effect
|
||||
import Control.Monad.Effect hiding (run)
|
||||
import Control.Monad.Effect.Address
|
||||
@ -17,11 +18,6 @@ import Data.Abstract.Environment
|
||||
import Data.Abstract.Eval
|
||||
import Data.Abstract.Store
|
||||
import Data.Abstract.Value
|
||||
import Data.Function (fix)
|
||||
import Data.Functor.Foldable (Base, Recursive(..))
|
||||
import Data.Pointed
|
||||
import Data.Semigroup
|
||||
import Data.Set
|
||||
|
||||
-- | The effects necessary for tracing analyses.
|
||||
type Tracing g t v
|
||||
|
@ -5,14 +5,12 @@ module Analysis.ConstructorName
|
||||
, constructorLabel
|
||||
) where
|
||||
|
||||
import Prologue
|
||||
import Data.Aeson
|
||||
import Data.ByteString.Char8 (ByteString, pack, unpack)
|
||||
import Data.JSON.Fields
|
||||
import Data.Proxy
|
||||
import Data.Term
|
||||
import Data.Text.Encoding (decodeUtf8)
|
||||
import Data.Union
|
||||
import GHC.Generics
|
||||
|
||||
-- | Compute a 'ConstructorLabel' label for a 'Term'.
|
||||
constructorLabel :: ConstructorName syntax => TermF syntax a b -> ConstructorLabel
|
||||
|
@ -5,12 +5,11 @@ module Analysis.CyclomaticComplexity
|
||||
, cyclomaticComplexityAlgebra
|
||||
) where
|
||||
|
||||
import Prologue
|
||||
import Data.Aeson
|
||||
import Data.Proxy
|
||||
import qualified Data.Syntax.Declaration as Declaration
|
||||
import qualified Data.Syntax.Statement as Statement
|
||||
import Data.Term
|
||||
import Data.Union
|
||||
|
||||
-- | The cyclomatic complexity of a (sub)term.
|
||||
newtype CyclomaticComplexity = CyclomaticComplexity Int
|
||||
|
@ -1,5 +1,52 @@
|
||||
module Prologue where (
|
||||
module Prologue (
|
||||
module X
|
||||
, ) where
|
||||
|
||||
)
|
||||
import Data.Union as X
|
||||
import Data.Function as X (fix, on, (&))
|
||||
import Data.Functor.Foldable as X (Base, Recursive(..))
|
||||
import Data.Semigroup as X
|
||||
import Control.Applicative as X
|
||||
import Data.Maybe as X
|
||||
import Data.Monoid as X (Alt(..))
|
||||
import Data.Pointed as X
|
||||
|
||||
import Prelude
|
||||
-- Data Types
|
||||
import Data.Map as X (Map)
|
||||
import Data.Set as X (Set)
|
||||
import Data.Sequence as X (Seq)
|
||||
import Data.IntMap as X (IntMap)
|
||||
import Data.IntSet as X (IntSet)
|
||||
|
||||
|
||||
import Data.Proxy as X ( Proxy(..) )
|
||||
|
||||
-- Generics
|
||||
import GHC.Generics as X (
|
||||
Generic(..)
|
||||
, Generic1
|
||||
, Rep
|
||||
, D
|
||||
, C
|
||||
, Rep1
|
||||
, from1
|
||||
, K1(..)
|
||||
, M1(..)
|
||||
, U1(..)
|
||||
, V1
|
||||
, D1
|
||||
, C1
|
||||
, S1
|
||||
, (:+:)(..)
|
||||
, (:*:)(..)
|
||||
, (:.:)(..)
|
||||
, Rec0
|
||||
, Constructor(..)
|
||||
, Datatype(..)
|
||||
, Selector(..)
|
||||
, Fixity(..)
|
||||
, Associativity(..)
|
||||
, Meta(..)
|
||||
, FixityI(..)
|
||||
, URec
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user