I'm having a problem getting code with datatype contexts to build with GHC 
HEAD. The code is from FGL, but even a simplified code like:

module Heap(
  Heap(..)
) where

data Ord a => Heap a b = Empty | Node a b [Heap a b]
     deriving Eq

does not work. I get the compile error:
Heap.hs:1:1:
    No instance for (Ord a)
      arising from a use of `Node'
    In the pattern: Node _ _ _
    In an equation for `$con2tag_Heap': $con2tag_Heap (Node _ _ _) = 1#

I checked the release notes and saw that Datatype contexts are now treated as 
an extension. It says it will be on by default, but even passing 
-XDatattypeContexts or adding the pragma {-# LANGUAGE DatatypeContexts #-} does 
not help.

The problem started after applying the patches related to the new type checker 
(around 13 Sept).

-David


_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to