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 is a

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 function

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 about that just the other day. Is there such an application

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. I was wondering about that just the other day

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 analysis tools

[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

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, fromMaybe:

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 function,

[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 call site with a location? I'm sorry

[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 =

[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] 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 entries: http://www.haskell.org/haskellwiki/Great_language_shootout

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 want to

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: http://www.haskell.org/haskellwiki

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

2006-11-10 Thread Donald Bruce Stewart
igouy2: On 11/10/06, Henk-Jan van Tuyl hjgtuyl at chello.nl 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

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 con urgencia

[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

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 = (pre++) . (++/pre) 14:42 lambdabot Defined. 14:43 dons L.top'n'tail foo me now 14:43 lambdabot prefoo me now/pre 14:43 mauke that reminds me

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

[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 = (pre++) . (++/pre) 14:42 lambdabot Defined. 14:43 dons L.top'n'tail foo me now 14:43 lambdabot prefoo me now/pre 14:43 mauke that reminds me, haskell needs don't 14:43 dons yes! 14:44

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

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 monad

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/listinfo/haskell-cafe

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 example, like

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. Result is [3063349438]

[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

[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

[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:

Re: [Haskell-cafe] Haskell custom search engine

2006-10-25 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 LARGE link so

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 grammar.)

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 able to do

[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] 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

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 get:

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 Golf'

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. This

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 final exam was a

[Haskell-cafe] Porting content from the old wiki

2006-10-08 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:

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 versions are

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 missing

[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 box at work, I got unrecognized flag -p. You're cabal

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] 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 that mean when I want to optimize my program, I'll need to rebuild fps

[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 and eye

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

2006-09-20 Thread Donald Bruce Stewart
crespi.albert: I'm trying to write in Haskell a function that in Java would be something like this: char find_match (char[] l1, char[] l2, char e){ //l1 and l2 are not empty int i = 0; while (l2){ char aux = l2[i]; char[n] laux = l2;

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

2006-09-20 Thread Donald Bruce Stewart
dons: crespi.albert: I'm trying to write in Haskell a function that in Java would be something like this: char find_match (char[] l1, char[] l2, char e){ //l1 and l2 are not empty int i = 0; while (l2){ char aux = l2[i]; char[n] laux = l2;

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. I

[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:

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 I fix the

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

Re: [Haskell-cafe] Microsoftish Haskell

2006-09-17 Thread Donald Bruce Stewart
kaveh.shahbazian: Will Haskell become another pet for Microsoft? No. This question doesn't even make sense. are many issues around licensing GHC as you'v seen in this mailing list and I think Haskell already HAS some big problems that prevent others to use it confidently.) Haskell is in

Re: [Haskell-cafe] Microsoftish Haskell

2006-09-17 Thread Donald Bruce Stewart
kaveh.shahbazian: Thanks Don I sense the truth in your words. But I expect a more technical view of point. I need it for presenting to other peoples i.e. to whom wanted fom me an overview of Haskell/Using It/Licensing/Libraries/Communities to be provided (BOSS!). Ok. Overview,

Re: [Haskell-cafe] Re: Optimization problem

2006-09-17 Thread Donald Bruce Stewart
ross: On Thu, Sep 14, 2006 at 07:51:59PM +0200, Bertram Felgenhauer wrote: It's a result of thinking about lazy evaluation, and especially lazy patterns (and let bindings) for some time. A wiki article that helped me a lot to understand these is

Re: [Haskell-cafe] Bit string

2006-09-15 Thread Donald Bruce Stewart
tomasz.zielonka: On Fri, Sep 15, 2006 at 11:35:45AM +1000, Thomas Conway wrote: My question for all present is: Have I missed either a problem with using Integer, or have I overlooked a better representation? Consider also (UArray Int Bool). In GHC it has an efficient implementation. A

Re: [Haskell-cafe] Slow IO

2006-09-12 Thread Donald Bruce Stewart
daniel.is.fischer: Am Dienstag, 12. September 2006 22:26 schrieben Sie: Daniel Fischer wrote: The programme consumed more and more memory (according to top), kswapd started to have a higher CPU-percentage than my programme, programme died, system yelling 'Speicherzugriffsfehler', top

Re: [Haskell-cafe] foreach

2006-09-12 Thread Donald Bruce Stewart
lemmih: On 9/13/06, Tim Newsham [EMAIL PROTECTED] wrote: I was rewriting some non-haskell code in haskell and came up with this construct: foreach l f = mapM_ f l main = do args - getArgs foreach args (\arg - do foreach [1..3] (\n - do

Re: [Haskell-cafe] Heap profiling

2006-09-11 Thread Donald Bruce Stewart
bitshifter: Does anyone know if there is a way around the 20 charachter identifier limitation when heap profiling? I have a number of identifiers that indistinguishably break that limit. Add custom {-# SCC mybetteridentifier #-} pragmas next to the places with overly long names? -- Don

Re: [Haskell-cafe] how do you debug programs?

2006-09-06 Thread Donald Bruce Stewart
mnislaih: Hi Tamas There are several ways to debug a Haskell program. The most advanced ones are based in offline analysis of traces, I think Hat [1] is the most up-to-date tool for this. There is a Windows port of Hat at [5]. Another approach is to simply use Debug.Trace. A more

Re: [Haskell-cafe] does the compiler optimize repeated calls?

2006-09-06 Thread Donald Bruce Stewart
tpapp: Hi, I have a question about coding and compilers. Suppose that a function is invoked with the same parameters inside another function declaration, eg -- this example does nothing particularly meaningless g a b c = let something1 = f a b something2 =

Re: [Haskell-cafe] User data type with operator contructors only

2006-09-05 Thread Donald Bruce Stewart
kolar: Hello all, my question probably comes from not reading manual properly. But, why is it not possible to have something like: infixr 5 : data Stack a = a : (Stack a) | :|| And if yes, how can I do that? I know that lists are a hack in Haskell, infixr 5 : data

Re: [Haskell-cafe] Why does this program eat RAM?

2006-09-04 Thread Donald Bruce Stewart
jeremy.shaw: At Tue, 5 Sep 2006 03:03:51 + (UTC), John Goerzen wrote: I have the below program, and I'm trying to run it on an input of about 90MB. It eats RAM like crazy, and I can't figure out why. I have not looked in detail at your code -- but it could simply be the fact that

Re: [Haskell-cafe] Exercise in point free-style

2006-09-01 Thread Donald Bruce Stewart
haskell: Hello, I was just doing Exercise 7.1 of Hal Daum?'s very good Yet Another Haskell Tutorial. It consists of 5 short functions which are to be converted into point-free style (if possible). It's insightful and after some thinking I've been able to come up with solutions that

Re: [Haskell-cafe] Exercise in point free-style

2006-09-01 Thread Donald Bruce Stewart
haskell: Julien Oster wrote: But I'm having problems with one of the functions: func3 f l = l ++ map f l While we're at it: The best thing I could come up for func2 f g l = filter f (map g l) is func2p f g = (filter f) . (map g) Which isn't exactly point-_free_. Is it

Re: [Haskell-cafe] question on traversing syntax tree

2006-08-24 Thread Donald Bruce Stewart
xiongyf04: I am writing a compiler using Haskell. After the compiler parses program, the program is stored into an syntax tree stucture defined blew: .. data Exp = Plus Exp Term | Minus Exp Term | Term Term deriving Show data Term = Times Term

Re: Re[2]: class [] proposal Re: [Haskell-cafe] One thought: Num to 0as ? to list?

2006-08-23 Thread Donald Bruce Stewart
tomasz.zielonka: On Wed, Aug 23, 2006 at 01:28:57PM +0100, Malcolm Wallace wrote: The lengths people will go to in making things difficult for the reader, just to save a few characters is truly amazing. Remember, the code will be read many more times than it is written. IMHO, the various

Re: [Haskell-cafe] Re: Useful: putCharLn {inspire by the Int-[Char] thread

2006-08-21 Thread Donald Bruce Stewart
yumagene: On 8/19/06, Henk-Jan van Tuyl [EMAIL PROTECTED] wrote: Or you could use: putStrLn [head This and that] Gotta say I really like this ... running the head function inside of the list... Okay so I can really learn something here... what would that look like in raw monadic

Re: [Haskell-cafe] A restricted subset of CPP included in a revision of Haskell 98

2006-08-17 Thread Donald Bruce Stewart
brianlsmith: Hi, I find it strange that right now almost every Haskell program directly or indirectly (through FPTOOLS) depends on CPP, yet there is no effort to replace CPP with something better or standardize its usage in Haskell. According to the Note also cpphs,

Re: [Haskell-cafe] Description of Haskell extensions used by FPTOOLS

2006-08-17 Thread Donald Bruce Stewart
brianlsmith: Is there any design document for the FPTOOLS libraries or some description of language features that are (allowed to be) used in them? There's a list of extensions used at the bottom of this page: http://hackage.haskell.org/trac/haskell-prime/wiki/HaskellExtensions

Re: [Haskell-cafe] Flags

2006-08-10 Thread Donald Bruce Stewart
Maduser: I have started to program in Haskell. Now I want programm something like flags. It's a set of flags. It sould be possible to convert the Flag as Int/String (the bit combination). I have written this: import Data.Set as Set type Flags = Set Flag data Flag = Flag1 | Flag2 |

Re: [Haskell-cafe] Why Not Haskell?

2006-08-09 Thread Donald Bruce Stewart
robdockins: On Aug 8, 2006, at 5:36 PM, Albert Lai wrote: Brian Hulley [EMAIL PROTECTED] writes: Also, the bottom line imho is that Haskell is a difficult language to understand, and this is compounded by the apparent cleverness of unreadable code like: c = (.) . (.) when a

Re: [Haskell-cafe] beginner's haskell question

2006-08-08 Thread Donald Bruce Stewart
jens-theisen-tmp01: Hello, as a haskell newbie I'm wondering about the following question. Are there options to popular haskell implementations or other means (haskell lint?) to check for incomplete patterns at compile time for some? I can't see a reason why this shouldn't be possible

Re: [Haskell-cafe] Need a good book on Haskell

2006-08-07 Thread Donald Bruce Stewart
Also, we have a large library of research papers here: http://www.haskell.org/haskellwiki/Research_papers mvanier: A good follow-up is The Haskell School of Expression by Paul Hudak. Eventually, though, you're going to have to start reading research papers, which is where most of the

Re: [Haskell-cafe] How can we detect and fix memory leak due to lazyness?

2006-08-07 Thread Donald Bruce Stewart
kyagrd: On 8/7/06, Spencer Janssen [EMAIL PROTECTED] wrote: Forcing evaluation using (==) is a bit of a hack. Luckily, we have a better function to force evaluation: seq (which has type a - b - b). seq x y evaluates x to weak head normal form before returning y. Let's try another

Re: [Haskell-cafe] Re:Re: Why Haskell

2006-08-07 Thread Donald Bruce Stewart
hthiel.char: And just from a PR point of view, Haskell does project a cutting edge image. Anyway... Maybe this is our brand! Be on the cutting edge of programming language development -- use Haskell Bored of your language? Try something new. Try Haskell! Same old syntax? Same old

Re: [Haskell-cafe] A problem with Show

2006-08-06 Thread Donald Bruce Stewart
zdenes: Hello, I made a simple datatype called Pair and I'd like to make it an instance of Show class. But when I try to do that I run into troubles: data Pair a b = Pair a b instance Show a b = Show (Pair a b) where show (Pair a b) = show a ++ _ ++ show b In Hugs I get this

Re: [Haskell-cafe] fast image processing in haskell?

2006-08-05 Thread Donald Bruce Stewart
bulat.ziganshin: Hello Chris, Saturday, August 5, 2006, 3:47:19 AM, you wrote: in Haskell before blitting the data (whilst also retaining some semblance of functional programming...) the best way to optimize Haskell program (with current technologies) is to rewrite it in strict

Re: [Haskell-cafe] Monad Imparative Usage Example

2006-08-02 Thread Donald Bruce Stewart
kaveh.shahbazian: Haskell is the most powerfull and interesting thing I'v ever encountered in IT world. But with an imparative background and lack of understanding (because of any thing include that maybe I am not that smart) has brought me problems. I know this is an old issue. But please

Re: [Haskell-cafe] Monad Imparative Usage Example

2006-08-02 Thread Donald Bruce Stewart
kaveh.shahbazian: Monad Imparative Usage Example Thanks for your replies. I have not haskell on this computer and I will try this solutions tonight. I must notice that IO computations is not the point here. My target is to have this code for mutable variable 'var'. Still not entirely clear

[Haskell-cafe] Universal machines in Haskell

2006-07-26 Thread Donald Bruce Stewart
Now the ICFP contest is now over, several of the entrants have been interested in seeing if we can't write a decent universal machine (the 'hardware' of this year's contest), in Haskell. This is an interesting problem for Haskell, since the spec encourages the use of mutable variables and mutable

Re: [Haskell-cafe] Why Haskell?

2006-07-24 Thread Donald Bruce Stewart
marco-oweber: 2) Recompiling binaries (necessary in order to link in foreign object code into GHCi) is slow using GHC. Moreover I have to restart GHCi if I want to reload a changed DLL (unless there is a way to unload a DLL in GHCi). It also requires jumping around between several

[Haskell-cafe] irc channel stats

2006-07-20 Thread Donald Bruce Stewart
While we're in a period of reflection, pondering the history of haskell, I've prepared some graphs of activity on the IRC channel. Summary: its growing much as the mailing lists are, with more than 5000 users over the past 5 years. Full details here, http://www.cse.unsw.edu.au/~dons/irc/

Re: [Haskell-cafe] Re: Type-Level Naturals Like Prolog?

2006-07-17 Thread Donald Bruce Stewart
jawarren: Thank you to everyone for the responses. I guess what I should have clarified is that I know how Peano numbers are *normally* encoded in the type language (I am very familiar with the HList library), but I would like to know why the type language appears to require data structures

Re: [Haskell-cafe] Re: Why is there no splitBy in the list module?

2006-07-12 Thread Donald Bruce Stewart
simonmarhaskell: I guess the problem with the splitWith thing is that it's a slippery path that leads right up to full-on parsers. Exactly, and this is why we didn't reach a concensus last time. Would someone like to make a concrete proposal (with code!) for 2-3 functions we could

Re: [Haskell-cafe] Re[2]: Haskell performance in heavy numerical computations

2006-07-10 Thread Donald Bruce Stewart
bulat.ziganshin: Hello Simon, Monday, July 10, 2006, 1:12:13 PM, you wrote: numerical speed is poor in ghc 6.4, according to my tests. it's 10-20 times worse than of gcc. afair, the mandelbrot benchmark of Great Language Shootout proves this - despite all optimization attempts, GHC

Re: [Haskell-cafe] Defining show for a function type.

2006-07-10 Thread Donald Bruce Stewart
johan.gronqvist: I am a haskell-beginner and I wish to write a Forth-like interpreter. (Only for practice, no usefulness.) I would like use a list (as stack) that can contain several kinds of values. data Element = Int Int | Float Float | Func : Machine - Machine | ... Now I would

Re: [Haskell-cafe] Clever generic ByteString hack?

2006-07-05 Thread Donald Bruce Stewart
duncan.coutts: On Wed, 2006-07-05 at 05:58 -0500, John Goerzen wrote: Hi, In MissingH, I have a bunch of little functions that operate on lists. Some, like uniq (which eliminates duplicate elements in a list), operate on (Eq a = [a]) lists. Others, like strip (which eliminates

Re: [Haskell-cafe] New Benchmark Under Review: Magic Squares

2006-07-03 Thread Donald Bruce Stewart
Perhaps you could post a new entry page on our shootout wiki? http://www.haskell.org/hawiki/ShootoutEntry This makes it easier for people to keep contributing. Cheers, Don daniel.is.fischer: Am Sonntag, 2. Juli 2006 01:58 schrieb Brent Fulgham: We recently began considering another

Re: [Haskell-cafe] A question about stack overflow

2006-06-27 Thread Donald Bruce Stewart
hankgong: Hi, all I'm just a newbie for Haskell and functional programming world. The idea I currently read is quite different and interesting. I have one general question about the recursively looping style. For example: myMax [ ] = error empty list myMax

Re: [Haskell-cafe] Binary IO

2006-06-24 Thread Donald Bruce Stewart
m4d.skills: Greetings, I am considering writing -in Haskell of course - a small program to translate binary files to human readable text. The trouble is that I can find no easily digestible tutorial style info on how to do binary IO in Haskell. I have read about some of

Re: [Haskell-cafe] what do you think of haskell ? (yes, it's a bit general ...:)

2006-06-16 Thread Donald Bruce Stewart
noteed: i want to process 4k pictures (and not just one pixel fater one)... for example. if there is a better solution than array, i'm eager to know it! Try Data.ByteString. 4G can be feasible :) -- Don ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] HCAR

2006-06-12 Thread Donald Bruce Stewart
stefan: Tashdid, does anyone know what happened to HCAR? or HWN? I guess the May ;) 2006 edition of HCAR will appear soon. I'm not sure about what happened to HWN the last couple of weeks, though, but I think that Donald is just quite busy these days. Yep, that's the case. Expect an

Re: [Haskell-cafe] Newbie request

2006-06-09 Thread Donald Bruce Stewart
gphilip.newsgroups: I am trying to learn Haskell. As an exercise, I wrote a function to create a binary tree in level-order. I am attaching the code. I am sure there are a number of places where the code could be improved. Could you please point these out? There's a highly efficient example

<    1   2   3   4   5   6   >