Skip to content

Commit 95e20f3

Browse files
committed
Group queries a little bit more closely by relation
1 parent 122908d commit 95e20f3

File tree

15 files changed

+1906
-1418
lines changed

15 files changed

+1906
-1418
lines changed

data/playground/haskell/branch.hs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
data a :*: b = a :*: b
2+
type a :+: b = Either a b
3+
4+
fst :: a :*: b -> a
5+
fst (a :*: b) = a
6+
7+
pair a b = a :*: b
8+
9+
fromLeft :: a :+: b -> a
10+
fromLeft (Left a) = a
11+
fromLeft _ = undefined
12+
113
fib :: Integer -> Integer
214
fib 0 = 0
315
fib 1 = 1

packages/common/src/scopeSupportFacets/haskell.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@ import {
88
const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel;
99

1010
export const haskellScopeSupport: LanguageScopeSupportFacetMap = {
11-
command: notApplicable,
12-
13-
element: notApplicable,
14-
tags: notApplicable,
15-
startTag: notApplicable,
16-
endTag: notApplicable,
17-
attribute: notApplicable,
18-
1911
list: unsupported,
2012
map: unsupported,
2113
ifStatement: unsupported,
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
abs :: Int -> Int
2+
abs x
3+
| x >= 0 = x
4+
| otherwise = -x
5+
6+
---
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
bap :: Int -> Int
2+
bap x
3+
| x > 0, x == 0 = x
4+
| otherwise = -x
5+
6+
---
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
compare :: Int -> Int -> Ordering
2+
compare x y
3+
| x < y = LT
4+
| x == y = EQ
5+
| x > y = GT
6+
7+
---

queries/haskell.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ Adds support for the Haskell programming language.
1414
- [ ] `branch`
1515
- [x] `branch.match`
1616
- [x] `branch.match.iteration`
17-
- [ ] `branch.if`
18-
- [ ] `branch.if.iteration`
19-
- [ ] `branch.guard`
20-
- [ ] `branch.guard.iteration`
17+
- [x] `branch.if`
18+
- [x] `branch.if.iteration`
2119
- [ ] `branch.ternary`
2220
- [ ] `collectionItem`
2321
- [ ] `collectionKey`

queries/haskell.scm

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,13 @@
1-
;; import haskell/haskell.argumentOrParameter.scm
2-
;; import haskell/haskell.argumentOrParameter.iteration.scm
31
;; import haskell/haskell.branch.scm
4-
;; import haskell/haskell.branch.iteration.scm
5-
;; import haskell/haskell.functionName.scm
6-
;; import haskell/haskell.name.function.scm
7-
;; import haskell/haskell.namedFunction.scm
2+
;; import haskell/haskell.functionApplication.scm
3+
;; import haskell/haskell.functionDeclaration.scm
84

95
;; Short declarations are below.
106

117
;; anonymousFunction
128
(exp_lambda) @anonymousFunction
139
(exp_lambda_case) @anonymousFunction
1410

15-
;; functionCall
16-
(exp_apply) @functionCall
17-
(exp_type_application) @functionCall
18-
(pat_apply) @functionCall
19-
(type_apply) @functionCall
20-
21-
;; functionCallee
22-
(exp_apply . (_) @functionCallee)
23-
(exp_type_application . (_) @functionCallee)
24-
(pat_apply . (_) @functionCallee
25-
(type_apply . (_) @functionCallee)
26-
2711
;; list
2812
(exp_list) @list
2913
(exp_list_comprehension) @list

queries/haskell/haskell.argumentOrParameter.iteration.scm

Lines changed: 0 additions & 30 deletions
This file was deleted.

queries/haskell/haskell.argumentOrParameter.scm

Lines changed: 0 additions & 26 deletions
This file was deleted.

queries/haskell/haskell.branch.scm

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
;; branch: function
2-
(function) @branch
3-
41
;; branch: guard_equation
52
(guard_equation
63
[

0 commit comments

Comments
 (0)