[Haskell-cafe] Impredicative types and Lens?

2013-09-08 Thread Artyom Kazak
Here’s a small example, which, when compiled, gives an error. Why? {-# LANGUAGE FlexibleInstances, ImpredicativeTypes, TemplateHaskell #-} import Control.Lens class Item a where name :: a - String instance Item (String, Int) where name = fst

Re: [Haskell-cafe] Impredicative types and Lens?

2013-09-08 Thread Edward Kmett
You can't write that lens by hand, so it isn't surprising that the template haskell can't generate it either. =) ImpredicativeTypes don't work all that well. -Edward On Sun, Sep 8, 2013 at 9:49 AM, Artyom Kazak y...@artyom.me wrote: Here’s a small example, which, when compiled, gives an