that can
manage resources
accross multiple programs)...
What did you think of the code example given where the one-shot nature is
provided by a 'C' wrapper around the FFI function. I think this is the best
solution...
Keean.
Adrian Hey wrote:
On Monday 08 Nov 2004 6:48 pm, Keean Schupke wrote
I might really want to call the initialisation twice. If you use global
variables, the library can only be initialised once... but what if I
really want to use the library twice? With the state in a type passed
between functions, you can have multiple different states active
at once.
Keean.
Adrian Hey wrote:
Oh and while we're at it, perhaps one of you could explain what it is
you think is unsafe about the hypothetical top level - bindings we're
discussing (I've asked this before too, but no answer has been provided).
Are your objections dogmatic, aesthetic, or rational?
Do either of
I would have thought it would have been sensible to base floating
point maths on the IEEE spec, as thats what most hardware implements,
and there are libraries to emulate it for everything else. Does haskell use
IEEE primitives for things like sin/cos and sqrt? I am really surprised this
area
.
stijn.
On Wed, 27 Oct 2004 14:09:36 +0100, Keean Schupke
[EMAIL PROTECTED] wrote:
Well, its functional of course:
union :: Interval - Interval - Interval
union i j = Interval {
isin x = isin i x || isin j x
}
intersection :: Interval - Interval - Interval
intersection i j
I think someone else mentioned using functions earlier,
rather than a datatype why not define:
data Interval = Interval { isin :: Float - Bool }
Then each range becomes a function definition, for example:
myInterval = Interval {
isin r
| r == 0.6 = True
| r 0.7 r
.
On Wed, 27 Oct 2004 11:52:54 +0100, Keean Schupke
[EMAIL PROTECTED] wrote:
I think someone else mentioned using functions earlier,
rather than a datatype why not define:
data Interval = Interval { isin :: Float - Bool }
Then each range becomes a function definition, for example:
myInterval
The _result_ of a rather complex computation, so it has to
return a function that returns the handle.
for example:
handleOpener = complex function
bracket handleOpener close (\h - do
Keean
Peter Simons wrote:
Remi Turk writes:
Assuming I could _not_ use 'bracket', 'withFile',
'finally' or
201 - 208 of 208 matches
Mail list logo