Re: [Haskell-cafe] Why doesn't this work?

2005-04-25 Thread Duncan Coutts
On Sun, 2005-04-24 at 23:16 -0700, Michael Vanier wrote: I've been trying to generate an infinite list of random coin flips in GHC 6.4, and I've come across some strange behavior: -- import System.Random data Coin = H | T

Re: [Haskell-cafe] invalid character encoding

2005-03-16 Thread Duncan Coutts
On Wed, 2005-03-16 at 11:55 +, Ross Paterson wrote: On Wed, Mar 16, 2005 at 03:54:19AM +, Ian Lynagh wrote: Do you have a list of functions which behave differently in the new release to how they did in the previous release? (I'm not interested in changes that will affect only

Re: [Haskell-cafe] invalid character encoding

2005-03-16 Thread Duncan Coutts
On Wed, 2005-03-16 at 13:09 +, Duncan Coutts wrote: On Wed, 2005-03-16 at 11:55 +, Ross Paterson wrote: It doesn't affect functions added by the hierarchical libraries, i.e. those functions are safe only with the ASCII subset. (There is a vague plan to make Foreign.C.String

Re: [Haskell-cafe] Browser-like UI

2005-03-01 Thread Duncan Coutts
In message [EMAIL PROTECTED] =?ISO-8859-1?Q?Maur=EDcio?= [EMAIL PROTECTED] writes: Hi, I've seen some options for GUI programming in Haskell libraries page, but what I really would like is to define my user interface using HTML (or, maybe, SVG). What are the options to do that in

Re: [Haskell-cafe] Re: Browser-like UI

2005-03-01 Thread Duncan Coutts
On Tue, 2005-03-01 at 11:15 -0300, MaurĂ­cio wrote: If there are no pre-built packages of gtk2hs for your system you can still build from source in a reasonably straigtforward way. Basically we provide pre-built versions of the problematic files that take so much memory to create in an

Re: [Haskell-cafe] GUI components for displaying Html pages

2005-02-23 Thread Duncan Coutts
On Wed, 2005-02-23 at 03:25 +, David Owen wrote: Hi all, I'm looking for a Haskell GUI library which supports the display of rendered Html pages in the same way that web browsers do. I've been getting to grips recently with wxHaskell as it was recommended on haskell-cafe. I was

Re: [Haskell-cafe] File path programme

2005-01-25 Thread Duncan Coutts
On Tue, 2005-01-25 at 19:12 +, Ben Rudiak-Gould wrote: My concern here is that someone will actually use the library once it ships, with the following consequences: 1. Programs using the library will have predictable (exploitable) bugs in pathname handling. 2. It will never

Re: [Haskell-cafe] Reading images

2005-01-21 Thread Duncan Coutts
On Fri, 2005-01-21 at 07:25 +, Adrian Hey wrote: On Thursday 20 Jan 2005 7:35 pm, Dmitri Pissarenko wrote: In my program, I need ONLY to read an image and to transform it into such matrix. Which graphics library can you recommend, if no other image manipulation operations are

Re: [Haskell-cafe] Re: Hugsvs GHC (again)was: Re: Somerandomnewbiequestions

2005-01-21 Thread Duncan Coutts
On Fri, 2005-01-21 at 12:33 +, Keean Schupke wrote: Glynn Clements wrote: The central issue is that the Unix API doesn't distinguish between cases 1 and 2 when it comes to non-blocking I/O, asynchronous I/O, select/poll etc. [OTOH, NT overlapped I/O and certain Unix extensions do

Re: [Haskell-cafe] Re: Hugsvs GHC (again)was: Re: Somerandomnewbiequestions

2005-01-21 Thread Duncan Coutts
On Fri, 2005-01-21 at 16:26 +, Keean Schupke wrote: Udo Stenzel wrote: Thus the question is, does select() reliably tell if read() would block or does it check for something else? Is the documentation wrong (on some platforms)? Having read around I have found that select does

Re: [Haskell-cafe] Re: Hugsvs GHC (again)was: Re: Somerandomnewbiequestions

2005-01-19 Thread Duncan Coutts
On Wed, 2005-01-19 at 15:06 +, Keean Schupke wrote: Why not use a thread-pool, and a safe call to read, provided there is an OS thread available, defaulting to unsafe if no thread is available... You could make the thread pool size an argument... If it's just a question of speed then

Re: [Haskell-cafe] Re: Hugs vs GHC (again)was: Re: Somerandomnewbiequestions

2005-01-18 Thread Duncan Coutts
On Tue, 2005-01-18 at 22:52 +, Glynn Clements wrote: Ben Rudiak-Gould wrote: Essentially, reading data from regular files is always deemed to occur soon, so the usual mechanisms for dealing with slow I/O (i.e. pipes, FIFOs, character devices, sockets) don't work. This applies equally to

Re: [Haskell-cafe] Re: Hugs vs GHC (again)was: Re: Somerandomnewbiequestions

2005-01-17 Thread Duncan Coutts
On Mon, 2005-01-17 at 13:44 -0800, Ben Rudiak-Gould wrote: John Meacham wrote: Actually, If I were writing new haskell libraries, I would use mmap whenever I could for accessing files. not only does it make the file pointer problem go away, but it can be drastically more efficient. I'm

Re: [Haskell-cafe] I/O interface

2005-01-17 Thread Duncan Coutts
On Mon, 2005-01-17 at 16:27 -0800, Ben Rudiak-Gould wrote: Marcin 'Qrczak' Kowalczyk wrote: Convenience. I'm worried that it uses separate types for various kinds of streams: files, pipes, arrays (private memory), and sockets. Haskell is statically typed and lacks subsumption. This means

Re: [Haskell-cafe] Building GUIs for Haskell programs

2005-01-12 Thread Duncan Coutts
On Wed, 2005-01-12 at 11:34 +, Jules Bean wrote: On 12 Jan 2005, at 11:10, Matthew Roberts wrote: All this is of course entirely dependent on having a suitable GUI library or set of bindings for haskell. I haven't tried wxHaskell yet so I can't comment there. (And for some applications,

Re: [Haskell-cafe] Building GUIs for Haskell programs

2005-01-11 Thread Duncan Coutts
On Tue, 2005-01-11 at 21:05 +0100, Dmitri Pissarenko wrote: Hello! I want to learn to create GUIs with Haskell. Which GUI frameworks can you recommend? wxHaskell is good for building portable GUIs. It has an extensive selection of widgets and has a good API. gtk2hs is good for building

Re: [Haskell-cafe] GUI

2004-12-27 Thread Duncan Coutts
In message [EMAIL PROTECTED] Matthew Roberts [EMAIL PROTECTED] writes: I know this question is probably going over old ground - so I apologise in advance. However, I want to know if there has been any practical standardisation in the GUI area. Last time I looked at this it seemed some

Re: [Haskell-cafe] FiniteMapFiniteMap

2004-12-13 Thread Duncan Coutts
On Mon, 2004-12-13 at 14:56 -0500, S. Alexander Jacobson wrote: Hmm cool. Binary does not appear in the GHC docs... Is it new? Ah, it's not a user library distributed with GHC, it's a library used internally in the implementation of GHC. If you want to use it you have to rip it out of the ghc

Re: [Haskell-cafe] ghc install

2004-12-11 Thread Duncan Coutts
In message [EMAIL PROTECTED] Radu Grigore [EMAIL PROTECTED] writes: Hi, I try to install ghc on 6.2 on a gentoo linux distribution (from sources). It fails with You are most welcome to report Haskell issues on Gentoo in the Gentoo bugzilla: http://bugs.gentoo.org/ We're fairly good at

Re: [Haskell-cafe] FiniteMapFiniteMap

2004-12-09 Thread Duncan Coutts
On Thu, 2004-12-09 at 11:04 -0500, S. Alexander Jacobson wrote: Or is there a better way to (de-)serialize FiniteMaps? There's a neat trick that we use in c2hs (at least the patched version shipped with gtk2hs) to strictly read all the keys of the finite map but read all the values lazily. This

Re: [Haskell-cafe] namespacing?

2004-12-08 Thread Duncan Coutts
On Wed, 2004-12-08 at 07:58 -0700, [EMAIL PROTECTED] wrote: I've got a general new person type question. I understand that I can hide a function in a module that I am importing if it conflicts with another identical function name. But if the situation arises that I would like to use two

[Haskell-cafe] Re: Haskell and qualified identifiers

2004-12-08 Thread Duncan Coutts
On Wed, 2004-12-08 at 17:04 +0100, Henning Thielemann wrote: On Wed, 8 Dec 2004, Duncan Coutts wrote: There are actually several options here, you can import modules only qualified, then every value from that module needs to be qualified. Some modules are designed to be used this way, see

Re: [Haskell-cafe] Re: Double - CDouble, realToFrac doesn't work

2004-11-05 Thread Duncan Coutts
On Fri, 2004-11-05 at 13:57, Henning Thielemann wrote: On Fri, 5 Nov 2004, Robert Dockins wrote: What IEEE has done is shoehorned in some values that aren't really numbers into their representation (NaN certainly; one could make a convincing argument that +Inf and -Inf aren't numbers).

Re: [Haskell-cafe] OO idioms redux

2004-10-13 Thread Duncan Coutts
In message [EMAIL PROTECTED] John Goerzen [EMAIL PROTECTED] writes: OK, recently I posed a question about rethinking some OO idioms, and that spawned some useful discussion. I now have a followup question. One of the best features of OO programming is that of inheritance. It can be used

[Haskell-cafe] closed classes [was: Re: exceptions vs. Either]

2004-08-06 Thread Duncan Coutts
On Fri, 2004-08-06 at 14:05, MR K P SCHUPKE wrote: You should include the definitions of the classes before saying HOrderedList l' just has to prove by induction that for any element in the list, the next element is greater, so the class is simply: class HOrderedList l instance HNil

Re: [Haskell-cafe] closed classes

2004-08-06 Thread Duncan Coutts
On Fri, 2004-08-06 at 15:44, Malcolm Wallace wrote: Hmm...doesn't --8-- module Closed(foo) where class C a where foo = ... instance C ... --8-- module Main where import Closed ...foo... --8-- do what you want? You can only use

Re: [Haskell-cafe] optimising for vector units

2004-07-26 Thread Duncan Coutts
On Mon, 2004-07-26 at 10:58, MR K P SCHUPKE wrote: In the absence of such a standard, the best that can be done is to abstract vectorisation by word size and number of words, and supply a software implementation of all vector ops to use if the hardware does not support certain primitives.

Re: [Haskell-cafe] some newbie FFI questions

2004-07-01 Thread Duncan Coutts
On Thu, 2004-07-01 at 12:34, MR K P SCHUPKE wrote: Oh... also when using unboxed arrays you may well have to have a separate array for each colour plane (r,g,b,a) as I think unboxed arrays can only contain primitive types - although I am not certain about this - it may be enough to have the

Re: [Haskell-cafe] Newbie questions

2004-07-01 Thread Duncan Coutts
On Thu, 2004-07-01 at 17:01, Crypt Master wrote: I consider myself a pretty good imperative programmer, been at it for decades, and am tryibng my hand at Haskell now. Unfrituantly I am not getting it all that quickly despite having the multimedia haskell book. [snip] The take operator

[Haskell-cafe] Re: [Haskell] Help in understanding a type error involving forall and class constraints

2004-06-30 Thread Duncan Coutts
On Wed, 2004-06-30 at 12:00, MR K P SCHUPKE wrote: Ahh.. I see whats happening: MArray (STUArray s) a (ST s) = String - String - ST s (UArray (Int,Int) a) IArray UArray a = String - String - a nothing here is specifying a... you cannot leave a polymorphic in this case. You need to

Re: [Haskell-cafe] Help in understanding a type error involving forall and class constraints

2004-06-30 Thread Duncan Coutts
On Wed, 2004-06-30 at 12:54, Duncan Coutts wrote: To restate the question for Haskell-Cafe readers: Is it possible to return an arbitrary unboxed array that was constructed in the ST monad (as an STUArray)? The issue is that you end up with a MArray class

Re: [Haskell-cafe] Polymorphic algebraic type constructors

2004-06-22 Thread Duncan Coutts
On Tue, 2004-06-22 at 20:52, Adrian Hey wrote: On Tuesday 22 Jun 2004 6:20 pm, MR K P SCHUPKE wrote: ahh but in this example: f :: [Int] - [Bool] f (i:is) = even i : f is f [EMAIL PROTECTED] = e e is an empty list of Ints not an empty list of Bools! If the difference is

Re: [Haskell-cafe] c2hs and gtk+hs problem

2004-05-18 Thread Duncan Coutts
On Tue, 2004-05-18 at 17:48, scott west wrote: Hello all, I've recently attempted to get the gtk+hs bindings operational, with evidently no success. They both compile fine, but when trying to make all the examples in the gtk+hs tree, it gives up with: Does anyone have any possible ways

Re: [Haskell-cafe] GHC and libc

2004-05-15 Thread Duncan Coutts
On Sat, 2004-05-15 at 16:08, Per Larsson wrote: When I compile my haskell program (on a linux machine) with GHC and send it to a colleague he can't run it because he has a somewhat older version of libc. Is there a GHC switch that I have missed that enables you to statically link the parts

Re: [Haskell-cafe] Programming style and XML processing in Haskell

2004-05-13 Thread Duncan Coutts
Something which wasn't mentioned but is quite useful is type-specialised xml parsers. Some tools manipulate xml generically, giving you back some DOM tree which is great if you are writing a general purpose xml parser. However most uses know exactly what DTD/Schema/Type they are dealing with and

Re: [Haskell-cafe] Where's the error in this snippet of code?

2004-03-25 Thread Duncan Coutts
On Wed, 2004-03-24 at 18:00, Alex Gontcharov wrote: I don't want to hide it within the function, I need the functions to have file scope. Oh, ok. I assumed from the indentation (you see layout matters!) that it was a nested function. Haskell (like Python) is layout sensitive, the indentation

RE: [Haskell-cafe] loop in C , recursion in haskell

2004-03-24 Thread Duncan Coutts
On Wed, 2004-03-24 at 15:51, Simon Marlow wrote: I am new to haskell and would look to write a function equivalent to the following loop in C int value = 50; int part_stack[4]; int *part_ptr = part_stack; for (; value; value /= 1) *part_ptr++ = value % 1;

Re: Perspectives on learning and using Haskell

2004-01-04 Thread Duncan Coutts
On Sun, 2004-01-04 at 10:20, Graham Klyne wrote: Which leads to a question: I've been thinking that the white box tests may be better served by test expressions coded *within* the module concerned. In many cases, I create these, then en-comment them when the code is working. I would

Re: IO system

2003-06-21 Thread Duncan Coutts
On Sat, 21 Jun 2003 17:34:59 +0100 Glynn Clements [EMAIL PROTECTED] wrote: I do not see why the location of data should have an influence here. Haskell values are private to the program, while file contents may be read and written by other processes. Haskell computations can be

Re: gtk2hs

2003-06-15 Thread Duncan Coutts
On Fri, 13 Jun 2003 19:39:53 +0200 Christian Buschmann [EMAIL PROTECTED] wrote: I tried to implement a simple counter with gtk2hs. To increase my counter I defined following event: onClicked btn $ do si - textBufferGetStartIter tb ei - textBufferGetEndIter tb

Re: modeling out of memory

2003-03-02 Thread Duncan Coutts
On Sun, 2 Mar 2003 10:16:12 +0200 Cagdas Ozgenc [EMAIL PROTECTED] wrote: Greetings, 1) How does one model out of memory condition in Haskell, perhaps using a Maybe type? Unfortuntely not since it would not be referentially transparent. It's part of a more general issue of exceptions in

Re: zipping two streams in the IO monad

2002-09-19 Thread Duncan Coutts
On Thu, 19 Sep 2002 22:06:59 +0200 Nick Name [EMAIL PROTECTED] wrote: In general, how does one implement a function like getChanContents wich returns an infinite list? Tell me just some pointer to information of course, I don't want an entire functional programming lesson :) See

<    8   9   10   11   12   13