Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix unique names inside (-) functions in core parsing #661

Merged
merged 2 commits into from
Jan 29, 2025

Conversation

TimWhiting
Copy link
Collaborator

@TimWhiting TimWhiting commented Jan 17, 2025

fun (-)(l1: list<a>, l2: list<a>, ?(==): (a, a) -> e bool): e list<a>
  l1.filter(fn(x) !l2.any(fn(y) y == x))

fun main()
  [1, 2, 3] - [3, 4, 5]

Monadic lifting creates a unique name based on the top level identifier

// core identifier
fun @mlift-x-@10007[1,0,1,0] : forall<(e :: E)> (@y-x10004 : std/core/types/bool) -> (e :: E) std/core/types/bool;

However, @ is not a valid follow character after -

We could change unique names, or change lexing to allow this as an identifier. I chose the latter in this PR.

Also, the implicits translation / open effects can add let identifiers such as the following below:

fun @lift-handle-cache@10567 // inline size: 3
  = tp... {
    val @implicit/(@uniq-x@10158==)[

I edited Core/Parse.hs to allow locally qualified identifiers inside function definitions.

@TimWhiting TimWhiting added this to the Small Release milestone Jan 17, 2025
@daanx daanx merged commit 83295a1 into koka-lang:dev Jan 29, 2025
@daanx
Copy link
Member

daanx commented Jan 29, 2025

Thanks TIm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants