Flipped / reversed fmap (<$>)?

前端 未结 5 1376
忘掉有多难
忘掉有多难 2020-12-13 19:04

I found defining the following

(%)  = flip fmap

I can write code like this:

readFile \"/etc/passwd\" % lines % filter (not          


        
5条回答
  •  轮回少年
    2020-12-13 19:36

    (<&>) :: Functor f => f a -> (a -> b) -> f b 
    

    Now available from Data.Functor in base.

    https://hackage.haskell.org/package/base-4.12.0.0/docs/Data-Functor.html#v:-60--38--62-

提交回复
热议问题