Skip to content

Adding haskell and greek lambdas#1

Merged
brain-fuel merged 10 commits intomainfrom
adding-haskell-and-greek-lambdas
Mar 20, 2023
Merged

Adding haskell and greek lambdas#1
brain-fuel merged 10 commits intomainfrom
adding-haskell-and-greek-lambdas

Conversation

@donovansmith44
Copy link
Copy Markdown
Collaborator

In addition to your original request, I also added the explicit Haskell-style lambdas of (\x -> x) to the grammar. Let me know if you like it.

| LAMBDA VAR_EXP '.' L_EXP
| '(' L_EXP ')'
| L_EXP L_EXP
| '\\\\' VAR_EXP '->' L_EXP
Copy link
Copy Markdown
Contributor

@brain-fuel brain-fuel Mar 17, 2023

Choose a reason for hiding this comment

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

Might as well just change ' \ \ \ \ ' to LAMBDA. The original intent of my ask was just to make it easier to type in "lambda" in multiple forms. If we're going to have the '->' for separating the bound expression from the LAMBDA VAR_EXP we might as well allow it everywhere.

Copy link
Copy Markdown
Collaborator Author

@donovansmith44 donovansmith44 left a comment

Choose a reason for hiding this comment

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

Allowing use of '->' operator everywhere.

Copy link
Copy Markdown
Collaborator Author

@donovansmith44 donovansmith44 left a comment

Choose a reason for hiding this comment

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

Allowed '->' to be used everywhere

Copy link
Copy Markdown
Collaborator Author

@donovansmith44 donovansmith44 left a comment

Choose a reason for hiding this comment

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

Allowed '->' to be used everywhere

Copy link
Copy Markdown
Collaborator Author

@donovansmith44 donovansmith44 left a comment

Choose a reason for hiding this comment

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

Def BINDing of abstractions of vars to L_EXPs

Copy link
Copy Markdown
Collaborator Author

@donovansmith44 donovansmith44 left a comment

Choose a reason for hiding this comment

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

I thought it might be easier to evaluate tree elements if we had keywords for construction rules, which allows for clearer bifurcation and descent.

| <'('> L_EXP L_EXP <')'>
| APPLY
| ABSTRACT
| <'('> L_EXP <')'>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Correct with the apply and abstract bits. Technically (and I just looked this up) line 20 is not part of the lambda calculus grammar.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Meaning this: <'('> L_EXP <')'>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actually, I was wrong.

Application is what I have for line 19 (in red)
Abstraction is LAMBDA VAR BIND L_EXP

Copy link
Copy Markdown
Collaborator Author

@donovansmith44 donovansmith44 left a comment

Choose a reason for hiding this comment

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

Fixing APPLY and L_EXP definitions

@brain-fuel brain-fuel merged commit db21725 into main Mar 20, 2023
@brain-fuel brain-fuel deleted the adding-haskell-and-greek-lambdas branch March 20, 2023 19:22
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