Re: [Haskell-cafe] Type constraints for class instances

2008-03-21 Thread Bas van Dijk
2008/3/21 Krzysztof Skrzętnicki [EMAIL PROTECTED]: ... I'd like to write the following code: instance (Ord a) = YOrd a where ycmp x y = case x `compare` y of LT - (x,y) GT - (y,x) EQ - (x,y) But i get an error Undecidable

[Haskell-cafe] ANN: Takusen 0.8.1

2008-03-21 Thread Alistair Bayley
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Takusen-0.8.1 This is a fairly minor bugfix release. although there are some API changes. Mainly, we've re-exported a lot of the types from Database.InternalEnumerator in Database.Enumerator. This will hopefully address a common complaint

Re: [Haskell-cafe] Type checking of partial programs

2008-03-21 Thread Henning Thielemann
On Thu, 20 Mar 2008, Roberto Zunino wrote: ac wrote: foo :: [Foo] - placeholder 1 foo xs = map placeholder 2 xs What are the possible type signatures for placeholder 1 and the possible expressions for placeholder 2? A nice GHCi trick I learned from #haskell: :t let foo xs = map

Re: [Haskell-cafe] Type constraints for class instances

2008-03-21 Thread Stephen Marsh
There is a bug in the code: *Main ycmp [5,2] [2,5] :: ([Int], [Int]) ([2,2],[5,5]) I think it is impossible to define a working (YOrd a) = YOrd [a] instance. Consider: let (a, b) = ycmp [[1..], [2..]] [[1..],[1..]] head (b !! 1) -- would be nice if it was 2, but it is in fact _|_ We take

Re: [Haskell-cafe] An ugly zip3 problem..

2008-03-21 Thread Dean Herington
I like Tillmann's cleanup. Here's another variation (warning: untested code). filter3 :: (FilterWindow3 - Double) - Dataset - Dataset filter3 f3 [] = [] filter3 f3 dss@(d:ds) = map f3 $ zip3 (d:dss) dss (shiftForward dss) -- Given a nonempty list, drops the first element and --

Re: [Haskell-cafe] Type constraints for class instances

2008-03-21 Thread Stephen Marsh
Actually, infinite trees wouldn't work, for a similar reason to above. You can't decide sort order on the infinite left branches, so you could never choose the correct right branch. Stephen 2008/3/21 Stephen Marsh [EMAIL PROTECTED]: There is a bug in the code: *Main ycmp [5,2] [2,5] ::

[Haskell-cafe] AMQP framing layer: design help requested.

2008-03-21 Thread Paul Johnson
I'm trying to implement the AMQP framing layer. This is the bottom layer of the protocol that packs and unpacks data in lazy ByteStrings. I'm using the Binary package with its Get and Put monads to do the unpacking, and that works well. But I've run into a problem and I can't find an

[Haskell-cafe] Problem with OpenAL

2008-03-21 Thread George Giorgidze
I tried OpenAL binding (the one which is on the Hackage), but with no luck. I can not hear anything from speakers and also according to generated output on console it seems that AL.play never completes playback of a buffer as buffer remains registered as unprocessed in OpenAL context. Here is the

[Haskell-cafe] [GSoC] Plugins for GHC

2008-03-21 Thread Max Bolingbroke
Hi, I'm interested in working on a plugins system for the Glasgow Haskell Compiler. The idea here is to allow third parties to add more capabilities to the compiler in a way that doesn't involve messing around with modifying GHC itself. Potential use cases are: * Allow Haskell code to be

Re: [Haskell-cafe] Type constraints for class instances

2008-03-21 Thread Krzysztof Skrzętnicki
It compiles, but it doesn't work when i try to use it on lists. There are some bugs in that code, but I need some time to fix it. 2008/3/21 Bas van Dijk [EMAIL PROTECTED]: 2008/3/21 Krzysztof Skrzętnicki [EMAIL PROTECTED]: ... I'd like to write the following code: instance (Ord a)

Re: [Haskell-cafe] AMQP framing layer: design help requested.

2008-03-21 Thread Adam Langley
On Fri, Mar 21, 2008 at 11:02 AM, Paul Johnson [EMAIL PROTECTED] wrote: This effectively duplicates the AmqpVariant solution. It would work, but it feels horrible. I get the feeling that there ought to be a better way, possibly using classes or existential types. Any suggestions?

Re: [Haskell-cafe] AMQP framing layer: design help requested.

2008-03-21 Thread Adam Langley
On Fri, Mar 21, 2008 at 6:41 PM, Adam Langley [EMAIL PROTECTED] wrote: Firstly, I would use the Get and Put monads directly, rather than making them instances of Binary. Also, while I'm at it - I believe that AMQP messages and small and delineated. In which case, the Data.Binary.Strict.Get

[Haskell-cafe] compile error with FFI code

2008-03-21 Thread Galchin Vasili
Hello, In my blah.hsc, I have allocbytes (#const (struct bozo)) .. where struct bozo is a bunch of long int ,,, In the runhaskell Setup.hs build step I get a nasty error message about an incomplete type. I have look at many times but this error doesn't make sense to me. ?? Kind regards,