Re: [Haskell-cafe] Unicode normalization

2011-04-19 Thread Colin Adams
It may be the only highly optimised implementation with source code available. I needed to implement this some years ago in Eiffel. I did it in a fairly straight-forward way, without worrying too much about optimal code, as my requirement was merely to conform. The nice thing about implementing no

Re: [Haskell-cafe] errors while installing yesod 0.8

2011-04-19 Thread Michael Snoyman
I got those warnings as well, but I don't think it's anything to be particularly concerned about. On Wed, Apr 20, 2011 at 8:58 AM, Bas van Dijk wrote: > monad-control builds fine on my system with both GHC 7.0.3 and 6.12.3. > > $ uname -a > Linux notebookbas 2.6.38-8-generic #42-Ubuntu SMP Mon A

Re: [Haskell-cafe] An example of enumerator processing some data between input and output

2011-04-19 Thread oleg
Paul Sujkov wrote: > I played a bit with the enumerator package, and I'm quite stuck with the > question how to duplex data to two (or more) consumers Many packages have the combinator named enumPair (or something like that). Here is one example http://okmij.org/ftp/ftp/Streams.html#1enu

Re: [Haskell-cafe] errors while installing yesod 0.8

2011-04-19 Thread Bas van Dijk
monad-control builds fine on my system with both GHC 7.0.3 and 6.12.3. $ uname -a Linux notebookbas 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux I do get some "Unrecognised pragma" warnings when building on 6.12.3 because I use the new INLINABLE prag

Re: [Haskell-cafe] errors while installing yesod 0.8

2011-04-19 Thread Michael Snoyman
I was also able to install monad-control, both with GHC 7 and 6.12.3. A more detailed error log will definitely be helpful here. Michael On Wed, Apr 20, 2011 at 2:58 AM, Rogan Creswick wrote: > On Tue, Apr 19, 2011 at 4:22 PM, Michael Litchard > wrote: > > yesod-static-0.1.0 depends on monad-c

[Haskell-cafe] CFT -- Haskell Implementors' Workshop 2011

2011-04-19 Thread Ben Lippmeier
Call for Talks ACM SIGPLAN Haskell Implementors' Workshop http://haskell.org/haskellwiki/HaskellImplementorsWorkshop/2011 Tokyo, Japan, September 23rd, 2011 The workshop will be held in conjunction with ICFP 2011 http://ww

[Haskell-cafe] Unicode normalization

2011-04-19 Thread wren ng thornton
Hello all, I'm in need of a Unicode normalization function, Utf8 NFC for ByteString in particular. From some quick Googling around it looks like the only available option is to use ICU in some form. The text-icu package has a nice binding to it, but unfortunately that means a lot of redundant

Re: [Haskell-cafe] Haskell from SML - referrential Transparency?!

2011-04-19 Thread Brandon Moore
> Thanks. > > It was the "no computation needed" difference that I was missing, and was >including (falsely) in my expectations for "same result", i.e. including the >same traces. To be clear, Debug.trace is not referentially transparent. It's only supposed to be used for debugging. Brand

Re: [Haskell-cafe] errors while installing yesod 0.8

2011-04-19 Thread Rogan Creswick
On Tue, Apr 19, 2011 at 4:22 PM, Michael Litchard wrote: > yesod-static-0.1.0 depends on monad-control-0.2.0.1 which failed to install. > > > This is what happened after I did cabal update, then cabal-dev install > yesod. This is the original error I received. Just for a point of reference - I ju

Re: [Haskell-cafe] errors while installing yesod 0.8

2011-04-19 Thread Daniel Fischer
On Wednesday 20 April 2011 01:22:20, Michael Litchard wrote: > So what else can I try? $ cabal install -v3 monad-control That should give some hints at which point exactly things fail. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.h

Re: [Haskell-cafe] errors while installing yesod 0.8

2011-04-19 Thread Michael Litchard
yesod-0.8.0 depends on monad-control-0.2.0.1 which failed to install. yesod-auth-0.4.0 depends on monad-control-0.2.0.1 which failed to install. yesod-core-0.8.0 depends on monad-control-0.2.0.1 which failed to install. yesod-form-0.1.0 depends on monad-control-0.2.0.1 which failed to install. yeso

