Re: Strafunski/overlapping instances in ghc-6.5

2006-04-03 Thread Christian Maeder
Christopher Brown wrote: Christian, Did you try the switch -fallow-overlapping-instances when compiling? Yes, but it doesn't seem to make much difference. Maybe a couple of more library files have not been translated with the above flag.

Re: Dumb guy needs help

2006-04-03 Thread Max Vasin
Davey == Davey dude [EMAIL PROTECTED] writes: Davey Im new to Haskell, hugs in particular, and was hoping you could Davey help me solve a problem. It should be pretty easy. I have to Davey use hugs to create an expression data Exp = Plus Exp Exp| Sub Davey Exp Exp| Mult Exp Exp| Power Exp Exp |

readChan and unGetChan?

2006-04-03 Thread Li, Peng
Suppose the following happens: (1) Thread A calls readChan on an empty channel and waits (2) Thread B puts something to the read-end of the channel using unGetChan When a GHC program does this, both threads are blocked! Is it the behaviour we really want for unGetChan, or should we fix the

[Haskell] Strafunski

2006-04-03 Thread Christopher Brown
Hi, I am trying to use Strafunski with GHC 6.5 and was wondering if someone could help me. I have all the instances for Term and Typeable defined for my data types, but when I try to compile with GHC 6.5 I get lots of overlapping instance errors. In particular, it seems the instances I

[Haskell] Re: [Haskell-cafe] Strafunski

2006-04-03 Thread Joost Visser
Hi Chris, Changes in the libraries of GHC have broken Strafunski compatibility in the past. I have not upgraded to GHC 6.5 myself so I'm not sure if this is the case again. Which versions of DrIFT and Strafunski are you using? Based on what you write, it seems new instances for Typeable

[Haskell] Re: [Haskell-cafe] Strafunski

2006-04-03 Thread Christopher Brown
Joost, Thanks very much - this solved my problem! Cheers Chris. On 3 Apr 2006, at 17:03, Joost Visser wrote: Hi Chris, Changes in the libraries of GHC have broken Strafunski compatibility in the past. I have not upgraded to GHC 6.5 myself so I'm not sure if this is the case again.

[Haskell] haskell@ archives, 1990-2000

2006-04-03 Thread Donald Bruce Stewart
I managed, with the help of some custom hacks, to convert Simon's tarball of the haskell@ archives from 1990-2000 into html. I've hosted the lot here: http://www.cse.unsw.edu.au/~dons/haskell-1990-2000/threads.html I'm not sure these archives are available anywhere else, other than the

Re: [Haskell] haskell@ archives, 1990-2000

2006-04-03 Thread Donald Bruce Stewart
dons: I managed, with the help of some custom hacks, to convert Simon's tarball of the haskell@ archives from 1990-2000 into html. By the way, this was in the context of writing up the HWN-style news over that decade, here: http://haskell.org/haskellwiki/Old_news -- Don

state threads

2006-04-03 Thread John Meacham
In case anyone was wondering what this state-threads thing I keep talking about is, here is a sample implementation (in C) as well as a lot of documentation and FAQs that apply to haskell as well. http://state-threads.sourceforge.net/ it should be noted that the chief disadvantage of state

RE: Concurrency

2006-04-03 Thread Simon Marlow
On 31 March 2006 13:41, John Meacham wrote: I have tried to summarize the current thinking into a proposal on the wiki. http://haskell.galois.com/cgi-bin/haskell-prime/trac.cgi/wiki/Concurrenc y I split it into 3 parts. the standard - all haskell' compilers must implement optional

Re: FFI, safe vs unsafe

2006-04-03 Thread John Meacham
On Sat, Apr 01, 2006 at 02:30:30PM +0400, Bulat Ziganshin wrote: new stacks can be allocated by alloca() calls. all these alloca-allocated stack segments can be used as pool of stacks assigned to the forked threads. although i don't tried this, my own library also used processor-specific

Re: Concurrency

2006-04-03 Thread Ross Paterson
On Fri, Mar 31, 2006 at 01:15:03PM -0800, John Meacham wrote: On Fri, Mar 31, 2006 at 04:21:26PM +0100, Simon Marlow wrote: Great. Apart from my misgivings about allowing cooperative scheduling at all, here's a few comments on the proposal: much much preferable to a standard that not

Re[2]: FFI, safe vs unsafe

2006-04-03 Thread Bulat Ziganshin
Hello John, Monday, April 3, 2006, 12:53:05 PM, you wrote: new stacks can be allocated by alloca() calls. all these alloca-allocated stack segments can be used as pool of stacks assigned to the forked threads. although i don't tried this, my own library also used processor-specific method.

terminating instances

2006-04-03 Thread Ross Paterson
GHC 6.4 has rather conservative constraints on instances to guarantee termination. GHC 6.5 has more liberal constraints; see http://haskell.galois.com/cgi-bin/haskell-prime/trac.cgi/wiki/FlexibleInstances Unfortunately instances generated by newtype-deriving need not satisfy either of these

Re: Concurrency

2006-04-03 Thread John Meacham
On Mon, Apr 03, 2006 at 11:38:08AM +0100, Ross Paterson wrote: On Fri, Mar 31, 2006 at 01:15:03PM -0800, John Meacham wrote: On Fri, Mar 31, 2006 at 04:21:26PM +0100, Simon Marlow wrote: Great. Apart from my misgivings about allowing cooperative scheduling at all, here's a few comments

Re: FFI, safe vs unsafe

2006-04-03 Thread Wolfgang Thaller
John Meacham wrote (... but I've reordered things): My only real 'must-have' is that the 4 modes all can be explicitly and unambiguously specified. I have opinions on the syntax/hints but that is more flexable. I basically agree (the syntax discussion will take place in the years after

Re: [Haskell-cafe] Haskell on Pocket PC?

2006-04-03 Thread Dmitri O.Kondratiev
Hi Neil, Thanks for your reply. Starting from YHC porting pages the only source for Win32 port I found is WinHaskell. [http://www-users.cs.york.ac.uk/~ndm/projects/winhaskell.php] I have not yet found which port it is: Hugs, YHc, ...? Also there is a thing called WinHugs at

Re: [Haskell-cafe] Distributing monadic(?) functions across dyadic functions

2006-04-03 Thread Nils Anders Danielsson
On Sun, 02 Apr 2006, Jared Updike [EMAIL PROTECTED] wrote: Something like distribute fst (==) where distribute f op x y = f x `op` f y A function like this has been suggested for the standard libraries a couple of times before. Someone suggested the name on, which I quite like: (*) `on` f

Re: [Haskell-cafe] show for functional types

2006-04-03 Thread Fritz Ruehr
I've revised my thinking about printing (total, finite) functions: I should have respected the notion that a printed representation can be cut-and-pasted back in at the prompt for evaluation to something equal to the original. I've also revised my implementation to this effect, so that

[Haskell-cafe] Re: Breaking up long lines

2006-04-03 Thread Pete Chown
Neil Mitchell wrote: The indentation rules are quite complex, but just type your code sensibly indented and it will probably just work. My biggest problem in this area was following haskell-mode's defaults too strictly. I found that things ended up indented more than was necessary for clear

Re: [Haskell-cafe] Haskell on Pocket PC?

2006-04-03 Thread Neil Mitchell
Hi, Starting from YHC porting pages the only source for Win32 port I found is WinHaskell. [http://www-users.cs.york.ac.uk/~ndm/projects/winhaskell.php] That's an entirely separate project, it just uses Yhc/GHC/Hugs. Thats the things about the Yhc port to Windows - its not a port, Yhc just

[Haskell-cafe] Efficient Sets for Small Enumerations

2006-04-03 Thread David F. Place
Often when writing algorithms which involve set operations on small enumerations, I start off using Data.Set. I soon find performance requires rewriting that code to use bitwise operations. I miss the nice interface of Data.Set and the type checking of using a proper data type. So, as

[Haskell-cafe] generics question 2

2006-04-03 Thread Frederik Eaton
Hi Ralf, I'm looking for a function like extT but with more general type: (t a - s a) - (t b - s b) - (t a - s a) Is there such a thing in the generics library? Thanks, Frederik -- http://ofb.net/~frederik/ ___ Haskell-Cafe mailing list

[Haskell-cafe] Re: Efficient Sets for Small Enumerations

2006-04-03 Thread Jean-Philippe Bernardy
David F. Place d at vidplace.com writes: I'm currently writing and evolution to the standard collection package that can be found here: http://darcs.haskell.org/packages/collections/ We integrate your module there. What would you say? Cheers, JP.

[Haskell-cafe] Strafunski

2006-04-03 Thread Christopher Brown
Hi, I am trying to use Strafunski with GHC 6.5 and was wondering if someone could help me. I have all the instances for Term and Typeable defined for my data types, but when I try to compile with GHC 6.5 I get lots of overlapping instance errors. In particular, it seems the instances I

[Haskell-cafe] Re: Strafunski

2006-04-03 Thread Christian Maeder
Christopher Brown wrote: Hi, I am trying to use Strafunski with GHC 6.5 and was wondering if someone could help me. I have all the instances for Term and Typeable defined for my data types, but when I try to compile with GHC 6.5 I get lots of overlapping instance errors. In particular, it

[Haskell-cafe] Re: Strafunski

2006-04-03 Thread Christopher Brown
Christian, Did you try the switch -fallow-overlapping-instances when compiling? Yes, but it doesn't seem to make much difference. Cheers, Chris. Cheers Christian Christopher Brown PhD Student, University of Kent. http://www.cs.kent.ac.uk/people/rpg/cmb21/ [EMAIL PROTECTED]

Re: [Haskell-cafe] Re: Efficient Sets for Small Enumerations

2006-04-03 Thread David F. Place
On Apr 3, 2006, at 10:02 AM, Jean-Philippe Bernardy wrote: I'm currently writing and evolution to the standard collection package that can be found here: http://darcs.haskell.org/packages/collections/ We integrate your module there. What would you say? Sure. I'd be honored.

Re: [Haskell-cafe] Strafunski

2006-04-03 Thread Joost Visser
Hi Chris, Changes in the libraries of GHC have broken Strafunski compatibility in the past. I have not upgraded to GHC 6.5 myself so I'm not sure if this is the case again. Which versions of DrIFT and Strafunski are you using? Based on what you write, it seems new instances for Typeable

Re: [Haskell-cafe] Code Review: Sudoku solver

2006-04-03 Thread Claus Reinke
It solves sudoku puzzles. (What pleasure do people get by doing these in their heads?!?) probably the same you get from writing programs?-) figuring out the rules, not getting lost in complexity, making something difficult work.. They are probably asking the same question: why take hours

Re: [Haskell-cafe] Code Review: Sudoku solver

2006-04-03 Thread Chris Kuklewicz
Claus Reinke wrote: It solves sudoku puzzles. (What pleasure do people get by doing these in their heads?!?) probably the same you get from writing programs?-) figuring out the rules, not getting lost in complexity, making something difficult work.. From a human standpoint, there are

Re: [Haskell-cafe] Code Review: Sudoku solver

2006-04-03 Thread Jared Updike
Chris wrote: You need more than 5 examples. The truly evil puzzles are rarer than that. Go get the set of minimal puzzles and see how far your logic takes you. Chris elucidated some of my questions before I finished writing my email... Claus wrote: (*) actually, that was a bit

[Haskell-cafe] Re: Strafunski/overlapping instances in ghc-6.5

2006-04-03 Thread Christian Maeder
Christopher Brown wrote: Christian, Did you try the switch -fallow-overlapping-instances when compiling? Yes, but it doesn't seem to make much difference. Maybe a couple of more library files have not been translated with the above flag.

Re: [Haskell-cafe] Efficient Sets for Small Enumerations

2006-04-03 Thread Benjamin Franksen
On Monday 03 April 2006 14:19, David F. Place wrote: Often when writing algorithms which involve set operations on small enumerations, I start off using Data.Set. I soon find performance requires rewriting that code to use bitwise operations. I miss the nice interface of Data.Set and the

Re: [Haskell-cafe] Code Review: Sudoku solver

2006-04-03 Thread Tom Schrijvers
since I haven't factored out the constraint propagation into a general module, the core of my code is a lot longer than the Curry version (about 60 additional lines, though I'm sure one could reduce that;-). the only negative point I can find about the Curry example is that it isn't obvious

Re: [Haskell-cafe] Code Review: Sudoku solver

2006-04-03 Thread Chris Kuklewicz
Jared Updike wrote: Chris wrote: You need more than 5 examples. The truly evil puzzles are rarer than that. Go get the set of minimal puzzles and see how far your logic takes you. Chris elucidated some of my questions before I finished writing my email... Claus wrote: (*) actually,

Re: [Haskell-cafe] Re: Strafunski

2006-04-03 Thread Bulat Ziganshin
Hello Christopher, the trick is that there is another approach to generics, largely based on the Strafunski. it's named scrap your boilerplate! (SYB) and it's implementation is included in ghc. you can find 3 SYB papers and it seems better to just learn and use this approach to generic

Re: [Haskell-cafe] Efficient Sets for Small Enumerations

2006-04-03 Thread David F. Place
On Apr 3, 2006, at 1:31 PM, Benjamin Franksen wrote: wondered about the Ord instance. Wouldn't it be faster to compare (word-) representations? I thought about that some. Since the set representation is based completely on the enumeration, it would be possible for the type being

Re[2]: [Haskell-cafe] Code Review: Sudoku solver

2006-04-03 Thread Bulat Ziganshin
Hello it seems that sudoku solver may be a good candidate for nofib suite / language comparison shootout -- Best regards, Bulatmailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Efficient Sets for Small Enumerations

2006-04-03 Thread Jean-Philippe Bernardy
On 4/3/06, David F. Place [EMAIL PROTECTED] wrote: On Apr 3, 2006, at 1:31 PM, Benjamin Franksen wrote: wondered about the Ord instance. Wouldn't it be faster to compare (word-) representations? I thought about that some. Since the set representation is based completely on the

[Haskell-cafe] Distributing monadic(?) functions across dyadic functions

2006-04-03 Thread tpledger
Nils Anders Danielsson wrote: A function like this has been suggested for the standard libraries a couple of times before. Someone suggested the name on, which I quite like: (*) `on` f = \x y - f x * f y Thanks! I always wanted to be someone. :-) Here's the link.

Re: [Haskell-cafe] Efficient Sets for Small Enumerations

2006-04-03 Thread David F. Place
On Apr 3, 2006, at 5:38 PM, Jean-Philippe Bernardy wrote: I don't think there is a requirement for the Ord class to be equal to compare a b = compare (toAscList a) (toAscList b). I'd say it's safe to simply compare the bits representation. Hmm. OK. Besides, I've integrated your module to

Re: [Haskell-cafe] Code Review: Sudoku solver

2006-04-03 Thread Donald Bruce Stewart
bulat.ziganshin: Hello it seems that sudoku solver may be a good candidate for nofib suite / language comparison shootout It would also be nice to see some example sudoku solvers posted on an `Idioms' page on haskell.org: http://www.haskell.org/haskellwiki/Category:Idioms someone could

Re: [Haskell-cafe] Code Review: Sudoku solver

2006-04-03 Thread Daniel Fischer
Am Montag, 3. April 2006 18:52 schrieb Chris Kuklewicz: Claus Reinke wrote: It solves sudoku puzzles. (What pleasure do people get by doing these in their heads?!?) probably the same you get from writing programs?-) figuring out the rules, not getting lost in complexity, making

Re: [Haskell-cafe] Strafunski

2006-04-03 Thread Christopher Brown
Joost, Thanks very much - this solved my problem! Cheers Chris. On 3 Apr 2006, at 17:03, Joost Visser wrote: Hi Chris, Changes in the libraries of GHC have broken Strafunski compatibility in the past. I have not upgraded to GHC 6.5 myself so I'm not sure if this is the case again.

[Haskell-cafe] RE: generics question 2

2006-04-03 Thread Ralf Lammel
Hi Ralf, I'm looking for a function like extT but with more general type: (t a - s a) - (t b - s b) - (t a - s a) Is there such a thing in the generics library? Hi Frederik, Not sure how you are exactly going to use such an operation ... But here is its implementation anyhow. Thanks