flix / flix

The Flix Programming Language
https://flix.dev/
Other
2.08k stars 149 forks source link

Absolute qualified names #7865

Open JonathanStarup opened 1 week ago

JonathanStarup commented 1 week ago

If i write this

def myFunction(): Random = ...

What Random am I speaking about, specifically? It can be Random or Current.Namespace.Random.

This is annoying if, e.g., I am implementing eff Random and want to have a handler using the existing Random

Proposal

Allow prefix . when specifying names, that means that I can write handler(f: a -> b \ ef, r: .Random): (a -> b \ ef - Random) \ IO = .... The feature is that .Random always refer to the root random, not the current random.

We don't use . much in Flix so I don't think parsing would be an issue

mlutze commented 5 days ago

IMO Standard library just needs to be in the Flix namespace. (Same with packages -- they should be qualified with something)

JonathanStarup commented 5 days ago

I like that approach. It is however a bit taxing since you cant do use flix._ and we don't have editor support for uses :L

mlutze commented 5 days ago

I like that approach. It is however a bit taxing since you cant do use flix._ and we don't have editor support for uses :L

Sounds like we should get editor support for uses :D