[Haskell-cafe] Questions about slow GC with STArray

2009-04-06 Thread FFT
I've been following with interest the recent discussions on reddit about the extremely slow hash tables in Haskell compared to F# and OCaml, and as I understood it, this performance problem is caused by GC not liking mutable arrays http://hackage.haskell.org/trac/ghc/ticket/650 It appears from

Re: [Haskell-cafe] high probability of installation problems and quality of the glorious implementation

2009-04-06 Thread Ketil Malde
Brandon S. Allbery KF8NH allb...@ece.cmu.edu writes: I wonder when we'll get a good haskell virtual package on Debian? What would this package do? Install ghc + all the little pieces of libghc6-cruft needed to get a sane working environment? Sounds easy to do (after all, it's just an empty

[Haskell-cafe] minor typo in The Haskell 98 Report

2009-04-06 Thread Benjamin L . Russell
Today, as I was reading through The Haskell 98 Report (see http://www.haskell.org/onlinereport/), I came across a minor typo, but it seems that the only way to fix such typos is to report them on one of the Haskell mailing lists; viz.: The original committees ceased to exist when the original

[Haskell-cafe] Re: [Haskell] [OT] Plural forms of the word octopus [Was: Re: Marketing Haskell]

2009-04-06 Thread ajb
[Shifted to haskell-cafe.] G'day all. Quoting Benjamin L.Russell dekudekup...@yahoo.com: According to the Merriam-Webster Online Dictionary, it is topoi (see http://www.merriam-webster.com/dictionary/topos). Topoi form a certain class of category. You can study topous, you can prove

Re: [Haskell-cafe] minor typo in The Haskell 98 Report

2009-04-06 Thread Malcolm Wallace
On 6 Apr 2009, at 08:56, Benjamin L.Russell wrote: Today, as I was reading through The Haskell 98 Report (see http://www.haskell.org/onlinereport/), I came across a minor typo, but it seems that the only way to fix such typos is to report them on one of the Haskell mailing lists; Thanks for

Re: [Haskell-cafe] Questions about slow GC with STArray

2009-04-06 Thread Bulat Ziganshin
Hello FFT, Monday, April 6, 2009, 11:07:33 AM, you wrote: this problem addressed there? Why is this supposed to be specific to boxed arrays only: wouldn't GC have to scan the whole mutable array whether it's boxed or unboxed? you need to scan only boxes: if array just contains plain

Re: [Haskell-cafe] Questions about slow GC with STArray

2009-04-06 Thread FFT
On Mon, Apr 6, 2009 at 1:10 AM, Bulat Ziganshin bulat.zigans...@gmail.com wrote: you need to scan only boxes: if array just contains plain cpu-level numbers, there is nothing to scan Are those the only legal contents of STUArray? ___ Haskell-Cafe

[Haskell-cafe] Unary Minus

2009-04-06 Thread Paul Keir
If I use :info (-) I get information on the binary minus. Is unary minus also a function? Thanks, Paul ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Questions about slow GC with STArray

2009-04-06 Thread Dan Doel
On Monday 06 April 2009 4:10:43 am Bulat Ziganshin wrote: one way to solve this problem is to make one `modified` bit per each 256 elements rather than entire array so GC will have to scan only modified chunks For reference, I constructed a benchmark that takes advantage of GHC's tagging of

Re: [Haskell-cafe] Unary Minus

2009-04-06 Thread Wouter Swierstra
If I use :info (-) I get information on the binary minus. Is unary minus also a function? You can define it yourself or use negate from the Prelude. Wouter ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Unary Minus

2009-04-06 Thread Martijn van Steenbergen
Paul Keir wrote: If I use :info (-) I get information on the binary minus. Is unary minus also a function? No, as far as I know the unary minus is part of the number literals. You can use negate if you want it as a function. Hope this helps, Martijn.

Re[2]: [Haskell-cafe] Questions about slow GC with STArray

2009-04-06 Thread Bulat Ziganshin
Hello Dan, Monday, April 6, 2009, 12:35:14 PM, you wrote: the size of the sub-array. The test then fills a 10 million element array. However, something about the benchmark makes it perform poorly for both small chunks and large chunks. -sstderr reports that lots of copying occurs for small

Re[2]: [Haskell-cafe] Questions about slow GC with STArray

2009-04-06 Thread Bulat Ziganshin
Hello FFT, Monday, April 6, 2009, 12:32:53 PM, you wrote: you need to scan only boxes: if array just contains plain cpu-level numbers, there is nothing to scan Are those the only legal contents of STUArray? numbers, chars, vanilla pointers. UArray just mimics C arrays, after all -- Best

Re: [Haskell-cafe] high probability of installation problems andquality of the glorious implementation

2009-04-06 Thread Claus Reinke
I want the Zen package: Make me one with everything. But would you find that on hackage?-) If an author had contemplated the perfect package, they wouldn't have put it on hackage, they wouldn't have a hackage account, they wouldn't have written the package, they might not even exist - you

[Haskell-cafe] Re: Unary Minus

2009-04-06 Thread Benjamin L . Russell
On Mon, 6 Apr 2009 12:13:09 +0200, Roel van Dijk vandijk.r...@gmail.com wrote: On Mon, Apr 6, 2009 at 12:04 PM, Benjamin L.Russell dekudekup...@yahoo.com wrote: Interesting. ?How is this hack implemented? This seems to be the relevant grammar: lexp6 - - exp7 lpat6 - - (integer | float)

[Haskell-cafe] Re: Unary Minus

2009-04-06 Thread Benjamin L . Russell
On Mon, 6 Apr 2009 12:13:09 +0200, Roel van Dijk vandijk.r...@gmail.com wrote: On Mon, Apr 6, 2009 at 12:04 PM, Benjamin L.Russell dekudekup...@yahoo.com wrote: Interesting. ?How is this hack implemented? This seems to be the relevant grammar: lexp6 - - exp7 lpat6 - - (integer | float)

Re: [Haskell-cafe] Unary Minus

2009-04-06 Thread Lennart Augustsson
Unary minus is a hack in the syntax for allowing the function negate to be written as prefix -. On Mon, Apr 6, 2009 at 10:36 AM, Martijn van Steenbergen mart...@van.steenbergen.nl wrote: Paul Keir wrote: If I use :info (-) I get information on the binary minus. Is unary minus also a function?

Re: [Haskell-cafe] Re: Unary Minus

2009-04-06 Thread Roel van Dijk
On Mon, Apr 6, 2009 at 12:04 PM, Benjamin L.Russell dekudekup...@yahoo.com wrote: Interesting.  How is this hack implemented? This seems to be the relevant grammar: lexp6 - - exp7 lpat6 - - (integer | float)(negative literal) The '6's and the '7' are superscripts. Perhaps the hack

Re: [Haskell-cafe] EclipseFP proposal for Google Summer of Code

2009-04-06 Thread Neil Mitchell
Hi Thomas, I send this e-mail because of possible scheduling issues: I will be away starting on April 15. So, if you want to ask me things, have suggestions for improvement, or want to do an interview or something, this can only be done *before* that date. I am pretty sure all the questions

Re[4]: [Haskell-cafe] Questions about slow GC with STArray

2009-04-06 Thread Bulat Ziganshin
Hello FFT, Monday, April 6, 2009, 12:56:51 PM, you wrote: Are those the only legal contents of STUArray? numbers, chars, vanilla pointers. UArray just mimics C arrays, after all I haven't gotten to learning about them in detail yet, but my hope was that STUArray was like vectorT in C++,

Re: Re[2]: [Haskell-cafe] Questions about slow GC with STArray

2009-04-06 Thread FFT
On Mon, Apr 6, 2009 at 1:49 AM, Bulat Ziganshin bulat.zigans...@gmail.com wrote: Are those the only legal contents of STUArray? numbers, chars, vanilla pointers. UArray just mimics C arrays, after all I haven't gotten to learning about them in detail yet, but my hope was that STUArray was

[Haskell-cafe] Re: Unary Minus

2009-04-06 Thread Benjamin L . Russell
Interesting. How is this hack implemented? I just checked the BNF grammar for the lexical syntax of Haskell in The Haskell 98 Language Report (see the BNF grammer given under 9.2 Lexical Syntax under 9 Syntax Reference at http://www.haskell.org/onlinereport/syntax-iso.html), but had difficulty

[Haskell-cafe] Paper: Translating donotation to SQL, Leijden, Meijer

2009-04-06 Thread GüŸnther Schmidt
Hi all, is the paper Translating donotation to SQL, Leijden, Meijer (1999) available anywhere? Günther ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] replicateM should be called mreplicate?

2009-04-06 Thread Sjoerd Visscher
Considering these naming conventions: http://haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html#3 • A postfix 'M' always stands for a function in the Kleisli category: The monad type constructor m is added to function results (modulo currying) and nowhere else. So, for

Re: [Haskell-cafe] Combining sequences

2009-04-06 Thread michael rice
I downloaded it and it appears more complicated than just adding files to a directory. There's a setup and a build, and no assurances it will work with Hugs. I think I'll wait for more information. Michael --- On Mon, 4/6/09, Thomas Hartman tphya...@gmail.com wrote: From: Thomas Hartman

Re: [Haskell-cafe] Re: Haskell EDSL to generate SQL?

2009-04-06 Thread Jeremy Shaw
At Sun, 05 Apr 2009 14:32:21 +0200, GüŸnther Schmidt wrote: What is the best resource to look for more detail examples? No idea. I have not used it in years. And, last I checked, it is far from perfect. For example, I believe that field names must be unique across all tables. Also, there was a

[Haskell-cafe] Infix tuple comma query (,)

2009-04-06 Thread Paul Keir
module Main where data (:%^) a b = a :%^ bderiving (Show) main = do print $ 18 :%^ (Just 99) print $ (,) 9 10 print $ 9 , 10 The last line in the code above causes a compile error. Why does infix use of the comma (tuple constructor?) function fail without brackets?

Re: [Haskell-cafe] Combining sequences

2009-04-06 Thread Daniel Fischer
Am Montag 06 April 2009 17:12:42 schrieb michael rice: I downloaded it and it appears more complicated than just adding files to a directory. There's a setup and a build, and no assurances it will work with Hugs. I think I'll wait for more information. Michael Try installing it with Cabal:

Re: [Haskell-cafe] Infix tuple comma query (,)

2009-04-06 Thread Daniel Fischer
Am Montag 06 April 2009 17:53:24 schrieb Paul Keir: module Main where data (:%^) a b = a :%^ bderiving (Show) main = do print $ 18 :%^ (Just 99) print $ (,) 9 10 print $ 9 , 10 The last line in the code above causes a compile error. Why does infix use of the comma

[Haskell-cafe] ANN: SVGFonts 0.1

2009-04-06 Thread Tillmann Vogt
I hereby publish my first library in Haskell. SVGFonts 0.1 It parses the pretty unknown SVG Font format to produce outlines of characters. The big advantage of this format is that it is XML, which means easy parsing and manipulating. Because I haven't found any svg-files on the Internet the

Re: [Haskell-cafe] ANN: SVGFonts 0.1

2009-04-06 Thread John Van Enk
This sounds very cool. Is is just a program, or is there a library sitting behind it? From your .cabal file, it seems to be just a binary program. Is this correct? http://hackage.haskell.org/packages/archive/SVGFonts/0.1/SVGFonts.cabal On Mon, Apr 6, 2009 at 1:22 PM, Tillmann Vogt

Re: [Haskell-cafe] replicateM should be called mreplicate?

2009-04-06 Thread David Menendez
On Mon, Apr 6, 2009 at 10:02 AM, Sjoerd Visscher sjo...@w3future.com wrote: Considering these naming conventions: http://haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html#3 • A postfix 'M' always stands for a function in the Kleisli category: The monad type constructor m is

Re: [Haskell-cafe] community.haskell.org unreachable?

2009-04-06 Thread Andrew Wagner
Works for me. The admin address referenced there is support [AT] community.haskell.org On Mon, Apr 6, 2009 at 1:32 PM, Claus Reinke claus.rei...@talk21.comwrote: I seem to be having problems reaching anything on that server. Does anyone know what is going on, or who to contact? It would help

Re: [Haskell-cafe] ANN: SVGFonts 0.1

2009-04-06 Thread Max Rabkin
On Mon, Apr 6, 2009 at 7:32 PM, Tillmann Vogt tillmann.v...@rwth-aachen.de wrote: It is a real library made of pure Haskell. What is wrong with my .cabal file? The issue is not about whether it is pure Haskell. You have simply marked it up as an executable rather than a library. Executable

Re: [Haskell-cafe] Making videos of your project

2009-04-06 Thread Claus Reinke
Btw, there seem to be many Haskells on YouTube - should we have some way of marking clips related to our Haskell? I've used haskell.org as a tag, but noone else has, yet - also, perhaps there should be a Haskell channel or something? And just in case there are others on the same Windows

[Haskell-cafe] Ghc: -O harmful?

2009-04-06 Thread Petr Skovron
Hello all, I have a haskell program that runs an order of magnitude slower when compiled with optimisations turned on. This happens on 6.8.2 as well as 6.10.1: p...@r4at184:/tmp[1]% ghc --make -fforce-recomp -o out buga.hs [1 of 1] Compiling Main ( buga.hs, buga.o )

Re: [Haskell-cafe] ANN: SVGFonts 0.1

2009-04-06 Thread John Van Enk
What your cabal file describes is a single executable, Executable Fonts main-is: tests/Fonts.hs This just tells us to build the file tests/Fonts.hs into a single executable named 'Fonts'. You probably want to retructure your project a bit into something like this. ./LICENSE ./README ./Setup.hs

Re: [Haskell-cafe] replicateM should be called mreplicate?

2009-04-06 Thread Luke Palmer
On Mon, Apr 6, 2009 at 11:42 AM, David Menendez d...@zednenem.com wrote: Of course, this suggests that mfix should be fixM, so perhaps a better distinction is that mplus and mfix need to be defined per-monad, whereas filterM and replicateM are generic. Don't you think that is an incidental

Re: [Haskell-cafe] ANN: SVGFonts 0.1

2009-04-06 Thread Tillmann Vogt
John Van Enk schrieb: This sounds very cool. Is is just a program, or is there a library sitting behind it? From your .cabal file, it seems to be just a binary program. Is this correct? http://hackage.haskell.org/packages/archive/SVGFonts/0.1/SVGFonts.cabal On Mon, Apr 6, 2009 at 1:22 PM,

[Haskell-cafe] community.haskell.org unreachable?

2009-04-06 Thread Claus Reinke
I seem to be having problems reaching anything on that server. Does anyone know what is going on, or who to contact? It would help if the haskellwiki page http://www.haskell.org/haskellwiki/Haskell.org_domain would mention the admin address directly, instead of referring to

[Haskell-cafe] cabal haddock and Paths_Xxx

2009-04-06 Thread Martijn van Steenbergen
Hello, cabal generates a Paths_Xxx file for me which I import and use, but cabal haddock doesn't seem to like it much. If I don't specify the generated module at all in my cabal file, cabal haddock generates visible documentation for the module, which is not what I want: the module should

Re: [Haskell-cafe] Ghc: -O harmful?

2009-04-06 Thread Don Stewart
-fno-state-hack? xofon: Hello all, I have a haskell program that runs an order of magnitude slower when compiled with optimisations turned on. This happens on 6.8.2 as well as 6.10.1: p...@r4at184:/tmp[1]% ghc --make -fforce-recomp -o out buga.hs [1 of 1] Compiling

Re: [Haskell-cafe] community.haskell.org unreachable?

2009-04-06 Thread Claus Reinke
Works for me. The admin address referenced there is support [AT] community.haskell.org Thanks. Yes, it is working again for me too, now, but had been quite persistently unreachable before, while www.haskell.org was reachable, so I'd be surprised if the the problem was at this end of the

[Haskell-cafe] strange performance issue with takusen 0.8.3

2009-04-06 Thread Marko Schütz
Dear All, I have an application where some simple data extracted from some source files is inserted into a PostgreSQL database. The application uses Takusen and is compiled with GHC 6.8.3. Some (59 in the test data) of the selects take on average 460ms each for a total time for this sample run of

[Haskell-cafe] Re: Numeric Prelude and identifiers (Was: fad 1.0 -- Forward AutomaticDifferentiation library)

2009-04-06 Thread Kalman Noel
Henning Thielemann schrieb: On Sun, 5 Apr 2009, Kalman Noel wrote: I'm wondering, too, if the Numeric Prelude could be organized more cleanly if we had a fancier module system - does someone have sufficient experience with, say, ML-style module systems to tell? Are you complaining about

Re: [Haskell-cafe] Combining sequences

2009-04-06 Thread nowgate
Hi Daniel, Thanks, but apparently no go. This isn't critical, as I already have a function that will combine two sequences. Michael = Michael [mich...@localhost untitled folder]$ cd utility-ht-0.0.4 [mich...@localhost utility-ht-0.0.4]$ ls LICENSE  Setup.lhs  src 

[Haskell-cafe] Re: Linking hmatrix without LAPACK

2009-04-06 Thread Duane Johnson
Hi Alberto! Thanks for your informative reply. I looked in to the versions of liblapack on my system... it turns out there is indeed a liblapack.dylib that (apparently) comes with Mac OS X. How to tell ghc to link to that instead is still in question. I can run simple matrix operations

Re: [Haskell-cafe] Combining sequences

2009-04-06 Thread Henning Thielemann
On Mon, 6 Apr 2009, nowg...@yahoo.com wrote: Michael [mich...@localhost untitled folder]$ cd utility-ht-0.0.4 [mich...@localhost utility-ht-0.0.4]$ ls LICENSE  Setup.lhs  src  utility-ht.cabal [mich...@localhost utility-ht-0.0.4]$ ./Setup.lhs configure --hugs /usr/bin/env: runhaskell: No such

[Haskell-cafe] ghc --make unable to find dynamic library, but ghci can

2009-04-06 Thread Duane Johnson
Hi Haskellers, This is related to my previous message, Linking hmatrix without LAPACK. Apparently, ghc --make is not finding the lapack.dylib library where ghci is (dylib is Mac OS X specific) . For example, the following test module does NOT work when compiled with ghc --make:

Re: [Haskell-cafe] Combining sequences

2009-04-06 Thread Henning Thielemann
On Sun, 5 Apr 2009, michael rice wrote: Thanks. It looks like mergeBy will do the job, but is it available in Hugs? The package is Haskell98 and needs no further package, thus it should work with almost every Haskell system. ___ Haskell-Cafe

Re: [Haskell-cafe] Ghc: -O harmful?

2009-04-06 Thread Daniel Fischer
Am Montag 06 April 2009 20:37:46 schrieb Don Stewart: -fno-state-hack? That, or {-# LANGUAGE BangPatterns #-} main = do   n - read `liftM` getLine   !pole - liftM (build n . map read . words) getLine   replicateM_ 100 $ do     getLine     print $ best pole 42 420 if the state-hack is

[Haskell-cafe] Monad transformer to consume a list

2009-04-06 Thread Stephan Friedrichs
Hello, is there a monad transformer to consume an input list? I've got external events streaming into the monad that are consumed on demand and I'm not sure if there's something better than a StateT. //Stephan -- Früher hieß es ja: Ich denke, also bin ich. Heute weiß man: Es geht auch so. -

Re: [Haskell-cafe] Monad transformer to consume a list

2009-04-06 Thread Henning Thielemann
On Mon, 6 Apr 2009, Stephan Friedrichs wrote: Hello, is there a monad transformer to consume an input list? I've got external events streaming into the monad that are consumed on demand and I'm not sure if there's something better than a StateT. I wondered that, too. I wondered whether

[Haskell-cafe] GHC accepts libraries compiled with Visual Studio?

2009-04-06 Thread Peter Verswyvelen
To my surprise GHC seems to accept .lib files (produced by e.g. Visual Studio on Windows) directly; I don't need to convert these to .a files using e.g. reimp That's really cool. Is this by design or did I miss something? The manual does not seem to mention this.

[Haskell-cafe] Strange type error with associated type synonyms

2009-04-06 Thread Peter Berry
{-# LANGUAGE TypeFamilies, TypeSynonymInstances, ScopedTypeVariables #-} The following is a class of memo tries indexed by d: class Fun d where type Memo d :: * - * abst :: (d - a) - Memo d a appl :: Memo d a - (d - a) -- Law: abst . appl = id -- Law: appl . abst = id

[Haskell-cafe] Re: Numeric Prelude and identifiers

2009-04-06 Thread Henning Thielemann
On Mon, 6 Apr 2009, Kalman Noel wrote: I'm not complaining, and I'm not sure what I mean :) I may like a scheme where functions operating on a type or type class live in a module seperate from the type (class) definition, so you could import a specific module to get only, say, (Ring, (*), one,

[Haskell-cafe] Volunteer

2009-04-06 Thread Xiao-Yong Jin
Hi, I learned that no one is doing generic unix source tarball, right now, and thought I might help to get it start. I have decent skills on Makefile, but knows very little about auto-tools. I can only spent a few hours every week on it, because I don't have too much spare time as a PhD

[Haskell-cafe] Re: Linking hmatrix without LAPACK

2009-04-06 Thread Duane Johnson
FYI, the following solution worked on Mac OS X (Leopard): ghc -o SilkwormGame --make -framework Accelerate Main.hs The key addition is -framework Accelerate. Thus, on Mac OS X, it is only necessary to install the gls library via macports. Atlas/ LAPACK/BLAS etc. come with the operating

Re: [Haskell-cafe] GHC accepts libraries compiled with Visual Studio?

2009-04-06 Thread Jeff Heard
I've noticed this before. I in fact have really only tried FTGL with VC compiled lib files... On Mon, Apr 6, 2009 at 5:34 PM, Peter Verswyvelen bugf...@gmail.com wrote: To my surprise GHC seems to accept .lib files (produced by e.g. Visual Studio on Windows) directly; I don't need to convert

[Haskell-cafe] Configuring cabal dependencies at install-time

2009-04-06 Thread Jeff Heard
Is there a way to do something like autoconf and configure dependencies at install time? Building buster, I keep adding dependencies and I'd like to keep that down to a minimum without the annoyance of littering Hackage with dozens of packages. For instance, today I developed an HTTP behaviour

Re: [Haskell-cafe] Infix tuple comma query (,)

2009-04-06 Thread Ryan Ingram
The prefix notation for \a b c - (a,b,c) is (,,) Without the parentheses, it's not immediately clear whether foo $ a,b means foo (a,b) or foo (\c - (a,b,c)) or some other, bigger tuple size. Anyways, it's just syntax :) -- ryan On Mon, Apr 6, 2009 at 9:08 AM, Daniel Fischer

Re: [Haskell-cafe] Volunteer

2009-04-06 Thread Marko Schütz
Dear Xiao-Yong, thank you very much for your willingness to help. I would suggest you look into some of the builds for various platforms as you mentioned. One infrastructure I find particularly interesting is pkgsrc (www.pkgsrc.org) which can be used to effortlessly build numerous packages from

Re: [Haskell-cafe] Strange type error with associated type synonyms

2009-04-06 Thread Ryan Ingram
On Mon, Apr 6, 2009 at 2:36 PM, Peter Berry pwbe...@gmail.com wrote: As I understand it, the type checker's thought process should be along these lines: 1) the type signature dictates that x has type Memo d a. 2) appl has type Memo d1 a - d1 - a for some d1. 3) we apply appl to x, so Memo d1

Re: [Haskell-cafe] Strange type error with associated type synonyms

2009-04-06 Thread Manuel M T Chakravarty
Peter Berry: {-# LANGUAGE TypeFamilies, TypeSynonymInstances, ScopedTypeVariables #-} The following is a class of memo tries indexed by d: class Fun d where type Memo d :: * - * abst :: (d - a) - Memo d a appl :: Memo d a - (d - a) -- Law: abst . appl = id -- Law: appl . abst

Re: [Haskell-cafe] Lazy vs correct IO [Was: A round of golf]

2009-04-06 Thread Jason Dusek
Is the choice of whether or not to open/close with each chunk read something that we can reasonably hide from the I/O API's user? There is at least one way in which is semantically distinct -- that old trick of opening a tempfile and then unlinking it to hide it. It may be the sort of

[Haskell-cafe] automatically inserting type declarations

2009-04-06 Thread FFT
I remember hearing about a Haskell mode for Vim, Emacs, Yi or VisualHaskell that inserts type declarations automatically (it's lazier to just check the type than to write it manually), but I can't remember any details. What editor mode / IDE was it? What do most people use with GHC on Linux? I'm

Re: [Haskell-cafe] Infix tuple comma query (,)

2009-04-06 Thread Alexander Dunlap
On Mon, Apr 6, 2009 at 8:53 AM, Paul Keir pk...@dcs.gla.ac.uk wrote: module Main where data (:%^) a b = a :%^ b    deriving (Show) main = do   print $ 18 :%^ (Just 99)   print $ (,) 9 10   print $ 9 , 10 The last line in the code above causes a compile error. Why does infix

[Haskell-cafe] Generating arbitrary function in QuickCheck

2009-04-06 Thread Yusaku Hashimoto
Hi, today, I want to ask about QuickCheck. I have known recently that arbitrary works on functions as well. I played on this for a while, and met a strange behavior. I tried to write property for sortBy. import Test.QuickCheck import Data.List instance Show (a - b) where show _ =

Re: [Haskell-cafe] Generating arbitrary function in QuickCheck

2009-04-06 Thread Eugene Kirpichov
Since the argument to sortBy must impose a linear ordering on its arguments, and any linear ordering may as well be generated by assigning an integer to each element of type 'a', and your sorting function is polymorphic, from the free theorem for the sorting function we may deduce that it suffices

Re: [Haskell-cafe] Generating arbitrary function in QuickCheck

2009-04-06 Thread Jason Dagit
On Mon, Apr 6, 2009 at 10:09 PM, Eugene Kirpichov ekirpic...@gmail.com wrote: Since the argument to sortBy must impose a linear ordering on its arguments, and any linear ordering may as well be generated by assigning an integer to each element of type 'a', and your sorting function is

Re: [Haskell-cafe] replicateM should be called mreplicate?

2009-04-06 Thread David Menendez
On Mon, Apr 6, 2009 at 1:46 PM, Luke Palmer lrpal...@gmail.com wrote: On Mon, Apr 6, 2009 at 11:42 AM, David Menendez d...@zednenem.com wrote: Of course, this suggests that mfix should be fixM, so perhaps a better distinction is that mplus and mfix need to be defined per-monad, whereas