[Haskell-cafe] Efficiency of passing function arguments
Henning Thielemann
lemming at henning-thielemann.de
Sat Apr 4 08:02:19 UTC 2020
On Sat, 4 Apr 2020, KS wrote:
> and we want to pass doc to a function, we should ideally hope that doc
> is not getting duplicated when passing it as an argument.
In Haskell, values are immutable and thus there is no need to copy. Values
and parameters are always references. Due to laziness a value references a
union. This union is in the beginning a generating function and once the
value gots evaluated, it is the computed value.
More information about the Haskell-Cafe
mailing list