Re: [Haskell-cafe] Java or C to Haskell

2006-09-20 Thread Donald Bruce Stewart
mailing_list: > On Wed, Sep 20, 2006 at 01:31:22AM -0700, Carajillu wrote: > > compare function just compares the two lists and return true if they are > > equal, or false if they are not. > > it is really a simple function, but I've been thinking about it a lot of > > time and I can't get the goal

[Haskell-cafe] ICFP programming contest 2006 results: video stream

2006-09-20 Thread Donald Bruce Stewart
Malcolm Wallace has recorded the ICFP programming contest results announcement as video, straight from the ICFP conference in Portland. He's posted it to Google Video, and it's available to download (120M) or stream from Google video, here: http://video.google.com/videoplay?docid=641909436975

Re: [Haskell-cafe] [newbie] How to test this function?

2006-09-20 Thread Donald Bruce Stewart
br1: > I've written a function that looks similar to this one > getList = find 5 where > find 0 = return [] > find n = do > ch <- getChar > if ch `elem` ['a'..'e'] then do > tl <- find (n-1) > return (ch : tl) else > find n > First, how do

Re: [Haskell-cafe] [newbie] How to test this function?

2006-09-20 Thread Donald Bruce Stewart
dons: > br1: > > Second, I want to test this function, without hitting the filesystem. In > > C++ I would use a istringstream. I couldn't find a function that returns > > a Handle from a String. The closer thing that may work that I could find > > was making a pipe and convertind the file

Re: [Haskell-cafe] [newbie] How to test this function?

2006-09-20 Thread Donald Bruce Stewart
dons: > br1: > > Second, I want to test this function, without hitting the filesystem. In > > C++ I would use a istringstream. I couldn't find a function that returns > > a Handle from a String. The closer thing that may work that I could find > > was making a pipe and convertind the file

[Haskell-cafe] Haskell.org down

2006-09-23 Thread Donald Bruce Stewart
Just in case it has gone unnoticed, haskell.org seems to have been down for a few hours now. Do we have an admin looking into this? -- Don ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Unable to profile program using Data.ByteString.Lazy

2006-09-23 Thread Donald Bruce Stewart
lists: > Hi folks, > > I wrote a program that uses some of the Data.ByteString libraries. I'm > using GHC 6.4.1 and FPS 0.7. > > The program compiles and works just fine. But when I try to profile it, > by compiling with -prof, I get: > >Failed to load interface for `Data.ByteString.Lazy':

Re: [Haskell-cafe] Haskell.org down

2006-09-23 Thread Donald Bruce Stewart
paul.hudak: > Thanks Don. I alerted our IT staff this morning, and they seem to have > things working again, although here is their final response: > >The web server had over 150 client connections which exceeded >its limit. I restarted the web server and all is well. > >I'll keep a

Re: [Haskell-cafe] Unable to profile program using Data.ByteString.Lazy

2006-09-24 Thread Donald Bruce Stewart
lists: > Donald Bruce Stewart wrote: > >Probably you didn't build fps with profiling as well? You can rebuild > >fps with: > >runhaskell Setup.hs configure -p > >as the first step. > > > >-- Don > > > > Thanks, I'll try it. Does

[Haskell-cafe] Haskell.org down (again)

2006-09-26 Thread Donald Bruce Stewart
Something's going on. Haskell.org seems to be down again. That's the 3rd time in 4 days. -- Don ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Unable to profile program using Data.ByteString.Lazy

2006-09-26 Thread Donald Bruce Stewart
lists: > Donald Bruce Stewart wrote: > >Probably you didn't build fps with profiling as well? You can rebuild > >fps with: > >runhaskell Setup.hs configure -p > >as the first step. > > > That worked on my Windows box at home, but on my Linux bo

Re: [Haskell-cafe] Haskell.org down (again)

2006-09-26 Thread Donald Bruce Stewart
dons: > Something's going on. Haskell.org seems to be down again. > That's the 3rd time in 4 days. And of course sending this message when the server _was_ down is guaranteed to lead to confusion when it is finally delivered, and the server is _up_. -- Don

Re: [Haskell-cafe] Is Haskell a 5GL?

2006-09-28 Thread Donald Bruce Stewart
david.curran: > Where are compute languages going? > I think multi core, distributed, fault tolerant. > So you would end up with a computer of the sort envisioned by Hillis > in the 80s with his data parallel programs. The only language that > seems even close to this model is Erlang. What am I mis

Re: [Haskell-cafe] instance of String illegal

2006-09-28 Thread Donald Bruce Stewart
adam: > I am trying to create an instance of a class for String types. I have > the following: > > class Foo a where > mkFoo :: a -> String > > instance Foo String where > mkFoo x = x > > and receive the following error: > > test.hs:9:0: > Illegal instance declaration for `Foo Stri

[Haskell-cafe] Porting content from the old wiki

2006-10-07 Thread Donald Bruce Stewart
The main thing holding up porting of content from the old wiki is licensing. In order to help this, could people who've written for the old wiki, and are happy to have that work moved to the new wiki and relicensed, add their names to the list here: http://haskell.org/haskellwiki/HaWiki_migrat

Re: [Haskell-cafe] Haskell performance (again)!

2006-10-08 Thread Donald Bruce Stewart
duncan.coutts: > On Sun, 2006-10-08 at 15:25 -0700, Jason Dagit wrote: > > > Another good idea when you have a pretty version which is easy to > > verify for correctness and an ugly version that is harder to verify is > > to use QuickCheck or SmallCheck and define a property that says both > > ver

Re: [Haskell-cafe] Re: What's going on in our courses?

2006-10-14 Thread Donald Bruce Stewart
monnier: > > Last Spring my Functional Programming class implemented a Genetic Algorithm > > with Neural Networks that learned to play Nim. The students had a really > > good time--they also learned lots about Functional Programming > > with Haskell. > > Part of the final exam was a tournament.

Re: [Haskell-cafe] Re: What's going on in our courses?

2006-10-14 Thread Donald Bruce Stewart
dons: > monnier: > > > Last Spring my Functional Programming class implemented a Genetic > > > Algorithm > > > with Neural Networks that learned to play Nim. The students had a really > > > good time--they also learned lots about Functional Programming > > > with Haskell. > > > Part of the fina

Re: [Haskell-cafe] List comparisons and permutation group code

2006-10-21 Thread Donald Bruce Stewart
dmhouse: > On 21/10/06, Tomasz Zielonka <[EMAIL PROTECTED]> wrote: > >Do you also have this experience with Haskell?: when you feel that > >some code is not ideal, almost always it can be improved. > > One of the recurring features of the #haskell IRC conversations is > something called 'Algorithm

Re: [Haskell-cafe] Read a single char

2006-10-23 Thread Donald Bruce Stewart
briqueabraque: > Hi, > > How can I read a single character from standard output? I would like > the user to press a single key and the reading function return > imediately after that key is pressed. so you want a function of type: IO Char asking Hoogle (http://haskell.org/hoogle) we ge

[Haskell-cafe] Guidelines for proposing library changes

2006-10-24 Thread Donald Bruce Stewart
After some discussion on the libraries list, I've put up the suggested 'best practice' for proposing library changes, here: http://haskell.org/haskellwiki/Library_submissions The idea is to reduce the number of 'bikeshed' discussions we're having, ensure that submissions are not dropped, an

[Haskell-cafe] Haskell custom search engine

2006-10-24 Thread Donald Bruce Stewart
Google now lets us create our own custom search engine pages, so I whipped one up for Haskell, http://www.google.com/coop/cse?cx=015832023690232952875%3Acunmubfghzq also, as a demo, embedded http://www.cse.unsw.edu.au/~dons/search.html Seems to do a reasonable job of targetting just Has

Re: [Haskell-cafe] Haskell custom search engine

2006-10-24 Thread Donald Bruce Stewart
bulat.ziganshin: > Hello Donald, > > Wednesday, October 25, 2006, 8:44:48 AM, you wrote: > > > Google now lets us create our own custom search engine pages, so I > > whipped one up for Haskell, > > great. and it search mail archives too > > how about adding it to haskell site, or at least a LAR

Re: Fwd: [Haskell-cafe] Haskell custom search engine

2006-10-25 Thread Donald Bruce Stewart
dnavarro: > >Google now lets us create our own custom search engine pages, so I > >whipped one up for Haskell, > > I volunteered. Accepted. > Are you planning to add just sites for Haskell-related software, or > are research papers included in the scope of this? > > (Dude, where's my english

Re: [Haskell-cafe] Haskell custom search engine

2006-10-25 Thread Donald Bruce Stewart
ndmitchell: > Hi > > >Neil, I wonder if we could integrate this with Hoogle somehow? > > If I provide an Ajax'y style API and we put the results in a frame, > I'm sure we can give something like "top 3 results from hoogle" (if > they make any sense). That sound a reasonable idea? You should be a

[Haskell-cafe] Ruby quiz, Haskell wiki

2006-10-25 Thread Donald Bruce Stewart
I've created a page to document haskell solutions to the ruby quiz puzzle series. http://haskell.org/haskellwiki/Haskell_Quiz Those of you working on them, please upload your solutions, and create sub pages for new puzzles as they appear. Cheers, Don __

[Haskell-cafe] More documentation: how to create a Haskell project

2006-10-29 Thread Donald Bruce Stewart
There's been a bit of discussion on irc, lists and privately about about documenting publically the best practice for creating a new Haskell project -- be that a library or an application. Some advice is now available here: http://haskell.org/haskellwiki/How_to_write_a_Haskell_program Sugges

[Haskell-cafe] Documenting subcommunities

2006-10-29 Thread Donald Bruce Stewart
As the Haskell community grows and spreads its lambda-tipped tentacles into new domains, I've noticed that some distinct sub-communities are emerging. To try to document and collect information relevant to these groups, some new wiki pages have been created. Alongside the 'traditional' areas of:

[Haskell-cafe] More documentation: languages written in Haskell

2006-10-29 Thread Donald Bruce Stewart
I noticed today that although we have a list of most applications written in Haskell, nowhere was there collected a page of perhaps our best use case for Haskell: for implementing compilers and interpreters! So here's a new 'libraries and tools' category page: http://haskell.org/haskellwiki/L

[Haskell-cafe] Tutorial: Writing a Lisp Interpreter In Haskell

2006-10-31 Thread Donald Bruce Stewart
People might be interested in a new tutorial that's just appeared in blogspace, by coffeemug (of #haskell): http://www.defmacro.org/ramblings/lisp-in-haskell.html Also, its on reddit, http://programming.reddit.com/info/oj1w/details An enthusiastic view of the language from a newcomer's pers

Re: [Haskell-cafe] How to improve speed? (MersenneTwister is several times slower than C version)

2006-11-01 Thread Donald Bruce Stewart
Now, this will be hard to get close the the highly tuned C. Possibly its doable. The main tricks are documented here: http://haskell.org/haskellwiki/Performance/GHC#Unboxed_types Inspecting the Core to ensure the math is being inlined and unboxed will be the most crucial issue, I'd imagine.

Re: [Haskell-cafe] Basic Binary IO

2006-11-01 Thread Donald Bruce Stewart
nuno: > >Hi all! > >Today i was reading System.IO and didn't manage to >understand how it works just by reading it. >I looked the internet for some help on this, but only >"advanced" information is available. >Can anyone show me how to use openBinaryFile ? >Just an exa

Re: [Haskell-cafe] How to improve speed? (MersenneTwister is several times slower than C version)

2006-11-01 Thread Donald Bruce Stewart
lemmih: > On 11/1/06, isto <[EMAIL PROTECTED]> wrote: > >Hi all, > > > >On HaWiki was an announcement of MersenneTwister made by Lennart > >Augustsson. On a typical run to find out 1000th rnd num the output > >is (code shown below): > > > >$ time ./testMTla > >Testing Mersenne Twister. > >Resu

Re: [Haskell-cafe] How to improve speed? (MersenneTwister is several times slower than C version)

2006-11-02 Thread Donald Bruce Stewart
bulat.ziganshin: > Hello isto, > > Thursday, November 2, 2006, 1:16:55 AM, you wrote: > > > I have tried to do different things but now I'm stuck. unsafeRead > > and unsafeWrite improved a bit the lazy (STUArray-version) and > > why you think it's a lazy? :) ST monad is just the same as IO mon

Re: [Haskell-cafe] Finding Memory Leaks

2006-11-02 Thread Donald Bruce Stewart
mattcbro: > > > > Jason Dagit-2 wrote: > > > > > > > > Do any memory leaks show up if you compile with -caf-all when you profile? > > > > Jason > > ___ > > Haskell-Cafe mailing list > > Haskell-Cafe@haskell.org > > http://www.haskell.org/mailman/li

Re: [Haskell-cafe] RFC and Announcement: HLADSPA, LADSPA for Haskell

2006-11-06 Thread Donald Bruce Stewart
lemming: > > On Sun, 5 Nov 2006, Alfonso Acosta wrote: > > > PS1: Big thanks and claps for the people at [EMAIL PROTECTED] . They > > helped a lot to make this initial release possible. > > PS2: I would like to get the project hosted at the darcs repository at > > haskell.org. Do you consider it

[Haskell-cafe] Livecoding music in Haskell

2006-11-06 Thread Donald Bruce Stewart
Alex McLean has kindly put up a screencast of him creating *music via live coding in Haskell* ! http://doc.gold.ac.uk/~ma503am/alex/haskellmusic And a .avi version of the screencast, playable in mplayer (for those not flash inclined). http://yaxu.org/20/hs.avi The code is running in hs

[Haskell-cafe] don't: a 'do' for comonads?

2006-11-08 Thread Donald Bruce Stewart
As seen on #haskell, from an idea by Malcolm, 14:42 ?let top'n'tail = (""++) . (++"") 14:42 lambdabot> Defined. 14:43 dons> > L.top'n'tail "foo me now" 14:43 lambdabot> "foo me now" 14:43 mauke> that reminds me, haskell needs don't 14:43 dons> yes! 14:44 pkhuon

Re: [Haskell-cafe] Sistema de Ecuaciones NO lineales

2006-11-09 Thread Donald Bruce Stewart
bonobo: > On Thu, 9 Nov 2006 02:52 pm, Sebastian Gaviria wrote: > > hola como estan > > > > Quiero preguntar quien puede resolver el sistemas de ecuaciones NO lineales > > de Newton y el codigo de Jacobi en Haskell > > > > me ayudarian mucho al poder implementar ese codigo > > > > por Favor es

[Haskell-cafe] Great language shootout: reloaded

2006-11-09 Thread Donald Bruce Stewart
So back in January we had lots of fun tuning up Haskell code for the Great Language Shootout[1]. We did quite well at the time, at one point ranking overall first[2]. After doing all we could with ghc 6.4.2, the Haskell entries have been left for the last 10 months, while we worked on new libraries

Re: [Haskell-cafe] Re: don't: a 'do' for comonads?

2006-11-09 Thread Donald Bruce Stewart
apfelmus: > Donald Bruce Stewart wrote: > > As seen on #haskell, from an idea by Malcolm, > > > > 14:42 ?let top'n'tail = (""++) . (++"") > > 14:42 lambdabot> Defined. > > 14:43 dons> > L.top'n'ta

Re: [Haskell-cafe] don't: a 'do' for comonads?

2006-11-09 Thread Donald Bruce Stewart
hjgtuyl: > > don't :: whatever -> > > (whatever goes in, nothing comes out) So its: don't :: a -> Void ? -- Don ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Great language shootout: reloaded

2006-11-10 Thread Donald Bruce Stewart
igouy2: > > On 11/10/06, Henk-Jan van Tuyl wrote: > >> > >> Haskell suddenly dropped several places in the overall socre, when > the > >> size measurement changed from line-count to number-of-bytes after > >> gzipping. Maybe it's worth it, to study why this is; Haskell > programs > >> are > >> of

Re: [Haskell-cafe] best Linux for GHC?

2006-11-12 Thread Donald Bruce Stewart
bulat.ziganshin: > Hello haskell-cafe, > > Now i'm consider installation of some Linux version at my box. My > friend offered me 3 variants: SuSe, Fedora Core 5, free variant of > RedHat (i can't remember its name, may be Ubuntu?) > > what may be best for GHC-based development? in particular, i w

Re: [Haskell-cafe] ByteString FFI

2006-11-12 Thread Donald Bruce Stewart
donn: > How do people like to set up their foreign I/O functions to return > ByteStrings? I was a little stumped over this yesterday evening, > while trying to write ` recv :: Socket -> Int -> Int -> ByteString ' > > Doc says `Byte vectors are encoded as strict Word8 arrays of bytes, > held in a

Re: [Haskell-cafe] ByteString FFI

2006-11-12 Thread Donald Bruce Stewart
donn: > On Mon, 13 Nov 2006, Donald Bruce Stewart wrote: > > > And for custom data (not just C strings), if the withCString* functions > > don't quite fit, you can always pack the foreign Ptr into a ByteString > > by stepping inside the ByteString constructor: > &

Re: [Haskell-cafe] Great language shootout: reloaded

2006-11-13 Thread Donald Bruce Stewart
tpledger: > Donald Bruce Stewart wrote: > [...] > > While we're here we should fix: > > chameneos > > And anything else you want to take a > > look at. > > > > A community page has been set up to > > which you can submit improved

[Haskell-cafe] Debugging partial functions by rewriting ...

2006-11-14 Thread Donald Bruce Stewart
Ok, so I took the rule rewriting idea and added a preprocessor instead, that inserts 'assert's for you, currently just for head,tail and fromJust. This program, for example: module Main where import qualified Data.Map as M import Data.Maybe main = do print f f = let m = M.f

[Haskell-cafe] Re: Debugging partial functions by the rules

2006-11-15 Thread Donald Bruce Stewart
oleg: > > Donald Bruce Stewart wrote: > > So all this talk of locating head [] and fromJust failures got me > > thinking: > > > > Couldn't we just use rewrite rules to rewrite *transparently* > > all uses of fromJust to safeFromJust, tagging the ca

