
28 Nov
2010
28 Nov
'10
1:18 p.m.
On Sun, Nov 28, 2010 at 15:59, Jafet
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