fork(5) download
  1. {-# LANGUAGE TypeFamilies #-}
  2. {-# LANGUAGE MultiParamTypeClasses #-}
  3. {-# LANGUAGE ScopedTypeVariables #-}
  4.  
  5. class FooC a b where
  6. type FooE a b
  7. foob :: FooE a b -> b
  8.  
  9. foo :: forall a b . FooC a b => [FooE a b] -> b
  10. foo = map (foob :: FooE a b -> b)
  11.  
  12. main :: IO ()
  13. main = undefined
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
[1 of 1] Compiling Main             ( prog.hs, prog.o )

prog.hs:10:7:
    Could not deduce (b ~ [b])
    from the context (FooC a b)
      bound by the type signature for foo :: FooC a b => [FooE a b] -> b
      at prog.hs:9:8-47
      `b' is a rigid type variable bound by
          the type signature for foo :: FooC a b => [FooE a b] -> b
          at prog.hs:9:17
    Expected type: [FooE a b] -> b
      Actual type: [FooE a0 b] -> [b]
    In the return type of a call of `map'
    In the expression: map (foob :: FooE a b -> b)
    In an equation for `foo': foo = map (foob :: FooE a b -> b)
stdout
Standard output is empty