We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It would be convenient to be able to access fields of a record similarly to in regular languages.
Having to use destructuring for everything is very verbose:
fullName(person { firstName: FirstName, lastName: LastName }, FullName) :- FullName <- FirstName + " " + LastName.
Where using field access could be simpler:
fullName(person(P), FullName) :- FullName <- P{firstName} + " " + P{lastName}.
This indexing operation would be not tied to variables, so a bit less useful but valid:
fullName(FullName) :- FullName <- { firstName: "Cam" }{firstName} + " " + { lastName: "Eldridge" }{lastName}.
Would also be useful to have a similar array access:
firstAndLastName(Names, FullName) :- len(Names, N), FullName <- Names[0] + " " + Names[N - 1].
Could even chain accessors:
Record{field}[3]{anotherField}{lastField}
Wildcards/variables in records would be bound as usual:
name(Name, person(P)) :- equal(P{name}, Name). name("Cam", person { name: A }). // A = "Cam"
The text was updated successfully, but these errors were encountered:
I am noticing that we don't really need indexing or updating, what we need is language level support for views
I do (3) very often (destructure a struct, transform a value, reconstruct it), so it would be nice to make all these steps super painless.
Views are a very functional-programming type idea though... maybe what I am doing is actually just something that needs a functional language...
Sorry, something went wrong.
No branches or pull requests
It would be convenient to be able to access fields of a record similarly to in regular languages.
Having to use destructuring for everything is very verbose:
Where using field access could be simpler:
This indexing operation would be not tied to variables, so a bit less useful but valid:
Would also be useful to have a similar array access:
Could even chain accessors:
Wildcards/variables in records would be bound as usual:
The text was updated successfully, but these errors were encountered: