[Haskell-cafe] 'Associative' order of calling
Matteo Acerbi
matteo.acerbi at gmail.com
Sat Oct 24 18:23:51 UTC 2015
On Sat, Oct 24, 2015 at 8:12 PM, Janis Voigtländer <
janis.voigtlaender at gmail.com> wrote:
> 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?
>
I might lack some basic knowledge, so thanks for asking.
What does it mean to take all the content elements from a data structure?
If one has f a = Bool -> a, and a value
xs :: f Int
xs True = 2
xs False = 3
what are x1 and x2?
Best,
Matteo
PS. I won't be able to read the answer before tomorrow. :-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20151024/3c010acb/attachment.html>
More information about the Haskell-Cafe
mailing list