Re: [Haskell-cafe] http://trac.haskell.org/ not redering correctly

2011-04-19 Thread Conrad Parker
On 20 April 2011 05:55, Andrew Coppin wrote: > On 17/04/2011 11:29 AM, Erik de Castro Lopo wrote: >> >> Hi all, >> >> Trac pages aren't rendering correctly. It seems the HTTP server >> can't find the CSS files. See below. >> >> Cheers, >> Erik > > I'm glad it's not just me. Any danger of this bein

Re: [Haskell-cafe] errors while installing yesod 0.8

2011-04-19 Thread Rogan Creswick
On Tue, Apr 19, 2011 at 3:10 PM, Michael Litchard wrote: > New information, may be helpful. > > I manually installed hamlet 0.8 with cabal-dev, and it seemed to > install. Here is the message > > > Registering hamlet-0.8.0... > Installing library in > /home/mlitchard/hamlet-0.8.0/cabal-dev//lib/ha

Re: [Haskell-cafe] HXT and xhtml page encoded in cp1251

2011-04-19 Thread Albert Y. C. Lai
On 11-04-18 05:06 PM, Dmitry V'yal wrote: The readDocument arrow fails with the following message: fatal error: encoding scheme not supported: "WINDOWS-1251" Can someone suggest a workaround for my use case? If you have a Handle (from file or Network for example), import System.IO(hGetConten

Re: [Haskell-cafe] errors while installing yesod 0.8

2011-04-19 Thread Michael Litchard
New information, may be helpful. I manually installed hamlet 0.8 with cabal-dev, and it seemed to install. Here is the message Registering hamlet-0.8.0... Installing library in /home/mlitchard/hamlet-0.8.0/cabal-dev//lib/hamlet-0.8.0/ghc-6.12.3 Registering hamlet-0.8.0... Then I tried to manual

Re: [Haskell-cafe] Haskell from SML - referrential Transparency?!

2011-04-19 Thread Gregory Guthrie
Thanks. It was the "no computation needed" difference that I was missing, and was including (falsely) in my expectations for "same result", i.e. including the same traces. --- Dr. Gregory Guthrie Computer Science Department School of Computer Science & M

Re: [Haskell-cafe] errors while installing yesod 0.8

2011-04-19 Thread Rogan Creswick
On Tue, Apr 19, 2011 at 2:18 PM, Michael Litchard wrote: > mlitchard@apotheosis:~/monad-control$ cabal install > Resolving dependencies... > Configuring monad-control-0.2.0.1... > cabal: Error: some packages failed to install: > monad-control-0.2.0.1 failed during the configure step. The exception

Re: [Haskell-cafe] errors while installing yesod 0.8

2011-04-19 Thread Michael Litchard
OS Linux apotheosis 2.6.35-22-server #33-Ubuntu SMP Sun Sep 19 20:48:58 UTC 2010 x86_64 GNU/Linux GHC The Glorious Glasgow Haskell Compilation System, version 6.12.3 Is the problem here that I'm not using ghc 7? I try to be conservative with my compiler upgrades. But if this might be the probl

Re: [Haskell-cafe] errors while installing yesod 0.8

2011-04-19 Thread Michael Snoyman
I haven't seen this error. What version of GHC are you using, and what OS? Michael On Wed, Apr 20, 2011 at 12:18 AM, Michael Litchard wrote: > Trying to install yesod 0.8 breaks when it's time to install > monad-control. Google wasn't very helpful, nor was the error message I > received > > > >

[Haskell-cafe] errors while installing yesod 0.8

2011-04-19 Thread Michael Litchard
Trying to install yesod 0.8 breaks when it's time to install monad-control. Google wasn't very helpful, nor was the error message I received mlitchard@apotheosis:~/monad-control$ cabal install Resolving dependencies... Configuring monad-control-0.2.0.1... cabal: Error: some packages failed to in

Re: [Haskell-cafe] http://trac.haskell.org/ not redering correctly

2011-04-19 Thread Andrew Coppin
On 17/04/2011 11:29 AM, Erik de Castro Lopo wrote: Hi all, Trac pages aren't rendering correctly. It seems the HTTP server can't find the CSS files. See below. Cheers, Erik I'm glad it's not just me. Any danger of this being fixed someday? I notice that there's duplicate reports of the HTML

Re: [Haskell-cafe] Need comments on a libusb asynchronous select/poll loop

2011-04-19 Thread Bas van Dijk
On 19 April 2011 15:06, John Obbele wrote: > I'm trying to implement an asynchronous interface to libusb, re-using > the raw bindings-usb (by Maurício C. Antunes) and partially copying what > can be found in the (great but synchronous-only) usb package (from Bas > van Dijk). Great! I have wished

Re: [Haskell-cafe] Haskell from SML - referrential Transparency?!

2011-04-19 Thread Daniel Fischer
On Tuesday 19 April 2011 21:38:18, Gregory Guthrie wrote: > I did post the code - but don't expect anyone to really wade through and > debug for me! :-) Oh, wow. Haskell looking like Lisp :( > (The issues that I am asking about are a9b, a9bb at > line 435, 438) http://hpaste.org/45851/haskell_fr

Re: [Haskell-cafe] Painless parallelization.

2011-04-19 Thread Don Stewart
> to write a pure functional parallel code with the level of abstraction I used > in Haskell? The status of parallel programming in Haskell is loosely maintained here: http://stackoverflow.com/questions/3063652/whats-the-status-of-multicore-programming-in-haskell/3063668#3063668 Your options,

Re: [Haskell-cafe] Haskell from SML - referrential Transparency?!

2011-04-19 Thread Luke Palmer
On Tue, Apr 19, 2011 at 1:41 PM, Gregory Guthrie wrote: > Perhaps the description was unclear; > >F1;f1 gives result r1;r2 (not the same) >F1;f2gives r1;r2 >F2,f1gives r1;r2 > No, you were clear, and Felipe's answer still makes sense. Since f1 and f2 have the sam

Re: [Haskell-cafe] Haskell from SML - referrential Transparency?!

2011-04-19 Thread Gregory Guthrie
Perhaps the description was unclear; F1;f1 gives result r1;r2 (not the same) F1;f2gives r1;r2 F2,f1gives r1;r2 --- > -Original Message- > From: Felipe Almeida Lessa [mailto:felipe.le...@gmail.com] > Sent: Tuesday, Apr

Re: [Haskell-cafe] Haskell from SML - referrential Transparency?!

2011-04-19 Thread Gregory Guthrie
Oops; No - my (further) mistake. It is not IO() - f1 returns a data structure which implements Show, and the test is really: Test1 = do print "Test1:" print f1 (etc..) Thanks for the alert on trace. I used it like this: allocate :: Store -> (Store, Location) allocate ( Sto

Re: [Haskell-cafe] Haskell from SML - referrential Transparency?!

2011-04-19 Thread Jake McArthur
You can think of IO actions as values (which don't change) representing imperative programs to execute (which may have different results each time you execute them). So, `fa fb fc` represents the exact same value as `fa fb fc`, but if you execute that value multiple times you may get different resu

Re: [Haskell-cafe] Haskell from SML - referrential Transparency?!

2011-04-19 Thread Felipe Almeida Lessa
On Tue, Apr 19, 2011 at 4:10 PM, Gregory Guthrie wrote: > and I get different results from the two executions (f1,f2), even though > they have exactly the same definition. Reversing their order, gives the > exact same results (i.e. the results are still different, and in the same > original order

Re: [Haskell-cafe] Haskell from SML - referrential Transparency?!

2011-04-19 Thread Daniel Fischer
On Tuesday 19 April 2011 21:10:09, Gregory Guthrie wrote: > I am pretty new to Haskell, so need some clarification. > I am porting some code from SML, and getting a result that surprises me. > > I basically have some functions which work like this: > f1 = fa fb fc > test1 = do print "test

Re: [Haskell-cafe] Painless parallelization.

2011-04-19 Thread Mats Rauhala
You could look into par and pseq combinators and parallel strategies[1]. Real world haskell[2] has some examples on the usage. 1. http://hackage.haskell.org/package/parallel 2. http://book.realworldhaskell.org/read/concurrent-and-multicore-programming.html -- Mats Rauhala pgpeZ4z9l0SI6.pgp De

[Haskell-cafe] Haskell from SML - referrential Transparency?!

2011-04-19 Thread Gregory Guthrie
I am pretty new to Haskell, so need some clarification. I am porting some code from SML, and getting a result that surprises me. I basically have some functions which work like this: f1 = fa fb fc test1 = do print "test1:" f1 But I ran a few tests, and got odd re

[Haskell-cafe] Painless parallelization.

2011-04-19 Thread Grigory Sarnitskiy
Hello, I'm searching a way to benefit from modern hardware in my programs. I consider parallel programing to be actually easier than sequential one. Parallel computation allows to avoid sophisticated algorithms that were developed to gain performance on sequential architecture. It should also al

Re: [Haskell-cafe] An example of enumerator processing some data between input and output

2011-04-19 Thread Paul Sujkov
Actually, I may be quite wrong with the task. While duplexing the input is an interesting thing to do, actually I need to pipeline output of one consumer to another (outputting text after making some internal representation - with Show instance - with the parseData). The answer to this one should b

[Haskell-cafe] ANNOUNCE: cereal-0.3.1.0

2011-04-19 Thread Trevor Elliott
Hi Everyone, I'm proud to announce version 0.3.1.0 of the cereal binary-(de)serialization library [1]! This version includes some new functionality contributed by Lemmih, that adds support for partial parses in the Get monad. The changes don't modify the API presented in 0.3.0.0, instead adding

Re: [Haskell-cafe] Stack overflow in simple code with getStdRandom / randomR (GHC)

2011-04-19 Thread Volker Stolz
Blimey, I didn't notice that Krzysztof came to the same conclusion a bit earlier today, so I guess the answer is somewhere in his remark "One possible solution is to make cell holding std gen strict.". I'd still be interested in how to profile for this scenario, though. -Volker __

Re: [Haskell-cafe] Stack overflow in simple code with getStdRandom / randomR (GHC)

2011-04-19 Thread Henning Thielemann
On Tue, 19 Apr 2011, Volker Stolz wrote: The following three-liner creates a stack overflow (on my machine, MacOS), and I'm a bit puzzled as to why: import System.Random main = do mapM (const (getStdRandom (randomR (0, 5::Int [0..1000] botanix:~ stolz$ ./a.out Stack space ove

[Haskell-cafe] Another(!) PhD Position at Strathclyde

2011-04-19 Thread Conor McBride
Hot on the heels of Patricia Johann's advertisement, here's another PhD Position in the Mathematically Structured Programming Group, Deparment of Computer and Information Sciences at the

[Haskell-cafe] An example of enumerator processing some data between input and output

2011-04-19 Thread Paul Sujkov
Hi haskellers, I played a bit with the enumerator package, and I'm quite stuck with the question how to duplex data to two (or more) consumers using combinators from xml-enumerator (for example) package. What I mean is: main = withFile "out.xml" WriteMode $ \h -> parseFile "in.xml" decodeE

[Haskell-cafe] Stack overflow in simple code with getStdRandom / randomR (GHC)

2011-04-19 Thread Volker Stolz
The following three-liner creates a stack overflow (on my machine, MacOS), and I'm a bit puzzled as to why: > import System.Random > > main = do > mapM (const (getStdRandom (randomR (0, 5::Int [0..1000] botanix:~ stolz$ ./a.out Stack space overflow: current size 8388608 bytes. Use

[Haskell-cafe] Adjoint Folds and Unfolds Or: Scything through the Thicket of Morphisms

2011-04-19 Thread caseyh
Just tripped over this: Adjoint Folds and Unfolds Or: Scything through the Thicket of Morphisms Folds and unfolds are at the heart of the algebra of programming. They allow the cognoscenti to derive and manipulate programs rigorously... Ralf Hinze Lecture Notes in Computer Science, 2010, Volume

Re: [Haskell-cafe] [Haskell] select(2) or poll(2)-like function?

2011-04-19 Thread Henning Thielemann
On Sun, 17 Apr 2011, Matthias Kilian wrote: is there something like select(2) or poll(2) available in the standard (HP) libraries? I hoogled around a little bit but didn't find anything. (Something like this will be crucial for networking stuff listening on v4 and v6 sockets at the same time)

[Haskell-cafe] Errata for "Pearls of Functional Algorithm Design" by Richard Bird, 2010, page 25 #Haskell

2011-04-19 Thread caseyh
-- Errata for "Pearls of Functional Algorithm Design" by Richard Bird, -- 2010, page 25 #Haskell -- I don't like this solution it suffers from "indexitis" which -- Bird talks about in the chapter on Sudoku. -- I can see why lists are liked, they avoid "indexitis" at -- the cost of chopping and co

Re: [Haskell-cafe] Need comments on a libusb asynchronous select/poll loop

2011-04-19 Thread Antoine Latter
On Tue, Apr 19, 2011 at 9:35 AM, John Obbele wrote: > On Tue, Apr 19, 2011 at 08:52:44AM -0500, Antoine Latter wrote: >> Maybe I'm misunderstanding something, but why why I want to use epoll >> directly instead of just using forkIO plus threadWaitRead and >> threadWaitWrite? >> >> http://hackage.h

Re: [Haskell-cafe] A paper relating to Data.Set and Data.Map

2011-04-19 Thread Milan Straka
Hi Kazu and all, > Hello libraries and cafe, > > We (Hirai and I) would like to tell you our paper relating to > Data.Set and Data.Map. "Balancing Weight-Balanced Trees" is now > accepted and will appear in Journal of Functional Programming. > The camera-ready version of the paper is available fr

Re: [Haskell-cafe] Need comments on a libusb asynchronous select/poll loop

2011-04-19 Thread John Obbele
On Tue, Apr 19, 2011 at 08:52:44AM -0500, Antoine Latter wrote: > Maybe I'm misunderstanding something, but why why I want to use epoll > directly instead of just using forkIO plus threadWaitRead and > threadWaitWrite? > > http://hackage.haskell.org/packages/archive/base/latest/doc/html/Control-Co

[Haskell-cafe] Trac configuration error

2011-04-19 Thread Andrew Pennebaker
Try to visit http://trac.haskell.org/ghc. Python 2.5.2: /usr/bin/pythonTue Apr 19 15:02:32 2011A problem occurred in a Python script. Cheers, Andrew Pennebaker www.yellosoft.us ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskel

Re: [Haskell-cafe] Need comments on a libusb asynchronous select/poll loop

2011-04-19 Thread Antoine Latter
On Tue, Apr 19, 2011 at 8:06 AM, John Obbele wrote: > I was reading the recent thread about select/poll, events > handling and why forkIO is the only thing you should need (sorry > if this is a horrible summary ;) and I'm realizing I could use > some advice concerning my last project. > > I'm tryi

[Haskell-cafe] Need comments on a libusb asynchronous select/poll loop

2011-04-19 Thread John Obbele
I was reading the recent thread about select/poll, events handling and why forkIO is the only thing you should need (sorry if this is a horrible summary ;) and I'm realizing I could use some advice concerning my last project. I'm trying to implement an asynchronous interface to libusb, re-using th

Re: [Haskell-cafe] Question about the Monad instance for Iteratee (from the enumerator package)

2011-04-19 Thread Felipe Almeida Lessa
2011/4/19 Daniel Schüssler : > Hello, > > for reference, said instance is: > >> instance Monad m => Monad (Iteratee a m) where >>       return x = yield x (Chunks []) >> >>       m0 >>= f = ($ m0) $ fix $ >>               \bind m -> Iteratee $ runIteratee m >>= \r1 -> >>                       case

[Haskell-cafe] Question about the Monad instance for Iteratee (from the enumerator package)

2011-04-19 Thread Daniel Schüssler
Hello, for reference, said instance is: > instance Monad m => Monad (Iteratee a m) where > return x = yield x (Chunks []) > > m0 >>= f = ($ m0) $ fix $ > \bind m -> Iteratee $ runIteratee m >>= \r1 -> > case r1 of > Co

[Haskell-cafe] Confusing performance variation while optimising a tight loop

2011-04-19 Thread Patai Gergely
Hello all, I've been trying to improve the performance of Hemkay, my MOD player. The mixing routines are in a separate library with no special dependencies. Most of the time is spent in a small loop in the mixToBuffer function [1] (note that this version is not the master branch in case you give i