[Haskell-cafe] A Thought: Backus, FP, and Brute Force Learning

Richard A. O'Keefe ok at cs.otago.ac.nz
Sun Mar 24 23:43:11 CET 2013


It's "Backus", people.  He was never the god of wine.

I cannot detect any trace of Backus's FP in Haskell at all.
FP is strict. Haskell is not.
FP is typeless.  Haskell is highly typeful.
FP does not name formal parameters.  Haskell often does.
FP has roots in APL.  Haskell doesn't.

I don't see any trace of Backus's FP in ML, Clean, or F# either.

The idea of writing programs by composing lots of small
functions is common to them both, but the idea of
combinators preceded them both.

As for
"Def Innerproduct = (Insert +) o (ApplyToAll x) o Transpose"
the idea is that this ought to be *easier* to understand than
an imperative loop because all of the parts are separated out
instead of being graunched up together.

inner_product :: Num a => ([a],[a]) -> a

inner_product = foldr1 (+) . map (uncurry (*)) . uncurry zip

_is_ expressible in Haskell, although

inner_product :: Num a => [a] -> [a] -> a

inner_product = sum . zipWith (*)

would be more idiomatic.  But this is not because of any influence
from FP, but because Haskell has function composition and higher
order functions.




More information about the Haskell-Cafe mailing list