[Haskell-cafe] Constraints on <$> vs <$!>

MigMit miguelimo38 at yandex.ru
Mon Aug 10 21:38:03 UTC 2015


Prelude Control.Applicative> let f <$!> x = (f $!) <$> x
Prelude Control.Applicative> :t (<$!>)
(<$!>) :: Functor f => (a -> b) -> f a -> f b

> On 10 Aug 2015, at 23:30, Will Yager <will.yager at gmail.com> wrote:
> 
> What about
> 
> f <$!> x = (f $!) <$> x 
> 
> ?
> 
> --Will
> 
> 
> 
> On Aug 10, 2015, at 14:20, Christopher Allen <cma at bitemyapp.com> wrote:
> 
>> http://stackoverflow.com/questions/9423622/strict-fmap-using-only-functor-not-monad seems to cover it.
>> 
>> On Mon, Aug 10, 2015 at 4:17 PM, Alexey Egorov <electreg at list.ru> wrote:
>> Hello haskellers,
>> 
>> I wonder why <$> and <$!> have different typeclass constraints?
>> 
>> (<$>) :: Functor f => (a -> b) -> f a -> f b
>> (<$!>) :: Monad m => (a -> b) -> m a -> m b
>> _______________________________________________
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>> 
>> 
>> 
>> -- 
>> Chris Allen
>> Currently working on http://haskellbook.com
>> _______________________________________________
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe



More information about the Haskell-Cafe mailing list