Point-free style and using $

前端 未结 5 1688
生来不讨喜
生来不讨喜 2021-01-11 19:10

How does one combine using $ and point-free style?

A clear example is the following utility function:

times :: Int -> [a] -> [a]
t         


        
5条回答
  •  囚心锁ツ
    2021-01-11 20:06

    You can easily write an almost point-free version with

    times n  =  concat . replicate n
    

    A fully point-free version can be achieved with explicit curry and uncurry:

    times  =  curry $ concat . uncurry replicate
    

提交回复
热议问题