Re: [Haskell-cafe] Creating a dependency graph (in the hope it may show some structure)

2012-05-02 Thread Bram Neijt
Thank you! I feel stupid for posting a question when there is already a stackoverflow answer. But now that I have that, I have all the information I need. Greets, Bram On May 2, 2012 12:49 AM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: On 2 May 2012 06:15, Bram Neijt

[Haskell-cafe] heterogeneous environment

2012-05-02 Thread Ben
dear static typing masters -- while working on an STM-like library, i ran into the issue of trying to create a transaction log for reads / writes of heterogeneous reference types. i don't have a good answer to this problem. the problem is twofold : first, the general heterogeneous collection

Re: [Haskell-cafe] Again, version conflicting problem with cabal-install

2012-05-02 Thread Magicloud Magiclouds
Hi, long time no see. I am using cabal-install-0.15.0. And the new solver. It sure solves some problem. Thanks for the work. Well, on the other hand, there still are hackages that I just have no idea how the author make it (probably not up-to-date hackage database). After human-solver checking,

[Haskell-cafe] Reader monad, refactoring and missing the point all at once

2012-05-02 Thread Eugene Dzhurinsky
Hi all! Last day I was trying to fix idiii library, because it uses utf8 for parsing non-unicode content. I found the functions -- | Parses one value and returns it as a 'String' parseString :: CharEncoding - TagParser String parseString enc = do v - case enc of 0x01 -

[Haskell-cafe] Learn you

2012-05-02 Thread 山本和彦
Hello cafe, Translating Learn You a Haskell for Great Good into Japanese was finished and will be published on 22 May. I guess it's worth watching its cover page:

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

2012-05-02 Thread 山本和彦
Hello Leon, Out of curiousity,  was this a plurality election (vote for one),  or an approval election (vote for many)? Vote for one. This application requires twitter login. --Kazu ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Haskell Hackathon in Munich

2012-05-02 Thread Simon Hengel
Hi Heinrich, the Munich Haskell Meeting is glad to announce a local one day Hackathon in Munich. It will take place the 12th of May 2012 from 10am to 6pm. Please checkout the details at: I'll join. BTW: Any reason why we would not want to put this on the wiki? And can we create an IRC

[Haskell-cafe] using ResourceT with MVars

2012-05-02 Thread Warren Harris
I would like to use LevelDB in my code, and the HEAD version of leveldb-haskell now uses runResourceT to manage open db connections and iterators. I would also like to run multiple threads, and coordinate them for transaction-like behavior, i.e. read and writing data without interruption.

Re: [Haskell-cafe] using ResourceT with MVars

2012-05-02 Thread Michael Snoyman
On Wed, May 2, 2012 at 11:36 AM, Warren Harris warrensomeb...@gmail.com wrote: I would like to use LevelDB in my code, and the HEAD version of leveldb-haskell now uses runResourceT to manage open db connections and iterators. I would also like to run multiple threads, and coordinate them for

Re: [Haskell-cafe] using ResourceT with MVars

2012-05-02 Thread Warren Harris
On May 2, 2012, at 2:06 AM, Michael Snoyman wrote: I don't really know the details of LevelDB, but if the question is how do I run MVar operations in ResourceT, yes the answer would be lifted-base[1]. Since ResourceT is an instance of MonadBaseControl, you can use any of the functions

Re: [Haskell-cafe] heterogeneous environment

2012-05-02 Thread oleg
Ben wrote: - use Data.Unique to identify Refs, and use existential quantification or Data.Dynamic to create a heterogenous Map from uid to log. for example, to represent a log of compare-and-swaps we might do something like data Ref a = Ref (IORef a) Unique data OpaqueCAS = forall a .

[Haskell-cafe] Arithmetic expressions with GADTs: parsing

2012-05-02 Thread j . romildo
Hello. In order to learn GADTs, I have written the attached program, which defines a type for arithmetic expressions using GADTs, a parser for them, and an evaluation function. But my parser does not typecheck. ghc-7.4.1 gives me the error message: Expr.hs:25:28: Couldn't match expected

Re: [Haskell-cafe] Arithmetic expressions with GADTs: parsing

