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.
When importing type operators, GHC expects the
ExplicitNamespaces
pragma (whichTypeOperators
implies) and thetype
prefix before the import spec.But this did not happen when the
ImportSpec
was given with the constructorIThingWith
orIThingAll
since they do not contain namespaces. I've changed thePretty
instance so that they get this prefix if the parent is an operator.An example:
I've tried to create tests for this, but I got
Parse error
messages for the((:*:))
part.Thank you in advance:)