Re: [Haskell-cafe] More on the random idea

2007-05-26 Thread Donald Bruce Stewart
> it would really be nice if someone would sit down and sort this all out > in detail. there'd still be no guarantee that such a Haskell sandbox was > totally safe, but at least all issues and solutions could be shared, making > it as safe as the community knows how. The #haskell people have been

Re: [Haskell-cafe] More on the random idea

2007-05-26 Thread Donald Bruce Stewart
claus.reinke: > >>Oh, but there is the *minor* detail that I am literally allowing > >>unauthenticated users to perform arbitrary code execution. For example, > .. > >>AFAIK, Lambdabot dissalows any expression that performs IO. In Haskell, > >>this is beautifully easy: reject any expression having

[Haskell-cafe] Darcs users [was: New book: Real-World Haskell!]

2007-05-26 Thread Donald Bruce Stewart
On 26/05/07, Matthew Sackman <[EMAIL PROTECTED]> wrote: >(On the other hand, I don't know of anyone outside immediate >"haskellers" using Darcs.) Good idea to get some data on this, instead of speculating. Let's do that. A quick google reveals the Haskell crew is far from alone as users. h

Re: [Haskell-cafe] More on the random idea

2007-05-26 Thread Donald Bruce Stewart
andrewcoppin: > Since the online lambdabot still doesn't seem to want to talk to me, > I've been thinking about how I might rectify the situation... > > Apparently GHC has a flag that makes it execute a Haskell expression > directly. For example, > > C:\> ghc -e "map (2*) [1,2,3]" > [2,4,6] >

Re: [Haskell-cafe] Cannot compile Network.CGI programs

2007-05-26 Thread Donald Bruce Stewart
aneumann: > -BEGIN PGP SIGNED MESSAGE- > Hash: RIPEMD160 > > Hi, > > I installed the Network.CGI package and tried to compile the Hello World > example on my Ubuntu machine. > > >ghc cgi.hs -o cgi Missing --make to link against the cgi and network and mtl packages. Also, -O or -O2, you

Re: [Haskell-cafe] instance Monad AppF - Faster than the list monad?

2007-05-25 Thread Donald Bruce Stewart
greenrd: > The following Haskell 98 module implements a generalisation of > Prelude.ShowS for any type. Should be pretty easy to incorporate this > into code which currently uses the list monad non-trivially, and get > better performance - but can this be right? Surely someone would have > publishe

Re: [Haskell-cafe] Why this exception occurs ?

2007-05-25 Thread Donald Bruce Stewart
ketil: > On Fri, 2007-05-25 at 17:33 +1000, Donald Bruce Stewart wrote: > > > Sorry, I should clarify, think about how to represent: > > > > 256 :: Word8 > > So the error isn't really divide by zero, but overflow. I've been > bitten by this, too,

Re: [Haskell-cafe] Why this exception occurs ?

2007-05-25 Thread Donald Bruce Stewart
dons: > leaveye.guo: > > Hi. > > > > In GHCi ver 6.6, why this happens ? > > > > Prelude Data.ByteString> Data.ByteString.pack $! Prelude.map (`rem` 256) $ > > [0..511] > > "*** Exception: divide by zero > > It's the use of `rem` on Word8, by the way: > > Prelude> (0 `rem` 256) :: Data.Wor

Re: [Haskell-cafe] Why this exception occurs ?

2007-05-25 Thread Donald Bruce Stewart
leaveye.guo: > Hi. > > In GHCi ver 6.6, why this happens ? > > Prelude Data.ByteString> Data.ByteString.pack $! Prelude.map (`rem` 256) $ > [0..511] > "*** Exception: divide by zero It's the use of `rem` on Word8, by the way: Prelude> (0 `rem` 256) :: Data.Word.Word8 *** Exception: di

Re: [Haskell-cafe] Why this exception occurs ?

2007-05-25 Thread Donald Bruce Stewart
leaveye.guo: > Hi. > > In GHCi ver 6.6, why this happens ? > > Prelude Data.ByteString> Data.ByteString.pack $! Prelude.map (`rem` 256) $ > [0..511] > "*** Exception: divide by zero Interesting... Is that just, Data.ByteString.pack $ [0..255] ++ [0..255] ? -- Don _

Re: [Haskell-cafe] New book: Real-World Haskell!

2007-05-24 Thread Donald Bruce Stewart
bos: > I'll condense my remaining replies to this thread into a single message, > to save people a little noise. I'd just add that the response is literally overwhelming! Some 100-odd volunteers to review, and a lot of mail besides. Please bear with us as we try to surface under this mountain of

Re: Re: [Haskell-cafe] (no subject)

2007-05-24 Thread Donald Bruce Stewart
leaveye.guo: > To read the handle openBinaryFile returns, both the hGetBuf and > hGetBufNonBlocking needs one parameter _buf_ of type Ptr a. > I can not get one data of that type. > > In the doc, there is only nullPtr, and also some type cast functions. > I failed to find some other buffer-maker f

Re: Re: [Haskell-cafe] (no subject)

2007-05-24 Thread Donald Bruce Stewart
leaveye.guo: > to Ketil : > > Tring openBinaryFile, I notice that I cannot make one usable buffer, > just because I can not find one function to "malloc" a memory or just > get one "change-able" buffer. > > :-$ No 'malloc' here in Haskell land: that's done automatically. Recall that 'getContent

Re: [Haskell-cafe] (no subject)

2007-05-24 Thread Donald Bruce Stewart
marco-oweber: > On Thu, May 24, 2007 at 02:38:05PM +0800, L.Guo wrote: > > Thanks for your suggestion, and sorry for the subject. > > > > I have read the introduction of Data.ByteString, it is helpful. > > > > And also, there is one problem left. When i read a binary file, data is > > truncated

Re: [Haskell-cafe] (no subject)

2007-05-23 Thread Donald Bruce Stewart
leaveye.guo: > Thanks for your suggestion, and sorry for the subject. > > I have read the introduction of Data.ByteString, it is helpful. > > And also, there is one problem left. When i read a binary file, data > is truncated at the charactor EOF. > > Which function could do this work correctly

Re: [Haskell-cafe] (no subject)

2007-05-23 Thread Donald Bruce Stewart
leaveye.guo: > Hi MailList Haskell-Cafe: > > Till now, which module / package / lib can i use to access binary > file ? And is this easy to use in GHC ? Data.Binary? Or perhaps just Data.ByteString, available on hackage, http://hackage.haskell.org/cgi-bin/hackage-scripts/package/bina

[Haskell-cafe] New book: Real-World Haskell!

2007-05-23 Thread Donald Bruce Stewart
Bryan O'Sullivan, Don Stewart and John Goerzen are pleased, and frankly, very excited to announce that were developing a new book for O'Reilly, on practical Haskell programming. The working title is Real-World Haskell. The plan is to cover the major techniques used to write serious, real-world Ha

Re: [Haskell-cafe] Currying: The Rationale

2007-05-22 Thread Donald Bruce Stewart
prstanley: > > >> Hi > >> What is the rationale behind currying? is it for breaking subroutines > >into > >> pure one-to-one mappings? > > > >We don't have 'subroutines' as such, but otherwise yes. Also, it gives us > >partial application - we don't have to apply all the parameters at once, > >an

Re: [Haskell-cafe] Re: Editor

2007-05-22 Thread Donald Bruce Stewart
Alistair_Bayley: > > > I'm sure that I can quite reliably hit the command editor > > keybindings I > > > use many, many times faster than if I had to select them > > from a menu. > > > > Note that the claimed time-consuming part is not to actually press the > > keybinding, but to chose and remem

[Haskell-cafe] Wanted: extended static checking for xmonad

2007-05-21 Thread Donald Bruce Stewart
When working on xmonad, we're trying to produce very clean, correct code -- a window manager that just works. To do this, we're looking to employ more static checking tools to the code base. Currently we use: * QuickCheck (checks high level window manager behaviour) * Catch (Neil's patter

Re: [Haskell-cafe] Random idea

2007-05-20 Thread Donald Bruce Stewart
andrewcoppin: > Greetings. > > I was thinking... we already have Lambdabot sitting in an IRC channel. > How hard would it be to mangle Lambdabot to the point where it works > over HTTP? You know - so you could type some Haskell into a form on a Lambdabot web server is here: http://lambdab

Re: [Haskell-cafe] idlelog

2007-05-19 Thread Donald Bruce Stewart
lpenz: > > Hi > > I made a program that detects user presence in a linux box by checking > for keyboard interruptions in /proc/interrupts. > > Problem is, it is supposed to run for a long time, and it keeps about > 40MB for itself. > > Yeah, this is one more "help me with this memory problem"

Re: [Haskell-cafe] Pesky monads...

2007-05-19 Thread Donald Bruce Stewart
matt: > It occurred to me that the predicate will generally be a monadic function > itself, so here's a > refined version: > > :: Monad m => (a -> m Bool) -> (a -> m a) -> a -> m a > untilM pred f x = do c <- pred x > if c then return x > else f x >

Re: [Haskell-cafe] What really happens

2007-05-19 Thread Donald Bruce Stewart
andrewcoppin: > Hi everybody. > > Is there any circumstances under which an expression like map (2*) would > perform an in-place update rather than generating a new list? (Obviously Yes, should be fine, if the result is consumed. We have fusion frameworks that do this. > this depends on which

Re: [Haskell-cafe] global variables

2007-05-17 Thread Donald Bruce Stewart
eeoam: > H|i, > > Does anyone know of a simple and straightforward way to use global > variables in Haskell? > > E. As other posters have said, you'll need to state what you're trying to do. For one particular case, that of a program that needs access to state over its lifetime, State monads ar

Re: [Haskell-cafe] global variables

2007-05-17 Thread Donald Bruce Stewart
eeoam: > H|i, > > Does anyone know of a simple and straightforward way to use global > variables in Haskell? > > E. The usual way is to run the code that needs a global variable in a State monad. The next answer is: you don't really need global variables, since you don't have mutable variables

Re: [Haskell-cafe] CUFP website

2007-05-16 Thread Donald Bruce Stewart
cyril.schmidt: > I noticed recently that the website of CUFP conference (Commercial Uses of > Function Programming), which used to be at http://www.galois.com/cufp, > is not accessible anymore. > > Does anybody know where it moved? Try http://cufp.galois.com/ -- Don _

Re: [Haskell-cafe] Co-arbitrary

2007-05-08 Thread Donald Bruce Stewart
joelr1: > Would someone kindly explain why we need co-arbitrary in QuickCheck > and how to define it? Generating random function generators. A nice explanation was given recently on the programming subreddit: "The CoArbitrary class continues to confuse me" http://programming.reddit.com

[Haskell-cafe] Haskell Weekly News: May 07, 2007

2007-05-06 Thread Donald Bruce Stewart
--- Haskell Weekly News http://sequence.complete.org/hwn/20070507 Issue 62 - May 07, 2007 --- Welcome to issue 62 of HWN, a weekly newsletter covering

[Haskell-cafe] Mounting haskell.org wiki under WikipediaFS?

2007-05-06 Thread Donald Bruce Stewart
Anyone tried editing haskell.org's wiki as text, using: http://wikipediafs.sourceforge.net/ "WikipediaFS is a mountable Linux virtual file system that enables you to deal with Wikipedia (or any Mediawiki-based site) articles as if they were real files. It is thus possible to use a real text e

Re: [Haskell-cafe] Intermediate Haskell Books?

2007-05-06 Thread Donald Bruce Stewart
aneumann: > -BEGIN PGP SIGNED MESSAGE- > Hash: RIPEMD160 > > Are there any good books about intermediate to advanced Haskell? The > descriptions here http://haskell.org/haskellwiki/Books_and_tutorials > aren't very helpful. Not in real-world paper form, yet. Mostly advanced techniques an

Re: [Haskell-cafe] Any Haskellers anywhere?

2007-05-05 Thread Donald Bruce Stewart
hoelz: > Gabor Greif <[EMAIL PROTECTED]> wrote: > > > Am 06.05.2007 um 03:52 schrieb Rob Hoelz: > > > > > Sounds like a good idea to me. I'd like to see if any Haskellers > > > are in Madison. > > > > Doesn't Google have a service for visualizing locations on a map? > > The wiki could point the

Re: [Haskell-cafe] Re: The Functional Pearls

2007-05-05 Thread Donald Bruce Stewart
jon.fairbairn: > [EMAIL PROTECTED] (Donald Bruce Stewart) writes: > > > I've created a wiki page collecting the 'functional pearl' papers that > > have appeared in JFP and ICFP and other places over the last 20 odd > > years. > > > >

Re: [Haskell-cafe] The Functional Pearls

2007-05-05 Thread Donald Bruce Stewart
ithika: > On 05/05/07, Donald Bruce Stewart <[EMAIL PROTECTED]> wrote: > >I've created a wiki page collecting the 'functional pearl' papers that > >have appeared in JFP and ICFP and other places over the last 20 odd > >years. > > >

Re: [Haskell-cafe] Problems with Hs-Plugins

2007-05-05 Thread Donald Bruce Stewart
pvolgger: > I tried following very simple program: > >module Main where > >import System.Eval.Haskell > > > >main = do i <- eval "1 + 6 :: Int" [] :: IO (Maybe Int) > > if isJust i then putStrLn (show (fromJust i)) else return () > I compile it with "ghc -c Main.hs" and everything seems fi

Re: [Haskell-cafe] Is Excel a FP language?

2007-05-05 Thread Donald Bruce Stewart
andrewcoppin: > >I just had a thought... Why doesn't somebody implement a >spreadsheet where Haskell is the formula language? 8-) >I have already been struggling (unsuccessfully) to write a >program to graph functions, but why not go the whole hog and >make an entire spreadshee

[Haskell-cafe] The Functional Pearls

2007-05-05 Thread Donald Bruce Stewart
I've created a wiki page collecting the 'functional pearl' papers that have appeared in JFP and ICFP and other places over the last 20 odd years. http://haskell.org/haskellwiki/Research_papers/Functional_pearls Lots of lovely functional programs there. There's also a list on that page of pea

Re: [Haskell-cafe] Debugging

2007-05-04 Thread Donald Bruce Stewart
monang: > On 5/5/07, Stefan O'Rear <[EMAIL PROTECTED]> wrote: > >On Fri, May 04, 2007 at 10:44:15PM -0700, Ryan Dickie wrote: > >> I've only written trivial applications and functions in haskell. But the > >> title of this thread got me thinking. > >> > >> In an imperative language you have clear s

[Haskell-cafe] "Programming in Haskell" made it to RegDeveloper

2007-05-03 Thread Donald Bruce Stewart
http://www.regdeveloper.co.uk/2007/05/03/programming_haskell/ Mmm... mainstream exposure. -- Don ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] outputing .hs file without comments

2007-05-03 Thread Donald Bruce Stewart
jmvilaca: > >Hi all, > > >Is there a simple tool or command to remove all comments >from a Haskell file, i.e. something that outputs the input >file but without any comments on it? Using Language.Haskell, such a program is almost trivial: -- -- strip comments from haske

Re: FW: [Haskell-cafe] RE:Cross-over from Haskell.org [Haskell] Re: Newbie: what are the advantages of Haskell?

2007-05-02 Thread Donald Bruce Stewart
ajb: > G'day all. > > Quoting "Michael T. Richter" <[EMAIL PROTECTED]>: > > > Ummm... Udo? Just what the fuck did you hope to accomplish with this > > kind of talk? > > Guys, could we keep it civil on the list, please? > > And for the record: > > http://www.perl.com/pub/2000/12/advocacy.

Re: [Haskell-cafe] Hugs/nhc getting progressively slower

2007-05-01 Thread Donald Bruce Stewart
ndmitchell: > Hi, > > I like to develop on Hugs, because its a nice platform to work with, > and provides WinHugs, auto-reloading, sub-second compilation etc. > Unfortunately some of the newer libraries (ByteString/Binary in > particular) have been optimised to within an inch of their lives on > G

Re: [Haskell-cafe] Is Hs-Plugins dead?

2007-05-01 Thread Donald Bruce Stewart
pvolgger: > Is Hs-Plugins still under develeopment; is there still somebody who is > updating it? It's in stasis. It will likely get a little bit more updating when I finish my phd. It's needed for lambdabot in #haskell, so that's enough pressure to keep it working :-) For the longer term, a mo

Re: [Haskell-cafe] what exactly does "deriving (Functor, Monad, MonadIO)" do?

2007-05-01 Thread Donald Bruce Stewart
tphyahoo: > I was trying to follow the reasoning in Don's article on using haskell > for shell scripting > > http://cgi.cse.unsw.edu.au/~dons/blog/2007/03/10 > > In the source listing at the end we is > > newtype Shell a = Shell { runShell :: ErrorT String IO a } >deriving (Functor

Re: [Haskell-cafe] Bloom Filter

2007-04-30 Thread Donald Bruce Stewart
ajb: > Quoting tom <[EMAIL PROTECTED]>: > This looks cool: > > bytes2int = foldr ((. (256 *)) . (+)) 0 . (map toInteger) > > but I'm not smart enough to parse it. This is both more readable and > shorter: > > bytes2int = foldr (\x r -> r*256 + fromInteger x) 0 > > Integer log2's are pr

Re: [Haskell-cafe] Re: Creating pseudo terminals

2007-04-30 Thread Donald Bruce Stewart
tomahawkins: > On 4/29/07, Georg Sauthoff <[EMAIL PROTECTED]> wrote: > >On 2007-04-29, Tom Hawkins <[EMAIL PROTECTED]> wrote: > > > >Hi, > > > >[..] > >> I haven't done this before in any language, so any tips would be > >> appreciated. From what I gather, a call to posix_openpt or openpty > >> re

[Haskell-cafe] Haskell Weekly News: April 27, 2007

2007-04-26 Thread Donald Bruce Stewart
--- Haskell Weekly News http://sequence.complete.org/hwn/20070427 Issue 61 - April 27, 2007 --- Welcome to issue 61 of HWN, a weekly newsletter coverin

[Haskell-cafe] New HaskODell user groups

2007-04-26 Thread Donald Bruce Stewart
I've created a new wiki page documenting all the new user groups for Haskell that are springing up! http://haskell.org/haskellwiki/User_groups If you're starting a new group, please add it here, and publicise. -- Don P.S. Some obvious user group candidates, in my opinion, would be a Portla

Re: [Haskell-cafe] Program optimisation

2007-04-20 Thread Donald Bruce Stewart
ahey: > Donald Bruce Stewart wrote: > >ahey: > >>David Roundy wrote: > >>>I remember once going through all sorts of pain trying to avoid > >>>stack overflows when using Data.Map to compute a histogram, which > >>>all would have been avoided if

[Haskell-cafe] QuickCheck subsumes unit testing

2007-04-20 Thread Donald Bruce Stewart
Just to walk the walk, and not just talk the talk, here's a quick unit testing 'diff' driver I hacked up for QuickCheck. When run, it 'diffs' (well, just prints ;-) the incorrect values from the unit test: $ runhaskell T.hs sort unit test : Falsifiable after 0 tests: - [1,2,

Re: [Haskell-cafe] Program optimisation

2007-04-20 Thread Donald Bruce Stewart
ahey: > David Roundy wrote: > > I remember once going through all sorts of pain trying to avoid > > stack overflows when using Data.Map to compute a histogram, which > > all would have been avoided if there were a strict version of > > Data.Map (or even just strict functions on the lazy Data.Map).

Re: [Haskell-cafe] Program optimisation

2007-04-20 Thread Donald Bruce Stewart
droundy: > In any case, in my opinion Haskell desperately needs more strict data > types, as strict types can go a long way towards eliminating all sorts of Yes! Haskell is a combined strict and lazy language, after all. In particular, the ability to precisely combine strictness and laziness in a

[Haskell-cafe] Re: [C2hs] anyone interested in developing a Language.C library?

2007-04-20 Thread Donald Bruce Stewart
chak: > Duncan Coutts wrote: > >If anyone is interested in developing a Language.C library, I've just > >completed a full C parser which we're using in c2hs. > > > >It covers all of C99 and all of the GNU C extensions that I have found > >used in practise, including the __attribute__ annotations. I

Re: [Haskell-cafe] >> and sequencing [newbie]

2007-04-16 Thread Donald Bruce Stewart
clifford.beshers: > >Donald Bruce Stewart wrote: > > david: > > >Ah... so the secret is in the hidden variables. On some >level I am beginning to fear that Monads resurrect some of >the scariest aspects of method overriding from my OO >

Re: [Haskell-cafe] >> and sequencing [newbie]

2007-04-16 Thread Donald Bruce Stewart
david: > >Ah... so the secret is in the hidden variables. On some >level I am beginning to fear that Monads resurrect some of >the scariest aspects of method overriding from my OO >programming days. Do you (all) ever find that the ever >changing nature of >>= makes code hard

[Haskell-cafe] Re: Zero-arity tests in QuickCheck and displaying expected result

2007-04-16 Thread Donald Bruce Stewart
> Are there any examples of such custom drivers? > > On Apr 16, 2007, at 10:09 PM, Donald Bruce Stewart wrote: > > >That's just the default driver. Plenty of custom drivers exist which > >compare the output. The QC driver is just a function you implement, > >a

[Haskell-cafe] Re: Zero-arity tests in QuickCheck and displaying expected result

2007-04-16 Thread Donald Bruce Stewart
joelr1: > > On Apr 16, 2007, at 9:29 PM, Donald Bruce Stewart wrote: > > >It's interesting to note that QuickCheck generalises unit testing: > >zero-arity QC properties are exactly unit tests. > > I don't think this works very well. I rely quite heavily

Re: [Haskell-cafe] Re: Tutorial on Haskell

2007-04-16 Thread Donald Bruce Stewart
pete-expires-20070615: > Simon Peyton-Jones <[EMAIL PROTECTED]> writes: > > > My guess is that they'll be Linux/Perl/Ruby types, and they'll be > > practitioners rather than pointy-headed academics. > > > Suggest concrete examples of programs that are > > * small > >

Re: [Haskell-cafe] Efficient use of ByteString and type classes in template system

2007-04-15 Thread Donald Bruce Stewart
johan.tibell: > Hi Haskell Caf?! > > I'm writing a perl/python like string templating system which I plan > to release soon: > > darcs get http://darcs.johantibell.com/template > > The goal is to provide simple string templating; no inline code, etc.. > An alternative to printf and ++. Ok. You

[Haskell-cafe] xmonad window manager mailing list

2007-04-12 Thread Donald Bruce Stewart
I'm pleased to announce that the xmonad window manager now has a mailing list set up: http://www.haskell.org/mailman/listinfo/xmonad For those who don't know, xmonad is a tiling window manager written in Haskell. You can find more about it at: http://xmonad.org and Lennart Kolmodin'

Re: [Haskell-cafe] k-minima in Haskell

2007-04-11 Thread Donald Bruce Stewart
mrvr84: > >What's the best way to implement the following function in >haskell: Given a list and an integer k as input return the >indices of the least k elements in the list. The code should >be elegant and also, more importantly, must not make more >than the minimum O(k*lengt

[Haskell-cafe] Haskell Weekly News: April 12, 2007

2007-04-11 Thread Donald Bruce Stewart
--- Haskell Weekly News http://sequence.complete.org/hwn/20070412 Issue 60 - April 12, 2007 --- Welcome to issue 60 of HWN, a weekly newsletter coverin

Re: [Haskell-cafe] Why Perl is more learnable than Haskell

2007-04-11 Thread Donald Bruce Stewart
kynnjo: > Perhaps Haskell will never lend itself to something like a Perl one-liner, > but still I wish that there were books on Haskell that focused on making > Haskell useful to the learner as quickly as possible... If such already > exist and I've missed it, please let me know. There's some th

Re: [Haskell-cafe] Function call by string

2007-04-08 Thread Donald Bruce Stewart
pvolgger: > Hello everybody! > Can me somebody say how I can call a function by string? Thus I want to > have a function that has as argument a string (name of a function to > call) and then tries to call that function, a kind of: > > functionCall :: String -> [String] -> RetVal > functionCall f

Re: [Haskell-cafe] Yi Source

2007-04-08 Thread Donald Bruce Stewart
dfeustel: > Is the full source of Yi suitable for building on non-linux platforms > (ie OpenBSD) (going to be) available? > Yes, it is *always* available via darcs. I use yi on openbsd too :-) See here, http://www.cse.unsw.edu.au/~dons/yi.html -- Don

[Haskell-cafe] Mutable variables eliminated from .NET | Lambda the Ultimate

2007-04-01 Thread Donald Bruce Stewart
As seen on reputable language news site, Lambda the Ultimate. http://lambda-the-ultimate.org/node/2164 Mutable variables eliminated from .NET Redmond, WA: At an unusual press conference held this Sunday morning, Bill Taylor, Microsoft's General Manager of Platform Strategy, announced

Re: [Haskell-cafe] cost of modules

2007-03-27 Thread Donald Bruce Stewart
jeremy.shaw: > At Tue, 27 Mar 2007 23:10:21 +0200, > Fawzi Mohamed wrote: > > > If someone has an idea on how else I can improve timings please tell me. > > I believe you are seeing a speed decrease, because GHC is not inlining > functions as much when you split them into modules. If you add > ex

Re: [Haskell-cafe] Why the Prelude must die

2007-03-25 Thread Donald Bruce Stewart
ajb: > G'day all. > > Quoting Neil Mitchell <[EMAIL PROTECTED]>: > > > Yes. It will break 100's of applications. > > That sounds like a challenge! Find me 100 applications that use > Data.Map.map and I will eat crow. Well, it'll break 100s of modules :-) $ find . -name '*.hs' -exec grep

Re: [Haskell-cafe] Why the Prelude must die

2007-03-23 Thread Donald Bruce Stewart
stefanor: > This is a ranty request for comments, and the more replies the better. Use -fno-implicit-prelude and roll your own Prelude. Stick it on hackage and everyone can use it. -- Don ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www

[Haskell-cafe] Re: [Haskell] Haskell Chess

2007-03-18 Thread Donald Bruce Stewart
smazanek: > Hello again, > > I got a lot of interesting and useful comments on my posting > about Haskell Chess. Somebody suggested using the program > for benchmarks. Several people asked me to open the program > for contributions. And others were just interested in the exercises. > > It is prob

Re: [Haskell-cafe] Using external programs with Haskell in windows.

2007-03-18 Thread Donald Bruce Stewart
christian.lean2: > Donald Bruce Stewart wrote: > >christian.lean2: > > > >>I'm looking for a way to run an external program and get the results in > >>haskell. Something similar to HSH but that will work in windows. I don't > >>need anythin

Re: [Haskell-cafe] Using external programs with Haskell in windows.

2007-03-17 Thread Donald Bruce Stewart
christian.lean2: > I'm looking for a way to run an external program and get the results in > haskell. Something similar to HSH but that will work in windows. I don't > need anything too complex, just to provide the command to be run as a > string and get the result as a string. Is this possible?

Re: [Haskell-cafe] Typical?

2007-03-16 Thread Donald Bruce Stewart
hthiel.char: > >Hello All, >Us who're learning Haskell have a lot in common... that is, >if Amazon has it right... > > >We recommend: STAR TREK-USS ENTERPRISE D >by Corgi Classics >Recommended because you purchased or rated: >* The Haskell School of Expr

Re: [Haskell-cafe] Make strict (IO String) lazy

2007-03-15 Thread Donald Bruce Stewart
lemming: > > On the one hand, in the standard libraries there are functions like > readFile, getContents, hGetContents which read a file lazily. This is > often a nice feature, but sometimes lead to unexpected results, say when > reading a file and overwriting it with modified contents. Unfortuna

Re: [Haskell-cafe] Lazy IO and closing of file handles

2007-03-15 Thread Donald Bruce Stewart
claus.reinke: > >Not necessarily so, since you are making assumptions about the > >timeliness of garbage collection. I was similarly sceptical of Claus' > >suggestion: > > > >Claus Reinke: > >>in order to keep the overall structure, one could move readFile backwards > >>and parseEmail forwards in t

Re: [Haskell-cafe] Lazy IO and closing of file handles

2007-03-14 Thread Donald Bruce Stewart
donn: > > When using readFile to process a large number of files, I am exceeding > > the resource limits for the maximum number of open file descriptors on > > my system. How can I enhance my program to deal with this situation > > without making significant changes? > > I note that if you use mm

Re: [Haskell-cafe] Re: Lazy IO and closing of file handles

2007-03-14 Thread Donald Bruce Stewart
pete-expires-20070513: > [EMAIL PROTECTED] (Donald Bruce Stewart) writes: > > > pete-expires-20070513: > >> When using readFile to process a large number of files, I am exceeding > >> the resource limits for the maximum number of open file descriptors on > &g

Re: [Haskell-cafe] Lazy IO and closing of file handles

2007-03-14 Thread Donald Bruce Stewart
pete-expires-20070513: > When using readFile to process a large number of files, I am exceeding > the resource limits for the maximum number of open file descriptors on > my system. How can I enhance my program to deal with this situation > without making significant changes? Read in data strictl

Re: [Haskell-cafe] c2hs and pthreadtypes.h

2007-03-13 Thread Donald Bruce Stewart
magnus: > I'm trying to use c2hs but get stuck when including sys/types.h (though > the problem really resides in pthreadtypes.h): > > % ./Setup.hs build -v > Preprocessing executables for kowasu-0.1... > /usr/bin/c2hs -C -D__GLASGOW_HASKELL__=606 -C -Icsrc -o src/Kowasu/PTrace.hs > src/Kowasu

Re: [Haskell-cafe] Re: [Haskell] Haskell Weekly News: March 12, 2007

2007-03-13 Thread Donald Bruce Stewart
ithika: > Quoth Conrad Parker, nevermore, > > > > Besides, If it's not open source, it's not computer > > science. Science demands repeatable results, computer science > > demands literate programming. The solution is not to shy away from > > including code, or else the IP lawyers have won, scienc

[Haskell-cafe] Haskell Weekly News: March 12, 2007

2007-03-11 Thread Donald Bruce Stewart
--- Haskell Weekly News http://sequence.complete.org/hwn/20070312 Issue 59 - March 12, 2007 --- Welcome to issue 59 of HWN, a weekly newsletter coverin

[Haskell-cafe] Re: Simple benchmark of list operations?

2007-03-10 Thread Donald Bruce Stewart
bulat.ziganshin: > Hello haskell-cafe, > > Page http://community.livejournal.com/ru_lambda/44716.html > contains three very simple but long-working benchmark functions: > > dummy :: [Int] -> [Int] > dummy [] = [] > dummy (x:xs) = x:dummy (dummy xs) > > dummy2 :: [Int] -> [Int] > dummy2 = dum

Re: [Haskell-cafe] Program Command Line Arguments

2007-03-10 Thread Donald Bruce Stewart
Dave: > My apologies if this is a question with a trivial answer. > Command line args in C are accessed via argc and argv[] > defined as arguments to main();. > > How are command line arguments to a ghc-compiled program > accessed in Haskell? Or is that even possible? Simplest: System.Environment

Re: [Haskell-cafe] idea for avoiding temporaries

2007-03-10 Thread Donald Bruce Stewart
bulat.ziganshin: > Hello Claus, > > Saturday, March 10, 2007, 4:36:22 AM, you wrote: > > > ah, ok, i'm not used to thinking in such scales;-) (perhaps you should get > > in touch > > with those SAC people, after all - i don't know what their state of play > > is, but > > many years ago, they st

[Haskell-cafe] Re: HS-Plugins 1.0 chokes on simple test, WinXP GHC-6.6

2007-03-09 Thread Donald Bruce Stewart
Is this using the darcs repository version of hs-plugins? That's the only versions that works with 6.6 alistair: > Does anyone have hs-plugins working on WinXP with ghc-6.6? When I run > the simple test below I get this error: > > Main: > c:/ghc/ghc-6.6/HSbase.o: unknown symbol `_free' > Main: us

Re: [Haskell-cafe] open a browser from the command line, wait a few seconds, and shut it. (ie, translate forking from bash to haskell)

2007-03-08 Thread Donald Bruce Stewart
tphyahoo: > I have a bash script that opens a browser for a few seconds, and then > closes it. > > Could someone point me up the equivelant(s) in haskell, h4sh, hsh, > etc,0 and friends? > > I reckon this amounts to, what's the process for translating forking > from bash to haskell. > > ***

Re: [OT] Re: [Haskell-cafe] Tricks for making low level haskell hacking easier

2007-03-05 Thread Donald Bruce Stewart
0xbadcode: > On 2/10/07, Donald Bruce Stewart <[EMAIL PROTECTED]> wrote: > >1) Use Hscolour to pretty-ifiy the Core so its more parsable: > > > >ghc -O Foo.hs -ddump-simpl | HsColour -tty | less -r > > > >will colourise the Core, and pipe it into less (

Re: [Haskell-cafe] Haskell 6.6 problem

2007-03-04 Thread Donald Bruce Stewart
dfeustel: > make and make install of ghc 6.6 completed successfully, > but exe generated by ghc fails to load. > > ===test.hs=== > main :: IO() > main =putStr "This is a test\n" > = > > ghc test.hs > compilation IS NOT required > /usr/bin/ld: cannot find -lgmp > collect2: ld

[Haskell-cafe] Haskell Weekly News: March 05, 2007

2007-03-04 Thread Donald Bruce Stewart
--- Haskell Weekly News http://sequence.complete.org/hwn/20070305 Issue 58 - March 05, 2007 --- Welcome to issue 58 of HWN, a weekly newsletter coverin

Re: [Haskell-cafe] Re: ANN: HSH 1.2.0

2007-03-04 Thread Donald Bruce Stewart
dfeustel: > > > On 2007-03-04, [EMAIL PROTECTED], "Feustel > > <[EMAIL PROTECTED]> wrote: > > > >> The Makefile in the HSH distribution should do this for you. But you > > > >> can say: > > > >> > > > >> ghc --make -o setup -package Cabal Setup.lhs > > > > > > > > A40:/home/daf/Hsh/hsh}ghc --mak

Re: [Haskell-cafe] Re: wanted: haskell one-liners (in the perl sense of one-liners)

2007-03-04 Thread Donald Bruce Stewart
hc-pkg > configure: Dependency base-any: using base-2.0 > configure: Dependency Cabal-any: using Cabal-1.1.6 > Setup.lhs: cannot satisfy dependency haskell-src-any > [EMAIL PROTECTED]:~/haskellInstalls/hs-plugins$ > **** > Advice? > > 2007/3/4, Donald Bruce Stewart

Re: [Haskell-cafe] Re: wanted: haskell one-liners (in the perl sense of one-liners)

2007-03-04 Thread Donald Bruce Stewart
There's some nice one liners bundled with h4sh: http://www.cse.unsw.edu.au/~dons/h4sh.html For example: http://www.cse.unsw.edu.au/~dons/h4sh.txt If you recall, h4sh is a set of unix wrappers to the list library. I still use them everyday, though probably should put out a new release so

Re: [Haskell-cafe] Lambdabot on Windows?

2007-03-03 Thread Donald Bruce Stewart
ia: > Does anyone know of a standalone version of lambdabot which will run > on Windows? (When I try to configure lambdabot-4.0, I get Setup.hs: > cannot satisfy dependency unix-any.) The darcs repo version of lambdabot does run on windows. you'll need to remove the unix dependency from the .ca

Re: [Haskell-cafe] Very Basic IO question

2007-03-02 Thread Donald Bruce Stewart
olivasj: > I am VERY new to Haskell, and just getting my feet wet with functional > programming in general. I've been going over a few examples online, but I > can't figure out the behavior I'm seeing on a very basic example: > > --- > module Main where > > import System.IO > > main :: IO (

[Haskell-cafe] Raiding the blogosphere

2007-02-28 Thread Donald Bruce Stewart
I've done a quick pass over the 100s of blog articles written in the last few months about Haskell, collecting and categorizing the best on Haskell.org: http://haskell.org/haskellwiki/Blog_articles Since it would be a real shame to not take advantage of these new tutorials. That page should s

Re: bytestring vs polymorphic contiguous lists Re: [Haskell-cafe] Re: Using loop fusion for writing efficenthigh-level code Re[2]:[Haskell] [Fwd: Re: Computer Language Shootout]

2007-02-28 Thread Donald Bruce Stewart
claus.reinke: > >The main example of course is ByteString fusion as presented in our recent > >paper: > >http://www.cse.unsw.edu.au/~dons/papers/CSL06.html > > btw, why did you restrict yourself to improving [Char], rather than [a]? > > naively, it would seem to me that most of the framework sho

Re: [Haskell-cafe] Plotting in Haskell

2007-02-27 Thread Donald Bruce Stewart
cwitte: > Are there any good libraries for drawing plots (2D and 3D) in Haskell > (under Windows using GHC)? There's the 'charts' library, http://dockerz.net/software/chart.html Alternatively, a binding to gnuplot is pretty trivial to hack up (see darcs-graph): http://www.cse.unsw.edu.au/

Re: [Haskell-cafe] How you can help improve Haskell implementations!

2007-02-26 Thread Donald Bruce Stewart
ndmitchell: > Hi > > >And also I guess the compilers will do more optimisations, etc. > >So this suggests an obvious extra feature for nobench which would be the > >ability to view a graph of each compiler's performance over a period of > >time, obviously this probably wouldn't be useful for at le

[Haskell-cafe] How you can help improve Haskell implementations!

2007-02-26 Thread Donald Bruce Stewart
Just a quick note to say that the Haskell implementation shootout is progressing, now supporting jhc, fixing a range of bugs, and providing more benchmark programs. Nice average numbers are also reported for the relative performance of each compiler or interpreter. On x86: http://www.cse.unsw.

Re: [Haskell-cafe] Re: Code and Perf. Data for Prime Finders (was: Genuine Eratosthenes sieve)

2007-02-25 Thread Donald Bruce Stewart
oneill: > Someone asked if I'd include a "classic C" version of the Sieve in my > comparisons. Having done so, Lennart wrote (slightly rephrased): > >How did you compare the C version with the Haskell versions? The > >Haskell programs produce the Nth prime, whereas the C code produces > >the

<    1   2   3   4   5   6   7   >