[STM] Better name for waitUntil?

2005-12-19 Thread Tomasz Zielonka
Hello!

I am finishing my waitUntil implementation for STM. It's a new
STM action that will allow to wait for a given time point.

waitUntil :: UTCTime - STM ()

(UTCTime is from Ashley Yakeley's Time library.)

The intended semantics is that

waitUntil t

will succeed as soon as time passes t, or more precisely when (now = t).

Right now I am to find a better name for waitUntil. Maybe it should be
more declarative, like itsAfter or timeAfter? I am not a native english
speaker, so I am probably missing many options. Any ideas?

I also think about adding something like itsBefore, which would mean
(now  t).

How about it'sAfter ?
Maybe only after, without it's ?

Thanks in advance for your help.

PS. I imagine that it would be possible to implement waitUntil more
efficiently in GHC's RTS, but my implementation can be a nice
showcase for STM's expressivity, and it's still quite efficient
(I used some (quite elegant :) hacks to implement subsecond
precision waitUntil efficiently).

Best regards
Tomasz

-- 
I am searching for a programmer who is good at least in some of
[Haskell, ML, C++, Linux, FreeBSD, math] for work in Warsaw, Poland
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


RE: [STM] Better name for waitUntil?

2005-12-19 Thread Simon Peyton-Jones
waitUntil sounds like a plausible name.  Better than itsAfter or
timeAfter.  But perhaps sleepUntil would be better, because it's a
variant of sleep?

Simon

| -Original Message-
| From: [EMAIL PROTECTED]
[mailto:glasgow-haskell-users-
| [EMAIL PROTECTED] On Behalf Of Tomasz Zielonka
| Sent: 19 December 2005 09:28
| To: GHC-users
| Subject: [STM] Better name for waitUntil?
| 
| Hello!
| 
| I am finishing my waitUntil implementation for STM. It's a new
| STM action that will allow to wait for a given time point.
| 
| waitUntil :: UTCTime - STM ()
| 
| (UTCTime is from Ashley Yakeley's Time library.)
| 
| The intended semantics is that
| 
| waitUntil t
| 
| will succeed as soon as time passes t, or more precisely when (now =
t).
| 
| Right now I am to find a better name for waitUntil. Maybe it should be
| more declarative, like itsAfter or timeAfter? I am not a native
english
| speaker, so I am probably missing many options. Any ideas?
| 
| I also think about adding something like itsBefore, which would mean
| (now  t).
| 
| How about it'sAfter ?
| Maybe only after, without it's ?
| 
| Thanks in advance for your help.
| 
| PS. I imagine that it would be possible to implement waitUntil more
| efficiently in GHC's RTS, but my implementation can be a nice
| showcase for STM's expressivity, and it's still quite efficient
| (I used some (quite elegant :) hacks to implement subsecond
| precision waitUntil efficiently).
| 
| Best regards
| Tomasz
| 
| --
| I am searching for a programmer who is good at least in some of
| [Haskell, ML, C++, Linux, FreeBSD, math] for work in Warsaw, Poland
| ___
| Glasgow-haskell-users mailing list
| Glasgow-haskell-users@haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: [STM] Better name for waitUntil?

2005-12-19 Thread Tomasz Zielonka
On Mon, Dec 19, 2005 at 09:34:19AM -, Simon Peyton-Jones wrote:
 waitUntil sounds like a plausible name.

But how do I name itsBefore?
dontWaitUntil? ;-)

 Better than itsAfter or timeAfter.

 But perhaps sleepUntil would be better, because it's a variant of
 sleep?

Well yes, but an STM compatible one, so you can simultaneously
waitUntil and try to read from channel, and you get whatever
happens first.

Also, the interface is entirely in STM - no need to initialize the timer
in IO. Simon Marlow gave a nice example for usefulness of this:
 Interesting.  You could use that do wait for idle time, for example:
 
atomically $ do
   t - readTVar last_mouse_click
   waitUntil (t+1000)
   ...
 
 so this transaction only completes when some idle time has passed since
 the last mouse click.

Let's assume I am going to implement itsBefore (seems to be quite
straightforward), so I want a pair of opposite names. Some
variations:

itsAfter / itsBefore
guardTimeAfter / guardTimeBefore
waitUntil / ???

Best regards
Tomasz

-- 
I am searching for a programmer who is good at least in some of
[Haskell, ML, C++, Linux, FreeBSD, math] for work in Warsaw, Poland
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: darcs switchover

2005-12-19 Thread Ross Paterson
On Fri, Dec 16, 2005 at 11:10:47AM -, Simon Marlow wrote:
 As you probably know, there is a mirror of the GHC source tree in a
 darcs repository.  (information about accessing the darcs repository is
 here: http://cvs.haskell.org/trac/ghc/wiki/GhcDarcs).
 
 The aim is to eventually switch over to using darcs for our revision
 control.  The point of this message is to find out what constraints
 people have that will affect when we can throw the switch.
 
 It doesn't look like we'll be able to keep a CVS mirror going once we
 switch to darcs, so darcs will be the only way to get an up-to-date GHC
 source tree.
 
 [...]
 
 Malcolm, Ross - since you both also use the CVS libraries tree, is it
 going to be possible for you to switch to using darcs to get the
 libraries?  Any idea how long you'll need?

No problem for me if you switch over at any time.  But how about having
a separate repository for each library package?

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: instance inference

2005-12-19 Thread Ross Paterson
As a termination test, how about no restrictions on context and head
except:

   Each assertion in the context must satisfy
* the variables of the assertion are a sub-multiset of those of the
  head (though they may be the same), and
* the assertion has fewer type constructors and variables (taken
  together and counting repetitions) than the head.

This ensures that under any ground substitution the context assertion has
fewer type constructors than the head.

It would accept all instances accepted by the current test, plus

instance C a
instance C (s a) = C (Sized s a)
instance (C1 a, C2 b) = C a b
instance C1 Int a = C2 Bool [a]
instance C1 Int a = C2 [a] b
instance C a a = C [a] [a]

But not things like

instance (C1 a, C2 a, C3 a) = C a

because that would need to check other instances as well.

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


RE: instance inference

2005-12-19 Thread Simon Peyton-Jones
Martin Sulzmann is the world expert on this stuff.  Maybe he'll know.

Simon

| -Original Message-
| From: [EMAIL PROTECTED]
[mailto:glasgow-haskell-users-
| [EMAIL PROTECTED] On Behalf Of Ross Paterson
| Sent: 19 December 2005 10:16
| To: Simon Peyton-Jones
| Cc: glasgow-haskell-users@haskell.org
| Subject: Re: instance inference
| 
| As a termination test, how about no restrictions on context and head
| except:
| 
|Each assertion in the context must satisfy
| * the variables of the assertion are a sub-multiset of those of
the
|   head (though they may be the same), and
| * the assertion has fewer type constructors and variables (taken
|   together and counting repetitions) than the head.
| 
| This ensures that under any ground substitution the context assertion
has
| fewer type constructors than the head.
| 
| It would accept all instances accepted by the current test, plus
| 
|   instance C a
|   instance C (s a) = C (Sized s a)
|   instance (C1 a, C2 b) = C a b
|   instance C1 Int a = C2 Bool [a]
|   instance C1 Int a = C2 [a] b
|   instance C a a = C [a] [a]
| 
| But not things like
| 
|   instance (C1 a, C2 a, C3 a) = C a
| 
| because that would need to check other instances as well.
| 
| ___
| Glasgow-haskell-users mailing list
| Glasgow-haskell-users@haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: instance inference

2005-12-19 Thread Johannes Waldmann

 | As a termination test, how about no restrictions on context and head
 | except:
 | 
 |Each assertion in the context must satisfy
 | * the variables of the assertion are a sub-multiset of those of
 the
 |   head (though they may be the same), and
 | * the assertion has fewer type constructors and variables (taken
 |   together and counting repetitions) than the head.

it seems you just re-discovered termination proofs by linear
interpretations :-) of course that's just the tip of the iceberg,
see e.g. http://www.cs.tau.ac.il/%7Enachumd/papers/printemp-print.pdf

best regards,
--
-- Johannes Waldmann -- Tel/Fax (0341) 3076 6479/80 --
 http://www.imn.htwk-leipzig.de/~waldmann/ ---

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: darcs switchover

2005-12-19 Thread Malcolm Wallace
Ross Paterson [EMAIL PROTECTED] writes:
 
 No problem for me if you switch over at any time.  But how about having
 a separate repository for each library package?

Seconded.

Regards,
Malcolm
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users