隐性编程也称为无点样式,例如http://en.wikipedia.org/wiki/Tacit_programming Purescript中的一个选项?
答案 0 :(得分:4)
看看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
(需要自己定义foldr,因为我无法导入任何模块)