Skip to content

Commit f0c5b34

Browse files
authored
feat: update Haskell language data (#670)
1 parent 4af13ac commit f0c5b34

File tree

5 files changed

+100
-46
lines changed

5 files changed

+100
-46
lines changed

SCC-OUTPUT-REPORT.html

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@
1313
<tbody><tr>
1414
<th>Go</th>
1515
<th>30</th>
16-
<th>24601</th>
17-
<th>1527</th>
18-
<th>470</th>
19-
<th>22604</th>
20-
<th>1625</th>
21-
<th>482875</th>
22-
<th>6907</th>
16+
<th>24855</th>
17+
<th>1534</th>
18+
<th>488</th>
19+
<th>22833</th>
20+
<th>1633</th>
21+
<th>491109</th>
22+
<th>7119</th>
2323
</tr><tr>
2424
<td>processor/constants.go</td>
2525
<td></td>
26-
<td>13693</td>
26+
<td>13694</td>
2727
<td>1</td>
2828
<td>2</td>
29-
<td>13690</td>
29+
<td>13691</td>
3030
<td>0</td>
31-
<td>214817</td>
32-
<td>2111</td>
31+
<td>214836</td>
32+
<td>2112</td>
3333
</tr><tr>
3434
<td>processor/formatters_test.go</td>
3535
<td></td>
@@ -73,13 +73,13 @@
7373
</tr><tr>
7474
<td>main_test.go</td>
7575
<td></td>
76-
<td>687</td>
76+
<td>688</td>
7777
<td>54</td>
7878
<td>15</td>
79-
<td>618</td>
79+
<td>619</td>
8080
<td>179</td>
81-
<td>16535</td>
82-
<td>383</td>
81+
<td>16548</td>
82+
<td>384</td>
8383
</tr><tr>
8484
<td>processor/processor.go</td>
8585
<td></td>
@@ -90,6 +90,16 @@
9090
<td>79</td>
9191
<td>18242</td>
9292
<td>416</td>
93+
</tr><tr>
94+
<td>cmd/badges/main.go</td>
95+
<td></td>
96+
<td>615</td>
97+
<td>82</td>
98+
<td>30</td>
99+
<td>503</td>
100+
<td>73</td>
101+
<td>17363</td>
102+
<td>437</td>
93103
</tr><tr>
94104
<td>main.go</td>
95105
<td></td>
@@ -100,16 +110,6 @@
100110
<td>24</td>
101111
<td>11384</td>
102112
<td>304</td>
103-
</tr><tr>
104-
<td>cmd/badges/main.go</td>
105-
<td></td>
106-
<td>468</td>
107-
<td>77</td>
108-
<td>21</td>
109-
<td>370</td>
110-
<td>68</td>
111-
<td>12982</td>
112-
<td>297</td>
113113
</tr><tr>
114114
<td>processor/detector_test.go</td>
115115
<td></td>
@@ -120,6 +120,16 @@
120120
<td>109</td>
121121
<td>7784</td>
122122
<td>162</td>
123+
</tr><tr>
124+
<td>cmd/badges/main_test.go</td>
125+
<td></td>
126+
<td>304</td>
127+
<td>8</td>
128+
<td>9</td>
129+
<td>287</td>
130+
<td>13</td>
131+
<td>7909</td>
132+
<td>177</td>
123133
</tr><tr>
124134
<td>processor/workers_tokei_test.go</td>
125135
<td></td>
@@ -170,16 +180,6 @@
170180
<td>17</td>
171181
<td>6072</td>
172182
<td>142</td>
173-
</tr><tr>
174-
<td>cmd/badges/main_test.go</td>
175-
<td></td>
176-
<td>199</td>
177-
<td>6</td>
178-
<td>0</td>
179-
<td>193</td>
180-
<td>10</td>
181-
<td>4088</td>
182-
<td>106</td>
183183
</tr><tr>
184184
<td>processor/similar_flags_test.go</td>
185185
<td></td>
@@ -324,15 +324,15 @@
324324
<tfoot><tr>
325325
<th>Total</th>
326326
<th>30</th>
327-
<th>24601</th>
328-
<th>1527</th>
329-
<th>470</th>
330-
<th>22604</th>
331-
<th>1625</th>
332-
<th>482875</th>
333-
<th>6907</th>
327+
<th>24855</th>
328+
<th>1534</th>
329+
<th>488</th>
330+
<th>22833</th>
331+
<th>1633</th>
332+
<th>491109</th>
333+
<th>7119</th>
334334
</tr>
335335
<tr>
336-
<th colspan="9">Estimated Cost to Develop (organic) $713,657<br>Estimated Schedule Effort (organic) 12.10 months<br>Estimated People Required (organic) 5.24<br></th>
336+
<th colspan="9">Estimated Cost to Develop (organic) $721,251<br>Estimated Schedule Effort (organic) 12.15 months<br>Estimated People Required (organic) 5.27<br></th>
337337
</tr></tfoot>
338338
</table></body></html>

examples/language/haskell.hs

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
module RBTree
2+
( RBTree
3+
, empty
4+
, insert
5+
, member
6+
, fromList
7+
) where
8+
9+
data Color = Red | Black
10+
deriving (Show, Eq)
11+
12+
data RBTree a = Empty
13+
| Node Color (RBTree a) a (RBTree a)
14+
deriving (Show, Eq)
15+
16+
empty :: RBTree a
17+
empty = Empty
18+
19+
member :: (Ord a) => a -> RBTree a -> Bool
20+
member _ Empty = False
21+
member x (Node _ left val right) =
22+
case compare x val of
23+
LT -> member x left
24+
GT -> member x right
25+
EQ -> True
26+
27+
insert :: (Ord a) => a -> RBTree a -> RBTree a
28+
insert x s = makeBlack (ins s)
29+
where
30+
makeBlack Empty = Empty -- never come here
31+
makeBlack (Node _ l v r) = Node Black l v r
32+
33+
ins Empty = Node Red Empty x Empty
34+
ins (Node color l v r)
35+
| x < v = balance color (ins l) v r
36+
| x > v = balance color l v (ins r)
37+
| otherwise = Node color l v r -- discard duplicated value
38+
39+
balance :: Color -> RBTree a -> a -> RBTree a -> RBTree a
40+
balance Black (Node Red (Node Red a x b) y c) z d =
41+
Node Red (Node Black a x b) y (Node Black c z d)
42+
balance Black (Node Red a x (Node Red b y c)) z d =
43+
Node Red (Node Black a x b) y (Node Black c z d)
44+
balance Black a x (Node Red (Node Red b y c) z d) =
45+
Node Red (Node Black a x b) y (Node Black c z d)
46+
balance Black a x (Node Red b y (Node Red c z d)) =
47+
Node Red (Node Black a x b) y (Node Black c z d)
48+
balance color l v r = Node color l v r
49+
50+
fromList :: (Ord a) => [a] -> RBTree a
51+
fromList = foldr insert empty

languages.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3232,8 +3232,9 @@
32323232
"/= ",
32333233
"== ",
32343234
"case ",
3235-
"do {",
3236-
"forall "
3235+
"otherwise ",
3236+
"wildcard ",
3237+
"do {"
32373238
],
32383239
"extensions": ["hs"],
32393240
"line_comment": ["--"],

main_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,7 @@ func TestSpecificLanguages(t *testing.T) {
599599
"Gwion",
600600
"HAML",
601601
"Hare",
602+
"Haskell",
602603
"HCL",
603604
"ignore",
604605
"INI",

processor/constants.go

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)