Re: [Haskell-cafe] is there some book about haskell and data struct and alg?

2008-05-30 Thread Gwern Branwen
On 2008.05.28 20:11:54 -0700, "Benjamin L. Russell" <[EMAIL PROTECTED]> scribbled 2.5K characters: > Although all the source code for the pdf version > (http://www.cs.cmu.edu/~rwh/theses/okasaki.pdf) of "Purely Functional Data > Structures" is provided in Standard ML, not Haskell, I found a brok

Re: [Haskell-cafe] Re: appending an element to a list

2008-05-30 Thread Abhay Parvate
I think I would like to make another note: when we talk about the complexity of a function, we are talking about the time taken to completely evaluate the result. Otherwise any expression in haskell will be O(1), since it just creates a thunk. And then the user of the program is to be blamed for ru

Fwd: Re: [Haskell-cafe] [Newbie question] -- Looping stdin until condition is met

2008-05-30 Thread Martin Blais
FYI. On Sat, 31 May 2008 02:11:13 +0200, "Daniel Fischer" <[EMAIL PROTECTED]> said: > Am Samstag, 31. Mai 2008 02:28 schrieb Martin Blais: > > Allright, this is a definitely a newbie question. > > > > I'm learning Haskell and going through the exercises in the > > beautiful Hutton book, and one of

Re: [Haskell-cafe] [Newbie question] -- Looping stdin until condition is met

2008-05-30 Thread Martin Blais
On Fri, 30 May 2008 17:19:54 -0700, "Philip Weaver" <[EMAIL PROTECTED]> said: > > Dear Philip, could you point your virtual finger towards a > > reference/paper/book/any-bleeping-thing that would help this simple > > beginner understand why it doesn't work in this case? I'm trying to > > picture wh

Re: [Haskell-cafe] [Newbie question] -- Looping stdin until condition is met

2008-05-30 Thread Philip Weaver
On Fri, May 30, 2008 at 5:14 PM, Martin Blais <[EMAIL PROTECTED]> wrote: > On Fri, 30 May 2008 16:54:18 -0700, "Philip Weaver" > <[EMAIL PROTECTED]> said: >> > 1. How do I catch the exception that is raised from "read"? >> > >> I think you want readIO, which yields a computation in the IO monad, >>

Re: [Haskell-cafe] [Newbie question] -- Looping stdin until condition is met

2008-05-30 Thread Martin Blais
On Fri, 30 May 2008 16:54:18 -0700, "Philip Weaver" <[EMAIL PROTECTED]> said: > > 1. How do I catch the exception that is raised from "read"? > > > I think you want readIO, which yields a computation in the IO monad, > so it can be caught. Holy schmoly, there it is, words of wisdom, written as cle

Re: [Haskell-cafe] is there some book about haskell and data struct and alg?

2008-05-30 Thread John Melesky
On May 30, 2008, at 5:32 AM, Benjamin L. Russell wrote: Actually, the link now points to the following URL (updated by John Melesky): http://www.eecs.usma.edu/webs/people/okasaki/pfds-haskell.tar.gz instead of the following URL (set by Henk-Jan van Tuyl): http://web.archive.org/web/28180

Re: [Haskell-cafe] [Newbie question] -- Looping stdin until condition is met

2008-05-30 Thread Don Stewart
philip.weaver: > > > > 1. How do I catch the exception that is raised from "read"? > > > I think you want readIO, which yields a computation in the IO monad, > so it can be caught. Ah, that's a third option, sequence the effect using readIO, import System.IO import qualified Control.Excep

Re: [Haskell-cafe] [Newbie question] -- Looping stdin until condition is met

2008-05-30 Thread Don Stewart
blais: > Allright, this is a definitely a newbie question. > > I'm learning Haskell and going through the exercises in the > beautiful Hutton book, and one of them requires for me to > write a loop that queries a line from the user (stdin), > looping until the user enters a valid integer (at least

Re: [Haskell-cafe] [Newbie question] -- Looping stdin until condition is met

2008-05-30 Thread Philip Weaver
On Fri, May 30, 2008 at 5:28 PM, Martin Blais <[EMAIL PROTECTED]> wrote: > Allright, this is a definitely a newbie question. > > I'm learning Haskell and going through the exercises in the > beautiful Hutton book, and one of them requires for me to > write a loop that queries a line from the user (

[Haskell-cafe] [Newbie question] -- Looping stdin until condition is met

2008-05-30 Thread Martin Blais
Allright, this is a definitely a newbie question. I'm learning Haskell and going through the exercises in the beautiful Hutton book, and one of them requires for me to write a loop that queries a line from the user (stdin), looping until the user enters a valid integer (at least that's how I want

Re: [Haskell-cafe] I/O without monads, using an event loop

2008-05-30 Thread Bit Connor
Yeah, this sounds really similar to functionally reactive programming. I recommend you start by reading this paper: http://haskell.cs.yale.edu/frp/genuinely-functional-guis.pdf On Fri, May 30, 2008 at 11:34 AM, Wolfgang Jeltsch <[EMAIL PROTECTED]> wrote: > Am Freitag, 30. Mai 2008 16:09 schrieb

[Haskell-cafe] Re: [ANN] bloomfilter 1.0 - Fast immutable and mutable Bloom filters

2008-05-30 Thread Achim Schneider
Bryan O'Sullivan <[EMAIL PROTECTED]> wrote: > A Bloom filter is a probabilistic data > structure that provides a fast set membership querying capability. > It does not give false negatives, but has a tunable false positive > rate. (A false positive arises when the filter claims that an > element

[Haskell-cafe] [ANN] bloomfilter 1.0 - Fast immutable and mutable Bloom filters

2008-05-30 Thread Bryan O'Sullivan
I'm pleased to announce the availability of a fast Bloom filter library for Haskell. A Bloom filter is a probabilistic data structure that provides a fast set membership querying capability. It does not give false negatives, but has a tunable false positive rate. (A false positive arises when th

Re: [Haskell-cafe] GHCi panic

2008-05-30 Thread Don Stewart
andrewcoppin: > I don't suppose this will surprise anybody greatly, but... > > Apparently if you write a Haskell module that is 400 KB in size and > defines a single CAF consisting of a 45,000-element [String], GHCi > panics when attempting to load it interpretted, and hits a stack > overflow a

[Haskell-cafe] GHCi panic

2008-05-30 Thread Andrew Coppin
I don't suppose this will surprise anybody greatly, but... Apparently if you write a Haskell module that is 400 KB in size and defines a single CAF consisting of a 45,000-element [String], GHCi panics when attempting to load it interpretted, and hits a stack overflow attempting to load it comp

[Haskell-cafe] Re: appending an element to a list

2008-05-30 Thread Martin Geisler
Tillmann Rendel <[EMAIL PROTECTED]> writes: Hi! (Cool, another guy from DAIMI on haskell-cafe!) > Another (n - 1) reduction steps for the second ++ to go away. > > last ("o" ++ "l") > A) ~> last ('o' : "" ++ "l")) > L) ~> last ("" ++ "l") > A) ~> last ("l") > L) ~> 'l' > > And the

[Haskell-cafe] Re: Damnit, we need a CPAN.

2008-05-30 Thread Achim Schneider
Wolfgang Jeltsch <[EMAIL PROTECTED]> wrote: > Am Donnerstag, 29. Mai 2008 17:38 schrieb Achim Schneider: > > […] > > > Rationale: We need […] grapefruit authors that commit to hackage > > Our reason to not commtting Grapefruit to Hackage so far was that > this would mean making an official relea

Re: [Haskell-cafe] Re: Damnit, we need a CPAN.

2008-05-30 Thread Duncan Coutts
On Fri, 2008-05-30 at 16:33 +0200, Chaddaï Fouché wrote: > 2008/5/30 Achim Schneider <[EMAIL PROTECTED]>: > > I already was pleasantly surprised when discovering cabal-install, I > > think it deserves some more prominence, or even integration into cabal > > itself, to make everyone aware of the fa

Re: [Haskell-cafe] appending an element to a list

2008-05-30 Thread Tillmann Rendel
Lanny Ripple wrote: My $0.02 is to say -- O(1) longList ++ [5] Yay. I've got a thunk. Oh wait, I need to access the '5'? No different than doing so for -- O(n) until ((==5) . head) [l,o,n,g,L,i,s,t,5] It's not the (++) that's O(n). It's the list traversal. Lets look at the actual redu

Re: [Haskell-cafe] Lazy lists simulated by unboxed mutable arrays

2008-05-30 Thread Henning Thielemann
On Wed, 28 May 2008, Ketil Malde wrote: Bulat Ziganshin <[EMAIL PROTECTED]> writes: well, i don't understand difference between your idea and lazybs implementation HT said earlier that: This would still allow the nice tricks for recursive Fibonacci sequence definition. Which I guess ref

Re: [Haskell-cafe] test driving cabal install... cabal install and normal install (runghc Setup) don't mix... two package.conf files...

2008-05-30 Thread Thomas Hartman
I think the reason it took longer to build HAppS-Server is that previously, when I was installing the MyProject example from happs.org I was using searchpath. I guess searchpath doesn't compile every single haskell module, whereas runghc Setup build and cabal install does. 2008/5/29 Spencer Janss

[Haskell-cafe] Re: [Haskell] Announce: hback - dual n-back memory game (0.0.2)

2008-05-30 Thread Don Stewart
wojtowicz.norbert: > I'm pleased to publically announce a little project I've worked on. > Based on a recent research paper [0] that claims fluid intelligence > could be improved by training working memory, I wrote up a dual n-back > test memory game in Haskell and gtk2hs. This is still essentially

Re: [Haskell-cafe] appending an element to a list

2008-05-30 Thread Lanny Ripple
My $0.02 is to say -- O(1) longList ++ [5] Yay. I've got a thunk. Oh wait, I need to access the '5'? No different than doing so for -- O(n) until ((==5) . head) [l,o,n,g,L,i,s,t,5] It's not the (++) that's O(n). It's the list traversal. I can further beat this pedantic point to dea

Re[2]: [Haskell-cafe] Damnit, we need a CPAN.

2008-05-30 Thread Bulat Ziganshin
Hello Neil, Friday, May 30, 2008, 8:41:43 PM, you wrote: >> Our reason to not commtting Grapefruit to Hackage so far was that this would >> mean making an official release and we thought that Grapefruit is not yet >> ready for this. > Release it on hackage. Releasing to hacking means other peopl

Re: [Haskell-cafe] I/O without monads, using an event loop

2008-05-30 Thread Roberto Zunino
Robin Green wrote: > I have been thinking about to what extent you could cleanly do I/O > without explicit use of the I/O monad, and without uniqueness types Here's a way to see I/O as a pure functional data structure. To keep things simple, we model only Char I/O: data Program = Quit | Outpu

Re: [Haskell-cafe] Damnit, we need a CPAN.

2008-05-30 Thread Neil Mitchell
Hi > Our reason to not commtting Grapefruit to Hackage so far was that this would > mean making an official release and we thought that Grapefruit is not yet > ready for this. However, I might be wrong in the sense that also despite its > current deficiencies, Grapefruit should be available from

Re: [Haskell-cafe] Damnit, we need a CPAN.

2008-05-30 Thread Wolfgang Jeltsch
Am Donnerstag, 29. Mai 2008 17:47 schrieb Neil Mitchell: > […] > > grapefruit authors that commit to hackage > > Or someone to help show the grapefruit authors the light. I helped put > smallcheck on hackage, others have done other packages. Perhaps you > could do grapefruit? What do you mean wit

Re: [Haskell-cafe] Damnit, we need a CPAN.

2008-05-30 Thread Wolfgang Jeltsch
Am Donnerstag, 29. Mai 2008 17:38 schrieb Achim Schneider: > […] > Rationale: We need […] grapefruit authors that commit to hackage Our reason to not commtting Grapefruit to Hackage so far was that this would mean making an official release and we thought that Grapefruit is not yet ready for th

[Haskell-cafe] Seen on HCAR: CoreErlang library

2008-05-30 Thread Dimitry Golubovsky
Hi, I have just spotted the item 5.4.3 on the recently issued HCAR: CoreErlang is a Haskell library which consists of a parser and a pretty-printer for the intermediate language used by Erlang. There is no e-mail of the developer (Henrique Ferreiro Garcia) shown on the report, so I am posting th

Re: [Haskell-cafe] I/O without monads, using an event loop

2008-05-30 Thread Jake Mcarthur
On May 30, 2008, at 9:09 AM, Robin Green wrote: eventMain :: (Event, SystemState AppState) -> (Command, SystemState AppState) The first thing I would do with this type is probably wrap it up in a State monad so I don't have to keep track of the SystemState AppState stuff myself, which com

Re: [Haskell-cafe] Copying Arrays

2008-05-30 Thread Bryan O'Sullivan
Ketil Malde wrote: > I guess this is where I don't follow: why would you need more short > strings for Unicode text than for ASCII or 8-bit latin text? Because ByteString is optimised for dealing with big blobs of binary data, its performance when you split a big ByteString into a pile of words i

Re: [Haskell-cafe] I/O without monads, using an event loop

2008-05-30 Thread Wolfgang Jeltsch
Am Freitag, 30. Mai 2008 16:09 schrieb Robin Green: > […] > I'm primarily interested in embedded system and desktop UIs, Than you should take a look at . > […] Best wishes, Wolfgang ___ Haskell-Cafe mailing list Has

Re: [Haskell-cafe] So how do people pronounce 'cabal' around here?

2008-05-30 Thread Dan Piponi
On Thu, May 29, 2008 at 8:58 PM, Jonathan Cast <[EMAIL PROTECTED]> wrote: > It's not French 'tis so! Two dictionaries I've now checked say it entered English from Hebrew via French 'cabale'. But that has to be the last I say on this as it's now well off topic. -- Dan __

Re: [Haskell-cafe] I/O without monads, using an event loop

2008-05-30 Thread Robin Green
On Fri, 30 May 2008 15:23:46 +0100 Andrew Butterfield <[EMAIL PROTECTED]> wrote: > Robin Green wrote: > > I have been thinking about to what extent you could cleanly do I/O > > without explicit use of the I/O monad, and without uniqueness types > > (which are the main alternative to monads in pure

Re: [Haskell-cafe] Re: Damnit, we need a CPAN.

2008-05-30 Thread Chaddaï Fouché
2008/5/30 Achim Schneider <[EMAIL PROTECTED]>: > I already was pleasantly surprised when discovering cabal-install, I > think it deserves some more prominence, or even integration into cabal > itself, to make everyone aware of the fact that there's such a thing as > automatic installation and tempt

Re: [Haskell-cafe] I/O without monads, using an event loop

2008-05-30 Thread Andrew Butterfield
Robin Green wrote: I have been thinking about to what extent you could cleanly do I/O without explicit use of the I/O monad, and without uniqueness types (which are the main alternative to monads in pure functional programming, and are used in the Concurrent Clean programming language). Suppose

Re: [Haskell-cafe] I/O without monads, using an event loop

2008-05-30 Thread Edsko de Vries
On Fri, May 30, 2008 at 03:09:37PM +0100, Robin Green wrote: > I have been thinking about to what extent you could cleanly do I/O > without explicit use of the I/O monad, and without uniqueness types > (which are the main alternative to monads in pure functional > programming, and are used in the C

[Haskell-cafe] Default definitions for associated type synonyms

2008-05-30 Thread Dreixel
Hello, Does anyone know if it is possible to specify a default definition for an associated type synonym? When I tried: class A a where > type B a = a > GHC (version 6.9.20080309) told me: "Type declaration in a class must be a kind signature or synonym default". However, when I look at the pa

[Haskell-cafe] I/O without monads, using an event loop

2008-05-30 Thread Robin Green
I have been thinking about to what extent you could cleanly do I/O without explicit use of the I/O monad, and without uniqueness types (which are the main alternative to monads in pure functional programming, and are used in the Concurrent Clean programming language). Suppose you have a main event

Re: [Haskell-cafe] Copying Arrays

2008-05-30 Thread Ketil Malde
"Johan Tibell" <[EMAIL PROTECTED]> writes: > Lazy I/O comes with a penalty in terms of correctness! Is there a page describing this in more detail? I believe my programs to be correct, but would like to know if there are additional pitfalls, beyond hClosing a handle with outstanding (unevaluate

[Haskell-cafe] Re: Damnit, we need a CPAN.

2008-05-30 Thread Achim Schneider
Duncan Coutts <[EMAIL PROTECTED]> wrote: > So I fully appreciate this packaging stuff is sometimes frustrating. I > hope you appreciate that it is actually improving. > I already was pleasantly surprised when discovering cabal-install, I think it deserves some more prominence, or even integration

Re: [Haskell-cafe] type-level integers using type families

2008-05-30 Thread Roberto Zunino
Manuel M T Chakravarty wrote: > Peter Gavin: >> will work if the non-taken branch can't be unified with anything. Is >> this planned? Is it even feasible? > > I don't think i entirely understand the question. Maybe he wants, given cond :: Cond x y z => x -> y -> z tt :: True true_exp ::

Re: [Haskell-cafe] Copying Arrays

2008-05-30 Thread Isaac Dupree
it makes me wonder: can we support concatenation with sharing (e.g. the "rope" data structure) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Copying Arrays

2008-05-30 Thread Johan Tibell
On Fri, May 30, 2008 at 12:11 PM, Duncan Coutts <[EMAIL PROTECTED]> wrote: > On Fri, 2008-05-30 at 10:38 +0200, Ketil Malde wrote: >> "Johan Tibell" <[EMAIL PROTECTED]> writes: >> > But ByteStrings are neither ASCII nor 8-bit Latin text! >> [...] >> > The intent of the not-yet-existing Unicode st

Re: [Haskell-cafe] is there some book about haskell and data struct and alg?

2008-05-30 Thread Benjamin L. Russell
Actually, the link now points to the following URL (updated by John Melesky): http://www.eecs.usma.edu/webs/people/okasaki/pfds-haskell.tar.gz instead of the following URL (set by Henk-Jan van Tuyl): http://web.archive.org/web/2818044004/http://www.cs.columbia.edu/~cdo/pfds-haskell.tar.gz I

Re: [Haskell-cafe] Copying Arrays

2008-05-30 Thread Duncan Coutts
On Fri, 2008-05-30 at 10:38 +0200, Ketil Malde wrote: > "Johan Tibell" <[EMAIL PROTECTED]> writes: > > >> I guess this is where I don't follow: why would you need more short > >> strings for Unicode text than for ASCII or 8-bit latin text? > > > But ByteStrings are neither ASCII nor 8-bit Latin

Re: [Haskell-cafe] test driving cabal install... cabal install and normal install (runghc Setup) don't mix... two package.conf files...

2008-05-30 Thread Duncan Coutts
On Thu, 2008-05-29 at 20:12 -0700, Philip Neustrom wrote: > I'm having issues trying to get cabal-install (latest darcs) > installed, as well. I'm seeing the message: > > Hackage/Types.hs:19:29: > Module `Distribution.Version' does not export `Dependency' > > which was mentioned on this li

Re: [Haskell-cafe] Copying Arrays

2008-05-30 Thread Johan Tibell
Hi! On Fri, May 30, 2008 at 10:38 AM, Ketil Malde <[EMAIL PROTECTED]> wrote: > "Johan Tibell" <[EMAIL PROTECTED]> writes: >> The intent of the not-yet-existing Unicode string is to represent >> text not bytes. > > Right, so this will replace the .Char8 modules as well? What confused > me was my m

Re: [Haskell-cafe] zlib, missing zlib.h

2008-05-30 Thread Tony Morris
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 apt-get install zlib1g-dev Tony Morris http://tmorris.net/ Real-world problems are simply degenerate cases of pure mathematical problems. Thomas Hartman wrote: > Tried to install > > http://hackage.haskell.org/cgi-bin/hackage-scripts/package/zlib

Re: [Haskell-cafe] Copying Arrays

2008-05-30 Thread Ketil Malde
"Johan Tibell" <[EMAIL PROTECTED]> writes: >> I guess this is where I don't follow: why would you need more short >> strings for Unicode text than for ASCII or 8-bit latin text? > But ByteStrings are neither ASCII nor 8-bit Latin text! [...] > The intent of the not-yet-existing Unicode string

[Haskell-cafe] Re: type-level integers using type families

2008-05-30 Thread Benedikt Huber
Peter Gavin schrieb: Has anyone else tried implementing type-level integers using type families? I tried using a couple of other type level arithmetic libraries (including type-level on Hackage) and they felt a bit clumsy to use. I started looking at type families and realized I could pretty

Re: [Haskell-cafe] modelling C in Haskell ..

2008-05-30 Thread Jonathan Cast
On 30 May 2008, at 12:29 AM, Galchin, Vasili wrote: compactness in writing and also namespace pollution .. ;^) I know what the advantages of C's notation are. But getting the best notation out of Haskell generally doesn't happen by trying to make your code look like C. So the general an

Re: [Haskell-cafe] Copying Arrays

2008-05-30 Thread Johan Tibell
On Fri, May 30, 2008 at 9:00 AM, Ketil Malde <[EMAIL PROTECTED]> wrote: > Duncan Coutts <[EMAIL PROTECTED]> writes: >> The reason we do not want to re-use ByteString as the underlying >> representation is because they're not good for short strings and we >> expect that for Unicode text (more than a

Re[2]: [Haskell-cafe] Copying Arrays

2008-05-30 Thread Bulat Ziganshin
Hello Ketil, Friday, May 30, 2008, 11:00:10 AM, you wrote: > I guess this is where I don't follow: why would you need more short > strings for Unicode text than for ASCII or 8-bit latin text? BS package require too much memory for storing short strings. alternative package that minimizes memory

[Haskell-cafe] ANNOUNCE: Haskell Communities and Activities Report (14th ed., May 2008)

2008-05-30 Thread Janis Voigtlaender
On behalf of the many, many contributors, we are pleased to announce that the Haskell Communities and Activities Report (14th edition, May 2008) http://www.haskell.org/communities/ is now available from the Haskell Communities home page in PDF

Re: [Haskell-cafe] modelling C in Haskell ..

2008-05-30 Thread Galchin, Vasili
compactness in writing and also namespace pollution .. ;^) Vasili On Fri, May 30, 2008 at 2:12 AM, Jonathan Cast <[EMAIL PROTECTED]> wrote: > On 29 May 2008, at 11:46 PM, Galchin, Vasili wrote: > > Hello, >> >> I don't want to write kludgy Haskell code! >> >> typedef struct blah >> { >>

Re: [Haskell-cafe] modelling C in Haskell ..

2008-05-30 Thread Jonathan Cast
On 29 May 2008, at 11:46 PM, Galchin, Vasili wrote: Hello, I don't want to write kludgy Haskell code! typedef struct blah { int val1; union { int val2; struct { int val3; int val4; } } }C_typ

Re: [Haskell-cafe] Copying Arrays

2008-05-30 Thread Ketil Malde
Duncan Coutts <[EMAIL PROTECTED]> writes: >>> Because I'm writing the Unicode-friendly ByteString =p > He's designing a proper Unicode type along the lines of ByteString. So - storing 22.5 bit code points instead of 8-bit quantities? Or storing whatever representation from the input, and provid