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

2008-04-21 Thread Ryan Ingram
On Fri, Apr 18, 2008 at 10:01 PM, Jonathan Cast [EMAIL PROTECTED] wrote: {-# GHC_OPTIONS -foverlapping-instances -fundecidable-instances #-} :) What you want to work is precisely what this allows. Of course, I bring that point up. And overlapping instances has the problem that it doesn't

Re: [Haskell-cafe] Announce: bytestring 0.9.1.0

2008-04-21 Thread Ian Lynagh
On Sun, Apr 20, 2008 at 05:07:48PM -0700, Donald Bruce Stewart wrote: The use of bytestring inside GHC is limited only to a little bit in the GHCi modules -- and could easily be replaced, I suspect. Doing so would remove one dependency from GHC's core, as well as making it easier to upgrade

Re: [Haskell-cafe] looking for examples of non-full Functional Dependencies

2008-04-21 Thread Martin Sulzmann
I now recall the reason for NOT using D a b, D [a] c == c = [b] The reason is that the above rule creates a new critical pair with instance D a b = D [a] [b] To resolve the critical pair we need yet another rule D a b, D [[a]] c == c =[[b]] You can already see where this leads to. In

Re: [Haskell-cafe] Announce: bytestring 0.9.1.0

2008-04-21 Thread Ian Lynagh
On Mon, Apr 21, 2008 at 01:27:20AM +0100, Duncan Coutts wrote: I guess we could try and adjust the names of the C symbols to include the package name and version. Or just rewrite the C bits in Haskell? There isn't much of it, and it doesn't look like there is a good reason that C should be

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

2008-04-21 Thread Hans van Thiel
On Fri, 2008-04-18 at 16:19 +0100, Duncan Coutts wrote: If there are any that you think are rejecting legitimate packages then do complain (as in this thread). I was sloppy in my upload of Emping 0.5 in not checking the libraries dependencies sufficiently and not doing a build (my apologies

Re: [Haskell-cafe] Help with associated types

2008-04-21 Thread Emil Axelsson
Thanks for the explanation! I didn't realize associate data types were different in that respect, but it makes sense to me now. I think associated data types seem too heavy-weight for my application. And anyway, just thinking about this made me simplify my previous solution to a

[Haskell-cafe] Functional board games

2008-04-21 Thread Dougal Stanton
I'm having a go at making a functional board game (the back-end logic for one, at least) and as with all good projects it raises lots of questions. But I'll keep it to one this time. Does anyone know of functional-style implementations of chess/draughts/go/anything else that might give me ideas?

Re: [Haskell-cafe] Functional board games

2008-04-21 Thread Jefferson Heard
Ralph Glass has a Xiang Qi board: http://xiangqiboard.blogspot.com/ On Mon, Apr 21, 2008 at 11:22 AM, Dougal Stanton [EMAIL PROTECTED] wrote: I'm having a go at making a functional board game (the back-end logic for one, at least) and as with all good projects it raises lots of questions.

Re: [Haskell-cafe] Functional board games

2008-04-21 Thread Bulat Ziganshin
Hello Dougal, Monday, April 21, 2008, 7:22:49 PM, you wrote: Does anyone know of functional-style implementations of chess/draughts/go/anything else that might give me ideas? I am writing once we have seen 100-line chess published in this list -- Best regards, Bulat

Re: [Haskell-cafe] Functional board games

2008-04-21 Thread Don Stewart
bulat.ziganshin: Hello Dougal, Monday, April 21, 2008, 7:22:49 PM, you wrote: Does anyone know of functional-style implementations of chess/draughts/go/anything else that might give me ideas? I am writing once we have seen 100-line chess published in this list There's more than a

Re: [Haskell-cafe] Functional board games

2008-04-21 Thread Ryan Ingram
Bertrand Felgenhauer[1] wrote a peg solitaire game[2] using Prompt[3] to interact with the user. Here's the core game loop: -- move a peg into a certain direction data Move = Move Pos Dir -- solitaire interface data Request a where RMove :: Board - [Move] - Request Move -- select a move

Re: [Haskell-cafe] Functional board games

2008-04-21 Thread Dougal Stanton
On Mon, Apr 21, 2008 at 5:08 PM, Ryan Ingram [EMAIL PROTECTED] wrote: Bertrand Felgenhauer[1] wrote a peg solitaire game[2] using Prompt[3] to interact with the user. Thanks to everyone for the suggestions, particularly the Games page on the Haskell wiki which didn't appear in all my googling

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

2008-04-21 Thread Don Stewart
Galois, Inc. is pleased to announce the open source release of a suite of web programming libraries for Haskell! The following libraries are available, providing support for a wide range of Haskell web programming scenarios: * json JSON (JavaScript Object Notation) is a lightweight

[Haskell-cafe] functional update

2008-04-21 Thread Evan Laforge
Here's some haskell to update a particular field in a data structure (the below run in a StateT / ErrorT context): set_track_width :: (UiStateMonad m) = Block.ViewId - Int - Block.Width - m () set_track_width view_id tracknum width = do view - get_view view_id track_views -

[Haskell-cafe] Laziness and Either

2008-04-21 Thread John Goerzen
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 error, or do I use an Either type to return errors? Initially, for simplicity, I just used error.

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

2008-04-21 Thread Brandon S. Allbery KF8NH
On Apr 21, 2008, at 3:50 , Ryan Ingram wrote: is almost unnecessary; (btw., functions /are/ instances of Show). Now it's my turn to call: Prelude Test.QuickCheck show ((\x - x) :: Int - Int) interactive:1:0: No instance for (Show (Int - Int)) import Data.Function. (but it is indeed a

Re: [Haskell-cafe] Functional board games

2008-04-21 Thread Matthew Naylor
Hi Dougal, Does anyone know of functional-style implementations of chess/draughts/go/anything else that might give me ideas? there's the Mate-in-N solver in the nofib suite: ftp://www.cs.york.ac.uk/pub/haskell/nofib.tar.gz It takes quite a simple approach, representing the board as two

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

2008-04-21 Thread Brandon S. Allbery KF8NH
On Apr 21, 2008, at 7:38 , Hans van Thiel wrote: On Fri, 2008-04-18 at 16:19 +0100, Duncan Coutts wrote: If there are any that you think are rejecting legitimate packages then do complain (as in this thread). Configuring Emping-0.5.1... cabal-setup: At least the following dependencies are

Re: [Haskell-cafe] Laziness and Either

2008-04-21 Thread Donn Cave
On Apr 21, 2008, at 11:18 AM, John Goerzen wrote: In the case of using error, we can happily process the data assuming everything will be fine, and raise an error if and when it is encountered. By using Either, however, any pattern match on the Left/Right result is going to force the

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

2008-04-21 Thread Brandon S. Allbery KF8NH
On Apr 21, 2008, at 14:21 , Brandon S. Allbery KF8NH wrote: http://www.cmu.edu.edu/~allbery/FuncShow.hs; note that it only works for monomorphic functions (more Note to self: be more careful when you just woke up. http:// www.ece.cmu.edu/~allbery/FuncShow.hs -- brandon s. allbery

Re: [Haskell-cafe] Glome.hs-0.3 and other things

2008-04-21 Thread Andrew Coppin
Jim Snow wrote: Useful references: What Every Programmer Needs to Know About Memory http://lwn.net/Articles/250967/ Thank you for monopolising my entire afternoon. This is probably the single most interesting thing I've read in ages! :-D Thinking about it, maybe this explains my sorting

Re: [Haskell-cafe] Glome.hs-0.3 and other things

2008-04-21 Thread David Roundy
On Mon, Apr 21, 2008 at 11:54 AM, Andrew Coppin [EMAIL PROTECTED] wrote: I suppose the idea is that Haskell is supposed to help you work at a higher level of abstraction, so you can concentrate on building better *algorithms* which require less work in the first place. Surely using an

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

2008-04-21 Thread Duncan Coutts
On Mon, 2008-04-21 at 14:30 -0400, Brandon S. Allbery KF8NH wrote: On Apr 21, 2008, at 7:38 , Hans van Thiel wrote: On Fri, 2008-04-18 at 16:19 +0100, Duncan Coutts wrote: If there are any that you think are rejecting legitimate packages then do complain (as in this thread).

Re: [Haskell-cafe] Laziness and Either

2008-04-21 Thread Henning Thielemann
On Mon, 21 Apr 2008, Donn Cave wrote: On Apr 21, 2008, at 11:18 AM, John Goerzen wrote: In the case of using error, we can happily process the data assuming everything will be fine, and raise an error if and when it is encountered. By using Either, however, any pattern match on the

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

2008-04-21 Thread Duncan Coutts
On Mon, 2008-04-21 at 13:38 +0200, Hans van Thiel wrote: Configuring Emping-0.5.1... cabal-setup: At least the following dependencies are missing: gtk -any I'll have to leave it at that, since my local Cabal version does configure and build, and I obviously can't use Hackage as a

Re: [Haskell-cafe] Glome.hs-0.3 and other things

2008-04-21 Thread Andrew Coppin
David Roundy wrote: On Mon, Apr 21, 2008 at 11:54 AM, Andrew Coppin [EMAIL PROTECTED] wrote: I suppose the idea is that Haskell is supposed to help you work at a higher level of abstraction, so you can concentrate on building better *algorithms* which require less work in the first place.

Re: [Haskell-cafe] Glome.hs-0.3 and other things

2008-04-21 Thread Stefan O'Rear
On Mon, Apr 21, 2008 at 07:54:24PM +0100, Andrew Coppin wrote: Jim Snow wrote: Useful references: What Every Programmer Needs to Know About Memory http://lwn.net/Articles/250967/ After studying all this material, I do find myself feeling slightly concerned. The article shows how in C / C++

Re: [Haskell-cafe] Hoogle

2008-04-21 Thread John Goerzen
On Wed April 16 2008 6:16:56 pm Brandon S. Allbery KF8NH wrote: On Apr 16, 2008, at 17:30 , John Goerzen wrote: On Wed April 16 2008 3:54:45 pm Galchin, Vasili wrote: I already found this link. Thanks in any case. I want to O_CREATE a file, i.e. do a openFd creating a new file.

Re: [Haskell-cafe] Laziness and Either

2008-04-21 Thread Magnus Therning
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 error, or do I use an Either type to return errors? Initially, for

Re: [Haskell-cafe] Laziness and Either

2008-04-21 Thread Malcolm Wallace
But when I did a simple refactoring to use Either, it occurred to me that this switch likely had a negative impact on laziness. Yes, probably. Is this analysis sensible? If so, are there better solutions? I notice that your Maybe-based code is written in a monadic style. If you also

Re: [Haskell-cafe] Laziness and Either

2008-04-21 Thread John Goerzen
On Mon April 21 2008 3:26:04 pm Magnus Therning wrote: In order to allow lazy decoding I ended up exporting decode' as well: decode' :: String - [Maybe Word8] I take it that in a situation like this, you'd have either: [] -- success with empty result a list full of Just x -- success

Re: [Haskell-cafe] Wrong Answer Computing Graph Dominators

2008-04-21 Thread Bertram Felgenhauer
Denis Bueno wrote: On Wed, Apr 16, 2008 at 2:33 PM, Bertram Felgenhauer [EMAIL PROTECTED] wrote: No. Data.Graph.Inductive.Query.Dominators is just buggy. [...] Here's a quick fix: Thanks! This fixes my problem. Have you submitted a bug and your patch to the appropriate tracker? If

Re: [Haskell-cafe] Wrong Answer Computing Graph Dominators

2008-04-21 Thread Denis Bueno
On Mon, Apr 21, 2008 at 5:21 PM, Bertram Felgenhauer [EMAIL PROTECTED] wrote: Denis Bueno wrote: On Wed, Apr 16, 2008 at 2:33 PM, Bertram Felgenhauer [EMAIL PROTECTED] wrote: No. Data.Graph.Inductive.Query.Dominators is just buggy. [...] Here's a quick fix: Thanks! This

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

2008-04-21 Thread Henrique Ferreiro GarcĂ­a
* feed Interfacing with RSS (v 0.9x, 2.x, 1.0) and Atom feeds Great! I had planned to make a feed reader using gtk2hs and this was exactly what I was waiting for. I have just seen that it is released as BSD3. Anyone knows if is there any problem in making use of it to develop

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

2008-04-21 Thread Don Stewart
hferreiro: * feed Interfacing with RSS (v 0.9x, 2.x, 1.0) and Atom feeds Great! I had planned to make a feed reader using gtk2hs and this was exactly what I was waiting for. I have just seen that it is released as BSD3. Anyone knows if is there any problem in making

Re: [Haskell-cafe] functional update

2008-04-21 Thread Ryan Ingram
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 } (=:) :: MonadState s m = FRef s a - a - m () ref =: a

Re: [Haskell-cafe] functional update

2008-04-21 Thread Stuart Cook
On Tue, Apr 22, 2008 at 4:12 AM, Evan Laforge [EMAIL PROTECTED] wrote: Has there been any work on improving update syntax in haskell? Possibly some improvement could be made with a typeclass or two and a few custom operators, to unify some of the disparate syntax. Maybe more improvement

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

2008-04-21 Thread Jonathan Cast
On 21 Apr 2008, at 12:50 AM, Ryan Ingram wrote: On Fri, Apr 18, 2008 at 10:01 PM, Jonathan Cast [EMAIL PROTECTED] wrote: {-# GHC_OPTIONS -foverlapping-instances -fundecidable-instances #-} :) What you want to work is precisely what this allows. Of course, I bring that point up. And