[Haskell-cafe] 'Associative' order of calling

Janis Voigtländer janis.voigtlaender at gmail.com
Sat Oct 24 18:12:11 UTC 2015


It has already been established in this thread what Charles meant by 3.

He meant that a fold-function that has the property he is after would
guarantee that it:

a) takes all the content elements from a data structure, say x1,...,xn,

b) builds an application tree with the to-be-folded, binary operation f in
the internal nodes of a binary tree, whose leafs, read from left to right,
form exactly the sequence x1,...,xn,

c) evaluates that application tree.

Do you agree that what I describe above is a property of a given fold-like
function, not of the f handed to that fold-like function?

And do you agree that what I describe above is a property that is weaker
than (and so, in particular different from) for example the property "this
fold-like function is foldl or foldr".


2015-10-24 19:55 GMT+02:00 Kim-Ee Yeoh <ky3 at atamo.com>:

>
> On Sun, Oct 25, 2015 at 12:42 AM, Matteo Acerbi <matteo.acerbi at gmail.com>
> wrote:
>
>> For what concerns question 3, I didn't understand the idea of calling a
>> function "associatively".
>>
>
> This. Associativity is a property of binary operators. It's not a property
> of the catamorphism 'calling' on a given binary operator.
>
> Also, when Charles writes: "Then it goes on to use f in "thisFold f
> [0,1,2]" like "f (1 (f 0 2))""
>
> commutativity appears to raise its head.
>
> -- Kim-Ee
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20151024/1fbda115/attachment.html>


More information about the Haskell-Cafe mailing list