[Haskell-cafe] Parsec type error with Flexible Contexts

Felipe Almeida Lessa felipe.lessa at gmail.com
Fri Aug 10 00:51:29 CEST 2012


Hello!

I've managed to reduce your code to a much simpler test case (without
parsec) but I'm still not sure why this is happening:


{-# LANGUAGE MultiParamTypeClasses, FlexibleContexts #-}

data D m
  = D { bar1 :: P m ()
      , bar2 :: P m ()
      }

data P m c = P

class S m c where

foo :: S m () => P m ()
foo = undefined

emptyDef :: S m () => D m
emptyDef
  = D
    { bar1 = foo
    , bar2 = foo
    }

haskellStyle :: S m () => D m
haskellStyle
  = emptyDef
    { bar1 = foo
    , bar2 = foo
    }


Cheers,

-- 
Felipe.



More information about the Haskell-Cafe mailing list