Vector products: Difference between revisions

Content added Content deleted
Line 1,885: Line 1,885:
console.log(unlines(
console.log(unlines(
zipWith(k => f => k + show(
zipWith(k => f => k + show(
fapp(f)([a, b, c])
saturated(f)([a, b, c])
))(['a . b', 'a x b', 'a . (b x c)', 'a x (b x c)'])(
))(['a . b', 'a x b', 'a . (b x c)', 'a x (b x c)'])(
[dotProduct, crossProduct, scalarTriple, vectorTriple]
[dotProduct, crossProduct, scalarTriple, vectorTriple]
Line 1,929: Line 1,929:
) : undefined;
) : undefined;


// Curried function -> arguments -> fully-saturated value.
// Curried function -> [Argument] -> a more saturated value
const fapp = f =>
const saturated = f =>
// A curried function applied to the available
// A curried function applied successively to
// arguments up to, but not beyond,
// a list of arguments up to, but not beyond,
// the point of saturation.
// the point of saturation.
args => 0 < args.length ? (
args => 0 < args.length ? (