Commit graph

87 commits

Author SHA1 Message Date
sebastianselander
8d1330ad42 typechecker is compatible with one extra addition to the spec 2023-03-23 11:13:48 +01:00
sebastian
3335ab7a57 compatible, EId rule for parsing is not working, testing not done yet 2023-03-22 21:26:14 +01:00
sebastianselander
914855e20f working on adapting the typechecker 2023-03-22 17:52:39 +01:00
sebastianselander
936cb1301f new grammar and adapted renamer 2023-03-22 12:45:51 +01:00
sebastianselander
88a4a934b8 added more manual tests 2023-03-22 10:32:22 +01:00
sebastianselander
24007313cb added shadowing for ECase in Renamer 2023-03-22 10:10:11 +01:00
sebastian
33b69a1895 Improved formatting 2023-03-21 22:07:21 +01:00
sebastian
57fe8cd0a6 Fixed larger bug
where pattern matching on `Just a` with type `Maybe b` could be used for
 any type.
2023-03-21 22:02:28 +01:00
sebastianselander
509de4415e progress on fixing bugs 2023-03-21 17:09:03 +01:00
sebastian
3026a96eb7 added todo for class 2023-03-21 14:51:06 +01:00
sebastian
4c015a4aac initial pattern matching implementation. should be somewhat correct 2023-03-21 14:33:18 +01:00
sebastianselander
9cd2cdb511 continued work on pattern matching v2 2023-03-20 17:40:09 +01:00
sebastianselander
c3ea343d00 unified top level type with expression type 2023-03-10 16:54:29 +01:00
sebastian
62724964d7 fixed Maybe ('a -> 'a) bug. Pattern matching still wonky, will have to redo 2023-03-08 15:22:42 +01:00
sebastianselander
fce54e7899 documented possible bad functions 2023-03-06 16:41:59 +01:00
sebastianselander
eef6fa7668 added new test and found another bug 2023-03-06 16:25:03 +01:00
sebastianselander
6947614fba Updated bug list & started working on more tests 2023-03-06 13:04:07 +01:00
sebastianselander
f5b5f11903 fixed formatting 2023-03-06 11:38:25 +01:00
sebastianselander
9c2f52f8bb fixed bug where bound variable didn't exist in case 2023-03-06 11:27:17 +01:00
sebastianselander
778fec3dc4 Implemented potential fix for one of the bugs 2023-03-05 14:34:39 +01:00
sebastianselander
fe63fa6215 Improved error message and created document for known bugs. 2023-03-05 13:24:56 +01:00
sebastianselander
fecb71bc07 Found a bug. 2023-03-03 18:17:51 +01:00
sebastianselander
03d7080396 pattern matching works? have to test more 2023-03-03 11:46:54 +01:00
sebastian
7656b46e3f a bit more work on pattern match + case expr 2023-03-02 22:07:38 +01:00
sebastianselander
2401b6437b continued work pattern matching 2023-03-02 16:05:43 +01:00
sebastianselander
05313652f9 unit tests, started on pattern matching 2023-02-28 17:15:48 +01:00
Sebastian Selander
d23d417ff3
Update TypeChecker.hs 2023-02-27 19:38:45 +01:00
sebastianselander
bbf6e159c7 Type inference/checking on ADTs mostly complete(?). Still have to test 2023-02-27 17:22:42 +01:00
sebastianselander
2f45f39435 Incorporated most of main, as well as started on quickcheck 2023-02-27 11:12:05 +01:00
sebastianselander
06e65de235 started on a test suite 2023-02-23 11:54:35 +01:00
sebastianselander
5daa5573f2 Added more comments to the code 2023-02-22 15:24:38 +01:00
sebastianselander
8065576c31 Let has a bug, otherwise probably(?) done 2023-02-20 20:38:36 +01:00
sebastianselander
a98135827c EAdd is bugged. Mostly complete though. 2023-02-20 16:51:44 +01:00
sebastianselander
dfbdb6678e Working on non-ugly version of algorithm W (Hindley-Milner) 2023-02-20 12:09:31 +01:00
sebastianselander
420fb107f0 Commented code and fixed some bugs I think. Still not complete
id : Int -> Int
id x = x
does not type check
2023-02-19 15:25:49 +01:00
sebastianselander
db932048ba Tried fixing bug. Failed. 2023-02-19 02:10:57 +01:00
sebastianselander
8b5cd3cf9a Remade the algorithm myself. Still some bugs. 2023-02-18 23:08:27 +01:00
sebastianselander
f188cffb8d Unification part works (probably). Have a hard time understanding it. 2023-02-17 18:42:50 +01:00
sebastianselander
764faa582b Remove hls pragmas 2023-02-17 12:01:57 +01:00
sebastianselander
f2e8a02255 Removed adhoc tests 2023-02-17 12:01:22 +01:00
sebastianselander
a9f54dbca1 Simplified quite a bit. Made a unify function. Still bugs left 2023-02-17 11:09:48 +01:00
sebastianselander
eafe0fea0b Rewrote using unification-fd. Heavily inspired (aka copied) from:
https://byorgey.wordpress.com/2021/09/08/implementing-hindley-milner-with-the-unification-fd-library/
2023-02-16 16:37:36 +01:00
sebastianselander
f1b77a7efa Refactored. Cleaner version, ala Martin version 2023-02-15 19:52:52 +01:00
sebastianselander
b03df17e34 Minor changes. Added a comment 2023-02-15 18:10:28 +01:00
sebastianselander
7619e36c60 Inference works better now. Still work to do. Should use proper library 2023-02-15 17:40:18 +01:00
sebastianselander
ad3f6b7011 Attempt at fixing EApp, failed. 2023-02-14 22:35:00 +01:00
sebastianselander
5d247057f5 Minor rewrite of tc. Some bugs still left 2023-02-14 22:03:56 +01:00
sebastianselander
6218efac20 Renamer done.
It renames bound variables to numbers, converts let to lambda, and
removes all variables from binds
2023-02-14 16:44:38 +01:00
sebastianselander
53314551f5 A bit cleaner code. A renamer is the focus to make the tc simpler 2023-02-14 12:56:07 +01:00
sebastianselander
200a9e57ed Fixed EId, more work on other expressions needed 2023-02-14 10:12:38 +01:00