2012-05-02 Thread Roman Cheplyaka
* j.romi...@gmail.com j.romi...@gmail.com [2012-05-02 08:03:45-0300] Hello. In order to learn GADTs, I have written the attached program, which defines a type for arithmetic expressions using GADTs, a parser for them, and an evaluation function. But my parser does not typecheck. ghc-7.4.1

Re: [Haskell-cafe] Arithmetic expressions with GADTs: parsing

2012-05-02 Thread j . romildo
On Wed, May 02, 2012 at 03:02:46PM +0300, Roman Cheplyaka wrote: * j.romi...@gmail.com j.romi...@gmail.com [2012-05-02 08:03:45-0300] [...] The alternatives given to | must be of the same type. In your case, one is Expr Double and one is Expr Bool. Inclusion of pBool in pFactor is probably a

Re: [Haskell-cafe] heterogeneous environment

2012-05-02 Thread Heinrich Apfelmus
Ben wrote: while working on an STM-like library, i ran into the issue of trying to create a transaction log for reads / writes of heterogeneous reference types. i don't have a good answer to this problem. the problem is twofold : first, the general heterogeneous collection problem, and second,

Re: [Haskell-cafe] Arithmetic expressions with GADTs: parsing

2012-05-02 Thread Sean Leather
Hi Romildo, On Wed, May 2, 2012 at 3:08 PM, j.romildo wrote: You are right in the sense that I cannot mix Expr Bool and Expr Double in a (O op l r) expression. But the parser should be able to parse any form of expressions. So I rewrite my program to take this into account. The new

[Haskell-cafe] ANN: HacPhi 2012

