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

Adding a "type" prefix when printing type operator import specs with import lists #475

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

viktorcsimma
Copy link

When importing type operators, GHC expects the ExplicitNamespaces pragma (which TypeOperators implies) and the type prefix before the import spec.

But this did not happen when the ImportSpec was given with the constructor IThingWith or IThingAll since they do not contain namespaces. I've changed the Pretty instance so that they get this prefix if the parent is an operator.

An example:

{-# LANGUAGE TypeOperators #-}

module TypeOperatorImport where

import TypeOperatorExport ((&&&), type (***)((:*:)), type (<))

test1 :: (<) () Bool
test1 = ()

test2 :: Bool -> Bool -> (***) () Bool
test2 b1 b2 = () :*: (b1 &&& b2)

I've tried to create tests for this, but I got Parse error messages for the ((:*:)) part.

Thank you in advance:)

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.

1 participant