yukigo-haskell-parser 0.1.2 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.mocharc.json +3 -3
- package/CHANGELOG.md +41 -7
- package/README.md +5 -10
- package/dist/index.js +21 -13
- package/dist/index.js.map +1 -1
- package/dist/parser/grammar.cjs +397 -0
- package/dist/parser/grammar.cjs.map +1 -0
- package/dist/parser/grammar.d.cts +38 -0
- package/dist/parser/lexer.d.ts +2 -1
- package/dist/parser/lexer.js +6 -1
- package/dist/parser/lexer.js.map +1 -1
- package/dist/prelude.js +279 -279
- package/dist/typechecker/DeclarationCollector.d.ts +2 -0
- package/dist/typechecker/DeclarationCollector.js +6 -5
- package/dist/typechecker/DeclarationCollector.js.map +1 -1
- package/dist/typechecker/TypeBuilder.js +9 -7
- package/dist/typechecker/TypeBuilder.js.map +1 -1
- package/dist/typechecker/checker.d.ts +9 -4
- package/dist/typechecker/checker.js +66 -94
- package/dist/typechecker/checker.js.map +1 -1
- package/dist/typechecker/core.js +8 -7
- package/dist/typechecker/core.js.map +1 -1
- package/dist/typechecker/inference.d.ts +4 -1
- package/dist/typechecker/inference.js +39 -19
- package/dist/typechecker/inference.js.map +1 -1
- package/dist/utils/helpers.d.ts +3 -0
- package/dist/utils/helpers.js +5 -0
- package/dist/utils/helpers.js.map +1 -1
- package/dist/utils/types.d.ts +12 -3
- package/dist/utils/types.js +34 -22
- package/dist/utils/types.js.map +1 -1
- package/package.json +9 -10
- package/src/index.ts +223 -192
- package/src/parser/{grammar.ts → grammar.cjs} +191 -223
- package/src/parser/grammar.d.ts +3 -0
- package/src/parser/grammar.ne +521 -518
- package/src/parser/lexer.ts +357 -353
- package/src/prelude.ts +281 -281
- package/src/typechecker/DeclarationCollector.ts +160 -157
- package/src/typechecker/TypeBuilder.ts +153 -150
- package/src/typechecker/checker.ts +487 -501
- package/src/typechecker/core.ts +195 -192
- package/src/typechecker/inference.ts +1442 -1421
- package/src/utils/helpers.ts +34 -29
- package/src/utils/types.ts +75 -63
- package/tests/hspec.spec.ts +95 -92
- package/tests/lexer.spec.ts +175 -175
- package/tests/parser.spec.ts +838 -829
- package/tests/prelude.spec.ts +17 -17
- package/tests/typechecker.spec.ts +326 -327
- package/tsconfig.build.json +16 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +29 -26
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/parser/grammar.d.ts +0 -28
- package/dist/parser/grammar.js +0 -393
- package/dist/parser/grammar.js.map +0 -1
package/dist/prelude.js
CHANGED
|
@@ -1,281 +1,281 @@
|
|
|
1
|
-
export const preludeCode = `data Ordering = LT | EQ | GT
|
|
2
|
-
data Maybe a = Nothing | Just a
|
|
3
|
-
id :: a -> a
|
|
4
|
-
id x = x
|
|
5
|
-
const :: a -> b -> a
|
|
6
|
-
const x _ = x
|
|
7
|
-
(,) :: a -> b -> (a, b)
|
|
8
|
-
(,) x y = (x, y)
|
|
9
|
-
($) :: (a -> b) -> a -> b
|
|
10
|
-
($) f x = f x
|
|
11
|
-
($!) :: (a -> b) -> a -> b
|
|
12
|
-
($!) f x = f x
|
|
13
|
-
(.) :: (b -> c) -> (a -> b) -> a -> c
|
|
14
|
-
(.) f g a = (\\x -> f (g x)) a
|
|
15
|
-
(:) :: a -> [a] -> [a]
|
|
16
|
-
(:) x xs = x : xs
|
|
17
|
-
(++) :: [a] -> [a] -> [a]
|
|
18
|
-
(++) [] ys = ys
|
|
19
|
-
(++) (x:xs) ys = x : (xs ++ ys)
|
|
20
|
-
(&&) :: Bool -> Bool -> Bool
|
|
21
|
-
(||) :: Bool -> Bool -> Bool
|
|
22
|
-
(&&) x y = x && y
|
|
23
|
-
(||) x y = x || y
|
|
24
|
-
(==) :: (Ord a) => a -> a -> Boolean
|
|
25
|
-
(==) x y = x == y
|
|
26
|
-
(/=) :: (Ord a) => a -> a -> Boolean
|
|
27
|
-
(/=) x y = x /= y
|
|
28
|
-
(<) :: (Ord a) => a -> a -> Boolean
|
|
29
|
-
(<) x y = x < y
|
|
30
|
-
(>) :: (Ord a) => a -> a -> Boolean
|
|
31
|
-
(>) x y = x > y
|
|
32
|
-
(<=) :: (Ord a) => a -> a -> Boolean
|
|
33
|
-
(<=) x y = x <= y
|
|
34
|
-
(>=) :: (Ord a) => a -> a -> Boolean
|
|
35
|
-
(>=) x y = x >= y
|
|
36
|
-
(+) :: Num a => a -> a -> a
|
|
37
|
-
(-) :: Num a => a -> a -> a
|
|
38
|
-
(+) x y = x + y
|
|
39
|
-
(-) x y = x - y
|
|
40
|
-
(**) :: (Floating a) => a -> a -> a
|
|
41
|
-
(**) x y = x ** y
|
|
42
|
-
(^) :: (Num a, Integral b) => a -> b -> a
|
|
43
|
-
(^) x y = x ^ y
|
|
44
|
-
(^^) :: (Fractional a, Integral b) => a -> b -> a
|
|
45
|
-
(^^) x y = x ^^ y
|
|
46
|
-
(*) :: (Num a) => a -> a -> a
|
|
47
|
-
(*) x y = x * y
|
|
48
|
-
(/) :: Fractional a => a -> a -> a
|
|
49
|
-
(/) _ 0 = error "Prelude./: divide by zero"
|
|
50
|
-
(/) x y = x / y
|
|
51
|
-
(!!) :: [a] -> Int -> a
|
|
52
|
-
(!!) xs n | n < 0 = error "Prelude.!!: negative index"
|
|
53
|
-
(!!) [] _ = error "Prelude.!!: index too large"
|
|
54
|
-
(!!) (x:_) 0 = x
|
|
55
|
-
(!!) (_:xs) n = xs !! (n - 1)
|
|
56
|
-
not :: Bool -> Bool
|
|
57
|
-
not True = False
|
|
58
|
-
not False = True
|
|
59
|
-
quot :: Integral a => a -> a -> a
|
|
60
|
-
quot _ 0 = error "divide by zero"
|
|
61
|
-
quot 0 _ = 0
|
|
62
|
-
quot a b = let { absA = abs a; absB = abs b; result = quotPositive absA absB } in if (a < 0) == (b < 0) then result else -result
|
|
63
|
-
rem :: Integral a => a -> a -> a
|
|
64
|
-
rem _ 0 = error "divide by zero"
|
|
65
|
-
rem 0 _ = 0
|
|
66
|
-
rem a b = let { absA = abs a; absB = abs b; remainder = remPositive absA absB } in if a < 0 then -remainder else remainder
|
|
67
|
-
quotPositive :: Integral a => a -> a -> a
|
|
68
|
-
quotPositive n d | n < d = 0 | otherwise = 1 + quotPositive (n - d) d
|
|
69
|
-
remPositive :: Integral a => a -> a -> a
|
|
70
|
-
remPositive n d | n < d = n | otherwise = remPositive (n - d) d
|
|
71
|
-
div :: Integral a => a -> a -> a
|
|
72
|
-
div _ 0 = error "divide by zero"
|
|
73
|
-
div 0 _ = 0
|
|
74
|
-
div a b = let { q = quot a b; r = rem a b } in if r == 0 || (a < 0) == (b < 0) then q else q - 1
|
|
75
|
-
mod :: Integral a => a -> a -> a
|
|
76
|
-
mod _ 0 = error "divide by zero"
|
|
77
|
-
mod 0 _ = 0
|
|
78
|
-
mod a b = a - (div a b) * b
|
|
79
|
-
signum :: (Num a) => a -> a
|
|
80
|
-
signum x | x == 0 = 0 | x > 0 = 1 | otherwise = -1
|
|
81
|
-
abs :: (Num a) => a -> a
|
|
82
|
-
abs n = if n < 0 then -n else n
|
|
83
|
-
succ :: (Num a) => a -> a
|
|
84
|
-
succ x = x + 1
|
|
85
|
-
pred :: (Num a) => a -> a
|
|
86
|
-
pred x = x - 1
|
|
87
|
-
sqrt :: (Num a) => a -> a
|
|
88
|
-
sqrt x = x ** 0.5
|
|
89
|
-
max :: Ord a => a -> a -> a
|
|
90
|
-
max x y = if x <= y then y else x
|
|
91
|
-
min :: Ord a => a -> a -> a
|
|
92
|
-
min x y = if x <= y then x else y
|
|
93
|
-
even :: (Integral a) => a -> Bool
|
|
94
|
-
odd :: (Integral a) => a -> Bool
|
|
95
|
-
even n = n \`rem\` 2 == 0
|
|
96
|
-
odd n = (not . even) n
|
|
97
|
-
length :: [a] -> Int
|
|
98
|
-
length [] = 0
|
|
99
|
-
length (_:l) = 1 + length l
|
|
100
|
-
genericLength :: (Integral a) => [b] -> a
|
|
101
|
-
genericLength [] = 0
|
|
102
|
-
genericLength (x:xs) = 1 + genericLength xs
|
|
103
|
-
null :: [a] -> Bool
|
|
104
|
-
null [] = True
|
|
105
|
-
null (_:_) = False
|
|
106
|
-
union :: (Eq a) => [a] -> [a] -> [a]
|
|
107
|
-
union xs ys = unionBy (==) xs ys
|
|
108
|
-
deleteBy :: (a -> a -> Bool) -> a -> [a] -> [a]
|
|
109
|
-
deleteBy eq x [] = []
|
|
110
|
-
deleteBy eq x (y:ys) = if x \`eq\` y then ys else y : deleteBy eq x ys
|
|
111
|
-
deleteFirstsBy :: (a -> a -> Bool) -> [a] -> [a] -> [a]
|
|
112
|
-
deleteFirstsBy eq xs ys = foldl (flip (deleteBy eq)) xs ys
|
|
113
|
-
nubBy :: (a -> a -> Bool) -> [a] -> [a]
|
|
114
|
-
nubBy eq [] = []
|
|
115
|
-
nubBy eq (x:xs) = x : nubBy eq (filter (\\y -> not (eq x y)) xs)
|
|
116
|
-
unionBy :: (a -> a -> Bool) -> [a] -> [a] -> [a]
|
|
117
|
-
unionBy eq xs ys = xs ++ deleteFirstsBy eq (nubBy eq ys) xs
|
|
118
|
-
intersect :: (Eq a) => [a] -> [a] -> [a]
|
|
119
|
-
intersect xs ys = intersectBy (==) xs ys
|
|
120
|
-
intersectBy :: (a -> a -> Bool) -> [a] -> [a] -> [a]
|
|
121
|
-
intersectBy eq xs ys = [x | x <- xs, any (eq x) ys]
|
|
122
|
-
elem :: (Eq a) => a -> [a] -> Bool
|
|
123
|
-
notElem :: (Eq a) => a -> [a] -> Bool
|
|
124
|
-
elem x xs = any (\\y -> y == x) xs
|
|
125
|
-
notElem x xs = all (\\y -> y /= x) xs
|
|
126
|
-
maximum :: (Ord a) => [a] -> a
|
|
127
|
-
minimum :: (Ord a) => [a] -> a
|
|
128
|
-
maximum [] = error "Prelude.maximum: empty list"
|
|
129
|
-
maximum xs = foldl1 max xs
|
|
130
|
-
minimum [] = error "Prelude.minimum: empty list"
|
|
131
|
-
minimum xs = foldl1 min xs
|
|
132
|
-
sum :: (Num a) => [a] -> a
|
|
133
|
-
product :: (Num a) => [a] -> a
|
|
134
|
-
sum xs = foldl (+) 0 xs
|
|
135
|
-
product xs = foldl (*) 1 xs
|
|
136
|
-
concat :: [[a]] -> [a]
|
|
137
|
-
concat xss = foldr (++) [] xss
|
|
138
|
-
concatMap :: (a -> [b]) -> [a] -> [b]
|
|
139
|
-
concatMap f xs = (concat . map) f xs
|
|
140
|
-
take :: Int -> [a] -> [a]
|
|
141
|
-
take n _ | n <= 0 = []
|
|
142
|
-
take _ [] = []
|
|
143
|
-
take n (x:xs) = x : take (n - 1) xs
|
|
144
|
-
drop :: Int -> [a] -> [a]
|
|
145
|
-
drop n xs | n <= 0 = xs
|
|
146
|
-
drop _ [] = []
|
|
147
|
-
drop n (_:xs) = drop (n - 1) xs
|
|
148
|
-
head :: [a] -> a
|
|
149
|
-
head (x:_) = x
|
|
150
|
-
head [] = error "Prelude.head: empty list"
|
|
151
|
-
tail :: [a] -> [a]
|
|
152
|
-
tail (_:xs) = xs
|
|
153
|
-
tail [] = error "Prelude.tail: empty list"
|
|
154
|
-
last :: [a] -> a
|
|
155
|
-
last [x] = x
|
|
156
|
-
last (_:xs) = last xs
|
|
157
|
-
last [] = error "Prelude.last: empty list"
|
|
158
|
-
init :: [a] -> [a]
|
|
159
|
-
init [x] = []
|
|
160
|
-
init (x:xs) = x : init xs
|
|
161
|
-
init [] = error "Prelude.init: empty list"
|
|
162
|
-
zip :: [a] -> [b] -> [(a, b)]
|
|
163
|
-
zip xs ys = zipWith (,) xs ys
|
|
164
|
-
zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
|
|
165
|
-
zipWith z (a:as) (b:bs) = z a b : zipWith z as bs
|
|
166
|
-
zipWith _ _ _ = []
|
|
167
|
-
reverse :: [a] -> [a]
|
|
168
|
-
reverse xs = foldl (flip (:)) [] xs
|
|
169
|
-
filter :: (a -> Bool) -> [a] -> [a]
|
|
170
|
-
filter p [] = []
|
|
171
|
-
filter p (x:xs) | p x = x : filter p xs | otherwise = filter p xs
|
|
172
|
-
map :: (a -> b) -> [a] -> [b]
|
|
173
|
-
map f [] = []
|
|
174
|
-
map f (x:xs) = f x : map f xs
|
|
175
|
-
any :: (a -> Bool) -> [a] -> Bool
|
|
176
|
-
any f [] = False
|
|
177
|
-
any f (x:xs) = f x || any f xs
|
|
178
|
-
all :: (a -> Bool) -> [a] -> Bool
|
|
179
|
-
all f [] = True
|
|
180
|
-
all f (x:xs) = f x && all f xs
|
|
181
|
-
foldl :: (a -> b -> a) -> a -> [b] -> a
|
|
182
|
-
foldl f z [] = z
|
|
183
|
-
foldl f z (x:xs) = foldl f (f z x) xs
|
|
184
|
-
foldl1 :: (a -> a -> a) -> [a] -> a
|
|
185
|
-
foldl1 f (x:xs) = foldl f x xs
|
|
186
|
-
foldl1 _ [] = error "Prelude.foldl1: empty list"
|
|
187
|
-
foldr :: (a -> b -> b) -> b -> [a] -> b
|
|
188
|
-
foldr f z [] = z
|
|
189
|
-
foldr f z (x:xs) = f x (foldr f z xs)
|
|
190
|
-
foldr1 :: (a -> a -> a) -> [a] -> a
|
|
191
|
-
foldr1 f [x] = x
|
|
192
|
-
foldr1 f (x:xs) = f x (foldr1 f xs)
|
|
193
|
-
foldr1 _ [] = error "Prelude.foldr1: empty list"
|
|
194
|
-
find :: Ord a => (a -> Bool) -> [a] -> Maybe a
|
|
195
|
-
find _ [] = Nothing
|
|
196
|
-
find f (x:xs) | f x = Just x | otherwise = find f xs
|
|
197
|
-
sort :: (Ord a) => [a] -> [a]
|
|
198
|
-
sort xs = sortBy compare xs
|
|
199
|
-
sortBy :: (a -> a -> Ordering) -> [a] -> [a]
|
|
200
|
-
sortBy cmp xs = foldr (insertBy cmp) [] xs
|
|
201
|
-
compare :: Ord a => a -> a -> Ordering
|
|
202
|
-
compare x y | x == y = EQ | x <= y = LT | otherwise = GT
|
|
203
|
-
insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]
|
|
204
|
-
insertBy cmp x [] = [x]
|
|
205
|
-
insertBy cmp x ys@(y:ys') = case cmp x y of { GT -> y : insertBy cmp x ys'; _ -> x : ys }
|
|
206
|
-
flip :: (a -> b -> c) -> b -> a -> c
|
|
207
|
-
flip f x y = f y x
|
|
208
|
-
repeat :: a -> [a]
|
|
209
|
-
repeat x = x : (repeat x)
|
|
210
|
-
iterate :: (a -> a) -> a -> [a]
|
|
211
|
-
iterate f x = x : iterate f (f x)
|
|
212
|
-
replicate :: Int -> a -> [a]
|
|
213
|
-
replicate n x = take n (repeat x)
|
|
214
|
-
cycle :: [a] -> [a]
|
|
215
|
-
cycle [] = error "Prelude.cycle: empty list"
|
|
216
|
-
cycle xs = xs ++ (cycle xs)
|
|
217
|
-
fst :: (a,b) -> a
|
|
218
|
-
fst (x,_) = x
|
|
219
|
-
snd :: (a,b) -> b
|
|
220
|
-
snd (_,y) = y
|
|
221
|
-
between :: Ord a => a -> a -> a -> Bool
|
|
222
|
-
between m n p | n >= m && n <= p = True | otherwise = False
|
|
223
|
-
truncate :: (Num a, Integral b) => a -> b
|
|
224
|
-
truncate x = quot x 1
|
|
225
|
-
floor :: (Num a, Integral b) => a -> b
|
|
226
|
-
floor x = div x 1
|
|
227
|
-
negate :: Num a => a -> a
|
|
228
|
-
negate n = 0 - n
|
|
229
|
-
ceiling :: (Num a, Integral b) => a -> b
|
|
230
|
-
ceiling x = negate (floor (negate x))
|
|
231
|
-
round :: (Num a, Integral b) => a -> b
|
|
232
|
-
round x | r < 0.5 = n | r > 0.5 = n + 1 | even n = n | otherwise = n + 1 where { n = floor x; r = x - n }
|
|
233
|
-
dropWhile :: (a -> Bool) -> [a] -> [a]
|
|
234
|
-
dropWhile _ [] = []
|
|
235
|
-
dropWhile p xs@(x:xs') | p x = dropWhile p xs' | otherwise = xs
|
|
236
|
-
break :: (a -> Bool) -> [a] -> ([a], [a])
|
|
237
|
-
break _ [] = ([], [])
|
|
238
|
-
break p (x:xs) | p x = ([], x:xs) | otherwise = (x : fst (break p xs), snd (break p xs))
|
|
239
|
-
words :: String -> [String]
|
|
240
|
-
words s = let { sTrim = dropWhile (\\c -> c == ' ') s } in if null sTrim then [] else fst (break (\\c -> c == ' ') sTrim) : words (snd (break (\\c -> c == ' ') sTrim))
|
|
241
|
-
intersperse :: a -> [a] -> [a]
|
|
242
|
-
intersperse _ [] = []
|
|
243
|
-
intersperse _ [x] = [x]
|
|
244
|
-
intersperse sep (x:xs) = x : sep : intersperse sep xs
|
|
245
|
-
intercalate :: [a] -> [[a]] -> [a]
|
|
246
|
-
intercalate xs xss = concat (intersperse xs xss)
|
|
247
|
-
fromIntegral :: (Integral a, Num b) => a -> b
|
|
248
|
-
fromIntegral x = x
|
|
249
|
-
|
|
250
|
-
anyException = ""
|
|
251
|
-
evaluate x = x
|
|
252
|
-
|
|
253
|
-
class Show a where
|
|
254
|
-
show :: a -> String
|
|
255
|
-
|
|
256
|
-
instance Show Int where
|
|
257
|
-
show x = primShow x
|
|
258
|
-
|
|
259
|
-
instance Show Bool where
|
|
260
|
-
show True = "True"
|
|
261
|
-
show False = "False"
|
|
262
|
-
|
|
263
|
-
instance Show Ordering where
|
|
264
|
-
show LT = "LT"
|
|
265
|
-
show EQ = "EQ"
|
|
266
|
-
show GT = "GT"
|
|
267
|
-
|
|
268
|
-
instance Show (Maybe a) where
|
|
269
|
-
show Nothing = "Nothing"
|
|
270
|
-
show (Just x) = "Just " ++ show x
|
|
271
|
-
|
|
272
|
-
instance Show Char where
|
|
273
|
-
show c = '\\'' : c : '\\'' : []
|
|
274
|
-
|
|
275
|
-
instance Show String where
|
|
276
|
-
show s = primShowString s
|
|
277
|
-
|
|
278
|
-
instance Show [a] where
|
|
279
|
-
show xs = '[' : (intercalate "," (map show xs) ++ "]")
|
|
1
|
+
export const preludeCode = `data Ordering = LT | EQ | GT
|
|
2
|
+
data Maybe a = Nothing | Just a
|
|
3
|
+
id :: a -> a
|
|
4
|
+
id x = x
|
|
5
|
+
const :: a -> b -> a
|
|
6
|
+
const x _ = x
|
|
7
|
+
(,) :: a -> b -> (a, b)
|
|
8
|
+
(,) x y = (x, y)
|
|
9
|
+
($) :: (a -> b) -> a -> b
|
|
10
|
+
($) f x = f x
|
|
11
|
+
($!) :: (a -> b) -> a -> b
|
|
12
|
+
($!) f x = f x
|
|
13
|
+
(.) :: (b -> c) -> (a -> b) -> a -> c
|
|
14
|
+
(.) f g a = (\\x -> f (g x)) a
|
|
15
|
+
(:) :: a -> [a] -> [a]
|
|
16
|
+
(:) x xs = x : xs
|
|
17
|
+
(++) :: [a] -> [a] -> [a]
|
|
18
|
+
(++) [] ys = ys
|
|
19
|
+
(++) (x:xs) ys = x : (xs ++ ys)
|
|
20
|
+
(&&) :: Bool -> Bool -> Bool
|
|
21
|
+
(||) :: Bool -> Bool -> Bool
|
|
22
|
+
(&&) x y = x && y
|
|
23
|
+
(||) x y = x || y
|
|
24
|
+
(==) :: (Ord a) => a -> a -> Boolean
|
|
25
|
+
(==) x y = x == y
|
|
26
|
+
(/=) :: (Ord a) => a -> a -> Boolean
|
|
27
|
+
(/=) x y = x /= y
|
|
28
|
+
(<) :: (Ord a) => a -> a -> Boolean
|
|
29
|
+
(<) x y = x < y
|
|
30
|
+
(>) :: (Ord a) => a -> a -> Boolean
|
|
31
|
+
(>) x y = x > y
|
|
32
|
+
(<=) :: (Ord a) => a -> a -> Boolean
|
|
33
|
+
(<=) x y = x <= y
|
|
34
|
+
(>=) :: (Ord a) => a -> a -> Boolean
|
|
35
|
+
(>=) x y = x >= y
|
|
36
|
+
(+) :: Num a => a -> a -> a
|
|
37
|
+
(-) :: Num a => a -> a -> a
|
|
38
|
+
(+) x y = x + y
|
|
39
|
+
(-) x y = x - y
|
|
40
|
+
(**) :: (Floating a) => a -> a -> a
|
|
41
|
+
(**) x y = x ** y
|
|
42
|
+
(^) :: (Num a, Integral b) => a -> b -> a
|
|
43
|
+
(^) x y = x ^ y
|
|
44
|
+
(^^) :: (Fractional a, Integral b) => a -> b -> a
|
|
45
|
+
(^^) x y = x ^^ y
|
|
46
|
+
(*) :: (Num a) => a -> a -> a
|
|
47
|
+
(*) x y = x * y
|
|
48
|
+
(/) :: Fractional a => a -> a -> a
|
|
49
|
+
(/) _ 0 = error "Prelude./: divide by zero"
|
|
50
|
+
(/) x y = x / y
|
|
51
|
+
(!!) :: [a] -> Int -> a
|
|
52
|
+
(!!) xs n | n < 0 = error "Prelude.!!: negative index"
|
|
53
|
+
(!!) [] _ = error "Prelude.!!: index too large"
|
|
54
|
+
(!!) (x:_) 0 = x
|
|
55
|
+
(!!) (_:xs) n = xs !! (n - 1)
|
|
56
|
+
not :: Bool -> Bool
|
|
57
|
+
not True = False
|
|
58
|
+
not False = True
|
|
59
|
+
quot :: Integral a => a -> a -> a
|
|
60
|
+
quot _ 0 = error "divide by zero"
|
|
61
|
+
quot 0 _ = 0
|
|
62
|
+
quot a b = let { absA = abs a; absB = abs b; result = quotPositive absA absB } in if (a < 0) == (b < 0) then result else -result
|
|
63
|
+
rem :: Integral a => a -> a -> a
|
|
64
|
+
rem _ 0 = error "divide by zero"
|
|
65
|
+
rem 0 _ = 0
|
|
66
|
+
rem a b = let { absA = abs a; absB = abs b; remainder = remPositive absA absB } in if a < 0 then -remainder else remainder
|
|
67
|
+
quotPositive :: Integral a => a -> a -> a
|
|
68
|
+
quotPositive n d | n < d = 0 | otherwise = 1 + quotPositive (n - d) d
|
|
69
|
+
remPositive :: Integral a => a -> a -> a
|
|
70
|
+
remPositive n d | n < d = n | otherwise = remPositive (n - d) d
|
|
71
|
+
div :: Integral a => a -> a -> a
|
|
72
|
+
div _ 0 = error "divide by zero"
|
|
73
|
+
div 0 _ = 0
|
|
74
|
+
div a b = let { q = quot a b; r = rem a b } in if r == 0 || (a < 0) == (b < 0) then q else q - 1
|
|
75
|
+
mod :: Integral a => a -> a -> a
|
|
76
|
+
mod _ 0 = error "divide by zero"
|
|
77
|
+
mod 0 _ = 0
|
|
78
|
+
mod a b = a - (div a b) * b
|
|
79
|
+
signum :: (Num a) => a -> a
|
|
80
|
+
signum x | x == 0 = 0 | x > 0 = 1 | otherwise = -1
|
|
81
|
+
abs :: (Num a) => a -> a
|
|
82
|
+
abs n = if n < 0 then -n else n
|
|
83
|
+
succ :: (Num a) => a -> a
|
|
84
|
+
succ x = x + 1
|
|
85
|
+
pred :: (Num a) => a -> a
|
|
86
|
+
pred x = x - 1
|
|
87
|
+
sqrt :: (Num a) => a -> a
|
|
88
|
+
sqrt x = x ** 0.5
|
|
89
|
+
max :: Ord a => a -> a -> a
|
|
90
|
+
max x y = if x <= y then y else x
|
|
91
|
+
min :: Ord a => a -> a -> a
|
|
92
|
+
min x y = if x <= y then x else y
|
|
93
|
+
even :: (Integral a) => a -> Bool
|
|
94
|
+
odd :: (Integral a) => a -> Bool
|
|
95
|
+
even n = n \`rem\` 2 == 0
|
|
96
|
+
odd n = (not . even) n
|
|
97
|
+
length :: [a] -> Int
|
|
98
|
+
length [] = 0
|
|
99
|
+
length (_:l) = 1 + length l
|
|
100
|
+
genericLength :: (Integral a) => [b] -> a
|
|
101
|
+
genericLength [] = 0
|
|
102
|
+
genericLength (x:xs) = 1 + genericLength xs
|
|
103
|
+
null :: [a] -> Bool
|
|
104
|
+
null [] = True
|
|
105
|
+
null (_:_) = False
|
|
106
|
+
union :: (Eq a) => [a] -> [a] -> [a]
|
|
107
|
+
union xs ys = unionBy (==) xs ys
|
|
108
|
+
deleteBy :: (a -> a -> Bool) -> a -> [a] -> [a]
|
|
109
|
+
deleteBy eq x [] = []
|
|
110
|
+
deleteBy eq x (y:ys) = if x \`eq\` y then ys else y : deleteBy eq x ys
|
|
111
|
+
deleteFirstsBy :: (a -> a -> Bool) -> [a] -> [a] -> [a]
|
|
112
|
+
deleteFirstsBy eq xs ys = foldl (flip (deleteBy eq)) xs ys
|
|
113
|
+
nubBy :: (a -> a -> Bool) -> [a] -> [a]
|
|
114
|
+
nubBy eq [] = []
|
|
115
|
+
nubBy eq (x:xs) = x : nubBy eq (filter (\\y -> not (eq x y)) xs)
|
|
116
|
+
unionBy :: (a -> a -> Bool) -> [a] -> [a] -> [a]
|
|
117
|
+
unionBy eq xs ys = xs ++ deleteFirstsBy eq (nubBy eq ys) xs
|
|
118
|
+
intersect :: (Eq a) => [a] -> [a] -> [a]
|
|
119
|
+
intersect xs ys = intersectBy (==) xs ys
|
|
120
|
+
intersectBy :: (a -> a -> Bool) -> [a] -> [a] -> [a]
|
|
121
|
+
intersectBy eq xs ys = [x | x <- xs, any (eq x) ys]
|
|
122
|
+
elem :: (Eq a) => a -> [a] -> Bool
|
|
123
|
+
notElem :: (Eq a) => a -> [a] -> Bool
|
|
124
|
+
elem x xs = any (\\y -> y == x) xs
|
|
125
|
+
notElem x xs = all (\\y -> y /= x) xs
|
|
126
|
+
maximum :: (Ord a) => [a] -> a
|
|
127
|
+
minimum :: (Ord a) => [a] -> a
|
|
128
|
+
maximum [] = error "Prelude.maximum: empty list"
|
|
129
|
+
maximum xs = foldl1 max xs
|
|
130
|
+
minimum [] = error "Prelude.minimum: empty list"
|
|
131
|
+
minimum xs = foldl1 min xs
|
|
132
|
+
sum :: (Num a) => [a] -> a
|
|
133
|
+
product :: (Num a) => [a] -> a
|
|
134
|
+
sum xs = foldl (+) 0 xs
|
|
135
|
+
product xs = foldl (*) 1 xs
|
|
136
|
+
concat :: [[a]] -> [a]
|
|
137
|
+
concat xss = foldr (++) [] xss
|
|
138
|
+
concatMap :: (a -> [b]) -> [a] -> [b]
|
|
139
|
+
concatMap f xs = (concat . map) f xs
|
|
140
|
+
take :: Int -> [a] -> [a]
|
|
141
|
+
take n _ | n <= 0 = []
|
|
142
|
+
take _ [] = []
|
|
143
|
+
take n (x:xs) = x : take (n - 1) xs
|
|
144
|
+
drop :: Int -> [a] -> [a]
|
|
145
|
+
drop n xs | n <= 0 = xs
|
|
146
|
+
drop _ [] = []
|
|
147
|
+
drop n (_:xs) = drop (n - 1) xs
|
|
148
|
+
head :: [a] -> a
|
|
149
|
+
head (x:_) = x
|
|
150
|
+
head [] = error "Prelude.head: empty list"
|
|
151
|
+
tail :: [a] -> [a]
|
|
152
|
+
tail (_:xs) = xs
|
|
153
|
+
tail [] = error "Prelude.tail: empty list"
|
|
154
|
+
last :: [a] -> a
|
|
155
|
+
last [x] = x
|
|
156
|
+
last (_:xs) = last xs
|
|
157
|
+
last [] = error "Prelude.last: empty list"
|
|
158
|
+
init :: [a] -> [a]
|
|
159
|
+
init [x] = []
|
|
160
|
+
init (x:xs) = x : init xs
|
|
161
|
+
init [] = error "Prelude.init: empty list"
|
|
162
|
+
zip :: [a] -> [b] -> [(a, b)]
|
|
163
|
+
zip xs ys = zipWith (,) xs ys
|
|
164
|
+
zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
|
|
165
|
+
zipWith z (a:as) (b:bs) = z a b : zipWith z as bs
|
|
166
|
+
zipWith _ _ _ = []
|
|
167
|
+
reverse :: [a] -> [a]
|
|
168
|
+
reverse xs = foldl (flip (:)) [] xs
|
|
169
|
+
filter :: (a -> Bool) -> [a] -> [a]
|
|
170
|
+
filter p [] = []
|
|
171
|
+
filter p (x:xs) | p x = x : filter p xs | otherwise = filter p xs
|
|
172
|
+
map :: (a -> b) -> [a] -> [b]
|
|
173
|
+
map f [] = []
|
|
174
|
+
map f (x:xs) = f x : map f xs
|
|
175
|
+
any :: (a -> Bool) -> [a] -> Bool
|
|
176
|
+
any f [] = False
|
|
177
|
+
any f (x:xs) = f x || any f xs
|
|
178
|
+
all :: (a -> Bool) -> [a] -> Bool
|
|
179
|
+
all f [] = True
|
|
180
|
+
all f (x:xs) = f x && all f xs
|
|
181
|
+
foldl :: (a -> b -> a) -> a -> [b] -> a
|
|
182
|
+
foldl f z [] = z
|
|
183
|
+
foldl f z (x:xs) = foldl f (f z x) xs
|
|
184
|
+
foldl1 :: (a -> a -> a) -> [a] -> a
|
|
185
|
+
foldl1 f (x:xs) = foldl f x xs
|
|
186
|
+
foldl1 _ [] = error "Prelude.foldl1: empty list"
|
|
187
|
+
foldr :: (a -> b -> b) -> b -> [a] -> b
|
|
188
|
+
foldr f z [] = z
|
|
189
|
+
foldr f z (x:xs) = f x (foldr f z xs)
|
|
190
|
+
foldr1 :: (a -> a -> a) -> [a] -> a
|
|
191
|
+
foldr1 f [x] = x
|
|
192
|
+
foldr1 f (x:xs) = f x (foldr1 f xs)
|
|
193
|
+
foldr1 _ [] = error "Prelude.foldr1: empty list"
|
|
194
|
+
find :: Ord a => (a -> Bool) -> [a] -> Maybe a
|
|
195
|
+
find _ [] = Nothing
|
|
196
|
+
find f (x:xs) | f x = Just x | otherwise = find f xs
|
|
197
|
+
sort :: (Ord a) => [a] -> [a]
|
|
198
|
+
sort xs = sortBy compare xs
|
|
199
|
+
sortBy :: (a -> a -> Ordering) -> [a] -> [a]
|
|
200
|
+
sortBy cmp xs = foldr (insertBy cmp) [] xs
|
|
201
|
+
compare :: Ord a => a -> a -> Ordering
|
|
202
|
+
compare x y | x == y = EQ | x <= y = LT | otherwise = GT
|
|
203
|
+
insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]
|
|
204
|
+
insertBy cmp x [] = [x]
|
|
205
|
+
insertBy cmp x ys@(y:ys') = case cmp x y of { GT -> y : insertBy cmp x ys'; _ -> x : ys }
|
|
206
|
+
flip :: (a -> b -> c) -> b -> a -> c
|
|
207
|
+
flip f x y = f y x
|
|
208
|
+
repeat :: a -> [a]
|
|
209
|
+
repeat x = x : (repeat x)
|
|
210
|
+
iterate :: (a -> a) -> a -> [a]
|
|
211
|
+
iterate f x = x : iterate f (f x)
|
|
212
|
+
replicate :: Int -> a -> [a]
|
|
213
|
+
replicate n x = take n (repeat x)
|
|
214
|
+
cycle :: [a] -> [a]
|
|
215
|
+
cycle [] = error "Prelude.cycle: empty list"
|
|
216
|
+
cycle xs = xs ++ (cycle xs)
|
|
217
|
+
fst :: (a,b) -> a
|
|
218
|
+
fst (x,_) = x
|
|
219
|
+
snd :: (a,b) -> b
|
|
220
|
+
snd (_,y) = y
|
|
221
|
+
between :: Ord a => a -> a -> a -> Bool
|
|
222
|
+
between m n p | n >= m && n <= p = True | otherwise = False
|
|
223
|
+
truncate :: (Num a, Integral b) => a -> b
|
|
224
|
+
truncate x = quot x 1
|
|
225
|
+
floor :: (Num a, Integral b) => a -> b
|
|
226
|
+
floor x = div x 1
|
|
227
|
+
negate :: Num a => a -> a
|
|
228
|
+
negate n = 0 - n
|
|
229
|
+
ceiling :: (Num a, Integral b) => a -> b
|
|
230
|
+
ceiling x = negate (floor (negate x))
|
|
231
|
+
round :: (Num a, Integral b) => a -> b
|
|
232
|
+
round x | r < 0.5 = n | r > 0.5 = n + 1 | even n = n | otherwise = n + 1 where { n = floor x; r = x - n }
|
|
233
|
+
dropWhile :: (a -> Bool) -> [a] -> [a]
|
|
234
|
+
dropWhile _ [] = []
|
|
235
|
+
dropWhile p xs@(x:xs') | p x = dropWhile p xs' | otherwise = xs
|
|
236
|
+
break :: (a -> Bool) -> [a] -> ([a], [a])
|
|
237
|
+
break _ [] = ([], [])
|
|
238
|
+
break p (x:xs) | p x = ([], x:xs) | otherwise = (x : fst (break p xs), snd (break p xs))
|
|
239
|
+
words :: String -> [String]
|
|
240
|
+
words s = let { sTrim = dropWhile (\\c -> c == ' ') s } in if null sTrim then [] else fst (break (\\c -> c == ' ') sTrim) : words (snd (break (\\c -> c == ' ') sTrim))
|
|
241
|
+
intersperse :: a -> [a] -> [a]
|
|
242
|
+
intersperse _ [] = []
|
|
243
|
+
intersperse _ [x] = [x]
|
|
244
|
+
intersperse sep (x:xs) = x : sep : intersperse sep xs
|
|
245
|
+
intercalate :: [a] -> [[a]] -> [a]
|
|
246
|
+
intercalate xs xss = concat (intersperse xs xss)
|
|
247
|
+
fromIntegral :: (Integral a, Num b) => a -> b
|
|
248
|
+
fromIntegral x = x
|
|
249
|
+
|
|
250
|
+
anyException = ""
|
|
251
|
+
evaluate x = x
|
|
252
|
+
|
|
253
|
+
class Show a where
|
|
254
|
+
show :: a -> String
|
|
255
|
+
|
|
256
|
+
instance Show Int where
|
|
257
|
+
show x = primShow x
|
|
258
|
+
|
|
259
|
+
instance Show Bool where
|
|
260
|
+
show True = "True"
|
|
261
|
+
show False = "False"
|
|
262
|
+
|
|
263
|
+
instance Show Ordering where
|
|
264
|
+
show LT = "LT"
|
|
265
|
+
show EQ = "EQ"
|
|
266
|
+
show GT = "GT"
|
|
267
|
+
|
|
268
|
+
instance Show (Maybe a) where
|
|
269
|
+
show Nothing = "Nothing"
|
|
270
|
+
show (Just x) = "Just " ++ show x
|
|
271
|
+
|
|
272
|
+
instance Show Char where
|
|
273
|
+
show c = '\\'' : c : '\\'' : []
|
|
274
|
+
|
|
275
|
+
instance Show String where
|
|
276
|
+
show s = primShowString s
|
|
277
|
+
|
|
278
|
+
instance Show [a] where
|
|
279
|
+
show xs = '[' : (intercalate "," (map show xs) ++ "]")
|
|
280
280
|
`;
|
|
281
281
|
//# sourceMappingURL=prelude.js.map
|
|
@@ -7,6 +7,7 @@ export declare class DeclarationCollectorVisitor implements Visitor<void> {
|
|
|
7
7
|
private recordMap;
|
|
8
8
|
private signatureMap;
|
|
9
9
|
private coreHM;
|
|
10
|
+
private builder;
|
|
10
11
|
constructor(errors: string[], typeAliasMap: Map<string, Type>, recordMap: Map<string, Type>, signatureMap: Map<string, TypeScheme>, coreHM: CoreHM);
|
|
11
12
|
visitTypeAlias(node: TypeAlias): void;
|
|
12
13
|
visitRecord(node: Record): void;
|
|
@@ -17,4 +18,5 @@ export declare class DeclarationCollectorVisitor implements Visitor<void> {
|
|
|
17
18
|
visitTest(node: Test): void;
|
|
18
19
|
visitAssert(node: Assert): void;
|
|
19
20
|
visit(node: ASTNode): void;
|
|
21
|
+
fallback(node: ASTNode): void;
|
|
20
22
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { SimpleType, ListType, } from "yukigo-ast";
|
|
2
2
|
import { functionType, } from "./checker.js";
|
|
3
|
-
import { CoreHM } from "./core.js";
|
|
4
3
|
import { TypeBuilder } from "./TypeBuilder.js";
|
|
5
4
|
import { typeMappings } from "../utils/types.js";
|
|
6
|
-
const builder = new TypeBuilder(new CoreHM());
|
|
7
5
|
export class DeclarationCollectorVisitor {
|
|
8
6
|
errors;
|
|
9
7
|
typeAliasMap;
|
|
10
8
|
recordMap;
|
|
11
9
|
signatureMap;
|
|
12
10
|
coreHM;
|
|
11
|
+
builder;
|
|
13
12
|
constructor(errors, typeAliasMap, recordMap, signatureMap, coreHM) {
|
|
14
13
|
this.errors = errors;
|
|
15
14
|
this.typeAliasMap = typeAliasMap;
|
|
16
15
|
this.recordMap = recordMap;
|
|
17
16
|
this.signatureMap = signatureMap;
|
|
18
17
|
this.coreHM = coreHM;
|
|
18
|
+
this.builder = new TypeBuilder(this.coreHM);
|
|
19
19
|
}
|
|
20
20
|
visitTypeAlias(node) {
|
|
21
21
|
const typeAliasIdentifier = node.identifier.value;
|
|
@@ -24,7 +24,7 @@ export class DeclarationCollectorVisitor {
|
|
|
24
24
|
this.errors.push(`Multiple declaration of '${typeAliasIdentifier}'.`);
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
-
const { type, constraints } = builder.build(node.value);
|
|
27
|
+
const { type, constraints } = this.builder.build(node.value);
|
|
28
28
|
this.typeAliasMap.set(typeAliasIdentifier, type);
|
|
29
29
|
}
|
|
30
30
|
visitRecord(node) {
|
|
@@ -47,7 +47,7 @@ export class DeclarationCollectorVisitor {
|
|
|
47
47
|
this.errors.push(`Constructor '${cons.name}' is already defined`);
|
|
48
48
|
continue;
|
|
49
49
|
}
|
|
50
|
-
const paramTypes = cons.fields.map((field) => builder.build(field.value));
|
|
50
|
+
const paramTypes = cons.fields.map((field) => this.builder.build(field.value));
|
|
51
51
|
const returnType = {
|
|
52
52
|
type: "TypeConstructor",
|
|
53
53
|
name: recordIdentifier,
|
|
@@ -94,7 +94,7 @@ export class DeclarationCollectorVisitor {
|
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
96
|
const typeVarMap = new Map();
|
|
97
|
-
const { type, constraints } = builder.build(node.body, typeVarMap);
|
|
97
|
+
const { type, constraints } = this.builder.build(node.body, typeVarMap);
|
|
98
98
|
const quantifiers = Array.from(typeVarMap.values()).map((tv) => tv.id);
|
|
99
99
|
this.signatureMap.set(functionName, {
|
|
100
100
|
type: "TypeScheme",
|
|
@@ -115,5 +115,6 @@ export class DeclarationCollectorVisitor {
|
|
|
115
115
|
visit(node) {
|
|
116
116
|
node.accept(this);
|
|
117
117
|
}
|
|
118
|
+
fallback(node) { }
|
|
118
119
|
}
|
|
119
120
|
//# sourceMappingURL=DeclarationCollector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeclarationCollector.js","sourceRoot":"","sources":["../../src/typechecker/DeclarationCollector.ts"],"names":[],"mappings":"AAAA,OAAO,EAaL,UAAU,EACV,QAAQ,GACT,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,YAAY,GAKb,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"DeclarationCollector.js","sourceRoot":"","sources":["../../src/typechecker/DeclarationCollector.ts"],"names":[],"mappings":"AAAA,OAAO,EAaL,UAAU,EACV,QAAQ,GACT,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,YAAY,GAKb,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,OAAO,2BAA2B;IAI5B;IACA;IACA;IACA;IACA;IAPF,OAAO,CAAc;IAE7B,YACU,MAAgB,EAChB,YAA+B,EAC/B,SAA4B,EAC5B,YAAqC,EACrC,MAAc;QAJd,WAAM,GAAN,MAAM,CAAU;QAChB,iBAAY,GAAZ,YAAY,CAAmB;QAC/B,cAAS,GAAT,SAAS,CAAmB;QAC5B,iBAAY,GAAZ,YAAY,CAAyB;QACrC,WAAM,GAAN,MAAM,CAAQ;QAEtB,IAAI,CAAC,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC9C,CAAC;I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