[Haskell] Re: haskell.org Simple Permissive License

2006-01-13 Thread Ashley Yakeley
This is done now, with a mandatory simple permissive license. -- Ashley Yakeley, Seattle WA ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell

Re: [Haskell] Looking for a random-access sequence data structure

2006-01-13 Thread Duncan Coutts
On Fri, 2006-01-13 at 20:52 +, Ross Paterson wrote: > On Fri, Jan 13, 2006 at 08:25:46PM +, Duncan Coutts wrote: > > On Fri, 2006-01-13 at 13:53 +, Ross Paterson wrote: > > > Have a look at Data.Sequence (in CVS/darcs version), docs at > > > > > > http://www.haskell.org/ghc/dist/curren

Re: [Haskell] Haskell DB bindings (was Re: ANN: HDBC (Haskell Database Connectivity)

2006-01-13 Thread Keean Schupke
Erm, has nobody replied to this yet? I want a robust interface, that uses bracket notation all the way down, so that any error is caught and resources are freed appropriately without the use of finalizers (which may not get run and lead to resource starvation - they are not reliable if dealing

Re: [Haskell] Re: ANN: HDBC (Haskell Database Connectivity)

2006-01-13 Thread Keean Schupke
Yes, I see... I edited it from the source code, which actually has the type: dbConnectWith :: VerifyTables t => (SqlHandle () -> IO ()) -> t -> Query () -> IO () dbConnectWith confn tabs query = confn (do { _ <- runST (do verifyTables tabs ; query) 0; return () }) I obviously did not think ha

Re: [Haskell] Looking for a random-access sequence data structure

2006-01-13 Thread Ross Paterson
On Fri, Jan 13, 2006 at 08:25:46PM +, Duncan Coutts wrote: > On Fri, 2006-01-13 at 13:53 +, Ross Paterson wrote: > > Have a look at Data.Sequence (in CVS/darcs version), docs at > > > > http://www.haskell.org/ghc/dist/current/docs/libraries/base/Data-Sequence.html > [...] > It's probably t

Re: [Haskell] Looking for a random-access sequence data structure

2006-01-13 Thread Duncan Coutts
On Fri, 2006-01-13 at 13:53 +, Ross Paterson wrote: > On Fri, Jan 13, 2006 at 01:18:35PM +, Duncan Coutts wrote: > > I've been looking around (unsuccessfully) for an efficient data > > structure to implement a sequence data type with indexed > > insert/delete/lookup. > > > > lookup :: Sequ

Re: [Haskell] Looking for a random-access sequence data structure

2006-01-13 Thread Greg Buchholz
Duncan Coutts wrote: > > I've been looking around (unsuccessfully) for an efficient data > structure to implement a sequence data type with indexed > insert/delete/lookup. See also, Robert Will's "Democratic Sequences" which strive for O(log n) complexity for all major operations... Democr

[Haskell] Re: Looking for a random-access sequence data structure

2006-01-13 Thread Duncan Coutts
On Fri, 2006-01-13 at 15:21 +0100, Christian Maeder wrote: > Duncan Coutts wrote: > >> What's the semantics of insert? Does it replace an element, or does it > >> shirt all the elements after it one step? > > > > It shifts all the elements after it one step. So that's why all the > > finite map ty

[Haskell] Re: Looking for a random-access sequence data structure

2006-01-13 Thread Christian Maeder
Christian Maeder wrote: seqInsert i v = Map.insert i v . Map.mapKeysMonotonic (\ j -> if j < i then j else j + 1) Sorry, only O(n) and not O(log n). The same would apply to delete. ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/

[Haskell] Re: Looking for a random-access sequence data structure

2006-01-13 Thread Christian Maeder
Duncan Coutts wrote: What's the semantics of insert? Does it replace an element, or does it shirt all the elements after it one step? It shifts all the elements after it one step. So that's why all the finite map types are no help. import Data.Map as Map seqInsert i v = Map.insert i v . Ma

Re: [Haskell] Looking for a random-access sequence data structure

2006-01-13 Thread Duncan Coutts
On Fri, 2006-01-13 at 13:53 +, Ross Paterson wrote: > On Fri, Jan 13, 2006 at 01:18:35PM +, Duncan Coutts wrote: > > I've been looking around (unsuccessfully) for an efficient data > > structure to implement a sequence data type with indexed > > insert/delete/lookup. > > > > lookup :: Sequ

Re: [Haskell] Looking for a random-access sequence data structure

2006-01-13 Thread Duncan Coutts
On Fri, 2006-01-13 at 14:41 +0100, Sebastian Sylvan wrote: > On 1/13/06, Duncan Coutts <[EMAIL PROTECTED]> wrote: > > Hi all, > > > > I've been looking around (unsuccessfully) for an efficient data > > structure to implement a sequence data type with indexed > > insert/delete/lookup. > > > > lookup

Re: [Haskell] Looking for a random-access sequence data structure

2006-01-13 Thread Ross Paterson
On Fri, Jan 13, 2006 at 01:18:35PM +, Duncan Coutts wrote: > I've been looking around (unsuccessfully) for an efficient data > structure to implement a sequence data type with indexed > insert/delete/lookup. > > lookup :: Sequence a -> Int -> Maybe a > insert :: Sequence a -> Int -> a -> Seque

Re: [Haskell] Looking for a random-access sequence data structure

2006-01-13 Thread Sebastian Sylvan
On 1/13/06, Duncan Coutts <[EMAIL PROTECTED]> wrote: > Hi all, > > I've been looking around (unsuccessfully) for an efficient data > structure to implement a sequence data type with indexed > insert/delete/lookup. > > lookup :: Sequence a -> Int -> Maybe a > insert :: Sequence a -> Int -> a -> Sequ

Re: [Haskell] Looking for a random-access sequence data structure

2006-01-13 Thread S.M.Kahrs
> I've been looking around (unsuccessfully) for an efficient data > structure to implement a sequence data type with indexed > insert/delete/lookup. [snip] For example the Data.Map supports all of these except > insert. Okasaki's random access lists only support inserting elements at > the head of

[Haskell] Looking for a random-access sequence data structure

2006-01-13 Thread Duncan Coutts
Hi all, I've been looking around (unsuccessfully) for an efficient data structure to implement a sequence data type with indexed insert/delete/lookup. lookup :: Sequence a -> Int -> Maybe a insert :: Sequence a -> Int -> a -> Sequence a delete :: Sequence a -> Int -> Sequence a Obviously I can i

Re: [Haskell] Re: State Monad

2006-01-13 Thread Malcolm Wallace
Christian Maeder <[EMAIL PROTECTED]> writes: > Bruno Oliveira wrote: > > Can somebody point me out the exact CVS location of the State Monad > > implementation that ships with GHC? I am a bit lost in the CVS directory > > structure ... > > fptools/libraries/mtl/Control/Monad/State.hs Or rather

[Haskell] Re: State Monad

2006-01-13 Thread Christian Maeder
Bruno Oliveira wrote: Can somebody point me out the exact CVS location of the State Monad implementation that ships with GHC? I am a bit lost in the CVS directory structure ... fptools/libraries/mtl/Control/Monad/State.hs Christian ___ Haskell maili

[Haskell] State Monad

2006-01-13 Thread Bruno Oliveira
Hello, Can somebody point me out the exact CVS location of the State Monad implementation that ships with GHC? I am a bit lost in the CVS directory structure ... Related to this, I saw the following thread: http://www.mail-archive.com/haskell@haskell.org/msg17702.html Which seems to hint that