Skip to content
Draft
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
b5bdd5b
Basic adt typing and fix subst pol
NeilKleistGao May 20, 2025
e8d47a0
Support type parameters
NeilKleistGao May 21, 2025
37d6f63
Distinguish generic ctors from normal ones
NeilKleistGao May 22, 2025
921a079
WIP: Add pattern matching
NeilKleistGao May 22, 2025
75c2afd
Add docs
NeilKleistGao May 23, 2025
5850017
Merge branch 'hkmc2' into adt💬
LPTK May 27, 2025
929a49a
Deal with merge conflicts
chengluyu May 27, 2025
056e138
WIP from meeting
LPTK May 28, 2025
0c534f1
Add proper Unit type
LPTK May 28, 2025
a36c6d2
Elaborate example a bit
LPTK May 28, 2025
973afbc
Reject non-variable pattern args for now
NeilKleistGao May 28, 2025
8b259cf
WIP: Fix
NeilKleistGao May 28, 2025
37a60a3
WIP: Rerun test
NeilKleistGao May 29, 2025
0194f4d
Use mutable set for cache and have more test cases
NeilKleistGao May 29, 2025
7b77eef
Add more spaces for Paper example
NeilKleistGao May 29, 2025
8999fec
Add example test file
LPTK May 30, 2025
8febb63
Changes from meeting
LPTK May 30, 2025
36560d2
Fix missing cases
NeilKleistGao May 30, 2025
27038a7
W
LPTK May 30, 2025
94bf051
W
LPTK May 30, 2025
d0915ba
Merge remote-tracking branch 'NeilKleistGao/adt💬' into adt💬
LPTK May 30, 2025
096f282
Add pmsort
NeilKleistGao May 30, 2025
84f4712
Merge
NeilKleistGao May 30, 2025
b6ddcaf
Add a clean version
NeilKleistGao May 30, 2025
d318440
Remove difftests things for now
NeilKleistGao May 30, 2025
2783f5f
Add more examples
NeilKleistGao May 30, 2025
9f48b1e
Fix problems in ExamplesInResponse.mls
LPTK Jun 2, 2025
15e5fcb
Add equivalent sig
LPTK Jun 2, 2025
4fbb6ea
Port some examples from flix
NeilKleistGao Jun 6, 2025
8be7290
Port GUI example from flix
NeilKleistGao Jun 9, 2025
1a3b41d
Add extension examples
NeilKleistGao Jun 9, 2025
9ada6c8
Categorize examples and add more documentations
NeilKleistGao Jun 10, 2025
4e8a8a1
Add else type check
NeilKleistGao Jun 16, 2025
717a864
Merge
NeilKleistGao Jun 17, 2025
2788340
WIP: Add decl-site variance
NeilKleistGao Jun 17, 2025
c0198de
Add test for pat-mat
NeilKleistGao Jun 19, 2025
3c1abef
Changes from meeting + some older changes (start making the constrain…
LPTK Jun 24, 2025
60e27b3
Merge from hkmc2
NeilKleistGao Jun 25, 2025
cd6b77c
Rename
NeilKleistGao Jun 25, 2025
a5f3219
Make region targ covariant
NeilKleistGao Jul 3, 2025
afc5e74
Merge branch 'hkmc2' of github.com:hkust-taco/mlscript into adt💬
NeilKleistGao Jul 22, 2025
32a98c0
Add case study examples
NeilKleistGao Jul 23, 2025
3cd0c3a
WIP: Add codegen for constraint solver (without tests) and minor fix
NeilKleistGao Jul 24, 2025
9cb9f26
Some fix
NeilKleistGao Jul 25, 2025
4c6c366
Update web demo code
NeilKleistGao Jul 30, 2025
240a555
Add missing updates
NeilKleistGao Aug 20, 2025
522f9c1
Minor
NeilKleistGao Aug 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions hkmc2/shared/src/test/mlscript/bbml/GUI.mls
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
:bbml

:...
//│ ————————————————————————————————————————————————————————————————————————————————

// * This file includes the type checking implementation for the GUI example
// * adapted from https://doi.org/10.5281/zenodo.7990289
Copy link
Contributor

@LPTK LPTK Jun 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put such files in meaningfully-named subfolders of bbml so we can easily know what work they are ported from.


class Block
class IO
class Label
class Button

// * So far, our system does not support impure programs.
// * We explicitly insert this handle function at **the top level** to allow primitive effects like IO and Block
fun doPrimitiveEffects: [Res, E] -> (() ->{E | IO | Block} Res) ->{E} Res

fun sleep: (Int) ->{Block} ()

fun mkLabel: (Str) ->{IO} Label
fun mkButton: (Str) ->{IO} Button

fun setText: (Str, Label) ->{IO} ()

fun addActionListener: [T, E extends ~Block] -> (() ->{E} (), Button) ->{E | T} ()


doPrimitiveEffects of () =>
sleep(42)



doPrimitiveEffects of () =>
mkLabel("Hello, World!")


doPrimitiveEffects of () =>
let label = mkLabel("Hello, World!")
sleep(42)
setText("Goodbye, World!", label)


doPrimitiveEffects of () =>
let label = mkLabel("label")
let button = mkButton("button")
addActionListener(() => setText("clicked!", label), button)


// error!
// doPrimitiveEffects of () =>
// let label = mkLabel("label")
// let button = mkButton("button")
// addActionListener(() => sleep(1), button)


//│ ————————————————————————————————————————————————————————————————————————————————

Loading