Re: [Haskell-cafe] Haskell source AST zipper with state

2012-05-03 Thread Niklas Broberg
On Thu, May 3, 2012 at 2:52 AM, Andrew Seniuk ras...@gmail.com wrote: Note that the Annotated version of the HSE parser/AST will probably not provide enough generality for the sorts of attributes you want to store (it's for source locations, unless something changed in the most recent

Re: [Haskell-cafe] OpenGL: No instance for Random GLfloat

2012-05-03 Thread L Corbijn
Hi, GLfloat haskell is instance of several number related typeclasses. A function like 'fromRational' could be used to create a GLfloat from another number that has a random instance. L On May 3, 2012 4:39 AM, Mark Spezzano mark.spezz...@chariot.net.au wrote: Hi, I tried this but now I get

Re: [Haskell-cafe] Learn you

2012-05-03 Thread Ptival
For the French translation, I dropped the humor altogether. It just doesn't feel right to translate a reference to a meme. Plus the English phrasing is quite impossible to express... it would have been really dumb had I tried to stick to it. So I opted for a close translation, but sadly,

Re: [Haskell-cafe] Learn you

2012-05-03 Thread 山本和彦
Hello, I think the Japanese title is in a similar spirit as the original one. Breaking it down: Sugoi Haskell tanoshiku manabou! sugoi - awesome (rather colloquial) tanoshiku - while having fun manabou - let's learn Yes, exactly. Sugoi is a frank word which we cannot use in thesis.

[Haskell-cafe] Specify compile error

2012-05-03 Thread Ismael Figueroa Palet
Hi, I'm writing a program like this: data B = B Int data A = Safe Int | Unsafe Int createB :: A - B createB (Safe i) = B i createB (Unsafe i) = error This is not allowed Unfortunately, the situation when createB is called with an Unsafe value is only checked at runtime. If I omit the second

Re: [Haskell-cafe] Specify compile error

2012-05-03 Thread Adam Smith
Nope - because at compile time, there's no way to know whether createB's argument is a Safe or an Unsafe. That information only exists at run time. Consider the following functions. f :: Int - A f x = if x 0 then Unsafe x else Safe x g :: IO B g = do x - getLine return $ createB $ f

Re: [Haskell-cafe] Specify compile error

2012-05-03 Thread Aleksandar Dimitrov
On Thu, May 3, 2012 at 5:36 PM, Ismael Figueroa Palet ifiguer...@gmail.comwrote: Hi, I'm writing a program like this: data B = B Int data A = Safe Int | Unsafe Int createB :: A - B createB (Safe i) = B i createB (Unsafe i) = error This is not allowed Unfortunately, the situation when

Re: [Haskell-cafe] Specify compile error

2012-05-03 Thread Marc Weber
Is there a way to make it a compile time error?? http://en.wikibooks.org/wiki/Haskell/GADT It may pay off talking about your specific use case. Marc Weber ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] unable to run ghci (7.4.1)?

2012-05-03 Thread Baojun Wang
Dear list, I build haskell-platform 2011.04 by gentoo ~amd64 haskell overlay. But I can't run ghci even I rebuilt ghc or run haskell-updater, error message: ghci GHCi, version 7.4.1: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package

Re: [Haskell-cafe] unable to run ghci (7.4.1)?

2012-05-03 Thread Morel Pisum
Am 03.05.2012 18:29, schrieb Baojun Wang: Dear list, I build haskell-platform 2011.04 by gentoo ~amd64 haskell overlay. But I can't run ghci even I rebuilt ghc or run haskell-updater, error message: ghci GHCi, version 7.4.1: http://www.haskell.org/ghc/ :? for help Loading package

Re: [Haskell-cafe] unable to run ghci (7.4.1)?

2012-05-03 Thread Baojun Wang
On Fri, May 4, 2012 at 12:35 AM, Morel Pisum morel.pi...@googlemail.com wrote: Am 03.05.2012 18:29, schrieb Baojun Wang: Dear list, I build haskell-platform 2011.04 by gentoo ~amd64 haskell overlay. But I can't run ghci even I rebuilt ghc or run haskell-updater, error message: ghci GHCi,

Re: [Haskell-cafe] twitter election on favorite programming language

2012-05-03 Thread Alexander Danilov
01.05.2012 08:11, Kazu Yamamoto (山本和彦) пишет: Hello, A twitter election on favorite programming language was held in Japan and it appeared that Heskell is No. 10 loved language in Japan. :-) http://twisen.com/election/index/654 Regards, --Kazu favourite = (1 / frequently used),

Re: [Haskell-cafe] Specify compile error

