[Haskell-cafe] pure programs
jason.dusek at gmail.com
Thu Nov 6 16:45:36 EST 2008
Conal Elliott <conal at conal.net> wrote:
> To help me understand your question, would you be unhappy with
> the following structure?
> -- runnable
> main = interact f
> -- composable
> f = ...
> The discipline is to use interact (or another combinator) to
> wrap a functional/composable/pure component like f into an
> executable. Then give main to users and f to programmers.
I'd like to be able to compose with systems not written in
Haskell, though -- in short, I think of interact f as
the composable, exportable part.
My original email is motivated by concern about at what level
a program is "pure" in the presence of conditional compilation
(and dynamic linking, for that matter). I can not, for
example, say all pure functions in my code, when used with the
same Haskell library set, will return the same results on all
platforms. So source code level purity is out. If we move to
executable level purity, that seems plausible -- on a given
platform, a given executable, if it executes all, will execute
identically if it is statically linked with the C libs as well
as the Haskell. This is not actually possible on Macs but
The one corner case I had in mind was FreeBSD's Linux ABI
compatibility, but I suspect that doesn't matter at all (not
having any FreeBSD handy at the moment, I can not verify it).
More information about the Haskell-Cafe