[Haskell-cafe] Lenses that work with Arrows

2013-10-07 Thread Tom Ellis
Dear all, I introduce a very simple extension to the Lens datatype from Control.Lens that allows it to work with Arrows: https://gist.github.com/tomjaguarpaw/6865080 I would particularly like to discuss this with authors of Control.Lens to see if such an idea is suitable for inclusion in

Re: [Haskell-cafe] A question regarding reading CPP definitions from a C header

2013-10-07 Thread Malcolm Wallace
If you use cpphs as a library, there is an API called runCpphsReturningSymTab. Thence you can throw away the actual pre-preprocessed result text, keep only the symbol table, and lookup whatever macros you wish to find their values. I suggest you make this into a little code-generator, to

[Haskell-cafe] typeclass to select a list element

2013-10-07 Thread Paolino
Hello, I'm trying to use a type class to select an element from a list. I would like to have a String CC as a value for l10'. {-# LANGUAGE MultiParamTypeClasses, GADTs,FlexibleInstances, DataKinds ,TypeFamilies, KindSignatures, FlexibleContexts, OverlappingInstances, StandaloneDeriving,

Re: [Haskell-cafe] Lifting IO actions into Applicatives

2013-10-07 Thread Daniil Frumin
Isn't it the case that there could be more than one natural transformation between functors? On Tue, Oct 1, 2013 at 10:00 PM, John Wiegley jo...@fpcomplete.com wrote: Yitzchak Gale g...@sefer.org writes: In fact, it even makes sense to define it as FunctorIO, with the only laws being

Re: [Haskell-cafe] Lifting IO actions into Applicatives

2013-10-07 Thread Tom Ellis
On Mon, Oct 07, 2013 at 07:57:23PM +0400, Daniil Frumin wrote: Isn't it the case that there could be more than one natural transformation between functors? Definitely. In addition rwbarton responded to my challenge by finding two different applicative morphisms between the same applicative,

Re: [Haskell-cafe] Lifting IO actions into Applicatives

2013-10-07 Thread John Wiegley
Daniil Frumin difru...@gmail.com writes: Isn't it the case that there could be more than one natural transformation between functors? Yes, I imagine there would have to be some newtype wrappers to distinguish in those cases. -- John Wiegley FP Complete Haskell tools,

Re: [Haskell-cafe] Lenses that work with Arrows

2013-10-07 Thread Niklas Haas
On Mon, 7 Oct 2013 10:40:13 +0100, Tom Ellis tom-lists-haskell-cafe-2...@jaguarpaw.co.uk wrote: Dear all, I introduce a very simple extension to the Lens datatype from Control.Lens that allows it to work with Arrows: https://gist.github.com/tomjaguarpaw/6865080 I would particularly

Re: [Haskell-cafe] Lenses that work with Arrows

2013-10-07 Thread Tom Ellis
On Mon, Oct 07, 2013 at 07:14:44PM +0200, Niklas Haas wrote: On Mon, 7 Oct 2013 10:40:13 +0100, Tom Ellis tom-lists-haskell-cafe-2...@jaguarpaw.co.uk wrote: I introduce a very simple extension to the Lens datatype from Control.Lens that allows it to work with Arrows:

Re: [Haskell-cafe] Lenses that work with Arrows

2013-10-07 Thread Tom Ellis
On Mon, Oct 07, 2013 at 06:22:33PM +0100, Tom Ellis wrote: On Mon, Oct 07, 2013 at 07:14:44PM +0200, Niklas Haas wrote: On Mon, 7 Oct 2013 10:40:13 +0100, Tom Ellis tom-lists-haskell-cafe-2...@jaguarpaw.co.uk wrote: I introduce a very simple extension to the Lens datatype from

Re: [Haskell-cafe] A question regarding reading CPP definitions from a C header

2013-10-07 Thread Ömer Sinan Ağacan
Thanks for your answer, looks like this is my only option to do this. Can you provide some information about what does parameters of runCpphsReturningSymTab stands for? I made several attempts but couldn't get any useful return value. For example, I have no idea what does third parameter does.

Re: [Haskell-cafe] A question regarding reading CPP definitions from a C header

2013-10-07 Thread Carl Howells
Have you looked into using hsc2hs? If I understand your problem, it's designed exactly to solve it. -- Carl On Mon, Oct 7, 2013 at 12:20 PM, Ömer Sinan Ağacan omeraga...@gmail.comwrote: Thanks for your answer, looks like this is my only option to do this. Can you provide some information

[Haskell-cafe] Using Quick Check generators for getting arbitrary value streams

2013-10-07 Thread Luke Evans
I was hoping I could use Arbitrary instances to generate streams of values for test data. It looks like you're not 'supposed' to be trying this, other than for the specific purpose of then testing some properties on these streams within Quick Check itself. I'm looking for something like the

Re: [Haskell-cafe] A question regarding reading CPP definitions from a C header

2013-10-07 Thread Ömer Sinan Ağacan
Carl, thank you very much. This is exactly what I was looking for, and it solved my problem in 5 minutes. What's awesome is that when Cabal finds a .hsc file it automatically calls this tool. Great. Thanks again. --- Ömer Sinan Ağacan http://osa1.net 2013/10/8 Carl Howells

[Haskell-cafe] POSA

2013-10-07 Thread 山本和彦
Hi all, Michael Snoyman, Andreas Voellmy and I are invited to write an article about Warp to The Performance of Open Source Applications: http://aosabook.org/en/index.html It is now open to the public including our article. http://aosabook.org/en/posa/warp.html Enjoy! --Kazu