#2767: Type family bug ?
----------------------------------------+-----------------------------------
    Reporter:  test                     |        Owner:         
        Type:  bug                      |       Status:  new    
    Priority:  normal                   |    Milestone:         
   Component:  Compiler (Type checker)  |      Version:  6.10.1 
    Severity:  normal                   |   Resolution:         
    Keywords:                           |     Testcase:         
Architecture:  Unknown/Multiple         |           Os:  MacOS X
----------------------------------------+-----------------------------------
Comment (by test):

 I've narrowed down the problem to the code below.
 The problem is one of type inference.

 If either type signature is added, then it compiles fine.

 {{{
 {-# LANGUAGE TypeFamilies #-}
 {-# OPTIONS_GHC -fglasgow-exts #-}
 module Main where

 main = return ()

 -- eval' :: Solver solver => Tree solver a -> [(Label solver,Tree solver
 a)] -> solver [a]
 eval' (NewVar f) wl = do v <- newvarSM
                          eval' (f v) wl
 eval' Fail       wl = continue wl

 -- continue :: Solver solver => [(Label solver,Tree solver a)] -> solver
 [a]
 continue ((past,t):wl) = do gotoSM past
                             eval' t wl
 data Tree s a
                 = Fail
                 | NewVar (Term s -> Tree s a)

 class Monad solver => Solver solver where
         type Term solver        :: *
         type Label solver       :: *
         newvarSM        :: solver (Term solver)
         gotoSM          :: Label solver -> solver ()

 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2767#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to