Re: [Haskell-cafe] mixing wxhaskell state and file io

2007-02-04 Thread Donald Bruce Stewart
martindemello: I'm having a lot of trouble mixing file io and wxhaskell's varCreate/Get/Set functions. I have functions readWords :: String - IO WordMap wordGrid :: WordMap - Layout And within my GUI code, the following compiles (ignores the variable, basically): words - varCreate

Re: [Haskell-cafe] Strange behaviour with writeFile

2007-02-04 Thread Donald Bruce Stewart
cmb21: fo/haskell-cafe, mailto:[EMAIL PROTECTED] Errors-To: [EMAIL PROTECTED] Status: O Content-Length: 778 Lines: 27 Hi, I am observing some rather strange behaviour with writeFile. Say I have the following code: answer - AbstractIO.readFile filename let (answer2,

Re: [Haskell-cafe] nested maybes

2007-02-04 Thread Donald Bruce Stewart
u.stenzel: J. Garrett Morris wrote: On 2/4/07, Udo Stenzel [EMAIL PROTECTED] wrote: exists s wmap = isJust $ Map.lookup (sort s) wmap = find (== s) . snd If you're going to write it all on one line, I prefer to keep things going the same direction: Hey, doing it this way saved me a

Re: [Haskell-cafe] How is laziness defined?

2007-02-04 Thread Donald Bruce Stewart
tjay.dreaming: On 2/5/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Quoting TJ [EMAIL PROTECTED]: I would think that with 100% laziness, nothing would happen until the Haskell program needed to output data to, e.g. the console. Quite obviously that's not it. So how is laziness defined

Re: [Haskell-cafe] Re: Channel9 Interview: Software Composability and theFu ture of Languages

2007-02-01 Thread Donald Bruce Stewart
neil: The question is --- how would an expert describe such a process? Would a professional chef give instructions in the functional or imperative style? I think a sufficiently expert chef would not even need the functional style. Everything would be declarative. Dave Thomas (of

[Haskell-cafe] strict bytestring fun

2007-02-01 Thread Donald Bruce Stewart
High performance strings on the shootout: http://shootout.alioth.debian.org/gp4/benchmark.php?test=sumcollang=all interesting alternative programs 0.5 Haskell GHC #5 1.2990,880270 1.0 Clean 2.77600 136 2.0 C gcc

Re: [Haskell-cafe] Re: Channel9 Interview: Software Composability and theFu ture of Languages

2007-01-31 Thread Donald Bruce Stewart
magnus: All I'm trying to say is that imperative thinking is so common outside of CS/math and we learn it so early on in life that we probably can consider it the natural thinking way. foldl (\water dish - wash water dish) soapywater dishes :: [Dishes] :)

[Haskell-cafe] Haskell Weekly News: January 31, 2007

2007-01-31 Thread Donald Bruce Stewart
--- Haskell Weekly News http://sequence.complete.org/hwn/20070131 Issue 57 - January 31, 2007 --- Welcome to issue 57 of HWN, a weekly newsletter

Re: [Haskell-cafe] Haskell Cookbook?

2007-01-31 Thread Donald Bruce Stewart
ithika: Quoth Paul Moore, nevermore, why a newcomer like me shouldn't do this - in many ways, it's better to start with some examples from a newcomer's perspective (these are the sort of things I found useful) to show the more experienced people what we're looking for. I agree with

[Haskell-cafe] Re: [Haskell] Haskell Weekly News: January 31, 2007

2007-01-31 Thread Donald Bruce Stewart
Correct. Link #35. should be http://article.gmane.org/gmane.comp.lang.haskell.libraries/6109 Well spotted. xana: Hi, I think link 35. is not correct... Can you please point to the correct one? Best regards, Alexandra Donald Bruce Stewart wrote

[Haskell-cafe] Let's welcome the Ruby hackers!

2007-01-31 Thread Donald Bruce Stewart
As seen here, reports from 'Rails Edge': http://notes-on-haskell.blogspot.com/2007/01/haskell-open-secret.html It seems like everyone is turning onto Haskell these days. At Rails Edge last week, I saw a few telltale signs that some of the speakers (including a few members of the

Re: [Haskell-cafe] Re: ANNOUNCE: binary: high performance, pure binary serialisation

2007-01-30 Thread Donald Bruce Stewart
simonmar: Donald Bruce Stewart wrote: Binary: high performance, pure binary serialisation for Haskell -- The Binary Strike Team is pleased to announce the release of a new, pure, efficient binary serialisation

Re: [Haskell-cafe] What is the best way to understand large programs?

2007-01-30 Thread Donald Bruce Stewart
bulat.ziganshin: Hello Stefan, Monday, January 29, 2007, 1:59:22 AM, you wrote: Note: I *have* managed to pretty thourougly understand lambdabot, but it took a while, wasn't particularly easy, and anyway lambdabot's dependency groups are quite small compared to eg

Re: [Haskell-cafe] Haskell Cookbook?

2007-01-30 Thread Donald Bruce Stewart
deliverable: So I'm picking up Haskell bit by bit, and I found the code examples transpiring here most useful. Reflecting why it's harder to pick up Haskell than say Ruby or Python, here's what I found -- those languages deal with a typical domain available to any programmer -- his own

Re: [Haskell-cafe] Simple HTTP lib for Windows?

2007-01-29 Thread Donald Bruce Stewart
clawsie: hi, i have popped in on this thread before to mention my own extension to Network.HTTP (http://www.b7j0c.org/content/haskell-http.html, providing get() and head()). i would like to thank bjorn for his work on Network.HTTP and echo his observation that this package needs some work

Re: [Haskell-cafe] ANNOUNCE: binary: high performance, pure binary serialisation

2007-01-29 Thread Donald Bruce Stewart
ross: On Fri, Jan 26, 2007 at 01:51:01PM +1100, Donald Bruce Stewart wrote: Binary: high performance, pure binary serialisation for Haskell -- The Binary Strike Team is pleased to announce the release

Re: [Haskell-cafe] ANNOUNCE: binary: high performance, pure binary serialisation

2007-01-29 Thread Donald Bruce Stewart
tomasz.zielonka: On Tue, Jan 30, 2007 at 09:52:01AM +1100, Donald Bruce Stewart wrote: For the syntax, and So that people can directly port their code from NewBinary. (The instances are basically unchanged). newtype PutM a = Put { unPut :: (a, Builder) } type Put = PutM

Re: [Haskell-cafe] ANNOUNCE: binary: high performance, pure binary serialisation

2007-01-27 Thread Donald Bruce Stewart
lemming: On Sat, 27 Jan 2007, Donald Bruce Stewart wrote: lemming: On Fri, 26 Jan 2007, Donald Bruce Stewart wrote: Binary: high performance, pure binary serialisation for Haskell

Re: [Haskell-cafe] State of OOP in Haskell

2007-01-27 Thread Donald Bruce Stewart
deliverable: ...In the tradition of the letters of an ignorant newbie... What's the consensus on the OOP in Haskell *now*? There're some libraries such as OOHaskell, O'Haskell, and Haskell~98's own qualified type system with inheritance. If I have GHC, which way to do anything OOP-like

Re: [Haskell-cafe] State of OOP in Haskell

2007-01-27 Thread Donald Bruce Stewart
deliverable: Well, I'm thinking in terms of OOD/OOA/OOP -- Design, Architecture, Programming. That's about the only way to model a bog system. Say I have a stock market model -- I'll have a database of tickers, a simulator to backtest things, a trading strategy, etc. Do Haskell modules

Re: [Haskell-cafe] ANNOUNCE: binary: high performance, pure binary serialisation

2007-01-27 Thread Donald Bruce Stewart
dons: lemming: On Sat, 27 Jan 2007, Donald Bruce Stewart wrote: lemming: On Fri, 26 Jan 2007, Donald Bruce Stewart wrote: Binary: high performance, pure binary serialisation for Haskell

Re: [Haskell-cafe] newbie timing question

2007-01-26 Thread Donald Bruce Stewart
seanmcl: Hello, I'm trying to write a simple function to time an application. -- this doesn't work time f x = do n1 - CPUTime.getCPUTime let res = f x in do n2 - CPUTime.getCPUTime return (res,n2 - n1) On a function that takes 8 seconds to complete,

Re: [Haskell-cafe] ANNOUNCE: binary: high performance, pure binary serialisation

2007-01-26 Thread Donald Bruce Stewart
lemming: On Fri, 26 Jan 2007, Donald Bruce Stewart wrote: Binary: high performance, pure binary serialisation for Haskell -- The Binary Strike Team is pleased to announce the release of a new, pure

Re: [Haskell-cafe] ANNOUNCE: binary: high performance, pure binary serialisation

2007-01-26 Thread Donald Bruce Stewart
tomasz.zielonka: On Fri, Jan 26, 2007 at 04:31:28PM +0100, Henning Thielemann wrote: On Fri, 26 Jan 2007, Donald Bruce Stewart wrote: Binary: high performance, pure binary serialisation for Haskell

Re: [Haskell-cafe] ANNOUNCE: binary: high performance, pure binary serialisation

2007-01-26 Thread Donald Bruce Stewart
john: On Fri, Jan 26, 2007 at 04:42:48PM +0100, Tomasz Zielonka wrote: I also have to use a specific serialisation format. I guess we could both simply use putWord8, but then we'll probably lose most of the benefits of using the library. Perhaps we could think about introducing some

Re: [Haskell-cafe] Re: [Haskell] ANNOUNCE: binary: high performance, pure binary serialisation

2007-01-26 Thread Donald Bruce Stewart
tomasz.zielonka: On Fri, Jan 26, 2007 at 02:16:22PM +1100, Donald Bruce Stewart wrote: We believe so, and its a bug if this is not the case. The src documents the encoding format used for each type (we were unable to attach haddocks to instances.. grr.) All data is encoded

Re: [Haskell-cafe] Concurrency in Haskell

2007-01-26 Thread Donald Bruce Stewart
deliverable: Well, I'm a bit suspicious if the top references on Haskell concurrency are either research papers or compiler manual sections. How about some good ol' bundles of them codes to peruse and take example from? E.g., dining philosophers? The point was that there are *lots* of

Re: [Haskell-cafe] Channel9 Interview: Software Composability and theFu ture of Languages

2007-01-26 Thread Donald Bruce Stewart
catamorphism: On 1/26/07, Collin Winter [EMAIL PROTECTED] wrote: You have a PhD in computer science from Princeton, so your measure of what's hard and what isn't in this regard is nearly worthless. I find it incredibly insulting for you to assert that people who complain about Haskell's

[Haskell-cafe] Re: [Haskell] [Fwd: Re: Computer Language Shootout]

2007-01-25 Thread Donald Bruce Stewart
simonmarhaskell: Forwarding on behalf of Andrzej Jaworski [EMAIL PROTECTED]: Original Message From: Andrzej Jaworski [EMAIL PROTECTED] Dear fellows, It is ironic that just after SPJ disclosed Comments from Brent Fulgham on Haskell and the shootout the situation has

Re: [Haskell-cafe] Concurrency in Haskell

2007-01-25 Thread Donald Bruce Stewart
deliverable: What's the state of concurrency in Haskell? If Erlang's main strength is light-weight parallelism, can something like that be done in Haskell? http://haskell.org/haskellwiki/Libraries_and_tools/Concurrency_and_parallelism

Re: [Haskell-cafe] Re: [Haskell] [Fwd: Re: Computer Language Shootout]

2007-01-25 Thread Donald Bruce Stewart
Uniqueness types does give some extra optimisation potential, such as destructive updates if you can guarantee a variable is only referred to once. But even with that, the language that has impressed me most on the shootout is Clean. Where the Haskell community spends significant time they

Re: [Haskell-cafe] No Derived Read for Unboxed Arrays

2007-01-25 Thread Donald Bruce Stewart
ndmitchell: Hi, I was trying to convert some code from ordinary boxed array to unboxed arrays for performance reasons. However my code ultimately failed because I load a large array saved as a text file using the derived Read, Show mechanism. I found that Read was maybe 30 times

Re: [Haskell-cafe] No Derived Read for Unboxed Arrays

2007-01-25 Thread Donald Bruce Stewart
ndmitchell: HI Don (But of course, having Read/Show defined for UArray may well be useful, and sounds a good idea) There's also an instance Binary for UArray. That might be useful? Is there an instance Binary in a released library? If in doubt, look on hackage:

[Haskell-cafe] Pure serialisation and compression [Was: No Derived Read for Unboxed Arrays]

2007-01-25 Thread Donald Bruce Stewart
mattcbro: No doubt any kind of binary serialization would be a lot faster. In my case, however, I just wanted it to work out of the box. I need to read in about 5-10 arrays of only 1000 entries or so, saved in files. I suspect even the ascii parser could do that within a few seconds.

[Haskell-cafe] ANNOUNCE: binary: high performance, pure binary serialisation

2007-01-25 Thread Donald Bruce Stewart
Binary: high performance, pure binary serialisation for Haskell -- The Binary Strike Team is pleased to announce the release of a new, pure, efficient binary serialisation library for Haskell, now available from

[Haskell-cafe] Re: [Haskell] ANNOUNCE: binary: high performance, pure binary serialisation

2007-01-25 Thread Donald Bruce Stewart
dons: Binary: high performance, pure binary serialisation for Haskell -- The Binary Strike Team is pleased to announce the release of a new, pure, efficient binary serialisation library for Haskell, now

Re: [Haskell-cafe] Re: [Haskell] ANNOUNCE: binary: high performance, pure binary serialisation

2007-01-25 Thread Donald Bruce Stewart
john: Yay! I knew if I waited long enough someone would write this. Is the binary format portable? I need the produced files to work on both 32 and 64 bit architectures and with big and little endian machines. And of course, between different versions of a compiler or different compilers.

Re: [Haskell-cafe] Re: [Haskell] ANNOUNCE: binary: high performance, pure binary serialisation

2007-01-25 Thread Donald Bruce Stewart
john: On Thu, Jan 25, 2007 at 07:11:55PM -0800, John Meacham wrote: Is the binary format portable? I need the produced files to work on both 32 and 64 bit architectures and with big and little endian machines. And of course, between different versions of a compiler or different compilers.

Re: [Haskell-cafe] catch the stdout when execute a shell cmd

2007-01-23 Thread Donald Bruce Stewart
oxware: I use system in System.Cmd to execute a shell cmd, then how can I catch its stdout? Use System.Process, http://haskell.org/ghc/docs/latest/html/libraries/base/System-Process.html And example, call the 'date' program: (inh,outh,errh,pid) - runInteractiveProcess date [+%d:%m:%y]

Re: [Haskell-cafe] Partial application

2007-01-18 Thread Donald Bruce Stewart
phiroc: Hello, could someone please give me an example of the partial application of the following curried function: add' :: Int - Int - Int add' a b = a + b Normally, add' 1 should work, but it doesn't. Prelude let add' :: Int - Int - Int ; add' a b = a + b Prelude let add1

Re: [Haskell-cafe] HaskellForge?

2007-01-07 Thread Donald Bruce Stewart
uchchwhash: is it a good idea to have HaskellForge? Ruby, Lua and some other languages have already adopted GForge, and I must say, those sites look *impressive*!!! Got some URLs for these? any Ruby programmer on the list? can anyone provide an estimate of the amount of work involved?

Re: [Haskell-cafe] HaskellForge?

2007-01-07 Thread Donald Bruce Stewart
allbery: On Jan 7, 2007, at 23:17 , Donald Bruce Stewart wrote: uchchwhash: is it a good idea to have HaskellForge? Ruby, Lua and some other languages have already adopted GForge, and I must say, those sites look *impressive*!!! Got some URLs for these? http://rubyforge.org

Re: [Haskell-cafe] trouble installing greencard -- -fno-prune-tydecls flag ( was Re: trivial function application question )

2007-01-06 Thread Donald Bruce Stewart
dmhouse: On 06/01/07, Chris Kuklewicz [EMAIL PROTECTED] wrote: Running --configure notices that many things are not installed, but this is just noise from Cabal. This is the second time I've seen someone get confused by these messages. I propose we add a 'Configuration successful, now

Re: [Haskell-cafe] Stupid newbie question

2007-01-05 Thread Donald Bruce Stewart
bhurt: My apologies for wasting bandwidth on what I'm sure is a stupid newbie question. Given: -- Reimplementing the wheel here, I know data Option a = Some a | Empty deriving (Eq,Ord,Show,Read) nth 0 (x:xs) = Some x nth i (x:xs) = if i 0 then Empty else nth (i-1) xs nth

Re: [Haskell-cafe] trivial function application question

2007-01-05 Thread Donald Bruce Stewart
tphyahoo: So the core question (speaking as a perler) is how do you write my $s= 'abcdefg'; $s =~ s/a/z/g; $s =~ s/b/y/g; print $s\n; Simple patterns like this you'd just use a 'map' of course: main = print (clean abcdefg) clean = map (by . az) where by c = if c

[Haskell-cafe] Re: [Haskell] Re: state of HaXml?

2007-01-04 Thread Donald Bruce Stewart
nr: Sure, you can replace the openFile/hGetContents pair by readFile, but the real problem is the presence of the hClose. Removing that will solve your problem (but note that you now have no control over when the file is actually closed). Can I just leave it hanging and rely on the

Re: [Haskell-cafe] darcs repo for yampa + gadt

2007-01-03 Thread Donald Bruce Stewart
joelr1: Folks, I have a version of Yampa with Henrik Nilsson's GADT optimizations that I cleaned up for ghc 6.6 and cabalized. Would it be possible to set it up at darcs.haskell.org and if so how should I go about it? There are some details here:

Re: [Haskell-cafe] Announce: Package rdtsc for reading IA-32 time stamp counters

2007-01-02 Thread Donald Bruce Stewart
magr: Hallo all, version 1.0 of package rdtsc has just been released. Very nice. I've attached some small patches: a) to move the src into System.CPUTime.Rdtsc (more intuitive space) b) move C src into cbits dir (standard name) Good work, Don New patches: [update cabal file

[Haskell-cafe] Haskell Weekly News: January 02, 2007

2007-01-01 Thread Donald Bruce Stewart
--- Haskell Weekly News http://sequence.complete.org/hwn/20070102 Issue 55 - January 02, 2007 --- Welcome to issue 55 of HWN, a weekly newsletter

Re: [Haskell-cafe] some way to reverse engineer lambda expressions out of the debugger?

2006-12-31 Thread Donald Bruce Stewart
tphyahoo: I am a newbie learning haskell. (First forum post.) I am wondering if there is a trick to get debugging information about functions out of the environment (which for me, for now, is ghci). In this example, *UnixTools :t map (*) [1,2] map (*) [1,2] :: (Num a) = [a - a]

Re: [Haskell-cafe] how unsafe is this?

2006-12-30 Thread Donald Bruce Stewart
benc: I've defined a helper function to let me do regexps in functional style: sed exp str = unsafePerformIO $ do regexp - regcomp exp 0 regexec regexp str Is this always safe? or where is it not? (I'm using any one regexp more than once so it doesn't bother me that it

Re: [Haskell-cafe] flatten a nested list

2006-12-29 Thread Donald Bruce Stewart
pphetra: I would like to write a program that can do something like this. ;; lisp syntax * (my-flatten '(1 (2 (3 4) 5))) (1 2 3 4 5) I end up like this. data Store a = E a | S [Store a] deriving (Show) flat :: [Store a] - [a] flat [] = [] flat ((E x):xs) = [x] ++

Re: [Haskell-cafe] constant functions

2006-12-27 Thread Donald Bruce Stewart
nowgate: I'm trying to learn Haskell and translating some Lisp functions as exercises. How would I write a Haskell function named ALWAYS that behaves like this: one = always 1 bozo = always clown map one [2,3,4,5,6] [1,1,1,1,1] one 62 1 map bozo [2,3,4,5,6] [clown,clown

Re: [Haskell-cafe] constant functions

2006-12-27 Thread Donald Bruce Stewart
nowgate: Thanks! I figured I was close. Didn't even know const was available. I put together a compliment functions earlier complement :: (a - Bool) - a - Bool complement p x = not (p x) By the signature, the first argument is a function (predicate) which when given a value returns

Re: [Haskell-cafe] constant functions

2006-12-27 Thread Donald Bruce Stewart
nowgate: Hi Donald, I think you misunderstood what I was asking. There's not two cases. Maybe I'm not saying it sufficiently well but the function ALWAYS just returns a function that always returns the original argument to ALWAYS no matter what else you give the resulting function. when

Re: [Haskell-cafe] Re: Getting my feet wet - small browser game

2006-12-20 Thread Donald Bruce Stewart
jo: Marc A. Ziegert schrieb: software upgrades: use Read/Show classes instead of Foreign.Marshal, I'm having second thoughts here. Wouldn't Show evaluate all thunks of the data Shown? That would mean I couldn't use infinite data structures in data that goes out to disk. Btw, if you're

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

2006-12-19 Thread Donald Bruce Stewart
--- Haskell Weekly News http://sequence.complete.org/hwn/20061220 Issue 54 - December 20, 2006 --- Welcome to issue 54 of HWN, a weekly newsletter

[Haskell-cafe] Possible commercial FP/Haskell job

2006-12-19 Thread Donald Bruce Stewart
Noticed this in the blargh-o-sphere, some people might be interested: http://www.nnseek.com/e/comp.lang.python/lisp_python_programmers_among_others_wanted_20059193t.html Senior applications developer: Our advanced applications work is currently being done in Common Lisp, but that

[Haskell-cafe] #haskell irc channel reaches 300 users

2006-12-18 Thread Donald Bruce Stewart
A small announcement :) 5 years after its inception, under the guiding hand of Shae Erisson (aka shapr), the #haskell IRC channel[1] on freenode has finally reached 300 users! We reached 200 users in January, 250 users for the first time in August, and didn't expect hit to reach 300 for a while.

Re: [Haskell-cafe] Re: A suggestion for the next high profile Haskell project

2006-12-17 Thread Donald Bruce Stewart
paul: Magnus Therning [EMAIL PROTECTED] wrote: When reading this[1] I couldn't help thinking that rewriting GPG is an excellent opportunity for using Haskell to have an impact on the world. The Fedora project is planning to rewrite the foundations of RPM. I've noticed that the higher

[Haskell-cafe] Re: A suggestion for the next high profile Haskell project

2006-12-17 Thread Donald Bruce Stewart
Quoting Bulat Ziganshin [EMAIL PROTECTED]: Haskell can't provide fast execution speed unless very low-level programming style is used (which is much harder to do in Haskell than in C, see one of my last messages for example) AND jhc compiler is used I have to dispute this Bulat's

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 is

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 But

Re: [Haskell-cafe] Stack, Heap and GHC

2006-12-14 Thread Donald Bruce Stewart
felix: Hello everyone, I have been trying to run a Haskell program of mine that does an extensive computation with very large amounts of data. I compiled the program with ghc --make. When I run it it terminates after some time Did you compile with -O (optimisations). Sometimes this fixes

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 . groupBy ((==)

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 .

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

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 does not provide a way to evaluate the return value

[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

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 heard of Lisp,

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 this

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

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/ Issue 53 - December 12, 2006

[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, is

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-exts #-}

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 LICENSE based on a

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

[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

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 object

[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

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 pointers on

[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

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)? Bonus points

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 under runhugs or

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

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

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.(+++) :: (HTML a,

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

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 as B In

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:

[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] 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 Setup.hs

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

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,6)]

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 to be a feature of GHC Haskell.) Fixed

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

<    1   2   3   4   5   6   >