Re: [Haskell] ANNOUNCE: New Book - Programming in Haskell

2007-02-09 Thread Graham Robertson
Just a quick addendum to the earlier announcement, to say that course instructors can request inspection copies for this textbook via: http://www.cambridge.org/uk/9780521692694 for UK and European institutions or http://www.cambridge.org/us/9780521692694 for US institutions If you need more

Re: [Haskell] ANNOUNCE: Data.CompactString 0.1 - my attempt at a Unicode ByteString

2007-02-09 Thread Duncan Coutts
On Thu, 2007-02-08 at 17:01 -0800, John Meacham wrote: On Tue, Feb 06, 2007 at 03:16:17PM +0900, shelarcy wrote: I'm afraid that its fantasy is broken again, as no surrogate pair UCS-2 cover all language that is trusted before Europe and America people. UCS-2 is a disaster in every way.

Re: [Haskell] ANNOUNCE: Data.CompactString 0.1 - my attempt at a Unicode ByteString

2007-02-09 Thread Deborah Goldsmith
On Thu, 2007-02-08 at 17:01 -0800, John Meacham wrote: UCS-2 is a disaster in every way. someone had to say it. :) UCS-2 has been deprecated for many years. everything should be ascii, utf8 or ucs-4 or migrating to it. UCS-4 has also been deprecated for many years. The main forms of

Re: [Haskell] ANNOUNCE: Data.CompactString 0.1 - my attempt at aUni code ByteString

2007-02-09 Thread Steve Schafer
On Fri, 9 Feb 2007 16:21:07 -0800, you wrote: Note that some Unicode algorithms require the ability to back up in a stream of code points, so that may be a consideration in the design (maybe they could be implemented in Haskell in a way that doesn't require that; I'm still learning, so I'm

[Haskell] Haskell-mode 2.2

2007-02-09 Thread Stefan Monnier
I've just released version 2.2 of the Haskell-mode package for Emacs. It has very few visible changes, mostly some commands to query an underlying interactive hugs/ghci in order to get type/info about specific identifiers, courtesy of Matthew Danish. It does have some non-trivial changes in the

[GHC] #1137: HashTable.hashString broken

2007-02-09 Thread GHC
#1137: HashTable.hashString broken ---+ Reporter: [EMAIL PROTECTED] | Owner: Type: bug | Status: new Priority: normal | Milestone:

Re: [GHC] #1115: GHC concurrency runtime breaks every 497 (and a bit) days

2007-02-09 Thread GHC
#1115: GHC concurrency runtime breaks every 497 (and a bit) days +--- Reporter: Neil Davies | Owner: igloo Type: bug | Status: closed Priority: normal

[GHC] #1138: The -fexcess-precision flag is ignored if supplied on the command line.

2007-02-09 Thread GHC
#1138: The -fexcess-precision flag is ignored if supplied on the command line. +--- Reporter: dons | Owner: Type: bug | Status: new

RE: [Haskell-cafe] External Core

2007-02-09 Thread Simon Peyton-Jones
Aaron At the moment, on the way *out* of GHC, it goes like this: Core -- converted to ExternalCore -- printed to file On the way *in* we see file -- parsed to a mixture of HsSyn and IfaceSyn -- typechecked to Core This is all a bit of a

Re: [Haskell-cafe] Beginner Question

2007-02-09 Thread Yitzchak Gale
Hi Vishy, You wrote: I have just started on my journey in learning Haskell. Welcome aboard! We all wish you an enjoyable and (type)safe trip. I have started off reading wikibook, then will read yet another tutorial on haskell. Please guide me if I am on right track Those are both great

Re: [Haskell-cafe] IO is not a monad

2007-02-09 Thread Yitzchak Gale
Lennart Augustsson wrote: I think seq is funny because it is not lambda definable. I wrote: Does the set of computable functions on the natural numbers defined by the lambda calculus augmented with seq have higher Turing degree than the set of classical computable functions? I guess I was

[Haskell-cafe] FFI basics

2007-02-09 Thread Yitzchak Gale
Hi, I would like to use FFI for the first time. Can someone give me a really, really simple complete example? I want to be able to take a simple C program and access a function from it in Haskell. A simple example of the other way around would be nice, too, but I don't happen to need that just

Re: [Haskell-cafe] FFI basics

2007-02-09 Thread Alistair Bayley
I would like to use FFI for the first time. Can someone give me a really, really simple complete example? Everything I found on the wiki seems way beyond that - maybe I missed it. I am using GHC. I am not using Windows. From the old wiki: http://www.haskell.org/hawiki/FfiCookbook

Re: [Haskell-cafe] FFI basics

2007-02-09 Thread Bulat Ziganshin
Hello Yitzchak, Friday, February 9, 2007, 3:23:53 PM, you wrote: I would like to use FFI for the first time. Can someone give me a really, really simple complete example? nothing can be easier main = print (c_mysin 1.0) foreign import ccall mysin.h mysin c_mysin :: Double - Double

[Haskell-cafe] factorising to prime numbers

2007-02-09 Thread Dougal Stanton
Hi folks, I recently read in my copy of Concrete Mathematics the relationship between prime factors powers and lcm/gcd functions. So I decided to reimplement gcd and lcm the long way, for no other reason than because I could. If you look at the definition of 'powers' you'll note it's infinite.

Re: [Haskell-cafe] factorising to prime numbers

2007-02-09 Thread kahl
If you look at the definition of 'powers' you'll note it's infinite. So there's no easy way to take the product of this list, if I don't know how many items to take from it. So you need finite lists. -- how many of the prime p are in the unique factorisation -- of the integer n?

Re: [Haskell-cafe] factorising to prime numbers

2007-02-09 Thread Robert Dockins
On Feb 9, 2007, at 9:20 AM, Dougal Stanton wrote: Hi folks, I recently read in my copy of Concrete Mathematics the relationship between prime factors powers and lcm/gcd functions. So I decided to reimplement gcd and lcm the long way, for no other reason than because I could. If you look at

Re: [Haskell-cafe] factorising to prime numbers

2007-02-09 Thread Mikael Johansson
On Fri, 9 Feb 2007, Dougal Stanton wrote: Hi folks, I recently read in my copy of Concrete Mathematics the relationship between prime factors powers and lcm/gcd functions. So I decided to reimplement gcd and lcm the long way, for no other reason than because I could. If you look at the

[Haskell-cafe] GHC throws IOError on Win32 when there is no console

2007-02-09 Thread John Ky
Hi, I noticed on Windows that when I use IO functions that write to stdout when the process is lacking a console, those functions throw an IOError. I'm not sure if this also occurs for stderr because I haven't tried it. Some classes of processes are created without a console because they never

[Haskell-cafe] Re: GHC throws IOError on Win32 when there is no console

2007-02-09 Thread John Ky
Sorry, I should clarify. I am writing about applications compiled with GHC. -John On 2/10/07, John Ky [EMAIL PROTECTED] wrote: Hi, I noticed on Windows that when I use IO functions that write to stdout when the process is lacking a console, those functions throw an IOError. I'm not sure if

Re: [Haskell-cafe] GHC throws IOError on Win32 when there is no console

2007-02-09 Thread Paul Moore
On 09/02/07, John Ky [EMAIL PROTECTED] wrote: I noticed on Windows that when I use IO functions that write to stdout when the process is lacking a console, those functions throw an IOError. I'm not sure if this also occurs for stderr because I haven't tried it. This is Windows standard

[Haskell-cafe] Random numbers without IO

2007-02-09 Thread Dougal Stanton
Well, nobody likes tainting their beautiful pure code with IO, so I rewrote the Random module to take advantage of the latest research [1]: module Random where getRandom = 4 Cheers, D. [1] http://xkcd.com/c221.html -- Dougal Stanton ___

[Haskell-cafe] What's wrong with cgi-undecidable?

2007-02-09 Thread keepbal
http://darcs.haskell.org/packages/cgi-undecidable/ There only 3 or 4 lines of source code, but it can't be installed. The ghc version is 6.6 . Undecidable.hs:23:0: Duplicate instance declarations: instance [overlap ok] (MonadTrans t, MonadCGI m, Monad (t m)) =

Re: [Haskell-cafe] Random numbers without IO

2007-02-09 Thread Andrew Wagner
That's definitely the lazy approach! On 2/9/07, Dougal Stanton [EMAIL PROTECTED] wrote: Well, nobody likes tainting their beautiful pure code with IO, so I rewrote the Random module to take advantage of the latest research [1]: module Random where getRandom = 4 Cheers, D. [1]

Re: [Haskell-cafe] What's wrong with cgi-undecidable?

2007-02-09 Thread Matthew Brecknell
http://darcs.haskell.org/packages/cgi-undecidable/ There only 3 or 4 lines of source code, but it can't be installed. The ghc version is 6.6 . Undecidable.hs:23:0: Duplicate instance declarations: instance [overlap ok] (MonadTrans t, MonadCGI m, Monad (t m)) =

[Haskell-cafe] Tricks for making low level haskell hacking easier

2007-02-09 Thread Donald Bruce Stewart
For those of you who like your Haskell code fast, then, if you're like me, reading Core output all day can give you headaches. Here's a couple of tricks I use to make optimising low level stuff easier. 1) Use Hscolour to pretty-ifiy the Core so its more parsable: ghc -O Foo.hs -ddump-simpl

[Haskell-cafe] Query

2007-02-09 Thread vishy anand
hi i am going through yaht tutorial and exercise 4.6 and 4.7..i understood 4.6,but not 4.7 in which fromTuple (One a ) = Left (Left a ) and fromTuple (Two a b ) = Left (Right (a,b) ) function r written..why use Either type..cant i just say fromTuple (Two a b )=(a,b)