[Haskell] [ANN] GenCheck - a generalized property-based testing framework

2012-06-19 Thread Jacques Carette
Test.GenCheck is a Haskell library for /generalized proposition-based testing/. It simultaneously generalizes *QuickCheck* and *SmallCheck*. Its main novel features are: * introduces a number of /testing strategies/ and /strategy combinators/ * introduces a variety of test execution methods

Re: [Haskell] Articles on the value of strong typing

2007-03-26 Thread Jacques Carette
As far as published studies, I have found many through the Psychology of Programming Interest Group, which has a web site http://www.ppig.org/ and an archived mailing list http://www.mail-archive.com/discuss%40ppig.org/ with a fairly high density of reports on (formal) empirical studies on relat

Re: [Haskell] Generator Function for Prime Numbers

2007-03-12 Thread Jacques Carette
And yet Taral would be wrong and Dave Feustel correct: http://mathworld.wolfram.com/Prime-GeneratingPolynomial.html There is a polynomial (of degree 25) in 26 variables which generates only primes whenever it is positive. Surprising, yes it is. Note that this polynomial is actually rarely pos

[Haskell] Re: Replacing and improving pattern guards with PMC syntax

2006-10-04 Thread Jacques Carette
Claus Reinke wrote: My own awkward-looking translations were driven by having found two tool's in Haskell that come close to this ideal, even if the syntax is awkward: the mapping of pattern-match failure to "fail" in do-notation, and the use of "fail msg=mzero" in MonadPlus. By these means, matc

Re: [Haskell] Design guidance sought for Ranged Sets

2005-12-21 Thread Jacques Carette
If you decide to continue working with infinite sets, then my advice would be to change your representation. For infinite sets, do not use an implicit representation (ie like a potentially infinite list) but switch to an explicit symbolic-generator representation. In other words, you need to

Re: [Haskell] PROPOSAL: class aliases

