Skip to content

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