hkust-taco / mlscript

The MLscript programming language. Functional and object-oriented; structurally typed and sound; with powerful type inference. Soon to have full interop with TypeScript!
https://hkust-taco.github.io/mlscript
MIT License
175 stars 27 forks source link

Module Methods #233

Closed FlandiaYingman closed 1 week ago

FlandiaYingman commented 3 weeks ago

Module methods are the methods defined within a module. Module parameters are function parameters that are prefixed with module keyword. Module values are module literals or applications of functions returning modules.

Rules

LPTK commented 1 week ago

So is this ready for review? (BTW pls read https://github.com/hkust-taco/mlscript/blob/mlscript/CONTRIBUTING.md, if you haven't)

Please notify me once you're addressed all our discussions and updated your branch. Also, why not check your TODOs in https://github.com/hkust-taco/mlscript/pull/233#issue-2646388927?

FlandiaYingman commented 1 week ago

@LPTK

Things are getting messy as we come up with new ideas and rules and changing previous ones. I'm trying to refactor the code to ensure everything looks good and concise. That TODO list was intended to track the new rules that have been refactored.

This PR should be ready for review by tonight. I'll notify you when I'm done. 🫡

LPTK commented 1 week ago

Ok sure, no worries!

FlandiaYingman commented 1 week ago

@LPTK Everything's done! I

so now only Tree.scala will parse the Tree as the single truth

LPTK commented 1 week ago
  • fixed (maybe) a bug that our parser didn't pick up result types from generic functions (c874fe3, hope that's not intended)

Thanks, this was clearly a typo in the original code.

@LPTK Everything's done!

Actually you also need to update the branch and fix its conflicts with the main branch. If you choose to rebase, pls make sure that the tests still work on each individual commit: git rebase -i --exec "sbtn hkmc2JVM/test". If you don't rebase and have a dirty history, we can later squash all commits together when merging.