Haskell: 组合案例

Haskell: a case of composition

这是一个无用的连接案例 foldl,纯粹是教育(对我来说):

foldl (\xs x -> xs ++ [x]) [1,2] [11,12,13]
[1,2,11,12,13]

有没有办法使用组合而不是 lambda 将其打包得更紧?

这只是从 HTNW and Will Ness:

的评论中提取的更易读的摘要
-- Reduction to poinfree
a = \xs x -> xs ++ [x]
b = \xs x -> xs ++ return x
c = \xs x -> ((xs ++) . return) x
d = \xs x -> ((. return) (xs ++)) x
e = \xs x -> ((. return) . (++)) xs x