2012-05-03 Thread Jeremy Shaw
This response is written in literal Haskell. {-# LANGUAGE DataKinds, KindSignatures, GADTs #-} The key to getting the type checker involved is to put the information where the type-checker can see it -- namely, the type signature. So, let's change A so that the Safe/Unsafe information is in

Re: [Haskell-cafe] Specify compile error

2012-05-03 Thread Ismael Figueroa Palet
Wow, Jeremy, your solution looks very nice. I'll try it and report back Thanks a lot!! 2012/5/3 Jeremy Shaw jer...@n-heptane.com This response is written in literal Haskell. {-# LANGUAGE DataKinds, KindSignatures, GADTs #-} The key to getting the type checker involved is to put the

[Haskell-cafe] conduit: Finalize field in PipeM

2012-05-03 Thread Paolo Capriotti
Hi, I'm trying to write a function to convert a conduit to a Pipe (from pipes-core), and I'm having trouble understanding why the `Finalize` field in a `PipeM` constructor returns `r`. This makes it impossible to create it from the corresponding `M` constructor in pipes-core, since `M` includes an

[Haskell-cafe] haskellonline.org, a web frontend for ghc

2012-05-03 Thread Gintautas Miliauskas
Hello, check out http://haskellonline.org, an online Haskell typechecker. It is essentially a thin web wrapper over ghc, but it takes some friction out of learning Haskell, if only because no local setup is required. It is a weekend's work, so do not be too harsh, but feedback is welcome! I have

[Haskell-cafe] Tutorial on how to use multirec

2012-05-03 Thread j . romildo
Hello. I am writing a compiler in Haskell and need some tools to work with abstract syntax trees (like annotating them with source positions and other things). I have been pointed out to the multirec package. I have found some information about the package, but it is too dense to read and

Re: [Haskell-cafe] Haskell source AST zipper with state

2012-05-03 Thread Andrew Seniuk
On Thu, May 3, 2012 at 2:22 AM, Niklas Broberg niklas.brob...@gmail.com wrote: On Thu, May 3, 2012 at 2:52 AM, Andrew Seniuk ras...@gmail.com wrote: Note that the Annotated version of the HSE parser/AST will probably not provide enough generality for the sorts of attributes you want to

[Haskell-cafe] Annoyed at System.Random

2012-05-03 Thread Thomas DuBuisson
Ryan, I've grown annoyed at System.Random enough (specifically, StdGen). How much, if any, pushback would there be if I put together a FFI binding to a C AES-CTR based RNG. There are many advantages: 0) The API wouldn't have to change (though some parts should, and some change is already

Re: [Haskell-cafe] Annoyed at System.Random

2012-05-03 Thread Ryan Newton
Hi Thomas, Personally, I would love to see that happen. It seems like the best way to make split acceptable. Is Brian Gladman's C implementation still best in class? In my tests even without AESNI it could exceed the traditional System.Random in performance (

Re: [Haskell-cafe] Annoyed at System.Random

2012-05-03 Thread Ertugrul Söylemez
Thomas DuBuisson thomas.dubuis...@gmail.com wrote: I've grown annoyed at System.Random enough (specifically, StdGen). How much, if any, pushback would there be if I put together a FFI binding to a C AES-CTR based RNG. There are many advantages: [...] I'd be tempted to pull in the

Re: [Haskell-cafe] Annoyed at System.Random

2012-05-03 Thread Thomas DuBuisson
On Thu, May 3, 2012 at 5:26 PM, Ertugrul Söylemez e...@ertes.de wrote: Thomas DuBuisson thomas.dubuis...@gmail.com wrote: I've grown annoyed at System.Random enough (specifically, StdGen). How much, if any, pushback would there be if I put together a FFI binding to a C AES-CTR based RNG.  

Re: [Haskell-cafe] Learn you

2012-05-03 Thread wren ng thornton
On 5/3/12 1:26 AM, Richard O'Keefe wrote: The Little Lisper (and the other books like The Little Schemer and The Seasoned Schemer) are presumably meant to be funny, but to me come across as offensively patronising Tis a pity. I know the authors and they certainly didn't mean it to be

Re: [Haskell-cafe] Annoyed at System.Random

2012-05-03 Thread Ertugrul Söylemez
Thomas DuBuisson thomas.dubuis...@gmail.com wrote: Vincent has done great work for Haskell+Crypto so I think he knows I mean nothing personal when I say cprng-aes has the right idea done the wrong way. Why a new effort vs Vincent's package? 1. cprng-aes is painfully slow. 2. It doesn't use

[Haskell-cafe] ANN: containers-0.5.0.0

2012-05-03 Thread Johan Tibell
Hi all, I'm proud to announce a new major release of the containers package : http://hackage.haskell.org/package/containers-0.5.0.0 There has been a whopping 160 commits since the last release. The major improvements are: * a clearer distinction between value-lazy and value-strict

Re: [Haskell-cafe] Annoyed at System.Random

2012-05-03 Thread Thomas DuBuisson
On May 3, 2012 5:49 PM, Ertugrul Söylemez e...@ertes.de wrote: Thomas DuBuisson thomas.dubuis...@gmail.com wrote: Vincent has done great work for Haskell+Crypto so I think he knows I mean nothing personal when I say cprng-aes has the right idea done the wrong way. Why a new effort vs

Re: [Haskell-cafe] unable to run ghci (7.4.1)?

2012-05-03 Thread Brandon Allbery
On Thu, May 3, 2012 at 12:29 PM, Baojun Wang wan...@gmail.com wrote: /usr/lib64/ghc-7.4.1/base-4.5.0.0/HSbase-4.5.0.0.o: unknown symbol `stat' This is not a missing package, as some respondents seem to think; it's a sign that something went very wrong during building it and the result is

Re: [Haskell-cafe] unable to run ghci (7.4.1)?

2012-05-03 Thread Brandon Allbery
On Thu, May 3, 2012 at 12:35 PM, Morel Pisum morel.pi...@googlemail.comwrote: Weird. The base package is actually the most important package and should be included in the haskell-platform. Anyway; you could try to do cabal install base or so. cabal-install cannot install base; it is and

Re: [Haskell-cafe] unable to run ghci (7.4.1)?

2012-05-03 Thread Baojun Wang
On Fri, May 4, 2012 at 1:06 PM, Brandon Allbery allber...@gmail.com wrote: On Thu, May 3, 2012 at 12:35 PM, Morel Pisum morel.pi...@googlemail.com wrote: Weird. The base package is actually the most important package and should be included in the haskell-platform. Anyway; you could try to