[Haskell-cafe] Debugging partial functions by the rules

2006-11-14 Thread Donald Bruce Stewart
So all this talk of locating head [] and fromJust failures got me thinking: Couldn't we just use rewrite rules to rewrite *transparently* all uses of fromJust to safeFromJust, tagging the call site with a location? To work this requires a few things to go right: * a rewrite rule

Re: [Haskell-cafe] Re: Debugging partial functions by the rules

2006-11-16 Thread Donald Bruce Stewart
dmhouse: > On 16/11/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >And if we are absolutely positive that the value is (Just x), > >we can always write > >maybe (assert False undefined) id v > > It should be pointed out that Data.Maybe does export a less well-known > function, fromMay

Re: [Haskell-cafe] Re: Debugging partial functions by the rules

2006-11-16 Thread Donald Bruce Stewart
dons: > dmhouse: > > On 16/11/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > >And if we are absolutely positive that the value is (Just x), > > >we can always write > > >maybe (assert False undefined) id v > > > > It should be pointed out that Data.Maybe does export a less well-known

Re: [Haskell-cafe] Re[2]: [Haskell] I18N, external strings

2006-11-17 Thread Donald Bruce Stewart
bulat.ziganshin: > Hello Axel, > > Friday, November 17, 2006, 11:27:00 AM, you wrote: > > > (l_ "Translate this") > > > is compiled into a C string constant, that GHC then turns lazily into a > > list of characters, which l_ then turns into an array in C land to pass > > to the gettext function,

