Re: [Haskell-cafe] Introducing FP Complete

2012-06-05 Thread aditya bhargava
Sounds exciting! On Tue, Jun 5, 2012 at 6:22 PM, Bartosz Milewski wrote: > You might have seen a few post by me mentioning FP Complete and asked > yourself the question: Who is this guy and what is FP Complete? > > I haven't been active in the Haskell community, as I'm a relative newcomer > to Ha

[Haskell-cafe] Have you seen this functor/contrafunctor combo?

2012-06-05 Thread Conal Elliott
> newtype Q p a = Q (p a -> a) > > instance ContraFunctor p => Functor (Q p) where > fmap h (Q w) = Q (h . w . cmap h) using "cmap" for contravariant map. For instance, p a = u -> a. > instance ContraFunctor p => Applicative (Q p) where > pure a = Q (pure a) > Q fs <*> Q as = Q (\ r -> >

Re: [Haskell-cafe] Introducing FP Complete

2012-06-05 Thread Johan Tibell
Welcome to the community Bartosz. -- Johan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Introducing FP Complete

2012-06-05 Thread Bartosz Milewski
You might have seen a few post by me mentioning FP Complete and asked yourself the question: Who is this guy and what is FP Complete? I haven't been active in the Haskell community, as I'm a relative newcomer to Haskell. I am better known in the C++ community where I've been promoting function

[Haskell-cafe] Typing Judgments for Haskell2010++

2012-06-05 Thread Shayan Najd Javadipour
Hi Haskell Cafe! To develop Haskell-Type-Exts (HTE) [1,2], I need to have typing judgments for each language construct in Haskell 2010 with two extensions: RankNTypes and local assumptions (GADTs, Type Functions and etc). Since I could not find any academic paper describing a type system supportin

[Haskell-cafe] [ANNOUNCE] cereal-0.3.5.2

2012-06-05 Thread Trevor Elliott
Hi Everyone, I'm happy to announce version 0.3.5.2[1] of the cereal serialization library. This is a bugfix release, mostly improving performance characteristics of the library. One noteable change is with runGetLazy, which will now perform as expected when a parser attempts to consume more

[Haskell-cafe] converting functional dependencies to type families

2012-06-05 Thread Henning Thielemann
Hi all, when I reported a typechecker performance problem related to functional dependencies http://hackage.haskell.org/trac/ghc/ticket/5970 I promised to try to convert from functional dependencies to type families. Thus I converted my code and the llvm package to type-families: htt

Re: [Haskell-cafe] Tests by properties: origin?

2012-06-05 Thread Richard O'Keefe
As far as I'm aware: - property-based testing wasn't new (think 'assertions' and then think 'branch coverage') - randomly generated test cases weren't new (look up 'fuzz testing') and there were tools like DGL to generate random test cases in a controlled sort of way + the *type-driven*

Re: [Haskell-cafe] attoparsec double precision, quickCheck and aeson

2012-06-05 Thread Warren Harris
On Jun 5, 2012, at 10:51 AM, Bryan O'Sullivan wrote: > On Tue, Jun 5, 2012 at 9:12 AM, Warren Harris > wrote: > > which helps in many cases, but for some the parsing seems bi-stable, > alternating between two imprecise double values and causing the test to fail. > I was wondering if anyone c

Re: [Haskell-cafe] attoparsec double precision, quickCheck and aeson

2012-06-05 Thread Johan Tibell
On Tue, Jun 5, 2012 at 10:51 AM, Bryan O'Sullivan wrote: > If you need the full precision, use rational instead. The double parser is > there because parsing floating point numbers is often a bottleneck, and > double intentionally trades speed for precision. Relevant code in https://github.com/bo

Re: [Haskell-cafe] Extending constraints

2012-06-05 Thread Bas van Dijk
On 5 June 2012 18:46, Gábor Lehel wrote: > I must be missing something, but this seems a bit useless to me. You > have a phantom type parameter on Proxy, and then you're hiding it. So > when you pattern match on ProxyWrapper you recover the fact that there > was a type which satisfies the constrai

Re: [Haskell-cafe] attoparsec double precision, quickCheck and aeson

2012-06-05 Thread Bryan O'Sullivan
On Tue, Jun 5, 2012 at 9:12 AM, Warren Harris wrote: > > which helps in many cases, but for some the parsing seems bi-stable, > alternating between two imprecise double values and causing the test to > fail. I was wondering if anyone could suggest a better work-around for this > problem, or explai

Re: [Haskell-cafe] attoparsec double precision, quickCheck and aeson

2012-06-05 Thread Warren Harris
On Jun 5, 2012, at 9:57 AM, Johan Tibell wrote: > I don't think applying == to something that contains floating point > values at the leaves makes much sense. You want some approxEq function > that uses approximate equality on floating point value or you want to > equality function that ignores t

Re: [Haskell-cafe] Install a script with Cabal?

2012-06-05 Thread Rogan Creswick
On Tue, Jun 5, 2012 at 4:28 AM, Ketil Malde wrote: > Rogan Creswick writes: > >>> I have a small project that installs a couple of Haskell tools and a >>> script that uses these. Cabal will of course build and install the >>> Haskell programs, but how can I get Cabal to install the script as >>>

Re: [Haskell-cafe] attoparsec double precision, quickCheck and aeson

2012-06-05 Thread Johan Tibell
On Tue, Jun 5, 2012 at 9:51 AM, Warren Harris wrote: > > On Jun 5, 2012, at 9:38 AM, Johan Tibell wrote: >> You want to perform your test as >> >>    d1 - d2 < epsilon > > What's the best way to do this though, since aeson's Value type already > provides instance Eq? I guess I can write my own su

Re: [Haskell-cafe] attoparsec double precision, quickCheck and aeson

2012-06-05 Thread Warren Harris
On Jun 5, 2012, at 9:38 AM, Johan Tibell wrote: > You want to perform your test as > >d1 - d2 < epsilon What's the best way to do this though, since aeson's Value type already provides instance Eq? I guess I can write my own suite of equality comparisons, but these aeson values are the lea

Re: [Haskell-cafe] Extending constraints

2012-06-05 Thread Gábor Lehel
On Tue, Jun 5, 2012 at 5:29 PM, Bas van Dijk wrote: > Hello, > > I have the following program: > > -- > {-# LANGUAGE ConstraintKinds #-} > {-# LANGUAGE ExistentialQuantification #-} > {-# LANGUAGE ScopedTypeVariables #-} > > i

Re: [Haskell-cafe] attoparsec double precision, quickCheck and aeson

2012-06-05 Thread Johan Tibell
On Tue, Jun 5, 2012 at 9:12 AM, Warren Harris wrote: > which helps in many cases, but for some the parsing seems bi-stable, > alternating between two imprecise double values and causing the test to fail. You want to perform your test as d1 - d2 < epsilon where epsilon is derived from the r

Re: [Haskell-cafe] Extending constraints

2012-06-05 Thread Andres Löh
What you want seems a bit tricky. > p :: ProxyWrapper Num > p = ProxyWrapper (Proxy :: Proxy Int) At this point, all you know about p is that it is a Num. You don't know that it is Typeable, because you choose to forget about that. You could give p the type 'ProxyWrapper (Ext Typeable Num)' and i

Re: [Haskell-cafe] Extending constraints

2012-06-05 Thread Bas van Dijk
On 5 June 2012 17:57, Bas van Dijk wrote: > It works. It turns out it doesn't work exactly as I want. Say I have this ProxyWrapper of Nums: p :: ProxyWrapper Num p = ProxyWrapper (Proxy :: Proxy Int) then the following would give a type error: oops :: TypeRep oops = typeOfInnerProxy p Cou

[Haskell-cafe] attoparsec double precision, quickCheck and aeson

2012-06-05 Thread Warren Harris
The double parser provided by Data.Attoparsec.ByteString.Char8 looses precision around the 13-15th decimal place (http://hackage.haskell.org/packages/archive/attoparsec/0.10.2.0/doc/html/Data-Attoparsec-ByteString-Char8.html#v:double). Unfortunately this reeks havoc with my attempts to write a q

Re: [Haskell-cafe] Installation of the New Haskell Platform

2012-06-05 Thread Mark Lentczner
As Brent said, each version of GHC needs to build its own copy of the packages you use in your projects. Conveniently, these are all kept in separate directories by GHC version, so you can leave your old ones around as you compile new ones with the new platform. However... Most users don't want m

Re: [Haskell-cafe] Extending constraints

2012-06-05 Thread Bas van Dijk
On 5 June 2012 17:52, Andres Löh wrote: > Hi Bas. > > I haven't thought about this for long, but ... > >> data ProxyWrapper constraint = >>    forall a. constraint a => ProxyWrapper (Proxy a) > > I'm assuming adding Typable a in ProxyWrapper is not an option for you? No, I would rather keep that

Re: [Haskell-cafe] Extending constraints

2012-06-05 Thread Andres Löh
Hi Bas. I haven't thought about this for long, but ... > data ProxyWrapper constraint = >    forall a. constraint a => ProxyWrapper (Proxy a) I'm assuming adding Typable a in ProxyWrapper is not an option for you? So then what about: class (c1 a, c2 a) => Ext c1 c2 a instance (c1 a, c2 a) => E

[Haskell-cafe] Extending constraints

2012-06-05 Thread Bas van Dijk
Hello, I have the following program: -- {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE ScopedTypeVariables #-} import Data.Proxy (Proxy) import Data.Typeable (Typeable, TypeRep, type

Re: [Haskell-cafe] Install a script with Cabal?

2012-06-05 Thread Ivan Perez
I spent quite some time going through the cabal docs to generate some files automatically with hails. I totally feel your pain :) What I'm going to suggest is not really a solution to your problem, but since modifying the hooks to install specific programs is not the best solution either, you migh

[Haskell-cafe] ANNOUNCE: hquantlib-0.0.2.3

2012-06-05 Thread Pavel Ryzhov
Hi Cafe, I'm pleased to announce that HQuantLib has been released recently after a year of sleep. This is mainly a technical release to clean up dependencies and refresh build infrastructure. The library is intended to be a functional port of QuantLib (http://quantlib.org), a free/open-source

Re: [Haskell-cafe] Fundeps and overlapping instances

2012-06-05 Thread Gábor Lehel
On Tue, Jun 5, 2012 at 4:18 AM, Etienne Laurin wrote: > > Thanks for the idea. Here it is. > > http://hackage.haskell.org/trac/ghc/wiki/TFvsFD > > I posted my comments on the matter along with many additional comments > and examples that I found. > Thanks! One part is confusing me. In the secti

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

2012-06-05 Thread Paolino
Very useful to get a gadt back to monotype without an existential, which would mean to use classes for future uses of it with its load of object oriented thinking. Thanks for sharing. paolino 2012/6/4 Ryan Ingram > Another option is to reify the type so that you can get it back somehow. > Here

Re: [Haskell-cafe] Install a script with Cabal?

2012-06-05 Thread Ketil Malde
Rogan Creswick writes: >> I have a small project that installs a couple of Haskell tools and a >> script that uses these. Cabal will of course build and install the >> Haskell programs, but how can I get Cabal to install the script as >> well? There's a host of UserHooks available¹, but it'd prob

Re: [Haskell-cafe] Building gtk on OS/X with platform 2012.2.0.0

2012-06-05 Thread Stuart Hungerford
On Tue, Jun 5, 2012 at 5:12 PM, Ivan Perez wrote: > This is a known issue ([1]), and my guess, according to [2], is that > it is fixed in the latest version ([3]), which has not been uploaded > to hackage yet. > > What happens if you install gtk from that repo instead? You may want > to try to ap

Re: [Haskell-cafe] Building gtk on OS/X with platform 2012.2.0.0

2012-06-05 Thread Ivan Perez
This is a known issue ([1]), and my guess, according to [2], is that it is fixed in the latest version ([3]), which has not been uploaded to hackage yet. What happens if you install gtk from that repo instead? You may want to try to apply the patch to the version of gtk2hs that is available on hac