Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


"type instance V (Point v) = v" is not visible without explicit import. #17

fryguybob opened this Issue · 2 comments

2 participants


(Imported from Original issue from on January 23, 2012, 04:01:35 AM UTC)

What steps will reproduce the problem?
1. Use GHC 7.2.1
2. Write an expression which depends on V (Point (V a)) = V a, such as "transform (translation zeroV)"

Prelude Diagrams.Prelude> :t transform (translation zeroV) . P
transform (translation zeroV) . P
:: (Data.MemoTrie.HasTrie (Data.Basis.Basis a),
Data.MemoTrie.HasTrie (Data.Basis.Basis (V (Point a))),
Data.Basis.HasBasis a,
Data.Basis.HasBasis (V (Point a))) =>
a -> Point a
Prelude Diagrams.Prelude> :m + Graphics.Rendering.Diagrams.Points
Prelude Diagrams.Prelude Graphics.Rendering.Diagrams.Points> :t transform (translation zeroV) . P
transform (translation zeroV) . P
:: (Data.MemoTrie.HasTrie (Data.Basis.Basis a),
Data.Basis.HasBasis a) =>
a -> Point a


(Imported. Original comment by on January 23, 2012, 12:44:41 PM UTC)

Another way to reproduce this:

Prelude Diagrams.Prelude> :type (\x -> (x :: V (Point (Double,Double)))) (4,5)

Couldn't match type V (Point (Double, Double))' with(t0, t1)'
In the expression: (x :: V (Point (Double, Double)))
In the expression: \ x -> (x :: V (Point (Double, Double)))
In the expression:
(\ x -> (x :: V (Point (Double, Double)))) (4, 5)
Prelude Diagrams.Prelude> :m +Graphics.Rendering.Diagrams.Points
Prelude Diagrams.Prelude Graphics.Rendering.Diagrams.Points> :type (\x -> (x :: V (Point (Double,Double)))) (4,5)
(\x -> (x :: V (Point (Double,Double)))) (4,5) :: (Double, Double)

It seems this is likely a GHC bug, but I'd like to keep the ticket open here until we figure out a minimal test case to file as a GHC bug (or find an existing ticket).

I first encountered this problem when I split out most of the content of Graphics.Rendering.Diagrams.Points into the vector-space-points package. Currently the V instance is the only thing in the module.

Note that other V instances are defined in other modules and are re-exported via Diagrams.Prelude just fine. It's a mystery why the instance for Point is not.


This seems to have been fixed in GHC 7.6.1; closing.

@byorgey byorgey closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.