-
-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathPerformance.hs
More file actions
49 lines (36 loc) · 1.27 KB
/
Performance.hs
File metadata and controls
49 lines (36 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{- |
Copyright: (c) 2020 Kowainik
SPDX-License-Identifier: MPL-2.0
Maintainer: Kowainik <xrom.xkov@gmail.com>
Contains all 'Inspection's for known performance improvements.
The __preformance__ inspections are in ranges:
* @STAN-0401 .. STAN-0500@
-}
module Stan.Inspection.Performance
( -- * Performance inspections
-- *** @SPECIALIZE@ pragma
stan0401
-- * All inspections
, performanceInspectionsMap
) where
import Relude.Extra.Tuple (fmapToFst)
import Stan.Core.Id (Id (..))
import Stan.Inspection (Inspection (..), InspectionAnalysis (..), InspectionsMap)
import Stan.Severity (Severity (..))
import qualified Stan.Category as Category
-- | All performance 'Inspection's map from 'Id's.
performanceInspectionsMap :: InspectionsMap
performanceInspectionsMap = fromList $ fmapToFst inspectionId
[ stan0401
]
-- | 'Inspection' — @SPECIALIZE@ @STAN-0401@.
stan0401 :: Inspection
stan0401 = Inspection
{ inspectionId = Id "STAN-0401"
, inspectionName = "Performance: SPECIALIZE pragma"
, inspectionDescription = "Use {-# SPECIALIZE #-} pragma to improve performance"
, inspectionSolution = []
, inspectionCategory = Category.antiPattern :| []
, inspectionSeverity = Performance
, inspectionAnalysis = SpecializePragma
}