[Haskell-cafe] Orphan instances

2008-03-04 Thread Henning Thielemann
Consider the following modules module A class A t module T import A data T a module B import A import T class A t => B t instance B t => A (T t) GHC emits warning about orphan instance A (T t), since neither A nor T are defined in B. However I can't move the instance to A or T sin

[Haskell-cafe] Re: problem in using wash

2008-03-04 Thread Vikrant
Thanks for the information. Now I could find mistake in what I was importing. 'ghc-pkg describe WashNGo' told me correct exported module names. On 05/03/2008, Ferenc Wagner <[EMAIL PROTECTED]> wrote: > > Vikrant <[EMAIL PROTECTED]> writes: > > > I was trying to use wash to learn it. I am using ub

[Haskell-cafe] Re: Exporting Haskell Libraries to C Programmers

2008-03-04 Thread Bruce, Joseph R (Joe)
Don Stewart galois.com> writes: > > joseph.bruce: > > Hi, > > > > I have a Haskell library that I want to make available via FFI to C > > programmers on my project team. I read this thread > > (http://thread.gmane.org/gmane.comp.lang.haskell.cafe/21447) which had > > some interesting ideas, bu

Re: [Haskell-cafe] Functional programmer's intuition for adjunctions?

2008-03-04 Thread Derek Elkins
On Tue, 2008-03-04 at 18:30 +, Edsko de Vries wrote: > On Tue, Mar 04, 2008 at 11:58:38AM -0600, Derek Elkins wrote: > > On Tue, 2008-03-04 at 17:16 +, Edsko de Vries wrote: > > > Hi, > > > > > > Is there an intuition that can be used to explain adjunctions to > > > functional programmers,

Re: [Haskell-cafe] Re: Functional programmer's intuition for adjunctions?

2008-03-04 Thread Miguel Mitrofanov
Well, I think it's really cool to be sitting in cafe exchanging some сute facts from category theory we happen to know. Girls would definitely like it. On 5 Mar 2008, at 03:33, Derek Elkins wrote: On Tue, 2008-03-04 at 19:01 +, Dominic Steinitz wrote: Well, we have at least one very us

[Haskell-cafe] Re: [Yhc] Yhc Web Service quietly opened for public testing

2008-03-04 Thread Thomas Hartman
That is seriously cool. Congratulations Dmitry! thomas. 2008/3/4, Dimitry Golubovsky <[EMAIL PROTECTED]>: > Hi, > > I finally got the Yhc Web Service (web-based front end to the > compiler) running in public testing mode. There hasn't been any > documentation written, and Haddock stuff not br

Re: [Haskell-cafe] Re: Functional programmer's intuition for adjunctions?

2008-03-04 Thread Derek Elkins
On Tue, 2008-03-04 at 19:01 +, Dominic Steinitz wrote: > > Well, we have at least one very useful example of adjunction. It's > > called "curry". See, if X is some arbitrary type, you can define > > > > This adjunction is the one that makes a category cartesian closed. and the monad for it

Re: [Haskell-cafe] (flawed?) benchmark : sort

2008-03-04 Thread Krzysztof Skrzętnicki
I get it now, thanks. Also, I guess it is possible to find a better algorithm for standard library sort. Christopher Skrzętnicki On Wed, Mar 5, 2008 at 12:04 AM, Chaddaï Fouché <[EMAIL PROTECTED]> wrote: > 2008/3/4, Krzysztof Skrzętnicki <[EMAIL PROTECTED]>: > > Thanks for improved code. My poin

[Haskell-cafe] Re: problem in using wash

2008-03-04 Thread Ferenc Wagner
Vikrant <[EMAIL PROTECTED]> writes: > I was trying to use wash to learn it. I am using ubuntu and I have ghc6.6.1 > installed on my system. > I have also installed the package libghc6-wash-dev > > but in my code when i write > > "import WASH.CGI" > > it gives me following error > > firstCGI.hs:5:7

Re: [Haskell-cafe] (flawed?) benchmark : sort

2008-03-04 Thread Chaddaï Fouché
2008/3/4, Krzysztof Skrzętnicki <[EMAIL PROTECTED]>: > Thanks for improved code. My point was to measure which programming patterns > are faster than the others so I can learn which ones I should use. However, > the thing that is really bad is the fact, that even oneliner qsort_i is > faster than l

Re: [Haskell-cafe] (flawed?) benchmark : sort

2008-03-04 Thread Neil Mitchell
Hi > My intuition is only best and fastest code goes to library, to the point > that people can learn from it. It seems I was mislead. The compilers change over time - meaning that the fastest code may change over time. There is also the chance that the original code was not the best - for exampl

Re: [Haskell-cafe] (flawed?) benchmark : sort

2008-03-04 Thread Krzysztof Skrzętnicki
Thanks for improved code. My point was to measure which programming patterns are faster than the others so I can learn which ones I should use. However, the thing that is really bad is the fact, that even oneliner qsort_i is faster than library sort. Which is very different from what I've expected.

Re: [Haskell-cafe] Doubting Haskell

2008-03-04 Thread Don Stewart
chaddai.fouche: > 2008/3/4, Alan Carter <[EMAIL PROTECTED]>: > > I've written up some reflections on my newbie experience together with > > both versions, which might be helpful to people interested in > > popularizing Haskell, at: > > > > http://the-programmers-stone.com/2008/03/04/a-first-has

Re: [Haskell-cafe] Doubting Haskell

2008-03-04 Thread Chaddaï Fouché
2008/3/4, Alan Carter <[EMAIL PROTECTED]>: > I've written up some reflections on my newbie experience together with > both versions, which might be helpful to people interested in > popularizing Haskell, at: > > http://the-programmers-stone.com/2008/03/04/a-first-haskell-experience/ This is tr

Re: [Haskell-cafe] Haskell & Perl architecture question

2008-03-04 Thread Sterling Clover
Not quite sure what you're looking for? Do you mean that you're looking at the possibility of setting such a system up, or that you're looking at a system that is already set up and trying to grok how it works? If the latter, you might want to get a sense of how ghc manages its packages and depende

Re: [Haskell-cafe] Doubting Haskell

2008-03-04 Thread hjgtuyl
About the line length needed for Haskell programs, there was a discussion about this some time ago, that could be regarded as a tutorial for reducing indentation: http://haskell.org/pipermail/haskell-cafe/2007-July/028787.html As for the idle core you mention: I keep one core fully occupied w

Re: [Haskell-cafe] Functional programmer's intuition for adjunctions?

2008-03-04 Thread Dan Piponi
Edsko asked: > Is there an intuition that can be used to explain adjunctions to > functional programmers, even if the match isn't necessary 100% perfect > (like natural transformations and polymorphic functions?). I think there's a catch because many interesting examples of adjunctions involve

[Haskell-cafe] Haskell & Perl architecture question

2008-03-04 Thread Marty Landman
I'm looking at a production system running Perl & Haskell in an Apache environment and trying to get a handle on the system architecture. Are there online resources anyone could recommend I start with? Thanks in advance, Marty -- Marty Landman, Face 2 Interface Inc. 845-679-9387 Drupal Develo

[Haskell-cafe] Re: Functional programmer's intuition for adjunctions?

2008-03-04 Thread Dominic Steinitz
> Well, we have at least one very useful example of adjunction. It's > called "curry". See, if X is some arbitrary type, you can define > This adjunction is the one that makes a category cartesian closed. Dominic. ___ Haskell-Cafe mailing list Haske

Re: [Haskell-cafe] Doubting Haskell

2008-03-04 Thread Evan Laforge
> Especially if mixing tabs and spaces indeed. Haskell does the Python > thing of assuming that a tab is 8 spaces, which IMO is a mistake. The FWIW, most people in python land think the same thing, and the -t flag makes mixed tabs and spaces a warning or error. At the least, -Wall could report

Re: [Haskell-cafe] Functional programmer's intuition for adjunctions?

2008-03-04 Thread Miguel Mitrofanov
Well, we have at least one very useful example of adjunction. It's called "curry". See, if X is some arbitrary type, you can define type F = (,X) instance Functor F where fmap f (a,x) = (fa,x) type G = (->) X instance Functor G where fmap f h = \x -> f (h x) Now, we have the adjunction

Re: [Haskell-cafe] Functional programmer's intuition for adjunctions?

2008-03-04 Thread Edsko de Vries
On Tue, Mar 04, 2008 at 11:58:38AM -0600, Derek Elkins wrote: > On Tue, 2008-03-04 at 17:16 +, Edsko de Vries wrote: > > Hi, > > > > Is there an intuition that can be used to explain adjunctions to > > functional programmers, even if the match isn't necessary 100% perfect > > (like natural tra

Re: [Haskell-cafe] Functional programmer's intuition for adjunctions?

2008-03-04 Thread Derek Elkins
On Tue, 2008-03-04 at 17:16 +, Edsko de Vries wrote: > Hi, > > Is there an intuition that can be used to explain adjunctions to > functional programmers, even if the match isn't necessary 100% perfect > (like natural transformations and polymorphic functions?). Well when you pretend Hask is S

Re: [Haskell-cafe] (flawed?) benchmark : sort

2008-03-04 Thread Neil Mitchell
Hi > -- Zadanie 9 - merge sort > mergeSort :: Ord a => [a] -> [a] > mergeSort []= [] > mergeSort [x] = [x] > mergeSort xs= let(l, r) = splitAt (length xs `quot` 2) xs > in mergeSortP (mergeSort l) (mergeSort r) splitAt is not a particularly good way to split a lis

Re: [Haskell-cafe] (flawed?) benchmark : sort

2008-03-04 Thread Chaddaï Fouché
2008/3/4, Krzysztof Skrzętnicki <[EMAIL PROTECTED]>: > Hi > > I was playing with various versions of sorting algorithms. I know it's very > easy to create flawed benchmark and I don't claim those are good ones. > However, it really seems strange to me, that sort - library function - is > actually t

[Haskell-cafe] Functional programmer's intuition for adjunctions?

2008-03-04 Thread Edsko de Vries
Hi, Is there an intuition that can be used to explain adjunctions to functional programmers, even if the match isn't necessary 100% perfect (like natural transformations and polymorphic functions?). Thanks, Edsko ___ Haskell-Cafe mailing list Haskell-C

Re: [Haskell-cafe] Markup bug in HaskellWiki

2008-03-04 Thread Dougal Stanton
On 04/03/2008, Wolfgang Jeltsch <[EMAIL PROTECTED]> wrote: > Am Dienstag, 4. März 2008 16:10 schrieb Dougal Stanton: > > […] > > > > There's a file called, IIRC, haskell.php with a large list of > > keywords. Two of them, 'unzip' and 'unzip3' appear twice. Delete one > > of each and it all work

Re: [Haskell-cafe] Markup bug in HaskellWiki

2008-03-04 Thread Henning Thielemann
On Tue, 4 Mar 2008, Wolfgang Jeltsch wrote: > Am Dienstag, 4. März 2008 16:10 schrieb Dougal Stanton: > > […] > > > There's a file called, IIRC, haskell.php with a large list of > > keywords. Two of them, 'unzip' and 'unzip3' appear twice. Delete one > > of each and it all works fine again. > > W

Re: [Haskell-cafe] Annotating GHC assembler output?

2008-03-04 Thread Justin Bailey
On Mon, Mar 3, 2008 at 5:41 PM, Ben Lippmeier <[EMAIL PROTECTED]> wrote: > Hi Justin. > > try: ghc -c -ddump-to-file -ddump-asm > Thanks, that does it. I also tried the -keep-s-files (possibly new to 6.8) and found it produces the same output. Justin ___

Re: [Haskell-cafe] Doubting Haskell

2008-03-04 Thread Cale Gibbard
On 04/03/2008, Luke Palmer <[EMAIL PROTECTED]> wrote: > On Tue, Mar 4, 2008 at 4:16 AM, Ketil Malde <[EMAIL PROTECTED]> wrote: > > Paul Johnson <[EMAIL PROTECTED]> writes: > > > > > I'm surprised you found the significant whitespace difficult. > > > > I wonder if this has something to do wit

Re: [Haskell-cafe] Markup bug in HaskellWiki

2008-03-04 Thread Wolfgang Jeltsch
Am Dienstag, 4. März 2008 16:10 schrieb Dougal Stanton: > […] > There's a file called, IIRC, haskell.php with a large list of > keywords. Two of them, 'unzip' and 'unzip3' appear twice. Delete one > of each and it all works fine again. Why do they appear at all? They are not keywords. Best wish

Re: [Haskell-cafe] Connection helpers: for people interested in network code

2008-03-04 Thread Adam Langley
On Tue, Mar 4, 2008 at 7:31 AM, Bjorn Bringert <[EMAIL PROTECTED]> wrote: > you may want to have a look at the socket abstraction used in the HTTP > package: > > > http://hackage.haskell.org/packages/archive/HTTP/3001.0.4/doc/html/Network-Stream.html > > It would be great to get HTTPS support

[Haskell-cafe] problem in using wash

2008-03-04 Thread Vikrant
Hi, I was trying to use wash to learn it. I am using ubuntu and I have ghc6.6.1 installed on my system. I have also installed the package libghc6-wash-dev but in my code when i write "import WASH.CGI" it gives me following error firstCGI.hs:5:7: Could not find module `WASH.CGI': lo

Re: [Haskell-cafe] Connection helpers: for people interested in network code

2008-03-04 Thread Bjorn Bringert
On Fri, Feb 29, 2008 at 8:50 PM, Adam Langley <[EMAIL PROTECTED]> wrote: > I generally find that I'm wrapping sockets in the same functions a lot > and now I'm looking writings code which works with both Sockets and > SSL connections. So I wrote a module, presumptuously called > Network.Connecti

Re: [Haskell-cafe] Doubting Haskell

2008-03-04 Thread Paul Moore
On 04/03/2008, Alan Carter <[EMAIL PROTECTED]> wrote: > http://the-programmers-stone.com/2008/03/04/a-first-haskell-experience/ That was an interesting read. Thanks for posting it. I also liked the tale of the BBC ULA - it reminded me of a demo I saw once at an Acorn show, where they had a RISC PC

Re: [Haskell-cafe] Markup bug in HaskellWiki

2008-03-04 Thread Dougal Stanton
On 04/03/2008, Henning Thielemann <[EMAIL PROTECTED]> wrote: > > In the Wiki article > >http://haskell.org/haskellwiki/Comparison_chain > > there is the piece > >unzip">unzip > > which is improperly formatted. I guess the wiki uses GeSHi, and it's because of a bug in the keyword list.

[Haskell-cafe] Markup bug in HaskellWiki

2008-03-04 Thread Henning Thielemann
In the Wiki article http://haskell.org/haskellwiki/Comparison_chain there is the piece unzip">unzip which is improperly formatted. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Doubting Haskell

2008-03-04 Thread Luke Palmer
On Tue, Mar 4, 2008 at 4:16 AM, Ketil Malde <[EMAIL PROTECTED]> wrote: > Paul Johnson <[EMAIL PROTECTED]> writes: > > > I'm surprised you found the significant whitespace difficult. > > I wonder if this has something to do with the editor one uses? I use > Emacs, and just keep hitting TAB, cycl

Re: [Haskell-cafe] Doubting Haskell

2008-03-04 Thread Ketil Malde
Paul Johnson <[EMAIL PROTECTED]> writes: > I'm surprised you found the significant whitespace difficult. I wonder if this has something to do with the editor one uses? I use Emacs, and just keep hitting TAB, cycling through possible alignments, until things align sensibly. I haven't really tri

Re: [Haskell-cafe] CABAL: conditional executable?

2008-03-04 Thread Thomas Schilling
On 4 mar 2008, at 11.37, Magnus Therning wrote: On 3/4/08, Thomas Schilling <[EMAIL PROTECTED]> wrote: executable foo main-is: bla if !os(windows): buildable: false Unfortunately this gives rather unhelpful error messages when used with flags, but it works well enough for now. / Th

Re: [Haskell-cafe] Doubting Haskell

2008-03-04 Thread Paul Johnson
Alan Carter wrote: I've written up some reflections on my newbie experience together with both versions, which might be helpful to people interested in popularizing Haskell, at: http://the-programmers-stone.com/2008/03/04/a-first-haskell-experience/ Thank you for writing this. On the lack o

Re: [Haskell-cafe] CABAL: conditional executable?

2008-03-04 Thread Magnus Therning
On 3/4/08, Thomas Schilling <[EMAIL PROTECTED]> wrote: > > executable foo >main-is: bla >if !os(windows): > buildable: false > > Unfortunately this gives rather unhelpful error messages when used > with flags, but it works well enough for now. > > / Thomas Hmmm, I don't seem to get t

Re: [Haskell-cafe] CABAL: conditional executable?

2008-03-04 Thread Thomas Schilling
On 4 mar 2008, at 10.58, Magnus Therning wrote: Good point. Does CABAL 1.2 have support for multiple .cabal files in the same directory? If not then I'm not too happy with this solution. No. Eventually, Cabal will support something like this, but it's unlikely that Cabal 1.4 will.

Re: [Haskell-cafe] CABAL: conditional executable?

2008-03-04 Thread Magnus Therning
On 3/4/08, Henning Thielemann <[EMAIL PROTECTED]> wrote: > > > On Tue, 4 Mar 2008, Magnus Therning wrote: > > > I'm putting together a package consisting of 2 executables. Only one of > > them is pure Haskell and thus buildable on all platforms, the other > > relies on Windows API calls and can onl

Re: [Haskell-cafe] CABAL: conditional executable?

2008-03-04 Thread Henning Thielemann
On Tue, 4 Mar 2008, Magnus Therning wrote: I'm putting together a package consisting of 2 executables. Only one of them is pure Haskell and thus buildable on all platforms, the other relies on Windows API calls and can only be built on that platform. I found the “if os(...)” conditional in

Re: [Haskell-cafe] CABAL: conditional executable?

2008-03-04 Thread Thomas Schilling
executable foo main-is: bla if !os(windows): buildable: false Unfortunately this gives rather unhelpful error messages when used with flags, but it works well enough for now. / Thomas On 4 mar 2008, at 09.10, Magnus Therning wrote: I'm putting together a package consisting of 2 exe

[Haskell-cafe] CABAL: conditional executable?

2008-03-04 Thread Magnus Therning
I'm putting together a package consisting of 2 executables. Only one of them is pure Haskell and thus buildable on all platforms, the other relies on Windows API calls and can only be built on that platform. I found the “if os(...)” conditional in the CABAL docs but I'm having problems getting it