[Haskell-cafe] GSoC accepted projects

2008-04-22 Thread Malcolm Wallace
Haskell.org is pleased to announce that we received 7 funded student slots from Google for this year's Summer of Code. Of the 30 proposals we received, the mentoring group chose the following 7: * GHC API Improvements by Thomas Schilling, mentored by Simon Marlow * Dynamically Loaded Plu

Re: [Haskell-cafe] Hackage being too strict?

2008-04-22 Thread Hans van Thiel
[snip] > > The current a priori check, which said there were no fatal errors, while the > > a posteriori check failed, is misleading. Wouldn't it be better to warn > > potential > > uploaders that this first check is not complete? > > I'm not sure I see what you're getting at. We can't do a full

[Haskell-cafe] Re: [Haskell] ANNOUNCE: Generic Haskell 1.80 (Emerald)

2008-04-22 Thread Thomas van Noort
Hello, I took the liberty to move this discussion to the Haskell-Cafe mailing list. Adrian Hey wrote: Thomas van Noort wrote: Pleasant programming, Hello, This looks like good stuff. But having done all this work it seems a pity not to go the extra mm and cabalise this and make it build

Re: [Haskell-cafe] functional update

2008-04-22 Thread Henning Thielemann
On Mon, 21 Apr 2008, Ryan Ingram wrote: I recommend this blog entry: http://twan.home.fmf.nl/blog/haskell/overloading-functional-references.details along with a few additional combinators for imperative update: data FRef s a = FRef { frGet :: s -> a , frSet :: a -> s -> s } http://dar

[Haskell-cafe] Anyone mind proofing a short monad transformers explanation?

2008-04-22 Thread J.N. Oliveira
Ryan Ingram wrote: On 12/17/07, *Jack Kelly* <[EMAIL PROTECTED] > wrote: > liftIO $ hPutStrLn h "You lose" > liftIO $ hFlush h IO is once again special. For other inner monads, the lift function does the same thing. Note also that IO has no transforme

Re: [Haskell-cafe] ANNOUNCE: Galois web libraries for Haskell released

2008-04-22 Thread John Goerzen
On Mon April 21 2008 1:11:19 pm Don Stewart wrote: > Galois, Inc. is pleased to announce the open source release of a suite of > web programming libraries for Haskell! Lots of cool stuff here! A few questions: > * xml > A simple, lightweight XML parser/generator. > > http://hac

Re: [Haskell-cafe] ANNOUNCE: Galois web libraries for Haskell released

2008-04-22 Thread Aaron Tomb
On Apr 22, 2008, at 6:20 AM, John Goerzen wrote: * xml A simple, lightweight XML parser/generator. http://hackage.haskell.org/cgi-bin/hackage-scripts/package/xml Can you describe how this compares to HaXml? Were there deficiencies in HaXml? The main difference is that it'

Re: [Haskell-cafe] I hate Haskell's typeclasses

2008-04-22 Thread Ryan Ingram
On Mon, Apr 21, 2008 at 10:58 PM, Jonathan Cast <[EMAIL PROTECTED]> wrote: > I must have failed to communicate well. To me, the point of giving a class > a name is that then you can write a program that is parametric over the > elements of that class. Knowing that I can implement monads in Ruby

Re: [Haskell-cafe] ANNOUNCE: Galois web libraries for Haskell released

2008-04-22 Thread Don Stewart
jgoerzen: > On Mon April 21 2008 1:11:19 pm Don Stewart wrote: > > Galois, Inc. is pleased to announce the open source release of a suite of > > web programming libraries for Haskell! > > Lots of cool stuff here! A few questions: > > > * xml > > A simple, lightweight XML parser/generat

[Haskell-cafe] mapM vs mapM_ performance

2008-04-22 Thread Ben
Hello Haskellers, I'm running ghc 6.8.2 on vista 64. Consider the following program, which is compiled with -02 -prof -auto-all: module Main where import System.IO (openFile, IOMode(..), hPutStr) testlst = let ls = [(i, [(j, (fromIntegral j)::Float) | j <- [1..5]::[Int]]) | i <- [1..50]::[

Re: [Haskell-cafe] ANNOUNCE: Galois web libraries for Haskell released

2008-04-22 Thread John Goerzen
On Tue April 22 2008 12:20:34 pm Don Stewart wrote: > Yes, we needed full, low-level access to sqlite for some unusual use > cases. For high level stuff, HDBC and Takusen are nicer. Can you elaborate on these use cases? I would like to either add support for them to HDBC-sqlite3, or perhaps mak

Re: [Haskell-cafe] ANNOUNCE: Galois web libraries for Haskell released

2008-04-22 Thread Don Stewart
jgoerzen: > On Tue April 22 2008 12:20:34 pm Don Stewart wrote: > > > Yes, we needed full, low-level access to sqlite for some unusual use > > cases. For high level stuff, HDBC and Takusen are nicer. > > Can you elaborate on these use cases? I would like to either add support for > them to HDBC

[Haskell-cafe] Re: Some clarity please!

2008-04-22 Thread Michael Karcher
In gmane.comp.lang.haskell.prime Aaron Denney <[EMAIL PROTECTED]> wrote: > > Prelude> :i Ord > > class (Eq a) => Ord a where > > compare :: a -> a -> Ordering > > (<) :: a -> a -> Bool > > (>=) :: a -> a -> Bool > > (>) :: a -> a -> Bool > > (<=) :: a -> a -> Bool > > max :: a -> a -> a

Re: [Haskell] Re: [Haskell-cafe] ANNOUNCE: Galois web libraries for Haskell released

2008-04-22 Thread Sterling Clover
> > * feed > > Interfacing with RSS (v 0.9x, 2.x, 1.0) and Atom feeds > > > > http://hackage.haskell.org/cgi-bin/hackage-scripts/package/feed > Curious how well this handles malformed feeds -- i.e. is it strict in its parsing, or casual and tagsoup-like? Thanks, S. _

[Haskell-cafe] Processing XML with HXT

2008-04-22 Thread rodrigo.bonifacio
Hi all, I´m just starting with HXT. My question is, how can I expose a "use case" from the main function below (the XmlPickler for UseCase has been already defined): main :: IO () main = do runX ( xunpickleDocument xpUseCase [ (a_validate,v_0) ], "uc.xml" ) return () For example, i

[Haskell-cafe] Re: Re: semi-closed handles

2008-04-22 Thread Ben Franksen
Ryan Ingram wrote: > On 4/15/08, ChrisK <[EMAIL PROTECTED]> wrote: >> A small idiomatic nitpick: When I see (length s) gets computed and >> thrown >> away I wince at the wasted effort. I would prefer (finiteSpine s): > > On every piece of hardware I've seen, the actual calculation done by > "le

[Haskell-cafe] Storable class?

2008-04-22 Thread Galchin, Vasili
Hello, Examples of instances of the Storable class please. Thank you, Vasili ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Storable class?

2008-04-22 Thread Evan Laforge
This uses hsc2hs. As far as I can tell, alignment is unused. I've never had an error from using 'undefined' there. > #include "c_interface.h" > > instance Storable Color where > sizeOf _ = #size Color > alignment _ = undefined > peek = peek_color > poke = poke_color > > peek_colo

[Haskell-cafe] Re: ANNOUNCE: Galois web libraries for Haskell released

2008-04-22 Thread Gour
> "Don" == Don Stewart <[EMAIL PROTECTED]> writes: Don> It might make sense to wrap our sqlite3 binding with HDBC-sqlite3 Don> though, so you don't need to maintain your own sqlite binding. How about support for user-defined functions in sqlite3? Sincerely, Gour -- Gour | Zagreb, Croat

Re: [Haskell-cafe] Storable class?

2008-04-22 Thread Sebastian Sylvan
On Tue, Apr 22, 2008 at 9:29 PM, Evan Laforge <[EMAIL PROTECTED]> wrote: > This uses hsc2hs. As far as I can tell, alignment is unused. I've > never had an error from using 'undefined' there. Some architectures require all sorts of wacky alignments. E.g. floats may need to be 4 byte aligned, s

Re: [Haskell-cafe] ANNOUNCE: Galois web libraries for Haskell released

2008-04-22 Thread Andrew Coppin
Don Stewart wrote: * utf8-string A UTF8 layer for IO and Strings. The utf8-string package provides operations for encoding UTF8 strings to Word8 lists and back, and for reading and writing UTF8 without truncation. http://hackage.haskell.org/cgi-

Re: [Haskell-cafe] Storable class?

2008-04-22 Thread Evan Laforge
> On Tue, Apr 22, 2008 at 9:29 PM, Evan Laforge <[EMAIL PROTECTED]> wrote: > > This uses hsc2hs. As far as I can tell, alignment is unused. I've > > never had an error from using 'undefined' there. > > Some architectures require all sorts of wacky alignments. E.g. floats may > need to be 4 byte a

[Haskell-cafe] Stronger STM primitives needed? Or am I just doing it wrong?

2008-04-22 Thread Ryan Ingram
How can I implement the following operation efficiently in STM? Given a TVar "now", waitFor t0 = do t <- readTVar now if (t < t0) then retry else return () This naive implementation has the problem that the transaction gets restarted every time "now" gets updated, even if the new value i

Re: [Haskell-cafe] Storable class?

2008-04-22 Thread Sebastian Sylvan
On Tue, Apr 22, 2008 at 10:48 PM, Evan Laforge <[EMAIL PROTECTED]> wrote: > > On Tue, Apr 22, 2008 at 9:29 PM, Evan Laforge <[EMAIL PROTECTED]> wrote: > > > This uses hsc2hs. As far as I can tell, alignment is unused. I've > > > never had an error from using 'undefined' there. > > > > Some archi

Re[2]: [Haskell-cafe] Storable class?

2008-04-22 Thread Bulat Ziganshin
Hello Evan, Wednesday, April 23, 2008, 1:48:30 AM, you wrote: > The FFI doc doesn't really talk about the alignment method at all, so > I don't really understand how to write one or how it's used. write: easy. just specify how much data shoulkd be aligned. for primitive datatypes this usually eq

Re: [Haskell-cafe] Stronger STM primitives needed? Or am I just doing it wrong?

2008-04-22 Thread Matthew Brecknell
Ryan Ingram said: > How can I implement the following operation efficiently in STM? Given > a TVar "now", > > waitFor t0 = do > t <- readTVar now > if (t < t0) then retry else return () > > This naive implementation has the problem that the transaction gets > restarted every time "now" g

[Haskell-cafe] Re: Stronger STM primitives needed? Or am I just doing it wrong?

2008-04-22 Thread Chris Smith
On Tue, 22 Apr 2008 14:48:54 -0700, Ryan Ingram wrote: > waitFor t0 = do > t <- readTVar now > if (t < t0) then retry else return () > > This naive implementation has the problem that the transaction gets > restarted every time "now" gets updated, even if the new value is still > less than

Re: [Haskell-cafe] Re: Stronger STM primitives needed? Or am I just doing it wrong?

2008-04-22 Thread Ryan Ingram
On 4/22/08, Chris Smith <[EMAIL PROTECTED]> wrote: > > One primitive that would be strong enough is this: retryUntil :: TVar a > > -> (a -> Bool) -> STM () > > Hmm. This makes me suspicious. A change to a variable may change the > transaction such that it never even calls your retryUntil the next

Re: [Haskell-cafe] Re: Stronger STM primitives needed? Or am I just doing it wrong?

2008-04-22 Thread Matthew Brecknell
Ryan Ingram said: > > retryUntil :: TVar a -> (a -> Bool) -> STM () > > [...] > > the semantics would be that the transaction log, > instead of saying "I read from v" would say "I read from v and failed > because v didn't satisfy this predicate". > > Changes to any other variable in the log woul

Re: [Haskell-cafe] Processing XML with HXT

2008-04-22 Thread Albert Y. C. Lai
rodrigo.bonifacio wrote: I´m just starting with HXT. My question is, how can I expose a "use case" from the main function below (the XmlPickler for UseCase has been already defined): main :: IO () main = do runX ( xunpickleDocument xpUseCase [ (a_validate,v_0) ], "uc.xml" ) return

Re: [Haskell-cafe] I hate Haskell's typeclasses

2008-04-22 Thread Derek Elkins
On Mon, 2008-04-21 at 22:58 -0700, Jonathan Cast wrote: > class Forceable alpha where >seq :: alpha -> beta -> beta > > Instances derived automatically by the compiler, when possible, for > every type (like Typeable should be). We can omit functions if > desired (I don't remember why I t

Re: Re[2]: [Haskell-cafe] Storable class?

2008-04-22 Thread Galchin, Vasili
Hello, Below is a snippet of my code please look for the "poke" call with "<". This causes a "hang" when I run a test case. If I comment out the "poke" call then test case runs. Vasili -- |Correspond to some of the int flags from C's fcntl.h. data MQFlags = MQFlags {

Re: [Haskell-cafe] Re: Stronger STM primitives needed? Or am I just doing it wrong?

2008-04-22 Thread Ryan Ingram
Actually, I think I came up with a solution on the way home from work today. Instead of > data Future t a = Fut > { waitFor :: t -> STM () > , value :: STM (t, a) > } I will use > data Future t a = Fut > { waitFor :: t -> IO (STM ()) > , value :: IO (STM (t, a)) > } The

Re: [Haskell-cafe] Laziness and Either

2008-04-22 Thread Derek Elkins
On Mon, 2008-04-21 at 21:26 +0100, Magnus Therning wrote: > John Goerzen wrote: > > Back when I was working on the logic for the bin-packing solver that I > > added > > to MissingH (for use with datapacker), I had a design decision to make: do > > I > > raise runtime errors with the input using

[Haskell-cafe] Re: Some clarity please!

2008-04-22 Thread John Meacham
On Tue, Apr 22, 2008 at 05:28:27PM +, Michael Karcher wrote: > I am quite late to join this thread, but as I just read the thread > about Conal's AddBounds where he had a very valid point for > implementing min/max without resorting to <= or compare: > > min [] ys = [] > min xs [] = [] > min (

Re: [Haskell-cafe] I hate Haskell's typeclasses

2008-04-22 Thread Jonathan Cast
On 22 Apr 2008, at 8:03 PM, Derek Elkins wrote: On Mon, 2008-04-21 at 22:58 -0700, Jonathan Cast wrote: class Forceable alpha where seq :: alpha -> beta -> beta Instances derived automatically by the compiler, when possible, for every type (like Typeable should be). We can omit functions i

Re: [Haskell-cafe] I hate Haskell's typeclasses

2008-04-22 Thread Jonathan Cast
On 22 Apr 2008, at 9:53 AM, Ryan Ingram wrote: On Mon, Apr 21, 2008 at 10:58 PM, Jonathan Cast <[EMAIL PROTECTED]> wrote: I must have failed to communicate well. To me, the point of giving a class a name is that then you can write a program that is parametric over the elements of that class

Re: [Haskell-cafe] Processing XML with HXT

2008-04-22 Thread Uwe Schmidt
Hi Rodrigo, > I´m just starting with HXT. My question is, how can I expose a "use case" > from the main function below (the XmlPickler for UseCase has been already > defined): > > main :: IO () > main = do > runX ( xunpickleDocument xpUseCase [ (a_validate,v_0) ], "uc.xml" ) > retu

Re: [Haskell-cafe] Storable class?

2008-04-22 Thread Magnus Therning
Galchin, Vasili wrote: > Hello, > > Examples of instances of the Storable class please. I believe this is linked from the Haskell Wiki: http://therning.org/magnus/archives/315 There are a few comments on the alignment as well. /M -- Magnus Therning (OpenPGP: