On Thursday 11 Nov 2004 6:36 am, Judah Jacobson wrote:
AFAIKS, the definition of once that I gave uses unsafePerformIO in a
perfectly sound manner; namely, the creation of a top-level MVar. It
only becomes unsafe if certain optimizations are performed; but
then, that's also true for the
I want to connect several functions for signal processing. The typical
case is that in a network of signal processor there are parts that are
already discretized such as sampled sounds, and there are processors with
no particular sample rate such as amplifiers. But when it comes to
computation
Graham Klyne wrote:
Keean,
As far as I can tell, both your solutions to the one-shot problem
require that:
(a) the expression to be one-shotted is in the IO monad. That seems
reasonable, since why else does one care (semantically speaking)?
(b) they depend on the host operating system
At 11:31 11/11/04 +, Keean Schupke wrote:
Wouldn't it be easier to simply define once as a common Haskell library
function?
Erm, it is a library function (I provided the NamedSem library as an
attachment)... Are you suggesting it would be nice to be able to do this
without talking to the
Graham Klyne wrote:
Wouldn't it be easier to simply define once as a common Haskell
library function?
Depends on the type and the expected semantics. As Adrian Hey already
pointed out, (once :: IO a - IO a) with the obvious semantics is never
going to be safe, because it's just not the case
On Thu, Nov 11, 2004 at 10:49:13AM +0100, Henning Thielemann wrote:
The computation sample rate should be propagated through the network as
follows:
If in a component of equal sample rate some processors have the same
fixed sample rate, all uncertain processors must adapt that.
If some
Thanks for the advice. However, though I don't know how ghc manages the heap, I
am not sure it is possible to achieve constant heap usage, because a value of
type State is a function, and = is creating a call stack in this case. I
mean, I think that, even if the argument of f :: a - State s a
On Thu, 11 Nov 2004, Andreas Bauer wrote:
On Thu, Nov 11, 2004 at 10:49:13AM +0100, Henning Thielemann wrote:
The computation sample rate should be propagated through the network as
follows:
If in a component of equal sample rate some processors have the same
fixed sample rate, all
At 12:27 11/11/04 +, Ben Rudiak-Gould wrote:
Graham Klyne wrote:
Wouldn't it be easier to simply define once as a common Haskell library
function?
Depends on the type and the expected semantics. As Adrian Hey already
pointed out, (once :: IO a - IO a) with the obvious semantics is never
On Thu, 11 Nov 2004 09:16:04 +, Adrian Hey [EMAIL PROTECTED] wrote:
That's the trouble with unsafePerformIO. Haskell is supposed to be a
purely functional language and the compiler will assume all functions
are pure. As soon as you use unsafePerformIO to create something that
isn't a
Iavor S. Diatchki wrote:
In GHC the whole program stops when the main thread exits.
So if the law I was talking about holds, this program should
never terminate, as it will forever loop in 'reader'.
However since there is a concurrent thread running that can modify
the state, if 'reader' is
Graham Klyne wrote:
At 12:27 11/11/04 +, Ben Rudiak-Gould wrote:
[..]
going to be safe, because it's just not the case that
x = once (newIORef ())
y = x
has the same intended meaning as
x = once (newIORef ())
y = once (newIORef ())
No amount of
On Thu, 11 Nov 2004 10:49:13 +0100 (MEZ)
Henning Thielemann [EMAIL PROTECTED] wrote:
The computation sample rate should be propagated through the network as
follows:
If in a component of equal sample rate some processors have the same
fixed sample rate, all uncertain processors must adapt
Koji Nakahara [EMAIL PROTECTED] wrote:
On Thu, 11 Nov 2004 10:49:13 +0100 (MEZ)
Henning Thielemann [EMAIL PROTECTED] wrote:
The computation sample rate should be propagated through the network as
follows:
If in a component of equal sample rate some processors have the same
fixed
Henning Thielemann wrote:
The computation sample rate should be propagated through the network as
follows:
If in a component of equal sample rate some processors have the same
fixed sample rate, all uncertain processors must adapt that.
If some processors have different
Hello,
This sounds vaguely like the encryption modulus problem dealt with in
this paper:
http://www.eecs.harvard.edu/~ccshan/prepose/prepose.pdf
Function Pearl: Implicit Configurations -- or, Type Classes Reflect
the Values of Types.
Though, I have not thought about it too hard...
Jeremy
On Fri, 12 Nov 2004 01:10:06 +0900
Koji Nakahara [EMAIL PROTECTED] wrote:
On Thu, 11 Nov 2004 10:49:13 +0100 (MEZ)
Henning Thielemann [EMAIL PROTECTED] wrote:
The computation sample rate should be propagated through the network as
follows:
If in a component of equal sample rate some
On Thu, 11 Nov 2004 12:27:17 +, Ben Rudiak-Gould
[EMAIL PROTECTED] wrote:
On the other hand, these are perfectly safe:
once' :: IO a - IO (IO a)
oncePerString :: String - IO a - IO a
oncePerType :: Typeable a = IO a - IO a
once' seems virtually useless unless you have
I think you are right... The only safe operation I can see for a
one-time init
is type IO (). All results have to be returned via side effects. Hence with
my named-MVar proposal the first execution of the init function initialises
certain named-MVars, and subsequent executions do nothing at all.
On Thu, 11 Nov 2004 20:14:24 +, Keean Schupke
[EMAIL PROTECTED] wrote:
I think you are right... The only safe operation I can see for a
one-time init
is type IO (). All results have to be returned via side effects. Hence with
my named-MVar proposal the first execution of the init function
Actually, I don't see anything wrong on the face of it with
oncePerType :: Typeable a = IO a - IO a
since the only instances of Typeable are monomorphic. Indeed, the
implementation seems pretty straightforward: store the results of
already-run computations as Dynamic values in a global
This really really should have moved to haskell-cafe as previously
suggested (sending to both with this in mind); apologies for being a
little confising to haskell-cafe
This isn't a language design issue, it is a FAQ, or at best a nebulous
conceptual debate (speaking of which, has anyone got
22 matches
Mail list logo