隐式编程也称为无点样式吗? http://en.wikipedia.org/wiki/Tacit_programming Purescript中的一个选项?

最佳答案

看着PureScript Prelude source,我会这样说:



instance functorFn :: Functor ((->) r) where
  map = compose  -- point-free!


您在http://try.purescript.org/?session=3538ae1c-eece-8f50-ad0c-e1504846a793中的示例:

foldr f z Nil = z
foldr f z (x:xs) = f x (subfold xs)
  where subfold = foldr f z

sum = foldr (+) 0

main = trace $ show $ sum (1:2:3:4:Nil)  -- prints: 10


(需要自己定义文件夹,因为我无法导入任何模块)

10-08 16:24