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

add template haskell quasi-quoter to support parsing TutorialD at compile-time #288

Open
agentm opened this issue Apr 26, 2021 · 4 comments

Comments

@agentm
Copy link
Owner

agentm commented Apr 26, 2021

This could be a useful improvement so that users don't have to use the more verbose Haskell ADT directly.

executeRelationalExpr [tutd|s where name="Boston"|]
@YuMingLiao
Copy link
Contributor

YuMingLiao commented Apr 27, 2021

Hi @agentm

I've tried to embed the TutorialD in Haskell.
I guess you might want to see it: ShortCut.hs It needs the convertible library.

Although it has some drawbacks:

{,,,} => [,,,] since Haskell can only overload [].
the # prefix is needed for attribute names due to OverloadedLabels extension.
the # prefix for relation-related operator and @ prefix for attribute-related operator is needed due to some keyword operator is preserved.
f "count" [...] for function expressions.
... so it may look a bit weird.
(And right now, relation type expression haven't been implemented.)

But there are some advantages too:

It can have a persistent with macro because Haskell can give an expression a function name.
So it can compose.
And maybe it can make expression as a function, not sure about that, haven't tried that.
And plus, it can turn a type with Atomable type class in haskell into ConstructedAtomType directly.

Hope it helps.

@agentm
Copy link
Owner Author

agentm commented Apr 27, 2021

Hm... the link included in the comment claims the file has been deleted. Can you make a pull request?

@YuMingLiao
Copy link
Contributor

Oops. Okay, I've pulled a request now.

@YuMingLiao
Copy link
Contributor

f "count" [...] for function expressions is a bad/not-working design. I'll see if I can fix it.

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

No branches or pull requests

2 participants