[Haskell-cafe] Wiki page for rewrite rules tips, types and tricks

2006-11-17 Thread Donald Bruce Stewart
After suggesting solutions based on rewrite rules to three different questions this week, I though maybe we better have a wiki page on using rewrite rules for non-traditional ad-hoc tricks. http://haskell.org/haskellwiki/Playing_by_the_rules If you've used rewrite rules for something fun (oth

Re: [Haskell-cafe] Debugging partial functions by the rules

2006-11-18 Thread Donald Bruce Stewart
ndmitchell: > Hi > > >To see at a glance the various bug reports about fromJust you can > >search the bug database: > >http://bugs.darcs.net/[EMAIL > >PROTECTED]&@sort=activity&@group=priority&@search_text=fromJust > > > >I count 7 bugs. > > >I would be interested to see the results of static an

[Haskell-cafe] Starting your own Haskell project: part 2

2006-11-18 Thread Donald Bruce Stewart
We've expanded the wiki page on 'How to write a Haskell project', to include a complete walkthrough creating: * Darcs * Cabal * QuickCheck infrastructure. http://haskell.org/haskellwiki/How_to_write_a_Haskell_program Feedback welcome! -- Don P.S. It might even be useful to hav

Re: [Haskell-cafe] Starting your own Haskell project: part 2

2006-11-19 Thread Donald Bruce Stewart
dagit: > On 11/19/06, Dougal Stanton <[EMAIL PROTECTED]> wrote: > >Quoth Donald Bruce Stewart, nevermore, > >> P.S. It might even be useful to have a tool, haskell-project, which > >> sets up all these files automatically. > > > >I was wondering ab

Re: [Haskell-cafe] Starting your own Haskell project: part 2

2006-11-19 Thread Donald Bruce Stewart
dons: > dagit: > > On 11/19/06, Dougal Stanton <[EMAIL PROTECTED]> wrote: > > >Quoth Donald Bruce Stewart, nevermore, > > >> P.S. It might even be useful to have a tool, haskell-project, which > > >> sets up all these files automatically. > >

Re: [Haskell-cafe] trivial ghc problem, help needed

2006-11-22 Thread Donald Bruce Stewart
clawsie: > i have a program tb.hs: > > --- > module Main where > import Network.URI (URI(..), URIAuth(..), parseURI) > > myFunc :: String -> Maybe URI > myFunc u = parseURI u > > main = do { return () } > --- > > when i attempt to build it with ghc, i get the following output: > > tb.o: In fun

Re: [Haskell-cafe] Command line prompt templates

2006-11-23 Thread Donald Bruce Stewart
ithika: > I was trying to write my own equivalent to Don Stewart's mkcabal but > ended up getting sidetracked. I made some generalised prompts for use at > the command line and wanted to get some feedback on them. > > The full code can be found at [1] but the basic summary is like this: > > > pro

Re: [Haskell-cafe] question about "How to Write a Haskell Program" tutorial

2006-11-23 Thread Donald Bruce Stewart
mvanier: > First off, I apologize if this has come up before. As far as I can tell, > the mailing list archives don't have a search function. I'm running > ghc-6.6 and haddock-0.8, both compiled from source. > > I'm working my way through the "How to Write a Haskell Program" tutorial > (which

Re: [Haskell-cafe] Foldl

2006-11-24 Thread Donald Bruce Stewart
zacara: > > Hello, > i'd like to write a function that given a list like [1,2,3,4...] > returns a list of couple where the first element is the corresponding > element of the string, and the second is the sum of the previous > elements. > An example: > input: [1,2,3,4] > output: [(1,0)(2,1)(3,3)(4

Re: [Haskell-cafe] Starting your own Haskell project: part 2

2006-11-24 Thread Donald Bruce Stewart
ross: > On Sun, Nov 19, 2006 at 03:41:29PM +1100, Donald Bruce Stewart wrote: > > http://haskell.org/haskellwiki/How_to_write_a_Haskell_program > > > > Feedback welcome! > > There is inconsistent advice regarding Setup.hs/Setup.lhs. > (#! in .hs files seems

Re: [Haskell-cafe] Haddock question

2006-11-25 Thread Donald Bruce Stewart
zhen.sydow: > Hello, > > I follow the How to Write a Haskell program from > http://www.haskell.org/haskellwiki/How_to_write_a_Haskell_program, but > I have a problem with Haddock. > > I use Windows XP, I when I install GHC + Haddock I have this warning output > > C:\code\haskell\test> runhaskell

