Re: [Haskell-cafe] Has anyone looked into adding subtyping to Haskell?

2007-05-31 Thread Donald Bruce Stewart
stefan: > Al, > > >Has there been any work on extending Haskell's type system with > >structural subtyping? > > Koji Kagawaga. Polymorphic variants in Haskell. In Andres Loeh, > editor, Proceedings of the 2006 ACM SIGPLAN Workshop on Haskell, > Portland, Oregon, USA, September 17, 2006, p

Re: [Haskell-cafe] Just for a laugh...

2007-06-01 Thread Donald Bruce Stewart
bulat.ziganshin: > Hello Andrew, > > Thursday, May 31, 2007, 11:47:28 PM, you wrote: > > (Otherwise... wasn't there some library somewhere for serialising values > > in binary?) > > Binary, AltBinary (see latest HCAR), just an example using AltBinary: > > main = do > let s = encode (1.

Re: [Haskell-cafe] Just for a laugh...

2007-06-01 Thread Donald Bruce Stewart
jules: > Donald Bruce Stewart wrote: > >> let s = encode (1.1 :: Float) > >> :t s > >s :: Data.ByteString.Lazy.ByteString > >> s > >LPS ["\NUL\NUL\140\204\205\255\255\255\255\255\255\255\233"] > > > >> decod

Re: [Haskell-cafe] Just for a laugh...

2007-06-01 Thread Donald Bruce Stewart
andrewcoppin: > Donald Bruce Stewart wrote: > >See also the older NewBinary, > >http://hackage.haskell.org/cgi-bin/hackage-scripts/package/NewBinary-0.1 > > > > Now that's just ironic... > > > Incidentally, I've been thinking. You *might*

Re: [Haskell-cafe] I just don't get it (data structures and OO)

2007-06-03 Thread Donald Bruce Stewart
Phlex: > Hello all, > > I'm coming from the OO world, and there's something i don't quite > understand in the way haskellers manipulate data (as all functional > programmers i guess). > > Let's say i have a deep nested data structure. > Universe containing galaxies, containing solar systems, co

Re: [Haskell-cafe] Re: I just don't get it (data structures and OO)

2007-06-03 Thread Donald Bruce Stewart
apfelmus: > Phlex wrote: > > Donald Bruce Stewart wrote: > >> > >> Imagine updating a node in a tree by just detaching and reattaching a > >> pointer. > >> > >> [1] [1] > >> / \

Re: [Haskell-cafe] Re: Just for a laugh...

2007-06-03 Thread Donald Bruce Stewart
almeidaraf: > On 6/3/07, Rafael Almeida <[EMAIL PROTECTED]> wrote: > >The site seems to be asking for the internal floating point > >representation. So it doesn't matter if it's IEEE 754, if the ints are > >2-complements, or whatever. I used this code as a quick hack for one of > >my programs, but

Re: [Haskell-cafe] (pre)compiled Haskell compiler for True64/Alpha

2007-06-06 Thread Donald Bruce Stewart
lutz: > Does anyone have a haskell compiler for True64 (formerly known as OSF/1) on > Alpha hardware? > > I'm currently unable to compile the first bootstrap compiler. > Any hint which compiler should I start with? > > I'll send detailed error reports only if I do not succeed in the next hours.

[Haskell-cafe] Fast number parsing with strict bytestrings [Was: Re: Seemingly subtle change causes large performance variation]

2007-06-07 Thread Donald Bruce Stewart
mdanish: > Hello, > > I've been playing with the INTEST problem on SPOJ which demonstrates > the ability to write a program which processes large quantities of > input data. http://www.spoj.pl/problems/INTEST/ > But when I make a slight modification, the program chews up a ton more memory > an

Re: [Haskell-cafe] Fast number parsing with strict bytestrings [Was: Re: Seemingly subtle change causes large performance variation]

2007-06-07 Thread Donald Bruce Stewart
dons: > mdanish: > > Hello, > > > > I've been playing with the INTEST problem on SPOJ which demonstrates > > the ability to write a program which processes large quantities of > > input data. http://www.spoj.pl/problems/INTEST/ > > > But when I make a slight modification, the program chews up

Re: [Haskell-cafe] haskell version of fractal benchmark

2007-06-07 Thread Donald Bruce Stewart
clawsie: > i recently saw a (yet-another) benchark comparing various languages: > > http://www.timestretch.com/FractalBenchmark.html > > while no haskell example was listed, i thought i would try a naive > implementation myself for comparison. it is available here: > > http://www.b7j0c.org/dev/h

Re: [Haskell-cafe] Fast number parsing with strict bytestrings [Was: Re: Seemingly subtle change causes large performance variation]

2007-06-07 Thread Donald Bruce Stewart
dons: > dons: > > mdanish: > > > Hello, > > > > > > I've been playing with the INTEST problem on SPOJ which demonstrates > > > the ability to write a program which processes large quantities of > > > input data. http://www.spoj.pl/problems/INTEST/ > > > > > But when I make a slight modificatio

Re: [Haskell-cafe] haskell version of fractal benchmark

2007-06-08 Thread Donald Bruce Stewart
andrewcoppin: > Donald Bruce Stewart wrote: > >Some things to remember using Doubles: > > > >* {-# OPTIONS -fexcess-precision #-} > >* -fvia-C > >* -fbang-patterns > >* -optc-O2 -optc-mfpmath=sse -optc-msse2 > >* -optc-march=penti

Re: [Haskell-cafe] haskell version of fractal benchmark

2007-06-08 Thread Donald Bruce Stewart
Alistair_Bayley: > > [mailto:[EMAIL PROTECTED] On Behalf Of Donald > > Bruce Stewart > > > > 3) -fbang-patterns > > > > Better than `seq` > > Better in the "more convenient to write" sense, right? AFAIUI, seq and > bang patterns should

Re: [Haskell-cafe] Fast number parsing with strict bytestrings [Was: Re: Seemingly subtle change causes large performance variation]

2007-06-08 Thread Donald Bruce Stewart
conal: > >Lovely! > >Perhaps a stylistic shift would encourage writing this sort >of elegant, fusion-friendly code. >-- Generalized version of "interact". Encapsulates data >getter & putter. >genInteract :: IO i -> (o -> IO ()) -> ((i -> o) -> IO >()) >

Re: [Haskell-cafe] haskell version of fractal benchmark

2007-06-08 Thread Donald Bruce Stewart
sic: > * Andrew Coppin <[EMAIL PROTECTED]> [070608 02:45]: > >Bayley, Alistair wrote: > > > > [[1]mailto:[EMAIL PROTECTED] On Behalf Of Andrew Coppin > > > > Donald Bruce Stewart wrote: > > > > Some things to remember using Dou

Re: [Haskell-cafe] haskell version of fractal benchmark

2007-06-08 Thread Donald Bruce Stewart
dons: > sic: > > * Andrew Coppin <[EMAIL PROTECTED]> [070608 02:45]: > > >Bayley, Alistair wrote: > > > > > > [[1]mailto:[EMAIL PROTECTED] On Behalf Of Andrew Coppin > > > > > > Donald Bruce Stewart wrote: > > > > &

Re: [Haskell-cafe] TorDNSEL

2007-06-13 Thread Donald Bruce Stewart
newsham: > I wanted to point out: >http://exitlist.torproject.org/ > > written in Haskell. I haven't seen any announcements or info on this list > (apologies if someone else mentioned it already). For the record, I'm not > affiliated with the project in any way. > Is the source available

Re: [Haskell-cafe] Re: Efficient signal processing

2007-06-16 Thread Donald Bruce Stewart
simonmarhaskell: > Henning Thielemann wrote: > > >The program is compiled with GHC-6.4 and option -O2, CPU clock 1.7 GHz. > > ByteString is much faster with GHC 6.6, IIRC. We optimised the > representation of ForeignPtr, and ByteString takes advantage of that. I > recommend upgrading. Yes, a

Re: [Haskell-cafe] Re: Efficient signal processing

2007-06-18 Thread Donald Bruce Stewart
lemming: > > On Sun, 17 Jun 2007, Donald Bruce Stewart wrote: > > > simonmarhaskell: > > > Henning Thielemann wrote: > > > > > > >The program is compiled with GHC-6.4 and option -O2, CPU clock 1.7 GHz. > > > > > >

Re: [Haskell-cafe] hSetBuffering woes

2007-06-19 Thread Donald Bruce Stewart
eeoam: > Bryan O'Sullivan wrote: > >Eric wrote: > > > >>I'm writing a simple HTTP server and am trying to implement the POST > >>method. > > > >That's a rather general problem statement, indeed :-) For an > >application like this, I'd suggest that explicit resource management > >is the way to

Re: [Haskell-cafe] Reading/writing packed bytes from file

2007-06-19 Thread Donald Bruce Stewart
jeff: > I've read the documentation for some of the marshalling packages out > there for Haskell, and I'm left confused as to which one I should be > using and how to actually do what I want to do. I have a file, a > little over 2gb, of packed data in the format > > (recordcount) records of: >

Re: [Haskell-cafe] haskell crypto is reaaaaaaaaaally slow

2007-06-19 Thread Donald Bruce Stewart
aeyakovenko: > $ time ./md5sum ./md5sum > [105,252,52,138,187,192,216,17,225,123,185,3,124,101,86,132] > > real0m4.790s > user0m3.688s > sys 0m0.492s > > $ time md5sum ./md5sum > 69fc348abbc0d811e17bb9037c655684 ./md5sum > > real0m0.023s > user0m0.000s > sys 0m0.008s >

Re: [Haskell-cafe] haskell crypto is reaaaaaaaaaally slow

2007-06-19 Thread Donald Bruce Stewart
dons: > aeyakovenko: > > $ time ./md5sum ./md5sum > > [105,252,52,138,187,192,216,17,225,123,185,3,124,101,86,132] > > > > real0m4.790s > > user0m3.688s > > sys 0m0.492s > > > > $ time md5sum ./md5sum > > 69fc348abbc0d811e17bb9037c655684 ./md5sum > > > > real0m0.023s > > user

Re: [Haskell-cafe] haskell crypto is reaaaaaaaaaally slow

2007-06-19 Thread Donald Bruce Stewart
stefanor: > On Wed, Jun 20, 2007 at 01:24:00PM +1000, Donald Bruce Stewart wrote: > > aeyakovenko: > > > $ time ./md5sum ./md5sum > > > [105,252,52,138,187,192,216,17,225,123,185,3,124,101,86,132] > > > > > > real0m4.790s > > > user

Re: [Haskell-cafe] haskell crypto is reaaaaaaaaaally slow

2007-06-19 Thread Donald Bruce Stewart
> > aeyakovenko: > > > $ time ./md5sum ./md5sum > > > [105,252,52,138,187,192,216,17,225,123,185,3,124,101,86,132] > > > > > > real0m4.790s > > > user0m3.688s > > > sys 0m0.492s > > > > > > $ time md5sum ./md5sum > > > 69fc348abbc0d811e17bb9037c655684 ./md5sum > > > > > > real0m

Re: [Haskell-cafe] Haskell, crypto and OpenSSL

2007-06-19 Thread Donald Bruce Stewart
dons: > -- Fast md5 using OpenSSL and non-copying bytestrings > md5sum :: B.ByteString -> String > md5sum p = unsafePerformIO $ B.unsafeUseAsCStringLen p $ \(ptr,n) -> do > digest <- c_md5 ptr (fromIntegral n) nullPtr > liftM concat $ forM [0..15] $ \n -> do >

Re: [Haskell-cafe] haskell crypto is reaaaaaaaaaally slow

2007-06-19 Thread Donald Bruce Stewart
aeyakovenko: > i don't think its a problem with bytestrings. I strictly unpacked the > bytestring and i still have 4 seconds for an md5 sum of the [word8] Until someone writes an md5 on bytestrings, we can't really say how much the slowdown is due to unpacking, GC and other memory stress building

Re: [Haskell-cafe] haskell crypto is reaaaaaaaaaally slow

2007-06-19 Thread Donald Bruce Stewart
ttmrichter: > >On Wed, 2007-20-06 at 15:21 +1000, Donald Bruce Stewart >wrote: > > -- unsigned char *MD5(const unsigned char *d, unsigned long n, un > signed char *md); > foreign import ccall "openssl/md5.h MD5" c_md5 > :: Ptr CChar ->

Re: [Haskell-cafe] Odd lack of laziness

2007-06-21 Thread Donald Bruce Stewart
jeff: > Alright, I've been hacking away at what I posted the other day, and I > have something that works for files that will fit entirely into memory. > And then I figured out why I've been restricted to files that fit > entirely into memory... One of my functions is causing the entire thing > to

Re: [Haskell-cafe] Plugin Problem - Weirder

2007-06-21 Thread Donald Bruce Stewart
daniel.is.fischer: > Am Donnerstag, 21. Juni 2007 10:22 schrieb Bayley, Alistair: > > > [mailto:[EMAIL PROTECTED] On Behalf Of Daniel Fischer > > > > > > I suppose in contrast to the version from HackageDB, which I > > > got myself on > > > monday, the darcs version works with ghc >= 6.6, or I > >

Re: [Haskell-cafe] Compile-time here document facility

2007-06-22 Thread Donald Bruce Stewart
bayer: > I couldn't find a compile-time here document facility, so I wrote one > using Template Haskell: Very nice! You should wrap it in a little .cabal file, and upload it to hackage.haskell.org, so we don't forget about it. Details on cabalising and uploading here: http://haskell.org/ha

Re: [Haskell-cafe] Haskell version of ray tracer code is much slower than the original ML

2007-06-22 Thread Donald Bruce Stewart
jon: > On Friday 22 June 2007 19:54:16 Philip Armstrong wrote: > > On Fri, Jun 22, 2007 at 10:11:27PM +0400, Bulat Ziganshin wrote: > > >btw, *their* measurement said that ocaml is 7% faster :) > > > > Indeed. The gcc-4.0 compilied binary runs at about 15s IIRC, but it's > > still much better than

Re: [Haskell-cafe] "Graphical Haskell"

2007-06-22 Thread Donald Bruce Stewart
bf3: > Wow thanks for all the info! This certainly can get me started. > > And yet I have some more questions (sorry!): > > - Unfortunately this project won't be open source; if my first tests are > successful, I will try to convince my employer (who wants to develop such a > graphical language)

Re: [Haskell-cafe] Need for speed: the Burrows-Wheeler Transform

2007-06-23 Thread Donald Bruce Stewart
> ...OK...so how do I make Haskell go faster still? > > Presumably by transforming the code into an ugly mess that nobody can > read any more...? > http://haskell.org/haskellwiki/Performance -- Don ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.o

Re: [Haskell-cafe] Parallel + exceptions

2007-06-24 Thread Donald Bruce Stewart
andrewcoppin: > Bulat Ziganshin wrote: > >Hello Andrew, > > > > > >definitive reading: "Tackling the awkward squad: monadic input/output, > >concurrency, exceptions, and foreign-language calls in Haskell" > >http://research.microsoft.com/Users/simonpj/papers/marktoberdorf/marktoberdorf.ps.gz > >

Re: [Haskell-cafe] Constructing a datatype given just its constructor as a string?

2007-06-24 Thread Donald Bruce Stewart
hughperkins: > >Just noticed that all my responses have been going only to >Neil, not to the group. >Anyway, the jist of our conversation was that it's not >possible to create arbitrary datatypes/constructors from >strings in Haskell. Can anyone deny/confirm? Entirely possib

Re: [Haskell-cafe] Wikipedia archiving bot - code review

2007-06-25 Thread Donald Bruce Stewart
gwern0: > Hey everyone. So I've been learning Haskell for a while now, and I've > found the best way to move from theory to practice is to just write > something useful for yourself. Now, I'm keen on editing Wikipedia and > I've long wanted some way to stop links to external websites from > breakin

Re: [Haskell-cafe] ANN: Scripting.Lua 0.1

2007-06-26 Thread Donald Bruce Stewart
gracjanpolak: > > Hi all, > > I'm pleased to announce the first public release of Scripting.Lua. > > The package hslua-0.1 contains Haskell FFI bindings for a Lua interpreter > along with some Haskell utility functions simplifying Haskell to Lua and > Lua to Haskell calls. Full Lua interpreter i

Re: [Haskell-cafe] Preferred way to get data from a socket

2007-06-26 Thread Donald Bruce Stewart
chad.scherrer: > I've never used sockets before, but I need to now, and I need to be > able to get a lot of data quickly. I was thinking about doing > something like this (below), but I'm wondering if there's a way that > would be faster. Is the obvious way of doing this "the right way"? I'm > happ

Re: [Haskell-cafe] loading an Haskell symbol at run-time

2007-06-26 Thread Donald Bruce Stewart
tittoassini: > Hi, > > to load an Haskell symbol at run-time is still necessary to use the load > functions from the hs-plugins library (System.Plugins.Load) or is there some > function in the GHC API that does the same job? > yes, definitely possible. i think Lemmih put an example on the wiki

Re: [Haskell-cafe] Preferred way to get data from a socket

2007-06-26 Thread Donald Bruce Stewart
chad.scherrer: > Ok, cool. FWIW, the current documentation for Network says: > > "For really fast I/O, it might be worth looking at the hGetBuf and > hPutBuf family of functions in System.IO." > > But this looked pretty low-level to me, and I figured it might be outdated. > > I also know Bulat Z

Re: [Haskell-cafe] Preferred way to get data from a socket

2007-06-27 Thread Donald Bruce Stewart
bulat.ziganshin: > Hello Donald, > > Wednesday, June 27, 2007, 6:37:07 AM, you wrote: > > >> I also know Bulat Ziganshin had put together a nice-looking Streams > >> library (http://unix.freshmeat.net/projects/streams/) based on John > >> Goerzen's previous HVIO work, but I wasn't sure if the Byt

Re: [Haskell-cafe] loading an Haskell symbol at run-time

2007-06-27 Thread Donald Bruce Stewart
tittoassini: > On Wednesday 27 June 2007 03:06:15 Donald Bruce Stewart wrote: > > tittoassini: > > > Hi, > > > > > > to load an Haskell symbol at run-time is still necessary to use the load > > > functions from the hs-plugins library (System.Plugins.Loa

Re: [Haskell-cafe] ANN: newports.hs utility for freebsd

2007-06-28 Thread Donald Bruce Stewart
clawsie: > i have written a small haskell program to solve a problem many users > of freebsd may have - knowing what ports have been updated after a > daily/weekly etc cvsup. this is a trivial bit of coding hardly worth > attention, but if it might be of use to you, you can find it here: > > http:

Re: [Haskell-cafe] ANNOUNCE: hiccup, a toy tcl impersonator in haskell

2007-06-29 Thread Donald Bruce Stewart
consalus: > A while back I saw a toy tcl interpreter in 550 lines of C called > 'picol'. I was looking for a simple language to implement in haskell, > so I made my own toy tcl interpreter. It was surprisingly easy to > make, thanks to the magic of Haskell and Bytestrings. :) It handles a > few th

[Haskell-cafe] Organising teams for ICFP 2007

2007-06-29 Thread Donald Bruce Stewart
Interested in competing in the ICFP 2007 programming contest -- the hackers contest of choice! http://www.icfpcontest.org There's 2000 people on this mailing list, and 350 people in #haskell, we must be able to put together a few decent teams out of that talent pool To help people get o

Re: [Haskell-cafe] sha1 implementation thats "only" 12 times slower then C

2007-06-30 Thread Donald Bruce Stewart
aeyakovenko: > So I tried implementing a more efficient sha1 in haskell, and i got to > about 12 times slower as C. The darcs implementation is also around > 10 to 12 times slower, and the crypto one is about 450 times slower. > I haven't yet unrolled the loop like the darcs implementation does, s

Re: [Haskell-cafe] sha1 implementation thats "only" 12 times slower then C

2007-07-03 Thread Donald Bruce Stewart
aeyakovenko: > inlining some of the functions definitely gave me a boost, so i am > about 8.5 times slower then openssl sha1sum. I dont really understand > the core output, but after inlining i got a completely different > profile output, i am guessing its because the cost of the inlined > functio

Re: [Haskell-cafe] Re: Abstraction leak

2007-07-04 Thread Donald Bruce Stewart
phil: > On Sun, Jul 01, 2007 at 06:07:13PM +0100, Andrew Coppin wrote: > >I haven't actually tried, but presumably a TCP connection is represented > >in the same way as a file, and so has the same problems. > > > >Basically doing binary I/O seems to be one of those things that in Haskell > >falls

Re: [Haskell-cafe] Re: Abstraction leak

2007-07-04 Thread Donald Bruce Stewart
drtomc: > >Anyone trying to do any of this? > > I've done some work in this area. I'm particularly interested in > manipulating ASN.1 in haskell. Actually, my first use of Parsec was an > ASN.1 parser. I'd done one previously in Spirit (the Boost C++ rip-off > of parsec), but semantic actions were

Re: [Haskell-cafe] Re: Abstraction leak

2007-07-04 Thread Donald Bruce Stewart
phil: > On Wed, Jul 04, 2007 at 09:02:15PM +1000, Donald Bruce Stewart wrote: > >phil: > >>On Sun, Jul 01, 2007 at 06:07:13PM +0100, Andrew Coppin wrote: > >>>I haven't actually tried, but presumably a TCP connection is represented > >>>in the s

Re: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-04 Thread Donald Bruce Stewart
phil: > On Wed, Jul 04, 2007 at 09:44:13PM +1000, Donald Bruce Stewart wrote: > >Binary instances are pretty easy to write. For a simple data type: > > > > > instance Binary Exp where > > > put (IntE i) = do put (0 :: Word8) > >

Re: [Haskell-cafe] folds with escapes

2007-07-04 Thread Donald Bruce Stewart
dm.maillists: > On Thursday 05 July 2007 11:20, Michael Vanier wrote: > > Again, I'm sure this has been done before (and no doubt better); I'd > > appreciate any pointers to previous work along these lines. > > Takusen is, if I recall correctly, based around a generalised fold supporting > accumu

Re: [Haskell-cafe] Re: Abstraction leak

2007-07-04 Thread Donald Bruce Stewart
drtomc: > On 7/4/07, Donald Bruce Stewart <[EMAIL PROTECTED]> wrote: > >Can we do a cheap bytestring binding to libxml, to avoid any initial > >String processing? > > For my part, it's not too big an issue. A version of HaXml or at least > Parsec built on top

[Haskell-cafe] Write a library today! Was: Binary serialization, was Re: Abstraction leakAKa

2007-07-05 Thread Donald Bruce Stewart
drtomc: > I was explaining Haskell to a perl/python hacking friend recently and > characterized things thus: > > Perl is a horrible language with fantastic libraries. > Haskell is a fantastic language with horrible libraries. > > Actually, many of the libraries that exist for Haskell *are* > fant

Re: [Haskell-cafe] Binary serialization, was Re: Abstraction leak

2007-07-05 Thread Donald Bruce Stewart
p.f.moore: > On 05/07/07, Jonathan Cast <[EMAIL PROTECTED]> wrote: > >Can't say I agree. I've been learning Python, and have been very > >un-impressed > >so far with its library coverage, which I would rate no better than (in > >terms > >of the POSIX bindings, worse than) Haskell. > > It probab

Re: [Haskell-cafe] interrupting an accept()ing thread

2007-07-05 Thread Donald Bruce Stewart
drtomc: > On 7/6/07, Lukas Mai <[EMAIL PROTECTED]> wrote: > >Hello, cafe! > > Have you been reading my mind? See the other recent Cafe thread (um, > titled something about System.Exit). > > Here's my solution: ... If you've got small examples illustrating how to use the various concurrency abst

Re: [Haskell-cafe] A very nontrivial parser

2007-07-05 Thread Donald Bruce Stewart
andrewcoppin: > Jonathan Cast wrote: > >On Thursday 05 July 2007, Andrew Coppin wrote: > > > >>...OK, anybody have a solution that works in Haskell 98? > >> > > > >Rank-2 types are perhaps /the/ most common, widely accepted extension to > >Haskell 98, after the approved addendum for FFI and

Re: [Haskell-cafe] RE: Modern Haskell books (was "Re: A very nontrivial parser")

2007-07-06 Thread Donald Bruce Stewart
bf3: > > but afair you don't yet have too much experience even with H98 > > language? from my POV, H98 as is useful for learning, but not for real > > apps. there is wide common subset of GHC and Hugs language extensions > > and this set (with exception for FD) will probably become new Haskell' >

Re: [Haskell-cafe] RE: Modern Haskell books (was "Re: A very nontrivial parser")

2007-07-06 Thread Donald Bruce Stewart
dons: > bf3: > > > but afair you don't yet have too much experience even with H98 > > > language? from my POV, H98 as is useful for learning, but not for real > > > apps. there is wide common subset of GHC and Hugs language extensions > > > and this set (with exception for FD) will probably become

Re: [Haskell-cafe] Haddock doesn't work -- with Haddock

2007-07-06 Thread Donald Bruce Stewart
ttmrichter: > >I've been wrestling the last few days with putting Haddock >documentation into my code. After a dead-simple library >failed to generate anything meaningful, I gave up, turfed my >copy of Haddock and downloaded the latest from the web >site. (Haddock 0.8, it see

Re: [Haskell-cafe] needsaname :: ([a] -> Maybe (b, [a])) -> (b -> [a]) -> [a] -> [a]

2007-07-06 Thread Donald Bruce Stewart
felipe.lessa: > >I've written it to run over lists, but it would not be difficult to > >make it run over ByteStrings instead, and exploit the 'no-copying' > >effect on the bits of the stream which were not modified, which would > >be very handy for programs processing large bytestrings. > > I wond

Re: [Haskell-cafe] A very edgy language (was: A very nontrivial parser)

2007-07-06 Thread Donald Bruce Stewart
trebla: > Andrew Coppin wrote: > >Personally, I just try to avoid *all* language extensions - mainly > >because most of them are utterly incomprehensible. (But then, perhaps > >that's just because they all cover extremely rare edge cases?) > > Haskell is an extremely rare edge case to begin with

Re: [Haskell-cafe] A very edgy language

2007-07-06 Thread Donald Bruce Stewart
trebla: > Donald Bruce Stewart wrote: > >Give #haskell is a far larger community than: > > > >#lisp > >#erlang > >#scheme > >#ocaml > > > >As well as > > > >#java > >#javascript > >#ruby >

Re: [Haskell-cafe] A very edgy language

2007-07-07 Thread Donald Bruce Stewart
andrewcoppin: > Donald Bruce Stewart wrote: > >Give #haskell is a far larger community than: > > > >#lisp > >#erlang > >#scheme > >#ocaml > > > >As well as > > > >#java > >#javascript > >#ruby &

Re: [Haskell-cafe] Re: GHC threads and SMP

2007-07-07 Thread Donald Bruce Stewart
ninegua: > replying to my own message... the behavior is only when -O is used > during compilation, otherwise they both run on 2 cores but at a much > lower (1/100) speed. Hmm, any change with -O2? Is the optimiser changing the code such that the scheduler doesn't get to switch threads as often? I

[Haskell-cafe] Too many packages on hackage? :-)

2007-07-07 Thread Donald Bruce Stewart
Hackage hackers, Looks like there's too many packages on hackage.haskell.org now for a single page listing: http://hackage.haskell.org/packages/archive/pkg-list.html Perhaps we can have a page with just the categories, with subpages hanging off? -- Don __

Re: [Haskell-cafe] A very edgy language (was: A very nontrivial parser)

2007-07-08 Thread Donald Bruce Stewart
bulat.ziganshin: > Hello Thomas, > > Sunday, July 8, 2007, 2:36:43 AM, you wrote: > > This is certainly true. I've coded up in less than six months, > > something that uses better algorithms and finer grained concurrency > > than the software I used to work on, and the latter represented 5 or > >

Re: [Haskell-cafe] A very edgy language

2007-07-08 Thread Donald Bruce Stewart
andrewcoppin: > > Does anybody have any clue why ByteStrings are actually faster? (And why > this information isn't easily findable anywhere - must shorly be a VFAQ.) > It's well documented in the API documentation for bytestrings. Start here: http://www.cse.unsw.edu.au/~dons/fps/Data-Byte

Re: [Haskell-cafe] Toy compression algorithms [was: A very edgy language]

2007-07-08 Thread Donald Bruce Stewart
andrewcoppin: > Andrew Coppin wrote: > >Dave Bayer wrote: > >>I was beginning to accept that I might die before clearing my > >>pipeline of research projects I want to code up. Haskell has given me > >>new hope. > > > >Indeed. ;-) > > > >Today I hve implemented encoders and decoders for RLE, MTF,

Re: [Haskell-cafe] In-place modification

2007-07-08 Thread Donald Bruce Stewart
andrewcoppin: > I was wittering on about stream fusion and how great it is, and I got a > message from Mr C++. > > (Mr C++ develops commercial games, and is obsessed with performance. For > him, the only way to achieve the best performance is to have total > control over every minute detail of

Re: [Haskell-cafe] Re: Too many packages on hackage? :-)

2007-07-08 Thread Donald Bruce Stewart
bulat.ziganshin: > Hello apfelmus, > > Sunday, July 8, 2007, 5:20:18 PM, you wrote: > > >>> > Looks like there's too many packages on hackage.haskell.org now for a > > it's the nicest problem i can imagine :) > > > For browsing libraries, I like the wiki pages much more than hackage. > > Can't

[Haskell-cafe] Compress and serialise data with lazy bytestrings, zlib and Data.Binary (was: Allocating enormous amounts of memory)

2007-07-08 Thread Donald Bruce Stewart
Jefferson Heard write: > I'm using the Data.AltBinary package to read in a list of 4.8 million > floats and 1.6 million ints. Doing so caused the memory footprint to > blow up to more than 2gb, which on my laptop simply causes the program > to crash. I can do it on my workstation, but I'd really

Re: [Haskell-cafe] Compress and serialise data with lazy bytestrings, zlib and Data.Binary (was: Allocating enormous amounts of memory)

2007-07-08 Thread Donald Bruce Stewart
dons: > Jefferson Heard write: > > > I'm using the Data.AltBinary package to read in a list of 4.8 million > > floats and 1.6 million ints. Doing so caused the memory footprint to > > blow up to more than 2gb, which on my laptop simply causes the program > > to crash. I can do it on my workstati

[Haskell-cafe] More binary IO, compression, bytestrings and FFI fun

2007-07-08 Thread Donald Bruce Stewart
Processing larger amounts of data, compression, serialisation and calling C. An elaboration of the previous example: * Build a largish structure in Haskell * Compress it in memory * Serialise it to disk * Deserialise it * Decompress * Pass it to C * Display the result

Re: [Haskell-cafe] Clearly, Haskell is ill-founded

2007-07-08 Thread Donald Bruce Stewart
drtomc: > I don't know if you saw the following linked off /. > > http://www.itwire.com.au/content/view/13339/53/ > > An amazon link for the book is here: > > http://www.amazon.com/Computer-Science-Reconsidered-Invocation-Expression/dp/0471798142 > > The basic claim appears to be that discrete

Re: [Haskell-cafe] Re: Too many packages on hackage? :-)

2007-07-08 Thread Donald Bruce Stewart
ketil: > On Mon, 2007-07-09 at 10:30 +1000, Donald Bruce Stewart wrote: > > > Another idea I've been pondering is allowing people to add links to > > documentation for libraries > > My main worry about Hackage is that it is often hard to tell the current > stat

Re: [Haskell-cafe] Lambdabot web interface

2007-07-09 Thread Donald Bruce Stewart
voigt: > Hi, > > I can't get http://lambdabot.codersbase.com/ to work for me. Whatever > input => "No lambdabot process" > > Is that a known issue, not the right URL, ...? > > Thanks, > Janis. Right URL, but Jason's not running lambdabot at the moment. You can access our bot via IRC though. h

Re: [Haskell-cafe] More binary IO, compression, bytestrings and FFI fun

2007-07-09 Thread Donald Bruce Stewart
phil: > On Mon, Jul 09, 2007 at 02:42:49PM +1000, Donald Bruce Stewart wrote: > >Processing larger amounts of data, compression, serialisation and calling > >C. > > Just a thought: is it worth sticking this up on the wiki? http://ha

Re: [Haskell-cafe] Lambdabot web interface

2007-07-09 Thread Donald Bruce Stewart
voigt: > Donald Bruce Stewart wrote: > >Right URL, but Jason's not running lambdabot at the moment. You can > >access our bot via IRC though. http://haskell.org/haskellwiki/IRC_channel > > Yup, but I assume that would mean bothering others with my experiments >

Re: [Haskell-cafe] xkcd #287 "NP-Complete"

2007-07-09 Thread Donald Bruce Stewart
trebla: > http://xkcd.com/c287.html > > import Data.Array > import Control.Monad > > -- exactly n v > -- items in v that sum to exactly n > -- returns list of solutions, each solution list of items > exactly :: (Real a) => a -> Array Int a -> [[a]] > exactly 0 v = return [] > exactly n v = do >

Re: [Haskell-cafe] "no-coding" functional data structures via lazyness

2007-07-09 Thread Donald Bruce Stewart
bayer: > Learning Haskell, the Prelude.ShowS type stood out as odd, exploiting > the implementation of lazy evaluation to avoid explicitly writing an > efficient concatenable list data structure. This felt like cheating, > or at least like using a screwdriver as a crowbar, to be less > judg

Re: [Haskell-cafe] Re: Too many packages on hackage? :-)

2007-07-09 Thread Donald Bruce Stewart
sascha.boehme: > Hello, > > > Who's our SoC hackage guy? To do list right here! > > The HackageDB project is for now concentrating on another subject. I see > the necessity of adding search features and additionally tags, but in > the moment I work on automatic generation of Haddock documentation

Re: [Haskell-cafe] Data.ByteString.dropWhile

2007-07-09 Thread Donald Bruce Stewart
drtomc: > Hi All, > > I notice that Data.ByteString has span and spanEnd. Is there a known and break/breakEnd. > particular reason why dropWhile and takeWhile don't have corresponding > *End functions? If not, what is the protocol for adding them? There's no reason -- we couldn't decide on whet

Re: [Haskell-cafe] Data.ByteString.dropWhile

2007-07-09 Thread Donald Bruce Stewart
drtomc: > Well, maybe I shoud be asking a higher level question then. > > I have a function > > tidy = reverse . dropWhile punk . reverse . dropWhile punk >where >punk = isPunctuation . chr . fromIntegral > > which is leading to a significant amount of allocation, and you can see why. >

Re: [Haskell-cafe] Data.ByteString.dropWhile

2007-07-09 Thread Donald Bruce Stewart
drtomc: > So the following isn't as clever as the line-noise Don posted, but > should be in the ball-park. Low level loops are irksome, but guaranteed to be quick :P > dropFromEnds p = dropWhile p . dropWhileEnd p > > dropWhileEnd p bs = take (findFromEndUntil (not p) bs) bs > > takeWhileEnd p

Re: [Haskell-cafe] Haskell and GnuPG?

2007-07-10 Thread Donald Bruce Stewart
magnus: > Continuing my "life up-side-down"? I'm looking for a Haskell wrapper > around GPGME. Is there such a beast? > Don't think there's such a binding yet. Would make a good contribution though! -- Don ___ Haskell-Cafe mailing list Haskell-Cafe@ha

Re: [Haskell-cafe] xkcd #287 "NP-Complete"

2007-07-10 Thread Donald Bruce Stewart
lemming: > > On Tue, 10 Jul 2007, Donald Bruce Stewart wrote: > > > These smaller NP problems really love the list monad. here's roconnor's > > solution from #haskell: > > > > import Control.Monad > > > > menu = [("Mixed Fruit&

Re: [Haskell-cafe] CPS versus Pattern Matching performance

2007-07-10 Thread Donald Bruce Stewart
tmorris: > When you you use maybe :: b -> (a -> b) -> Maybe a -> b instead of > pattern matching a returned Maybe value? > > Is there something a bit more concrete on this issue? You mean, versus using 'case' or sugar for case? It'll just inline to the same code. For example: maybe 10 (\n -

Re: [Haskell-cafe] CPS versus Pattern Matching performance

2007-07-10 Thread Donald Bruce Stewart
tmorris: > Thanks Don, > Is your explanation specific to maybe? Or does that apply to all functions? > > Suppose the following function for lists: > > f :: [a] -> b -> (a -> [a] -> b) -> b > > ...instead of pattern matching [] and (x:xs) It really depends on the body of 'f'. If they're simple w

Re: [Haskell-cafe] CPS versus Pattern Matching performance

2007-07-10 Thread Donald Bruce Stewart
lemming: > > On Tue, 10 Jul 2007, Tony Morris wrote: > > > Is your explanation specific to maybe? Or does that apply to all functions? > > > > Suppose the following function for lists: > > > > f :: [a] -> b -> (a -> [a] -> b) -> b > > > > ...instead of pattern matching [] and (x:xs) > > A foldr

Re: [Haskell-cafe] Sequence Classes

2007-07-10 Thread Donald Bruce Stewart
jcast: > I was just meditating on array fusion using streams, and list fusion using > streams, and it struck me: the definition of the list functions over arrays > is the same as that of the list functions over lists. From the ByteString > paper, we get: Yes indeed, hence Data.Stream provides

Re: [Haskell-cafe] In-place modification

2007-07-10 Thread Donald Bruce Stewart
allbery: > > On Jul 10, 2007, at 16:07 , Alex Queiroz wrote: > > >As I replied to Hugh, the Universe of computers is not restricted > >to PCs. We, embedded developers, will be using C for a lot of time > >still. > > Doesn't nhc98 target embedded devices? It's been used on embedded arm devic

Re: [Haskell-cafe] Looking for final year project - using Haskell, or another functional language

2007-07-10 Thread Donald Bruce Stewart
walter1003: > >Hi all, > >I will soon be doing my last year in computer science. >One part of our last year encompasses quite a big project >which will >go over 3 terms and will account for 3 modules (45 credits). >I was thinking in doing something using functional languag

Re: [Haskell-cafe] Allocating enormous amounts of memory and wondering why

2007-07-10 Thread Donald Bruce Stewart
jeff: > I switched to Data.Binary, which dropped me from 2.6GB to 1.5GB, and > then I switched this afternoon to unboxed arrays from lists of floats, > and that dropped me again from 1.5GB to 475MB. I think, all told, that > I'm in an acceptable range now, and thank you for pointing out the > libr

Re: [Haskell-cafe] Allocating enormous amounts of memory and wondering why

2007-07-10 Thread Donald Bruce Stewart
jeff: > I switched to Data.Binary, which dropped me from 2.6GB to 1.5GB, and > then I switched this afternoon to unboxed arrays from lists of floats, > and that dropped me again from 1.5GB to 475MB. I think, all told, that > I'm in an acceptable range now, and thank you for pointing out the > libr

[Haskell-cafe] increase in spam on the wiki

2007-07-11 Thread Donald Bruce Stewart
Looks like the spam protection measures are breaking down a bit. There's been 4 spam incidents (at least) on the wiki in the past day. Ashley et al, is there any easy fix? -- Don ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.

[Haskell-cafe] Defaulting to Rational [was: Number overflow]

2007-07-11 Thread Donald Bruce Stewart
lennart: > >Yes, I think we want Integer to be the type that is used >unless you ask for something else. >It adheres to the principle of getting it right before >optimizing. On a similar note, there's been a long discussion in #haskell about the problems of defaulting to floating

Re: [Haskell-cafe] Re: money type ?

2007-07-12 Thread Donald Bruce Stewart
simon: > Great - indeed, > > > sum [1.85, 5.95, -7.80] > 8.881784197001252e-16 > > sum [1.85::Money, 5.95, -7.80] > 0.00 > > I'm not yet sure these will do the best thing in all arithmetic, but it > seems to be the right thing for now. > > Yes, I will need to read these also. Perhaps first read

  1   2   3   4   5   6   7   >