Skip to content
This repository has been archived by the owner on Jul 26, 2018. It is now read-only.

should the vars oper be added to the Prelude? #32

Open
odanoburu opened this issue Apr 14, 2018 · 2 comments
Open

should the vars oper be added to the Prelude? #32

odanoburu opened this issue Apr 14, 2018 · 2 comments

Comments

@odanoburu
Copy link
Contributor

considering the problem I had at #28 with the extensive use of variants in a large grammar, the oper vars was proposed as partial solution:

-- hack to get the same behaviour as from variants. parses both, linearizes the first. 
oper vars : Str -> Str -> Str = \x,y -> pre { "" => x ; _ => y } ;

it then became a definition in a module of the grammar, but I wonder if it shouldn't be in the Prelude, so that no other grammars need to repeat its definition.

@inariksit
Copy link
Member

I don't have an opinion on this; I understand @aarneranta and @krangelov may have some plans to change the behaviour of variants at some point so that it doesn't explode that much?

Another point is that variants are not recommended in the resource grammar in any case, because it's better to have predictable output. It is better to define two functions: e.g. contracted and uncontracted negation in English (don't and do not), or different genders in second person pronoun. Then an application grammar can use variants to allow all of these.

@odanoburu
Copy link
Contributor Author

odanoburu commented Apr 17, 2018

Another point is that variants are not recommended in the resource grammar in any case, because it's better to have predictable output.

after having this argument twice I'm finally being convinced of this!

still, I think the vars oper seems useful enough as a way to parse typos (but not linearise them!) to warrant its inclusion in the prelude or some other core module...

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

No branches or pull requests

2 participants