[Haskell-cafe] Code review: list-like datatype with constant time appending based on function composition.
Atze van der Ploeg
atzeus at gmail.com
Tue Nov 18 19:30:28 UTC 2014
You might also be intrested in my and oleg's paper "reflection without
remorse" which discusses this construction in a more general setting, the
problems with it and their solution
Paper: http://homepages.cwi.nl/~ploeg/papers/zseq.pdf
Talk: https://www.youtube.com/watch?v=_XoI65Rxmss
On Nov 18, 2014 5:38 PM, "Arie Peterson" <ariep at xs4all.nl> wrote:
> > What about my doubts on why it works so lazily?
>
> Suppose 'f' is the function '(1 :)', and 'g' is some other unspecified
> other
> function of type '[Integer] -> [Integer]' ("difference list").
>
> You may evaluate the concatenation '(f . g) []' like this:
>
> (f . g) []
> = f (g [])
> = 1 : g []
>
> and at this point, you already have partial knowledge of the resulting
> list.
>
> Note that we use "lazy evaluation", in the sense that we do not evaluate
> the
> argument 'g []' to the function 'f' right away, but proceed by first
> substituting the definition of 'f'.
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20141118/a55fa9b8/attachment.html>
More information about the Haskell-Cafe
mailing list