Flipped / reversed fmap (<$>)?

前端 未结 5 1378
忘掉有多难
忘掉有多难 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:23

    Your operator (%) is exactly the operator (<&>) from the lens package.

    It can be imported with:

    import Control.Lens.Operators ((<&>))
    

提交回复
热议问题