2005-10-13 Thread Jacques Carette
Paul Govereau wrote: Of course, if we allow union and subtraction, then why not addition, intersection, complement (ok, maybe not complement). Class definitions (including constraints and defaults) are essentially (syntactic) theory signatures (as in Institutions, from Goguen, Burstall, an

Re: [Haskell] Literal for Infinity

2005-09-29 Thread Jacques Carette
The IEEE 754 standard says (fairly clearly) that +1.0 / +0.0 is one of the most 'stable' definitions of Infinity (in Float at least). Throwing an exception is also regarded as a possibility in IEEE 754, but it is expected that that is not the default, as experience shows that that is a sub-

Re: [Haskell] Re: Proposal: Relative Module Imports

2005-05-04 Thread Jacques Carette
Samuel Bronson <[EMAIL PROTECTED]> wrote: On 5/3/05, S. Alexander Jacobson alexjacobson.com> wrote: > Problem: We need a way to simplify module imports. > Idea: Allow module relative imports in a manner that does not break > any existing code. I almost want "import Text.HaXML.XML.{Types,Escape,Pre

Re: [Haskell] MonadPlus

2005-04-30 Thread Jacques Carette
Jan-Willem Maessen <[EMAIL PROTECTED]> wrote: > ...discussion of the laws of MonadPlus reinforces to me the real > need for being able to declare the laws that a typeclass should > satisfy, not just the signature. On this I cannot but agree. But we don't usually count on being able to prove the

Re: [Haskell] MonadPlus

2005-04-30 Thread Jacques Carette
Ashley Yakeley <[EMAIL PROTECTED]> wrote: I've added a bit more to . I highly recommend people read it before they start claiming in papers that such-and-such a type "may thus be an instance of MonadPlus". Very nice. One of the problems I have encountered with

RE: [Haskell] Re: Type of y f = f . f

2005-03-01 Thread Jacques Carette
It is really too bad the 'middle' version does not work, ie John Fairbarn's version > d1 :: (forall c . b c -> c) -> b (b a) -> a > d1 f = f . f John Meacham's version (dual (?)) > d2 :: (forall c . c -> b c) -> a -> b (b a) > d2 f = f . f Or something in the middle > d3 :: forall e a b . (fo

Re: [Haskell] Typing in haskell and mathematics

2005-01-28 Thread Jacques Carette
Tomasz Zielonka <[EMAIL PROTECTED]> wrote: It's not as bad as you think. You can do this: {-# OPTIONS -fglasgow-exts #-} module Apply where class Apply f a b | f -> a, f -> b where apply :: f -> a -> b instance Apply (a -> b) a b where apply f a = f a instance Ap

[Haskell] Typing in haskell and mathematics

2005-01-28 Thread Jacques Carette
The previous post on record syntax reminded me of some 'problems' I had noticed where Haskell and mathematics have a (deep) usage mismatch. First, consider a syntax for other component-wise function application? For example, it would be convenient to have (f,g) @ (x,y) be (f x, g y). In some l

Re: [Haskell] Re: [Haskell-cafe] field record update syntax

2005-01-28 Thread Jacques Carette
"S. Alexander Jacobson" <[EMAIL PROTECTED]> wrote: (Moved to Haskell list because this is now a suggestion for the language) I do a lot of this soft of thing. foo {bar = fn $ bar foo ,baz = fn2 $ baz foo } It would be much nicer if this syntax did the equivalent: foo {bar \= fn

RE: [Haskell] is $ a no-op?

2004-10-13 Thread Jacques Carette
> > -- It's kind of like an converse map. > > I have attempted, unsuccessfully, to write flist above in a point-free > manner. Is it possible? > Of course it is, but why? > flist = flip (map . flip ($)) Some functions are simpler point-free, others are simpler with points. I was curious abou

RE: [Haskell] is $ a no-op?

2004-10-13 Thread Jacques Carette
> -- |Apply list of functions to some value, returning list of results. > -- It's kind of like an converse map. > flist :: [a->b] -> a -> [b] > flist fs a = map ($ a) fs I have attempted, unsuccessfully, to write flist above in a point-free manner. Is it possible? Jacques _

RE: [Haskell] 2-D Plots, graphical representation of massive data

2004-08-27 Thread Jacques Carette
I said: > One could create Haskell libraries that are matlab-like, but most of > the advantages of haskell (ie stong typing) are not realizable in > Haskell. To express even the most basic of matrix datatypes and > operations requires dependent types. Jerzy Karcmarczuk replied: > I did not unde

RE: [Haskell] Dependent types, was:2-D Plots, graphical representation of massive data

2004-08-27 Thread Jacques Carette
> I think Jacques possibly means the ability to do static checking of matrix > and vector extents, to make sure that you don't try to perform operations > like matrix-vector multiply on operands whose extents do not match. If you > want to have this ability on your language, then you will have to r

Re: [Haskell] 2-D Plots, graphical representation of massive data

2004-08-26 Thread Jacques Carette
John Meacham <[EMAIL PROTECTED]> wrote: What would be cooler (IMHO) would be brining all of matlabs functionality into haskell via haskell libraries so one may use 'ghci' sort of as one uses matlab, but with the advantages haskell brings. One could create Haskell libraries that are matlab-like, but

[Haskell] Java class file reader

2004-07-14 Thread Jacques Carette
Does anyone have a Java class file reader (written in Haskell, naturally)? I have found a writer, but no reader? [Google came up empty...] If this does not exist (yet), any recommendations as to how one goes about reading such mixed binary data? Thanks for any help, Jacques

RE: Enum on Float/Double

2003-10-21 Thread Jacques Carette
The C function you are looking for is called 'nextafter', and is present on all systems/libraries that pretend to be fully IEEE-754 compliant (as this is a required function from the standard). It even takes a direction parameter (so you can do both nextafter and firstbefore). Since its API is si

RE: Random Permutations

2003-03-07 Thread Jacques Carette
Pertinent to this thread (though perhaps overkill) is the work of Flajolet et al on (fast) random generation of combinatorial structures for any structure given as a context-free grammar, including Permutation. In particular see http://citeseer.nj.nec.com/flajolet93calculus.html http://citeseer.nj