On 11/28/10 9:59 AM, Jafet wrote:
But GHC does not accept type synonym instances unless they are fully applied.
That's precisely the problem, and why a newtype is used. More than GHC
implementation details, there's the deeper problem that allowing general
type-level functions causes decidabil
On Sun, Nov 28, 2010 at 15:59, Jafet 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
Hi,
Does it make sense to declare a transparent identity instance for
Functor, Applicative, Monad, etc?
For example, I might want to generalize ($) = (<*>) where
> ($) :: (a -> b) -> a -> b
> (<*>) :: (Functor f) => f (a -> b) -> f a -> f b
The traditional definition makes Identity a newtype:
>