Skip to content

Conversation

@phadej
Copy link
Contributor

@phadej phadej commented Apr 1, 2025

This proposal adds a new extension -XPermutationImportSyntax greatly
relaxing the import syntax, and therefore extends -XQualifiedImports.

Rendered

@tek
Copy link
Contributor

tek commented Apr 1, 2025

It would have a much more natural vibe to say qualified import A. Let's allow that as well!

@phadej
Copy link
Contributor Author

phadej commented Apr 1, 2025

It would have a much more natural vibe to say qualified import A. Let's allow that as well!

Yes, technically it's possible, but that would steal syntax.

qualified :: a -> a
qualified x = x

is valid Haskell today. Adding what you suggest would require to steal syntax by turning qualified into true keyword. I will add that remark to alternatives.

@tek
Copy link
Contributor

tek commented Apr 1, 2025

since qualified would have to be followed by a true import keyword eventually, maybe Happy's new permutation rules could compensate for that automatically

@phadej
Copy link
Contributor Author

phadej commented Apr 1, 2025

since qualified would have to be followed by a true import keyword eventually, maybe Happy's new permutation rules could compensate for that automatically

Fair point. It might work indeed. If we write

ghci> qualified import = import

<interactive>:2:11: error: [GHC-58481]
    parse error on input ‘import’

we get confusing parsing error anyway, so in this case we'll probably get error like with

ghci> import qualified Foo Bar

<interactive>:3:22: error: [GHC-58481] parse error on input ‘Bar’

i.e. something like

ghci> qualified import = import

<interactive>:2:17: error: [GHC-58481]
    parse error on input ‘=’

as = will be the first token which doesn't make sense.

@akhra
Copy link

akhra commented Apr 2, 2025

rendered PR link is a 404

@VitWW
Copy link
Contributor

VitWW commented Apr 8, 2025

It is a April Fool Joke Proposal and this day is gone, so maybe it is better to change status to Draft and Closed!
And everyone could still reads it and laughs, but to be not confused with real Proposals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants