On Sun, Nov 28, 2010 at 15:59, Jafet <jafet.vi...@gmail.com> wrote: > But using this instance becomes unwieldy. If using Identity was > transparent, eg. if it was a type synonym > >> {-# LANGUAGE TypeSynonymInstances #-} >> type Identity a = a >> instance Applicative Identity where >> -- something like >> pure a = a >> f <*> a = f a > > But GHC does not accept type synonym instances unless they are fully applied. > > Is it sound for such an instance to exist? If so, how might it be defined?
Type synonym instances are nothing special, they are just shorthand for writing an instance for the type they are a synonym for. So an instance for 'Identity a' would actually be an instance for 'a' (which isn't such a good idea). An instance for 'Identity' is indeed not possible. Erik _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe