Re: [Haskell-cafe] Getting a string from url-converted UTF8 input

2010-05-16 Thread Eugene Dzhurinsky
On Sun, May 16, 2010 at 06:55:33PM +0200, Daniel Fischer wrote: > Is there any problem compiling from source on FreeBSD? Well, good question :) After I tried to find some sources, I realized that there are http://www.haskell.org/ghc/download_ghc_6_12_2.html#freebsd -- Eugene N Dzhurinsky pg

[Haskell-cafe] ANN: cil-0.0.1

2010-05-16 Thread Tom Hawkins
CIL [1] is an OCaml library that parses and compiles C down to a simplified subset to ease different forms of static analysis. Frama-C [2] augments CIL with a property specification language (ACSL), which can capture design contracts for C functions. Frama-C's Jessie plugin uses the Why [3] softw

Re: [Haskell-cafe] ShowList magic

2010-05-16 Thread Ivan Miljenovic
On 17 May 2010 12:56, Abby Henríquez Tejera wrote: > I'm a Haskell newbie and there's a bit of Haskell code that I don't > understand how it works. In the prelude, defining the class Show, the > function showList is implemented twice, one for String and another one > for other lists: > >    showLi

Re: [Haskell-cafe] executeFile failing on macosx

2010-05-16 Thread David Powell
Indeed System.Process does work for me. I had avoided it because it is a little more awkward to use it when you want the actual PIDs. I don't understand why System.Process.runProcess works for me, but executeFile does not. I did find this issue (for python) http://bugs.python.org/issue6800which

Re: [Haskell-cafe] What makes Haskell difficult as .NET?

2010-05-16 Thread Richard O'Keefe
On May 15, 2010, at 5:40 AM, Daryoush Mehrtash wrote: the speaker talks about F# on .Net platform. Early on in the talk he says that they did F# because haskell would be "hard to make as a .Net language".Does anyone know what features of Haskell make it difficult as .Net language? La

[Haskell-cafe] ShowList magic

2010-05-16 Thread Abby Henríquez Tejera
Hi. I'm a Haskell newbie and there's a bit of Haskell code that I don't understand how it works. In the prelude, defining the class Show, the function showList is implemented twice, one for String and another one for other lists: showList cs = showChar '"' . showl cs where sh

Re: [Haskell-cafe] executeFile failing on macosx

2010-05-16 Thread Thomas Schilling
Works fine on 10.6.3. If you run with +RTS -N2, though, you'll get "forking not supported with +RTS -N greater than 1" The reason for this is that forking won't copy over the threads which means that the Haskell IO manager stops working (you'd have to somehow reinitialise the RTS while leaving he

Re: [Haskell-cafe] executeFile failing on macosx

2010-05-16 Thread David Powell
On Mon, May 17, 2010 at 1:33 AM, Bulat Ziganshin wrote: > Hello David, > > Sunday, May 16, 2010, 7:18:29 PM, you wrote: > > > "executeFile" is failing for me on Mac OS X 10.5.8, with ghc 6.12.1 > > when compiling with "-threaded". Compiling without -threaded, or running > on linux is fine. > >>

Re: [Haskell-cafe] [reactive] A pong and integrate

2010-05-16 Thread Peter Verswyvelen
Yes, it would be very nice to actually pinpoint why this can't be done. Is it a bug, is it a design flaw, ... I'm just saying that I'm not aware of a working Pong game in Reactive. Well actually, someone did make a Tetris game with it once... Intuitively I would say Reactive gives the programmer t

Re: [Haskell-cafe] Numerical Analysis

2010-05-16 Thread Erik de Castro Lopo
Pierre-Etienne Meunier wrote: > I was also wondering about how to do linear algebra : an infinite > number of types would be needed to express all the constraints on > matrix multiplication : we need types such as "array of size m * n". > Is there a way to generate these automatically This is alr

Re: [Haskell-cafe] [reactive] A pong and integrate

2010-05-16 Thread Limestraël
Why isn't it possible to make a Pong with Reactive? Where is the problem? Conceptually, I don't see where it is. IMO, it's a time-leak issue due to a Reactive bug, but it is not a limitation of Reactive. I mean, it's not that it *can't* work, it's that it *should* work, shouldn't it? And why would

Re: [Haskell-cafe] Monadic style with Streams (as in Data.Array.Parallel.Stream)

2010-05-16 Thread Mark Wassell
Roman Leshchinskiy wrote: On 16/05/2010, at 11:54, Mark Wassell wrote: Hi, This possibly might go against the spirit of what Stream programming is about but I having difficulties converting an imperative algorithm [1] into Haskell and think it would be easier if I was able to write it i

Re: [Haskell-cafe] [reactive] A pong and integrate

2010-05-16 Thread Peter Verswyvelen
As far as I know, it was never possible to make a pong game in Reactive, at least not with the versions I tried, but I admit a lot of never versions got released since then. It would be great to see one though :) You might want to try Yampa, that works for sure (although you should mark all your o

Re: [Haskell-cafe] [reactive] A pong and integrate

2010-05-16 Thread Limestraël
Eventually, I don't think it is a profiling issue. Maybe a problem with integral. According to a quite recent post on the reactive mailing list, the following minimal code produces the same problem : > import FRP.Reactive > import FRP.Reactive.LegacyAdapters > import Control.Applicative > type V

Re: [Haskell-cafe] Numerical Analysis

2010-05-16 Thread Gregory Crosswhite
On May 16, 2010, at 4:51 AM, Roman Leshchinskiy wrote: > You are quite right that vector only supports nested arrays but not > multidimensional ones. This is by design, however - the library's only goal > is to provide efficient one-dimensional, Int-indexed arrays. I'm thinking > about how to

Re: [Haskell-cafe] Getting a string from url-converted UTF8 input

2010-05-16 Thread Daniel Fischer
On Sunday 16 May 2010 18:13:30, Eugene Dzhurinsky wrote: > On Sun, May 16, 2010 at 06:56:58PM +0300, Roman Cheplyaka wrote: > > I assume you are using GHC < 6.12. The trouble is in conversion done > > by putStrLn. Use one from System.IO.UTF8. > > > > Or try to upgrade to GHC 6.12 which respects the

Re: [Haskell-cafe] Numerical Analysis

2010-05-16 Thread Pierre-Etienne Meunier
> You are quite right that vector only supports nested arrays but not > multidimensional ones. This is by design, however - the library's only goal > is to provide efficient one-dimensional, Int-indexed arrays. I'm thinking > about how to implement multidimensional arrays on top of vector but it

Re: [Haskell-cafe] Getting a string from url-converted UTF8 input

2010-05-16 Thread Eugene Dzhurinsky
On Sun, May 16, 2010 at 06:56:58PM +0300, Roman Cheplyaka wrote: > I assume you are using GHC < 6.12. The trouble is in conversion done by > putStrLn. Use one from System.IO.UTF8. > > Or try to upgrade to GHC 6.12 which respects the locale settings. Hello, Roman! Thank you very much for the hint

Re: [Haskell-cafe] Getting a string from url-converted UTF8 input

2010-05-16 Thread Roman Cheplyaka
* Eugene Dzhurinsky [2010-05-16 18:42:08+0300] > Hello all! > > Can somebody please explain wha am I doing in wrong way? > > [snip] > > I am getting the output: > > === > 1) 345 =K=G5 <>4=> 1...@0bl :=86:8 2 2845 FB2? > > 2) :0:>9 5A

[Haskell-cafe] Getting a string from url-converted UTF8 input

2010-05-16 Thread Eugene Dzhurinsky
Hello all! Can somebody please explain wha am I doing in wrong way? === module UrlEncode where import System import Codec.Binary.UTF8.String as SU import Codec.Binary.Url as U import Data.Maybe main :: IO () main = do args <- getAr

Re: [Haskell-cafe] executeFile failing on macosx

2010-05-16 Thread Bulat Ziganshin
Hello David, Sunday, May 16, 2010, 7:18:29 PM, you wrote: > "executeFile" is failing for me on Mac OS X 10.5.8, with ghc 6.12.1 > when compiling with "-threaded".  Compiling without -threaded, or running on > linux is fine.  >>  forkProcess $ executeFile "/bin/echo" False ["Ok"] Nothing afair,

[Haskell-cafe] executeFile failing on macosx

2010-05-16 Thread David Powell
"executeFile" is failing for me on Mac OS X 10.5.8, with ghc 6.12.1 when compiling with "-threaded". Compiling without -threaded, or running on linux is fine. When compiled with -threaded, the following snippet produces the error: testProg: /bin/echo: executeFile: failed (Operation not supporte

[Haskell-cafe] Re: ANN: Monad.Reader Issue 16

2010-05-16 Thread Heinrich Apfelmus
Brent Yorgey wrote: > I am very pleased to announce that Issue 16 of The Monad.Reader is now > available [1]. > > Issue 16 consists of the following three articles: > > * "Demand More of Your Automata" by Aran Donohue > * "Iteratee: Teaching an Old Fold New Tricks" by John W. Lato > *

Re: [Haskell-cafe] Monadic style with Streams (as in Data.Array.Parallel.Stream)

2010-05-16 Thread Roman Leshchinskiy
On 16/05/2010, at 11:54, Mark Wassell wrote: > Hi, > > This possibly might go against the spirit of what Stream programming is about > but I having difficulties converting an imperative algorithm [1] into Haskell > and think it would be easier if I was able to write it in a monadic style > wit

Re: [Haskell-cafe] Numerical Analysis

2010-05-16 Thread Roman Leshchinskiy
On 16/05/2010, at 10:17, Pierre-Etienne Meunier wrote: > I've also just noticed a lack in the vector library : multidimensional arrays > seem to require indirections like in caml, whereas in C or in Data.Ix, there > is a way to avoid this. This is especially important for avoiding cache > misse

Re: [Haskell-cafe] Speed of Error handling with Continuations vs. Eithers

2010-05-16 Thread roconnor
On Fri, 14 May 2010, Derek Elkins wrote: You did it wrong. All you did was Church encode the Either type. Your bind is still doing a case-analysis. All you have to do is use ContT r (Either e). The bind implementation for ContT is completely independent of the underlying monad. It doesn't ev

Re: [Haskell-cafe] Speed of Error handling with Continuations vs. Eithers

2010-05-16 Thread Andrea Vezzosi
On Thu, May 13, 2010 at 8:13 PM, wren ng thornton wrote: > Andrea Vezzosi wrote: >> >> On Thu, May 13, 2010 at 10:51 AM, wren ng thornton >> wrote: >>> >>> Andrea Vezzosi wrote: wren ng thornton  wrote: > > With this change [1] I can't notice any difference for your > benchm

Re: [Haskell-cafe] GADTs and Scrap your Boilerplate

2010-05-16 Thread Ben Millwood
On Sun, May 16, 2010 at 2:34 AM, Tom Hawkins wrote: >> I got the GADT >> >> data DataBox where >>   DataBox :: (Show d, Eq d, Data d) => d -> DataBox >> > [snip] >> >> but I can't figure out how to implement gunfold for DataBox. >> >> The error message is >> >> Text/XML/Generic.hs:274:23: >>     A

Re: [Haskell-cafe] GADTs and Scrap your Boilerplate

2010-05-16 Thread José Pedro Magalhães
Hi Oscar, On Sat, May 15, 2010 at 22:19, Oscar Finnsson wrote: > > (...) > > I guess my questions are: > > 1. Is it possible to combine GADTs with Scrap your Boilerplate? > Your GADT encodes an existential datatype. The closest attempt to encode existential types in (something like) SYB that I k

Re: [Haskell-cafe] Monadic style with Streams (as in Data.Array.Parallel.Stream)

2010-05-16 Thread Stephen Tetley
Hi Mark What style of "Stream programming" do you have in mind? In Haskell there can be at least four styles of Stream programming depending how you count: There is the stream as infinite-list - see Wouter Swierstra's Data.Stream on Hackage and if you have university affiliation look for the pape