2012-05-02 Thread Chris Casinghino
Greetings, I am very pleased to officially announce Hac Phi 2012, a Haskell hackathon/get-together to be held August 3-5 at the University of Pennsylvania in Philadelphia. The hackathon will officially kick off at 2:30 Friday afternoon, and go until 5pm on Sunday (with breaks for sleep, of

Re: [Haskell-cafe] Learn you

2012-05-02 Thread Brent Yorgey
I am curious how the title was translated. Of course, the English title Learn You a Haskell for Great Good uses intentionally ungrammatical/unidiomatic English for humorous effect. Is the Japanese title also ungrammatical/unidiomatic Japanese? Or do Japanese speakers not find that humorous?

Re: [Haskell-cafe] Learn you

2012-05-02 Thread Colin Adams
I don't find it (the English title) humorous. I just assumed it was written by a non-native English speaker. On 2 May 2012 18:18, Brent Yorgey byor...@seas.upenn.edu wrote: I am curious how the title was translated. Of course, the English title Learn You a Haskell for Great Good uses

Re: [Haskell-cafe] Learn you

2012-05-02 Thread Brandon Allbery
On 2 May 2012 18:18, Brent Yorgey byor...@seas.upenn.edu wrote: I am curious how the title was translated. Of course, the English title Learn You a Haskell for Great Good uses intentionally ungrammatical/unidiomatic English for humorous effect. Is the On Wed, May 2, 2012 at 1:25 PM, Colin

Re: [Haskell-cafe] Learn you

2012-05-02 Thread Wojciech Jedynak
(caveat: I'm not a native speaker of Japanese) 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 In formal grammar it should be Sugoi

Re: [Haskell-cafe] Learn you

2012-05-02 Thread Bardur Arantsson
On 05/02/2012 07:37 PM, Brandon Allbery wrote: On 2 May 2012 18:18, Brent Yorgeybyor...@seas.upenn.edu wrote: I am curious how the title was translated. Of course, the English title Learn You a Haskell for Great Good uses intentionally ungrammatical/unidiomatic English for humorous effect.

Re: [Haskell-cafe] Learn you

2012-05-02 Thread Felipe Almeida Lessa
On Wed, May 2, 2012 at 2:41 PM, Wojciech Jedynak wjedy...@gmail.com wrote: In formal grammar it should be Sugoi Haskell tanoshiku WO manabou! - this WO is a particle identifying the object and this omission is normal in colloquial, spoken Japanese. My basic Japanase is very rusty, but

Re: [Haskell-cafe] Learn you

2012-05-02 Thread Brandon Allbery
On Wed, May 2, 2012 at 2:02 PM, Bardur Arantsson s...@scientician.netwrote: On 05/02/2012 07:37 PM, Brandon Allbery wrote: The English title does require a little context for the humor: it leverages a chain of poor-translation memes going back (at least) to all-your-base. I always thought

Re: [Haskell-cafe] Learn you

2012-05-02 Thread Wojciech Jedynak
2012/5/2 Felipe Almeida Lessa felipe.le...@gmail.com: On Wed, May 2, 2012 at 2:41 PM, Wojciech Jedynak wjedy...@gmail.com wrote: In formal grammar it should be Sugoi Haskell tanoshiku WO manabou! - this WO is a particle identifying the object and this omission is normal in colloquial, spoken

Re: [Haskell-cafe] Threads and hGetLine

2012-05-02 Thread Johannes Waldmann
There are two threads, one which is waits on input via hGetLine and another, which should terminate this thread or close this handle. like this? The trick is to fork the blocking call (hGetLine) and wait on an MVar. That way, the kill signal can be handled: {-# language PatternSignatures

[Haskell-cafe] Edmonton Functional Programming Users Group (EFPUG)

2012-05-02 Thread Kevin Charter
Hi Cafe, If you live in the Edmonton, Canada area, and you're interested in functional programming, EFPUG is an informal discussion group you might find interesting. Most of our talks have been on Haskell topics, but we're interested in functional languages in general. Our Google Group is

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

2012-05-02 Thread Mark Spezzano
Hi Haskellers, I'm trying to generate a random vertex in OpenGL as follows. genPosition :: IO (Vertex3 GLfloat) genPosition = do x - getStdRandom $ randomR (-1.6,1.6) y - getStdRandom $ randomR (-1.0,1.0) return (Vertex3 x y (-1))

[Haskell-cafe] Haskell source AST zipper with state

2012-05-02 Thread Tony Morris
Is there a library to traverse a source AST keeping state? -- Tony Morris http://tmorris.net/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] heterogeneous environment

2012-05-02 Thread Ben
thanks oleg and heinrich for the solutions; i'll definitely take a look at the vault package. i'll probably end up using unsafeCoerce though, it's too tempting (shame on me.) On May 2, 2012, at 2:33 AM, o...@okmij.org wrote: It seems you actually prefer this solution, if it worked. This

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

2012-05-02 Thread Andrew Seniuk
On Wed, May 2, 2012 at 7:20 PM, Tony Morris tonymor...@gmail.com wrote: Is there a library to traverse a source AST keeping state? Hi Tony, I was able to do this [1] using haskell-src-exts and a state monad. AST traversal is possible due to HSE deriving instances for Data in all its datatype

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

2012-05-02 Thread Patrick Palka
Because GLfloat is simply a newtype wrapper for CFloat, which has a Random instance, I would do: {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} deriving instance Random GLFloat On Wed, May 2, 2012 at 6:29 PM, Mark Spezzano mark.spezz...@chariot.net.auwrote: Hi

[Haskell-cafe] Haskell Weekly News: Issue 225

2012-05-02 Thread Daniel Santa Cruz
Welcome to issue 225 of the HWN, an issue covering crowd-sourced bits of information about Haskell from around the web. This issue covers the week of April 22 to 28, 2012. Announcements Matthias Fischmann made a call for participation to the Hong Kong Haskell hackathon, with tentative

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

2012-05-02 Thread Mark Spezzano
Hi, I tried this but now I get another error: The data constructors of `GLfloat' are not all in scope so you cannot derive an instance for it In the stand-alone deriving instance for `Random GLfloat' Mark On 03/05/2012, at 10:39 AM, Patrick Palka wrote: Because GLfloat is simply a

Re: [Haskell-cafe] Learn you

2012-05-02 Thread Richard O'Keefe
On 3/05/2012, at 5:18 AM, Brent Yorgey wrote: I am curious how the title was translated. Of course, the English title Learn You a Haskell for Great Good uses intentionally ungrammatical/unidiomatic English for humorous effect. Is the Japanese title also ungrammatical/unidiomatic Japanese?