Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit fa78c7c

Browse files
author
Patrick Thomson
authored
Merge pull request #5 from github/simplify-project-type
Simplify Data.Project.
2 parents 07fb2cb + c2b46a6 commit fa78c7c

File tree

1 file changed

+9
-23
lines changed

1 file changed

+9
-23
lines changed

src/Data/Project.hs

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{-# LANGUAGE DeriveAnyClass, KindSignatures, MultiWayIf #-}
22

3-
module Data.Project (
4-
-- * Projects
5-
ProjectF (..)
6-
, Project
3+
module Data.Project
4+
( Project (..)
75
, ProjectException (..)
86
, projectExtensions
97
, projectName
@@ -24,26 +22,14 @@ import qualified Data.Text as T
2422
import System.FilePath.Posix
2523
import Semantic.IO
2624

27-
-- | A 'ProjectF' contains all the information that semantic needs
28-
-- to execute an analysis, diffing, or graphing pass. It is higher-kinded
29-
-- in terms of the container type for paths and blobs, as well as the
30-
-- path type (this is necessary because protobuf uses different vector
31-
-- representations for @repeated string@ and @repeated Blob@.
32-
-- You probably want to use the 'Project' or 'PB' type aliases.
33-
data ProjectF (blobs :: * -> *) (paths :: * -> *) path = Project
34-
{ projectRootDir :: path
35-
, projectBlobs :: blobs Blob
25+
-- | A 'Project' contains all the information that semantic needs
26+
-- to execute an analysis, diffing, or graphing pass.
27+
data Project = Project
28+
{ projectRootDir :: FilePath
29+
, projectBlobs :: [Blob]
3630
, projectLanguage :: Language
37-
, projectExcludeDirs :: paths path
38-
} deriving (Functor, Generic)
39-
40-
deriving instance (Eq path, Eq (blobs Blob), Eq (paths path)) => Eq (ProjectF blobs paths path)
41-
deriving instance (Show path, Show (blobs Blob), Show (paths path)) => Show (ProjectF blobs paths path)
42-
43-
-- | This 'Project' type is the one used during semantic's normal
44-
-- course of diffing, evaluation, and graphing. You probably want to
45-
-- use this one.
46-
type Project = ProjectF [] [] FilePath
31+
, projectExcludeDirs :: [FilePath]
32+
} deriving (Eq, Show, Generic)
4733

4834
projectName :: Project -> Text
4935
projectName = T.pack . dropExtensions . takeFileName . projectRootDir

0 commit comments

Comments
 (0)