[Haskell-cafe] Improving library documentation

2006-11-25 Thread Donald Bruce Stewart
People sometimes complain that the standard libraries need more documentation. Since we have so many eyes reading the haddock source, a low barrier way for people to improve the docs is needed. I've created a new wiki page, linked from the libraries page: http://haskell.org/haskellwiki/Improv

Re: [Haskell-cafe] Binary code

2006-11-27 Thread Donald Bruce Stewart
trevion: > Hello, > > First, and forgive me if I'm making unwarranted assumptions, but > http://haskell.org/haskellwiki/Homework_help might be useful. Yes, almost certainly this is the case. The same questions were asked on #haskell at pretty much the same time... 15:54:34 --- join: greg_lun

[Haskell-cafe] [Redirect] polymorphism and existential types

2006-11-27 Thread Donald Bruce Stewart
Redirected to haskell-cafe@haskell.org, the right list. -- Don - Forwarded message from Louis-Julien Guillemette <[EMAIL PROTECTED]> - Date: Mon, 27 Nov 2006 16:15:26 -0500 (EST) From: Louis-Julien Guillemette Subject: [Haskell] polymorphism and existential types Supposing a polymorphic

Re: [Haskell-cafe] Compatibility between Data.ByteString.Base and Data.ByteString.Lazy

2006-11-29 Thread Donald Bruce Stewart
neil: > Hi, > > Firstly my apologies if this is an outrageously newbie question. > > I am trying to write a binary protocol parser using Data.ByteString. I > have created a module "ByteParser" containing my parsing utilities, which > imports ByteString as: > > import qualified Data.ByteString

Re: [Haskell-cafe] Beginner: IORef constructor?

2006-12-01 Thread Donald Bruce Stewart
tjay.dreaming: > Thanks. I've been reading the docs and examples on State (in > Control.Monad.State), but I can't understand it at all. ticks and > plusOnes... All they seem to do is return their argument plus 1... Here's a little demo. (I agree, the State docs could have nicer demos) Play around

Re: [Haskell-cafe] Beginner: IORef constructor?

2006-12-01 Thread Donald Bruce Stewart
tjay.dreaming: > Thanks for the demo. I don't actually understand what's going on yet, > but your code doesn't really use a global variable, does it? From > what I can understand, the main function is passing the State to the > other functions. Right, via the monad. The monad does all the threadi

Re: [Haskell-cafe] Beginner: IORef constructor?

2006-12-01 Thread Donald Bruce Stewart
tjay.dreaming: > Donald: > >Now, if you wanted to pass that ref to other functions, you'd have to > >thread it explicitly -- unless you store it in a state monad :) > > > >i.e. do ref <- theGlobalVariable > >... > >.. f ref > >... > > > > f r = do > >

Re: [Haskell-cafe] Parsec: Where's +++?

2006-12-01 Thread Donald Bruce Stewart
garious: > Koen Claessen's "Parallel Parsing Processes," suggests their parsing > combinators have been integrated into Parsec. If so, where is the +++ > operator hiding? Hoogle says: Control.Arrow.(+++) :: ArrowChoice a => a b c -> a b' c' -> a (Either b b') (Either c c') Text.Html.(+++) :: (H

Re: [Haskell-cafe] Generate 50 random coordinates

2006-12-01 Thread Donald Bruce Stewart
hankgong: > > Hello,all > > My intention is to generate 50 random coordinates like (x,y). > > myrand :: Int > myrand = randomRIO(1::Int, 100) > > rf=[(myrand, myrand) | a <- [1..50]] > > My short program is like this. However, GHCI say that the return type of > randomRIO is IO a while the func

Re: [Haskell-cafe] Re: Difficult memory leak in array processing

2006-12-02 Thread Donald Bruce Stewart
apfelmus: > Duncan Coutts wrote: > > On Wed, 2006-11-29 at 20:27 +0100, [EMAIL PROTECTED] wrote: > > > >> On the implementation level, lazy evaluation is in the way when > >> crunching bytes. > > > > Something I rather enjoyed when hacking on the ByteString lib is finding > > that actually lazy e

Re: [Haskell-cafe] unexpected compiler behavior

2006-12-05 Thread Donald Bruce Stewart
jepalomar23: > Hi, > I am newbie in Haskell and do not understand why the interpreted mode > differs from the compiled program. > I run this code > main = do > putStr "line1" > x<-getLine > putStr "line2" > y<-getLine > return (x++y) > > either un

[Haskell-cafe] WANTED: grey line layout boxes in vim and emacs

2006-12-06 Thread Donald Bruce Stewart
I'd like some more help from the editors in getting 2d layout right without trying. Here's a mockup of vim with vertical grey bars delimiting layout: http://www.cse.unsw.edu.au/~dons/tmp/haskell+boxes.png Does anyone know how to get this effect in vim (or emacs)? Bonus points if the grey bar

Re: [Haskell-cafe] WANTED: grey line layout boxes in vim and emacs

2006-12-06 Thread Donald Bruce Stewart
dons: > I'd like some more help from the editors in getting 2d layout right > without trying. Here's a mockup of vim with vertical grey bars > delimiting layout: > > http://www.cse.unsw.edu.au/~dons/tmp/haskell+boxes.png > > Does anyone know how to get this effect in vim (or emacs)? > > Bonu

[Haskell-cafe] Hac 2007 : Haskell Hackathon - extended registration

2006-12-07 Thread Donald Bruce Stewart
Hac 2007 The 2007 Haskell Hackathon January 10-12, 2007 Oxford University Computing Laboratory http://haskell.org/haskellwiki/Hac_2007 The deadline f

Re: [Haskell-cafe] interval arithmetic for integers?

2006-12-07 Thread Donald Bruce Stewart
nicolas.frisby: > I'm looking to not reinvent the wheel. > > Is there an existing package that supports interval arithmetic on > integers (or more)? A possible complication is that I'm hoping to > include open intervals such as (GreaterEqThan 3). > > If there's not a package to go with, any point

Re: [Haskell-cafe] One question...

2006-12-09 Thread Donald Bruce Stewart
wb: > Hello to everyone! > > Two days ago I have found Haskell in Internet. It sounds very nice. > I have read some articles, few examples, ... yes it sounds nice. Great! Welcome to Haskell. > Now my problem is connected with the "non-update" object feature. > I can't write "variable" instead

Re: [Haskell-cafe] On improving libraries: wanted list

2006-12-11 Thread Donald Bruce Stewart
bulat.ziganshin: > Hello isto, > > Monday, December 11, 2006, 2:19:02 PM, you wrote: > > > About 'Wanted' page: would it be possible to easily have an > > index being up-to-date reporting the activity status of each lib? > > Either in this 'Wanted' page or somewhere else like in the > > liblistp

[Haskell-cafe] Haskell Weekly News: December 12, 2006

2006-12-11 Thread Donald Bruce Stewart
--- Haskell Weekly News http://sequence.complete.org/ Issue 53 - December 12, 2006 --- Welcome to issue 53 of HWN, a weekly newsletter covering develop

Re: [Haskell-cafe] Aim Of Haskell

2006-12-12 Thread Donald Bruce Stewart
ndmitchell: > Hi > > >That's exactly the problem! For most people there *is* no difference. > >You say "functional programming" to most people, even professional > >programmers, and usually the only chance you have of getting them to > >understand what what you mean is by asking "so, have you hear

Re: [Haskell-cafe] Re: a cabal/database lib experience

2006-12-12 Thread Donald Bruce Stewart
simonmarhaskell: > Claus Reinke wrote: > > >cabal: > > - the separation into interpreter/compiler and resource as Setup > > does not set up the right mindset in users. for instance, you can > > "runhaskell Setup.hs --help" as for most unixy tools, but who'd > > think of that in

Re: [Haskell-cafe] Good Haskell introduction for an Ocaml programmer?

2006-12-12 Thread Donald Bruce Stewart
bhurt: > > Greetings, all. I'm an experienced Ocaml programmer, looking to broaden > my horizons yet further and pick up Haskell, and I'm wondering if there's > a good introduction to Haskell for me. I have Simon Thompson's "Haskell: > The Craft of Functional Programming", which isn't a bad b

Re: [Haskell-cafe] Haskell Weekly News: December 12, 2006

2006-12-12 Thread Donald Bruce Stewart
jbapple+haskell-cafe: > On 12/12/06, Donald Bruce Stewart <[EMAIL PROTECTED]> wrote: > >--- > >Haskell Weekly News > >http://sequence.complete.org/ >

Re: a cabal/database lib experience (was: [Haskell-cafe] Trivialdatabase access in Haskell)

2006-12-12 Thread Donald Bruce Stewart
bulat.ziganshin: > Hello Alistair, > > Tuesday, December 12, 2006, 12:50:43 PM, you wrote: > > > I guess I should comment, as one of the Takusen authors. > > > Yes, this is embarrasing. We have made a number of assumptions which > > Paul exposed: > > - users should know to do darcs get, then ru

[Haskell-cafe] Re: [Haskell] Waiting on multiple Chan-nels

2006-12-12 Thread Donald Bruce Stewart
sebastian.setzer.ext: > Hi, > How do you wait on multiple channels, but read only from one of them > (the first that gets an entry)? Is there a library-function I missed > which already does this? > > What do you think of this solution? Feels to heavy :) An alternative solution that strikes me,

Re: [Haskell-cafe] Why so slow?

2006-12-12 Thread Donald Bruce Stewart
lists: > The code below is using way more RAM than it should. It seems to only > take so long when I build the 'programs' list - the actual > reading/parsing is fast. For a 5MB input file, it's using 50MB of RAM! > Any idea how to combat this? > > Thanks, > Lyle > > {-# OPTIONS_GHC -fglasgow-e

Re: [Haskell-cafe] Re: a cabal/database lib experience

2006-12-12 Thread Donald Bruce Stewart
claus.reinke: > >>absolutely, this has occurred to me too. There should be a stanard Cabal > >>README file, and Don's mkcabal tool could drop it in the tree. > > > >This occurred to me too. My current plan for mkcabal is that it creates: > > > > foo.cabal > > Setup.lhs > > README > > LICE

Re: [Haskell-cafe] Re: On improving libraries: wanted list

2006-12-12 Thread Donald Bruce Stewart
jgoerzen: > On Mon, 11 Dec 2006 11:52:48 +1100, Donald Bruce Stewart wrote: > > > With the upcoming hackathon[1], and its timely focus on real world > > libraries, infrastructure and tools support, I've started a list of > > truly missing libraries, for particular pro

Re: [Haskell-cafe] Re: Reversing a string of words: C# v Perl V Ruby v Haskell

2006-12-13 Thread Donald Bruce Stewart
ulfn: > > On Dec 13, 2006, at 3:54 AM, Yitz Gale wrote: > > >Nice. Here is something similar: > > > >reverseWords = concat . reverse . groupBy eqsp > > where eqsp x y = isSpace x == isSpace y > > This can be made even nicer using the 'on' function [1]: > > reverseWords = concat . reverse . gro

Re: [Haskell-cafe] Reversing a string of words: C# v Perl V Ruby v Haskell

2006-12-13 Thread Donald Bruce Stewart
sdowney: > ok, i'll bite. why should i prefer join rather than concat in the list > monad. and, moreover, why is this a lambdabot trick? Oh, but you shouldn't prefer it! It's obfuscating! It's a trick simply because lambdabot knows the rewriting: 12:16 dons> ?pl reverseWords = concat . reve

Re: [Haskell-cafe] Request for a Simple Pretty Printing library

2006-12-13 Thread Donald Bruce Stewart
doaitse: > The Prettyprint library you can download from: > > http://www.cs.uu.nl/wiki/HUT/Download > I've added uulib to the libraries page: http://haskell.org/haskellwiki/Libraries_and_tools/Compiler_tools#Pretty_printing But this makes me wonder: how many other top secret utrecht

[Haskell-cafe] Building the community

2006-12-13 Thread Donald Bruce Stewart
One of the great aspects of programming Haskell is the community. We should aim to have the strongest, friendliest, most productive community we can. We're doing a good job so far, can we do even better? Reading this: "How to Build a User Community" http://headrush.typepad.com/creating_p

Re: [Haskell-cafe] Re: On improving libraries: wanted list

2006-12-13 Thread Donald Bruce Stewart
jgoerzen: > On Wed, Dec 13, 2006 at 04:19:58PM +1100, Donald Bruce Stewart wrote: > > > In particular, you seem to be wanting my pipeBoth function. > > > > > > Note that your proposed String -> IO String function type is insufficient > > > because it doe

[Haskell-cafe] Interpreter output in color

2006-12-13 Thread Donald Bruce Stewart
Forward to haskell-cafe@haskell.org for further discussion. - Forwarded message from Walter Moreira <[EMAIL PROTECTED]> - Date: Thu, 14 Dec 2006 06:46:44 + From: Walter Moreira <[EMAIL PROTECTED]> To: haskell@haskell.org Subject: [Haskell] interpreter ouput in color Hi all. I was won

Re: [Haskell-cafe] Optimization again.

2006-12-14 Thread Donald Bruce Stewart
szefirov: > From GHC documentation: "Once profiling has thrown the spotlight on the > guilty time-consumer(s), it may be better to re-think your program than > to try all the tweaks listed below." > > So, how should I rethink my program? Which way to take? Do you have some particular code that

Re: [Haskell-cafe] Optimization again.

2006-12-14 Thread Donald Bruce Stewart
szefirov: > I profiled my program and found that residency looks pretty fixed but > program memory usage grows and eventually I get heap overflow (on > Windows) or heavy pagefile trashing (on Linux). > > When I turn on +RTS -c to use heap compaction I immediately get the > following: > > --

Re: [Haskell-cafe] what are the points in pointsfree?

2006-12-14 Thread Donald Bruce Stewart
sdowney: > i'm not naive enough to think they are the composition function, and > i've gathered it has something to do with free terms, but beyond that > i'm not sure. unless it also has something to do with fix points? The wiki knows all! :) http://haskell.org/haskellwiki/Pointfree 1 Bu

<    1   2   3   4   5   6   7   >