[Haskell-cafe] Multi-param typeclass vs locally constrained typeclass methods

2013-09-18 Thread Jacques Carette
Could someone please explain what the difference (if any!), in semantics is between class Foo f = Bar f g where method1 :: f a - g a and class Bar' g where method2 :: Foo f = f a - g a ? Maybe the translation of the above to something lower level might help. [Note: f a - g a is just

Re: [Haskell-cafe] Multi-param typeclass vs locally constrained typeclass methods

2013-09-18 Thread Jacques Carette
On 13-09-18 08:54 AM, Roman Cheplyaka wrote: * Jacques Carette care...@mcmaster.ca [2013-09-18 08:21:51-0400] Could someone please explain what the difference (if any!), in semantics is between class Foo f = Bar f g where method1 :: f a - g a and class Bar' g where method2 :: Foo f = f

[Haskell-cafe] Strange cabal failure

2013-06-18 Thread Jacques Carette
In trying to install the lens package, it eventually tries to install transformers-compat-0.1.1.1 which in turn depends on transformers-0.3.0.0 -- however that asksk for transformers-0.3.0.0-3006d6ea13a2c10770bffd4de7a96dc9 which 1) is weird, and 2) doesn't exist!' What gives? Jacques

[Haskell-cafe] Workshop on Generic Programming, Second CFP

2013-06-10 Thread Jacques Carette
-chair), Indiana University Jacques Carette (co-chair), McMaster University Florian Rabe, Jacobs University Bremen Emilie Balland, INRIA Bordeaux Jeremy Siek, University of Colorado, Boulder Gabriel Dos Reis, Texas AM University Christophe Raffalli, Savoie University Anya Helene Bagge, Universitetet i

Re: [Haskell-cafe] Excercise on tagless final interpreters

2013-03-21 Thread Jacques Carette
On 13-03-21 06:32 AM, matteo vezzola wrote: I'm playing with tagless final interpreters reading [1], using a very simple language: class Ints repr where int :: Integer - repr Integer (.+.) :: repr Integer - repr Integer - repr Integer (.*.) :: repr Integer - repr Integer - repr

[Haskell-cafe] Workshop on Generic Programming

2013-03-18 Thread Jacques Carette
on. Program Committee - Jeremiah Willcock (co-chair), Indiana University Jacques Carette (co-chair), McMaster University Florian Rabe, Jacobs University Bremen Emilie Balland, INRIA Bordeaux Jeremy Siek, University of Colorado, Boulder Gabriel Dos Reis, Texas AM University Christophe

Re: [Haskell-cafe] monadic DSL for compile-time parser generator, not possible?

2013-03-12 Thread Jacques Carette
On 13-03-12 04:06 PM, Jeremy Shaw wrote: It would be pretty damn cool if you could create a data type for generically describing a monadic parser, and then use template haskell to generate a concrete parser from that data type. [...] I would like to suggest that while it would be cool, it is

Re: [Haskell-cafe] Compilers: Why do we need a core language?

2012-11-23 Thread Jacques Carette
On 22/11/2012 11:52 AM, Brandon Allbery wrote: On Thu, Nov 22, 2012 at 7:56 AM, Jacques Carette care...@mcmaster.ca mailto:care...@mcmaster.ca wrote: On 20/11/2012 6:08 PM, Richard O'Keefe wrote: On 21/11/2012, at 4:49 AM, c...@lavabit.com mailto:c...@lavabit.com wrote

Re: [Haskell-cafe] Compilers: Why do we need a core language?

2012-11-23 Thread Jacques Carette
On 22/11/2012 7:37 PM, Richard O'Keefe wrote: On 23/11/2012, at 1:56 AM, Jacques Carette wrote: Actually, here I disagree. It might be much 'easier' for the programmers to do it for a small core language, but it may turn out to be much, much less effective. I 'discovered' this when (co

Re: [Haskell-cafe] Compilers: Why do we need a core language?

2012-11-23 Thread Jacques Carette
On 23/11/2012 9:59 AM, Mike Meyer wrote: [...] I have to ask if your core language for Maple was larger than Maple? Yes. Maple 10 had 62 cases in its AST, we had 75 (p.13 of [1]) Jacques [1] http://www.cas.mcmaster.ca/~carette/publications/scp_MaplePE.pdf

Re: [Haskell-cafe] Compilers: Why do we need a core language?

2012-11-22 Thread Jacques Carette
On 20/11/2012 6:08 PM, Richard O'Keefe wrote: On 21/11/2012, at 4:49 AM, c...@lavabit.com wrote: Well, I don't know. Would it save some time? Why bother with a core language? For a high level language (and for this purpose, even Fortran 66 counts as high level) you really don't _want_ a

[Haskell-cafe] Does this have a name?

2012-11-05 Thread Jacques Carette
The function app1 f x = f = ($ x) or equivalently app2 f x = join (f * pure x) with type Monad m = m (a - m b) - a - m b ? Hoogle did not help. Jacques PS: a nice point-free version would be appreciated as well. I can easily change app1 and app2 myself to point-free with enough

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

2012-06-23 Thread Jacques Carette
On 12-06-23 04:26 AM, Roman Cheplyaka wrote: Hi, 1. Minor correction for your tutorial: reverse . reverse = id is called the involution property, not idempotency. Indeed! Fixed, thanks. 2. Writing haddock documentation would definitely increase the chances for GenCheck wide

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

2012-06-23 Thread Jacques Carette
On 12-06-23 04:38 AM, José Pedro Magalhães wrote: On Tue, Jun 19, 2012 at 4:04 PM, Jacques Carette care...@mcmaster.ca mailto:care...@mcmaster.ca wrote: User beware: this is gencheck-0.1, there are still a few rough edges. We plan to add a Template Haskell feature to this which

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

2012-06-20 Thread Jacques Carette
On 20/06/2012 6:56 AM, Henning Thielemann wrote: QuickCheck is Haskell-98 and thus is very portable. I see that GenCheck needs some more extensions - type families, multi-parameter type classes, what else? FlexibleContexts and FlexibleInstances. However, I am fairly sure that the

[Haskell-cafe] [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-cafe] [Haskell] [ANN] GenCheck - a generalized property-based testing framework

2012-06-19 Thread Jacques Carette
[Only cc:ing cafe] There are definite similarities, yes - I only became aware of testing-feat very recently. You seem to have concentrated more on efficiency, while we have focused more on the high-level modular design and on strategies. We should probably merge our efforts, if you are

Re: [Haskell-cafe] ANN: signed-multiset-0.1

2012-04-19 Thread Jacques Carette
On 19/04/2012 4:10 AM, Stefan Holdermans wrote: Release early, release often. Here's a second version: http://hackage.haskell.org/package/signed-multiset-0.2 Very cool. In the literature, we have found [1] that these are sometimes also called 'hybrid sets'. They do have some rather

Re: [Haskell-cafe] Why were unfailable patterns removed and fail added to Monad?

2012-01-20 Thread Jacques Carette
On 19/01/2012 10:19 PM, Edward Z. Yang wrote: In other words, MonadZero has no place in dealing with pattern match failure! I completely agree. See Bimonadic semantics for basic pattern matching calculi [1] for an exploration of just that. In the language of that paper, the issue is that

Re: [Haskell-cafe] Quickcheck research

2011-11-23 Thread Jacques Carette
On 11-11-23 08:28 PM, Jason Dagit wrote: On a similar line of reasoning, I've wondered if Perlin style noise generation could be applied to get a sort of fuzzing effect. This would be more interesting for cases where writing instances of arbitrary is hard to do but test cases do exist. Apply

Re: [Haskell-cafe] Quickcheck research

2011-11-22 Thread Jacques Carette
On 22/11/2011 12:42 PM, wren ng thornton wrote: Something I think would be nice is to see full integration between SmallCheck and QuickCheck. In particular, I'd like to use SmallCheck to exhaustively search the small cases, and then use QuickCheck in a way that ensures that it only tests on

[Haskell-cafe] Standard 'decorator' class?

2011-09-23 Thread Jacques Carette
Has a class like class Decoration t where type Datum t :: * value :: t - Datum t been defined in any of the haskell packages on hackage? [There are so many variants on naming, it is rather difficult to search for this] Jacques ___

[Haskell-cafe] Post-doc position

2011-08-23 Thread Jacques Carette
in software design, with an emphasis on games, for multiple visual scales, from the iPod Touch to 60inch high-resolution screen panels. The Fellowship is part of the Gaming Scalability Environment (G-ScalE) project involving Dr. Jacques Carette (Computing and Software, Faculty of Engineering), Dr

[Haskell-cafe] llvm package on Windows

2011-04-03 Thread Jacques Carette
I am trying to install llvm-0.9.0.1 on Windows (through cygwin), on top of a clean install of Haskell Platform 2010.2.0.0. I do cabal install llvm --configure-option --with-llvm-prefix=C:\\llvm (which is where I unpacked llvm-gcc4.2-2.8-x86-mingw43.tar.bz2). This fails with

[Haskell-cafe] Language.C++ ?

2010-11-27 Thread Jacques Carette
Is anyone working on a Language.C++ module, similar to the wonderful Language.C ? Right now just the syntax and a pretty-printer would be really nice to have... Jacques ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Musings on type systems

2010-11-21 Thread Jacques Carette
On 21/11/2010 8:33 PM, wren ng thornton wrote: On 11/20/10 6:33 AM, Ketil Malde wrote: I guess this makes [X] an exponential type, although I don't remember seeing that term :-) Nope. (a-b) is the exponential type, namely |a-b| = |b|^|a|. [_] is just a solution to the recursive equation [x]

Re: [Haskell-cafe] vector-space and standard API for vectors

2010-11-04 Thread Jacques Carette
On 02/11/2010 8:16 PM, Conal Elliott wrote: Vector (Complex a) is a vector with respect to both 'a' and 'Complex a'. Even worse, () is a vector w.r.t. *every* scalar type. Why is this bad? () is the canonical 0-dimensional vector space. 0-dimensional vector spaces are very useful because

Re: [Haskell-cafe] vector-space and standard API for vectors

2010-10-23 Thread Jacques Carette
On 23/10/2010 5:19 PM, Daniel Peebles wrote: Just out of curiosity, why do you (and many others I've seen with similar proposals) talk about additive monoids? are they somehow fundamentally different from multiplicative monoids? People usually use additive notation for commutative monoids,

Re: [Haskell-cafe] Question about memory usage

2010-08-17 Thread Jacques Carette
Daniel Fischer wrote: On Aug 16, 2010, at 6:03 PM, Jacques Carette wrote: Any sequence of numbers given by a linear recurrence equation with constant coefficients can be computed quickly using asymptotically efficient matrix operations. In fact, the code to do this can be derived

Re: [Haskell-cafe] Question about memory usage

2010-08-16 Thread Jacques Carette
Since we're off-topic... Any sequence of numbers given by a linear recurrence equation with constant coefficients can be computed quickly using asymptotically efficient matrix operations. In fact, the code to do this can be derived automatically from the recurrence itself. Here is what you

Re: [Haskell-cafe] Re: Difficulties with tagless - create primitives or compose them

2010-06-14 Thread Jacques Carette
Günther Schmidt wrote: I have recently found something new that might also prove to be useful for EDSLs. http://blog.sigfpe.com/2009/05/three-projections-of-doctor-futamura.html Dan's blog post doesn't give any code or implementation but in a way it tackles the same problem, and since you

Re: [Haskell-cafe] Difficulties with tagless - create primitives or compose them

2010-06-13 Thread Jacques Carette
Excellent answer! Splitting the Symantics class into pieces is one of the techniques that we didn't need for solving the original problem (tagless partial evaluation without resorting to fancy types) that set us on this track. Which is too bad, because it would have made a nice addition. The

Re: [Haskell-cafe] Re: Functions of type foo :: f a - g a

2010-05-13 Thread Jacques Carette
[I work with Gordon on this] The problem domain is test frameworks, more specifically proposition-based testing.  We are most of the way through unifying QuickCheck and SmallCheck (as well as untangling the various 'stages'), and are now generalizing. The generator is obvious.  The 'reducer'

Re: [Haskell-cafe] Would it be evil to add deriving Typeable to newtype Q?

2010-05-09 Thread Jacques Carette
Mike Dillon wrote: begin Ivan Lazar Miljenovic quotation: I take it you haven't had the legal problems that DrIFT had when it used to be called Derive? http://www.dcs.gla.ac.uk/~nww/Derive/History.html Looks like they stopped selling it in June 2007, at least in the UK:

Re: [Haskell-cafe] Seeking the correct quote

2010-04-28 Thread Jacques Carette
Bradford Larsen wrote: I don't have the book handy (it was from the library), but I seem to remember reading something along those lines in ``Datatype-Generic Programming: International Spring School, SSDGP 2006, Nottingham, UK, April 24-27, 2006, Revised Lectures'', edited by Backhouse,

[Haskell-cafe] Seeking the correct quote

2010-04-27 Thread Jacques Carette
I have heard generic programming described tongue-in-cheek as the kind of polymorphism that a language does not (yet) have. I find this description rather apt, and it matches fairly what I see called 'generic' in various communities. But who said this, where and when? Jacques

Re: [Haskell-cafe] Seeking the correct quote

2010-04-27 Thread Jacques Carette
Bradford Larsen wrote: On Tue, Apr 27, 2010 at 4:23 PM, Jacques Carette care...@mcmaster.ca wrote: I have heard generic programming described tongue-in-cheek as the kind of polymorphism that a language does not (yet) have. I find this description rather apt, and it matches fairly what I

Re: [Haskell-cafe] Seeking the correct quote

2010-04-27 Thread Jacques Carette
Sterling Clover wrote: I first encountered this quip on ltu: http://lambda-the-ultimate.org/node/1926#comment-23411 However, that comment doesn't give a source either. Probably where I remembered it from too. I'll continue searching - it's a good quote! Jacques

Re: [Haskell-cafe] Re: Metaprogramming in Haskell vs. Ocaml

2010-04-06 Thread Jacques Carette
One thing I should have mentionned - TH and camlp4 are really equivalents. And camlp4 is as-typed-as TH (or not, depending on your point of view). I am co-author of a camlp4 extension, and I must admit that coding in camlp4 was not enjoyable, while coding in metaocaml (eventually) is. [I

Re: [Haskell-cafe] Metaprogramming in Haskell vs. Ocaml

2010-04-05 Thread Jacques Carette
Don Stewart wrote: I think we don't see as much metaprogramming because of other language features -- laziness, operator syntax, and type classes -- make a bunch of common designs work without needing metaprogramming. While true, there are also 2 other reasons for meta-programmers are not

Re: [Haskell-cafe] Metaprogramming in Haskell vs. Ocaml

2010-04-05 Thread Jacques Carette
Jason Dagit wrote: While true, there are also 2 other reasons for meta-programmers are not all over Haskell: 1. efficiency nuts are already using C++ templates and don't see why they would switch, 2. people who care about types use a typed meta-language (like

Re: [Haskell-cafe] Metaprogramming in Haskell vs. Ocaml

2010-04-05 Thread Jacques Carette
Casey McCann wrote: Not to speak for Jacques, :-) and then you followed that up with a post with which I fully agree. Jacques but my impression is that while TH itself is typed--it's just more Haskell after all--it doesn't do much to prevent you from generating code that is not well-typed.

Re: [Haskell-cafe] more thoughts on Finally tagless

2010-03-08 Thread Jacques Carette
Stephen Tetley wrote: The finally tagless style is an implementation of the TypeCase pattern (Bruno C. d. S. Oliveira and Jeremy Gibbons): One part of our work does that, yes. The authors of the Finally Tagless note in the long version of their paper that the GADT TypeCase had some

Re: [Haskell-cafe] more thoughts on Finally tagless

2010-03-08 Thread Jacques Carette
Günther Schmidt wrote: In Olegs haskell implementation he is using classes mainly to model the syntax and instances to use for evaluators / compilers to allow multiple interpretations. When there are 3 authors on a paper (and in the implementation file), it is customary to acknowledge all 3,

Re: [Haskell-cafe] Finally tagless and abstract relational Algebra

2009-12-28 Thread Jacques Carette
Günther Schmidt wrote: My guess is that finally tagless style allows one to create a syntax without any initial dependency to an implementation. Ie. once one has created the syntax in this style one can then proceed to construct terms. Yes. So this is my goal, create a syntax for relational

Re: [Haskell-cafe] Finally tagless and abstract relational Algebra

2009-12-28 Thread Jacques Carette
Günther Schmidt wrote: I do know that I could express my algorithms via list-comprehension or in a List Monad, all using tuples. And that would be concrete and grossly inefficient. You should probably tell us what these algorithms accomplish, rather than how one implementation goes. From a

[Haskell-cafe] lhs2tex, Haskell Platform and cygwin

2009-12-17 Thread Jacques Carette
I just downloaded a fresh copy of Haskell Platform, and successfully got cabal to update itself. I installed smallcheck-0.4 successfully too. But then I tried to install lhs2tex, which 'worked' until the point of saying: Linking dist\build\lhs2TeX\lhs2TeX.exe ... Installing executable(s) in

Re: [Haskell-cafe] Restrictions on associated types for classes

2009-12-17 Thread Jacques Carette
Which is 'right' in a way, since in the language Conor defined, all definable terms are infinitely differentiable, and that can be inferred from the given rules. That, in practice, you only need a finite number of them in any given computation is derivable from the instances, but is not a

Re: [Haskell-cafe] lhs2tex, Haskell Platform and cygwin

2009-12-17 Thread Jacques Carette
Stephen Tetley wrote: Hi Jacques Does it install properly by the runhaskell Setup.hs configure / build / install? I re-installed it this way a couple of weeks ago and it never mentioned mktexlsr. No, it doesn't. I first run into issues with exceptions-related issues (as you did), which I

Re: [Haskell-cafe] lhs2tex, Haskell Platform and cygwin

2009-12-17 Thread Jacques Carette
Some success now. Reverting to building by hand, if I 1. edit config.ml to put quotes around the name of the GHC executable (since it contains spaces AND () ), 2. edit Makefile to add -package base-3.0.3.1 on to the --make line, things proceed through the build and install stage properly.

[Haskell-cafe] Literate refactoring?

2009-11-19 Thread Jacques Carette
I'd like to ask the cafe's advice on how to 'do this right'. The situation is that we've got 2 literate Haskell programs which we would like to refactor. In fact, this refactoring will ultimately unify these 2 separate programs into a single framework. Every refactoring step is well-defined

Re: [Haskell-cafe] Finally tagless - stuck with implementation of lam

2009-10-15 Thread Jacques Carette
(sorry for the slow reply on this topic...) Robert Atkey and Oleg presented some very interesting code in response to your query. But some of you might (and should!) be asking why on earth did Jacques use unsafePerformIO?, especially when neither Robert nor Oleg did. Simply put: I answered

Re: [Haskell-cafe] CBN, CBV, Lazy in the same final tagless framework

2009-10-15 Thread Jacques Carette
Just a short note to show how the 3 evaluation orders can be written in a very symmetric manner: o...@okmij.org wrote these as: In call-by-name, we have lam f = S . return $ (unS . f . S) In call-by-value, we have lam f = S . return $ (\x - x = unS . f . S . return) In

Re: [Haskell-cafe] Num instances for 2-dimensional types

2009-10-05 Thread Jacques Carette
Lennart Augustsson wrote: Everyone agrees that the Haskell numeric hierarchy is flawed, but I've yet to see a good replacement. That's because the good replacement which is mathematically sound would be a real mess to work with -- for exactly the same reason that Functor , Applicative and

Re: [Haskell-cafe] Finally tagless - stuck with implementation of lam

2009-10-05 Thread Jacques Carette
It's possible, but it's not nice. You need to be able to get out of the monad to make the types match, i.e. lam f = I (return $ \x - let y = I (return x) in unsafePerformIO $ unI (f y)) The use of IO 'forces' lam to transform its effectful input into an even

Re: [Haskell-cafe] Finally tagless - stuck with implementation of lam

2009-10-05 Thread Jacques Carette
, that is disappointing in some way, guess I still have a lot to learn. Günther Am 05.10.2009, 18:06 Uhr, schrieb Jacques Carette care...@mcmaster.ca: It's possible, but it's not nice. You need to be able to get out of the monad to make the types match, i.e. lam f = I (return $ \x - let y

[Haskell-cafe] Issue with IsFunction/Vspace in GHC 6.10.1

2009-04-02 Thread Jacques Carette
I was playing with some of Oleg's code (at end for convenience). After minor adjustments for ghc 6.10.1, it still didn't work. The error message is quite puzzling too, as it suggests adding exactly the constraint which is present... Any ideas? Jacques -- Oleg's definition of a vector

Re: [Haskell-cafe] Issue with IsFunction/Vspace in GHC 6.10.1

2009-04-02 Thread Jacques Carette
Claus Reinke wrote: {-# LANGUAGE ScopedTypeVariables #-} without, the 'f's in the instance are independent. Claus Thanks - I discovered this (by trial-and-error) at about the same time you sent the email. Is there a ticket somewhere to add a warning about this? I expected me 'f's to be the

Re: [Haskell-cafe] Pattern combinators

2008-12-20 Thread Jacques Carette
Andrew Wagner wrote: Wadler posted a blog entry the other day about a paper on pattern-matching in Haskell (http://wadler.blogspot.com/). I've taken a first stab at turning it into actual code for hackage (http://hpaste.org/13215). There are two commented-out definitions that don't

[Haskell-cafe] Ambiguous type variable woes

2008-11-23 Thread Jacques Carette
I was trying to create a typeclass for an abstract Stack class, and ran into some problems. The following 'works' fine: {-# OPTIONS_GHC -XEmptyDataDecls -XFlexibleContexts -fno-monomorphism-restriction #-} module Stack where data Void class Stack s where push_ :: s a r - b - s b (s a r)

Re: [Haskell-cafe] Re: Strange space leak

2008-07-16 Thread Jacques Carette
apfelmus wrote: Grzegorz Chrupala wrote: split DOC . words . map toLower = (:[]) . words . map toLower Since you converted everything to lowercase, the string DOC will never appear in the text, resulting in a single huge document. Oops, that should have been obvious, sorry for the dumb

Re: [Haskell-cafe] A question about algebra and dependent typing

2008-07-14 Thread Jacques Carette
Claus Reinke wrote: You might find this interesting: @inproceedings{ fokker95explaining, author = Jeroen Fokker, title = Explaining Algebraic Theory with Functional Programs, booktitle = Functional Programming Languages in Education, pages = 139-158, year = 1995, url =

[Haskell-cafe] PLMMS - Last call for papers

2008-04-23 Thread Jacques Carette
for this, where papers from both PLMMS 2007 and 2008 will be considered. Programme Committee --- Jacques Carette (Co-Chair) (McMaster University, Canada) John Harrison (Intel Corporation, USA) Hugo Herbelin (INRIA, Ecole polytechnique, France) James McKinna

Re: [Haskell-cafe] Longest increasing subsequence

2008-04-10 Thread Jacques Carette
You can translate the following algorithm (written in Maple 11), which can be made purely functional. [For the cognoscenti: attributes are implemented in-place in Maple, but that is really just an instance of the Decorator pattern which can be just as easily implemented with a functional

[Haskell-cafe] 2nd CFP: PLMMS 2008

2008-03-05 Thread Jacques Carette
Reasoning. There will be a separate submission and review phase for this, where papers from both PLMMS 2007 and 2008 will be considered. Programme Committee --- Jacques Carette (Co-Chair) (McMaster University, Canada) John Harrison (Intel Corporation, USA) Hugo

Re: [Haskell-cafe] Graphical graph reduction

2008-02-24 Thread Jacques Carette
I think HOPS is what you are looking for http://www.cas.mcmaster.ca/~kahl/HOPS/ It may advertize itself otherwise, but the main thing you 'see' when running programs in fully explicit mode is exactly all the graph reductions. Jacques ___

[Haskell-cafe] CFP - PLMMS 2008

2008-01-31 Thread Jacques Carette
in a journal; papers from both PLMMS 2007 and 2008 will be considered here (details to follow). Programme Committee --- Jacques Carette (Co-Chair) (McMaster University, Canada) John Harrison (Intel Corporation, USA) Hugo Herbelin (INRIA, Ecole polytechnique

Re: [Haskell-cafe] Somewhat random history question - chicken and egg

2007-11-13 Thread Jacques Carette
[EMAIL PROTECTED] wrote: But... tell me please, ANYONE, who takes part in this inspiring exchange: How many COBOL programs have you written in your life? How many programs in Cobol have you actually SEEN? Shudder. In '86, I had to modify a COBOL code generator, *written in COBOL*. The

Re: [Haskell-cafe] ANN: Math.OEIS 0.1

2007-10-25 Thread Jacques Carette
Carl Witty wrote: On Mon, 2007-10-22 at 10:54 -0400, Brent Yorgey wrote: The Online Encyclopedia of Integer Sequences should really contain more Haskell code for describing the sequences. Agreed! I propose an OEIS party where we all sit around one day and

Re: [Haskell-cafe] How odd...

2007-08-11 Thread Jacques Carette
[Sorry for the long quote, but context is important] Dan Piponi wrote: It's fairly standard practice, when documenting functions of a complex variable, to specify precisely which 'branch cuts' are being used. Here's a quote from the Mathematica documentation describing their Log function:

Re: [Haskell-cafe] Re: [Haskell] View patterns in GHC: Request forfeedback

2007-07-27 Thread Jacques Carette
Others have already pointed this out, but it is worth saying again: Maybe is not the only monadic effect which makes sense during pattern-matching. Wolfram Kahl and I have explored some of these things as part of the Pattern Matching Calculus, http://sqrl.mcmaster.ca/~kahl/PMC/ [If you want

Re: [Haskell-cafe] Re: Mathematica

2007-06-12 Thread Jacques Carette
Jon Harrop wrote: On Tuesday 12 June 2007 18:41:34 Tomasz Zielonka wrote: On Sun, May 13, 2007 at 02:19:55PM +0100, Andrew Coppin wrote: Writing *insanely* efficient number chrunking software requires a deep understanding of the target architecture, and lots of playing with very

Re: [Haskell-cafe] Implementing Mathematica

2007-06-01 Thread Jacques Carette
Andrew Coppin wrote: Lennart Augustsson wrote: Why do you seem so in awe of Mathematica? Oh, well, I guess it is only the most powerful maths software ever written... no biggie. No, it is one of several. In very little time I can find 20 things that Maple does better than Mathematica. In

Re: [Haskell-cafe] Re: Implementing Mathematica

2007-05-31 Thread Jacques Carette
Jon Harrop wrote: Arbitrary precision integers are quite a performance burden and they are rarely used. I would not expect a language that is trying to be efficient to impose arbitrary precision integers (or floats). Apparently you have looked inside a computer *algebra* system, one that

[Haskell-cafe] Re: [Haskell] boilerplate boilerplate

2007-05-22 Thread Jacques Carette
Personally I would like {-# OPTIONS -fglasgow-exts -fgenerics -} module Blog.Types where family Usual = (Eq, Ord, Read, Show, Typeable) data BlogEntry = Entry EpochSeconds Name Email Title Body deriving Usual newtype Name = Name String deriving Usual newtype Title = Title String deriving

[Haskell-cafe] Programming Languages and Mechanised Mathematics -- deadline extension

2007-04-25 Thread Jacques Carette
30, 2007: Notification June 29-30, 2007: Workshop Program Committee Lennart Augustsson [Credit Suisse] Wieb Bosma [Radboud University Nijmegen, Netherlands] Jacques Carette (co-Chair) [McMaster University, Canada] David Delahaye [CNAM, France] Jean-Christophe Filliâtre [CNRS and Université de

Re: [Haskell-cafe] Is Template Haskell a suitable macro language?

2007-04-24 Thread Jacques Carette
Magnus Jonsson wrote: I have the same problem too when using Haskell. The more I try to enforce static guarantees the more I get lots of datatypes that are similar except for one or two constructors. The best way I have found to avoid this is to simply give up on some of the static guarantees

Re: [Haskell-cafe] Is Template Haskell a suitable macro language?

2007-04-24 Thread Jacques Carette
Josef Svenningsson wrote: On 4/24/07, Jacques Carette [EMAIL PROTECTED] wrote: In Ocaml, you can frequently use polymorphic variants to get the same effect. Which means that if you are willing to do enough type-class-hackery, it should, in principle, be possible to do the same in Haskell

Re: [Haskell-cafe] Unresolved overloading error

2007-03-31 Thread Jacques Carette
Bryan Burgers wrote: On 3/31/07, Scott Brown [EMAIL PROTECTED] wrote: It's working now, thank you. I changed the definition to binom n j = div (fac n) ((fac j)*(fac (n - j))) bernoulli n p j = fromIntegral(binom n j)*(p ^ j) * ((1 - p)^(n - j)) As a matter of style suggestion, it might

Re: [Haskell-cafe] Why the Prelude must die

2007-03-25 Thread Jacques Carette
Vivian McPhail wrote: What I want to push is a 'mathematically sound' numeric prelude. A proper numerical prelude should have bona fide mathematical obects like groups, rings, and fields underlying common numerical classes. It would be edifying to the student who discovered that the particular

Mathematics in Haskell Re: [Haskell-cafe] Why the Prelude must die

2007-03-25 Thread Jacques Carette
My main worry is that this can be a horrible time sink without a clear path to success and, worse, known obstacles in the way. For example: we know that all Monads are Functors, but that is not expressed in the type classes, because it would be too much a pain to do so. That pain is heavily

Re: [Haskell-cafe] Two Other AI Sources

2007-03-20 Thread Jacques Carette
Alfonso Acosta wrote: Just in case it helps, I ported the code of Norvigs Paradigms of Artificial Intelligence Programming chapter 8 (integrals and derivates) for a collage course. A link to this code would have been / would still be most appreciated. Jacques

[Haskell-cafe] CFP: Prog. Lang for Mechanized Mathematics Workshop

2007-03-12 Thread Jacques Carette
Deadline June 29-30, 2007: Workshop Program Committee Lennart Augustsson http://www.cs.chalmers.se/%7Eaugustss [Credit Suisse] Wieb Bosma http://www.math.ru.nl/%7Ebosma/[Radboud University Nijmegen, Netherlands] Jacques Carette http://www.cas.mcmaster.ca/%7Ecarette (co-Chair) [McMaster

[Haskell-cafe] Declaring variance of class parameters?

2007-02-27 Thread Jacques Carette
If I have a class, say class Symantics repr where int:: Int - repr Int and so on, I would like to *require* that 'repr' be covariant. Is there any way to do that? Jacques ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] What inhabits this type: (forall a. a - b) - (forall a. m a - m b)

2007-02-27 Thread Jacques Carette
Since my last query was answered so quickly, let's try another. I have looked on Hoogle. I would have asked Djinn, but I don't have it around. So, can someone find a term that inhabits (forall a. a - b) - (forall a. m a - m b) ? I think of this as the type of functions that, given a

Re: [Haskell-cafe] Is Excel the most used -- and fucntional -- programming lanuage on Earth?

2007-01-30 Thread Jacques Carette
There is a Maple plug-in for Excel. If you have Maple (on Windows), just start Excel and you'll see extra buttons. This allows you to have cells containing symbols, as well as access to all of Maple's functions. This easily gets you a (very impure!) higher-order functional language

Re: [Haskell-cafe] Channel9 Interview: Software Composability and the Future of Languages

2007-01-27 Thread Jacques Carette
Tim Newsham wrote: I have to write: do { x - getSomeNum y - anotherWayToGetANum return (x + y) } even if the computation of x and y are completely independant of each other. I too have really missed a parallel composition operator to do something like the above.

Re: Stronger static types, was Re: [Haskell-cafe] Re: Versioning

2006-12-22 Thread Jacques Carette
Brian Hulley wrote: Would it be possible to augment Haskell's type system so that it was the same as that used in Epigram? No, no! Epigram is a wonderfully pure research experiment in one corner of the design space. The corner it is exploring is not particularly Haskell like, though the

Re: [Haskell-cafe] Re: Versioning

2006-12-21 Thread Jacques Carette
Lennart Augustsson wrote: I must second this opinion. There's this (false) perception that you need all kinds of extensions to make Haskell usable. It's simply not true. Certain extensions can make your life easier, but that's it. To write code in Haskell, this is true. However, one of

Re: [Haskell-cafe] Re: Versioning

2006-12-21 Thread Jacques Carette
Neil Mitchell wrote: In other words, you can program in Haskell just fine without extensions. But if you want that next level in type safety, extensions is where it's at, at least for the kind of code I write. What level of safety do these type extensions give you? Check out many, many, many

Stronger static types, was Re: [Haskell-cafe] Re: Versioning

2006-12-21 Thread Jacques Carette
Yes, dependent types have a lot to do with all this. And I am an eager lurker of all this Epigram. Scott Brickner wrote: Jacques Carette wrote: Array out-of-bounds, fromJust, head on an empty list, and pattern-match failures are in my list of things I wish the type system could help me

Re: [Haskell-cafe] AT solution: rebinding = for restricted monads

2006-12-19 Thread Jacques Carette
David Roundy wrote: The trouble is that your solution doesn't allow you to use do-notation with the IxMonad. And if you did allow yourself to use do-notation by rebinding (=), etc, then you wouldn't be able to use ordinary monads with do-notation in the same module. That's what makes things

[Haskell-cafe] On the various faces of Composition

2006-12-19 Thread Jacques Carette
[As recently seen on LtU - http://lambda-the-ultimate.org/node/1919] An amazing paper http://www.dbmcintyre.pwp.blueyonder.co.uk/index_f/menu_f/j_f/apl95.pdf on composition as seen from APL and J. The terminology (using verbs, nouns, adverbs, etc) is _so_ much more evocative than the

Re: [Haskell-cafe] AT solution: rebinding = for restricted monads

2006-12-19 Thread Jacques Carette
First, I believe that this paper http://homepages.inf.ed.ac.uk/ratkey/param-notions.pdf is intimately related to WitnessMonad. David Roundy wrote: Rebinding the do notation is at least reasonably clean, it's just that we don't want to lose the ability to mix with ordinary monads. This

Re: [Haskell-cafe] Re: Debugging partial functions by the rules

2006-11-15 Thread Jacques Carette
Robert Dockins wrote: Or how about ?? lookupVarible target env = case [ v | (n,v) - env, n==target ] of (x:_) - x _ - assert False $ BUG: Unexpected variable out of scope ++(show target)++ in environment ++(show env) Other have pointed out that, in the CURRENT Haskell

Re: [Haskell-cafe] A type class puzzle

2006-10-31 Thread Jacques Carette
Greg Buchholz wrote: I guess it just looks really strange to my eyes. For example, foo and bar are legal, but baz isn't. That's what I was thinking of the situation, but I guess the type classes iron out the differences. foo :: Int - Int - Int - Int foo 0 = (+) bar :: Int - Int - Int

Re: [Haskell-cafe] Re: Numeric type classes

2006-09-20 Thread Jacques Carette
Whenever people start discussing the Numeric type classes, the true scope of what a refactoring can (and should?) be is frequently under-estimated. The 'structure' of algebraic objects in mathematics has been studied quite a lot (in mathematics and in CS, but not so much by programming

Re: [Haskell-cafe] Re: Numeric type classes

2006-09-14 Thread Jacques Carette
David Menendez wrote: * Having (+) work on lists, tuples and all the other monoids would make error messages more complicated. It gets worse than that. Imagine trying to explain to someone why 1 + sin is actually \a - const 1 a + sin a. It isn't that hard - it is done routinely in

Re: [Haskell-cafe] Re: Numeric type classes

2006-09-14 Thread Jacques Carette
[EMAIL PROTECTED] wrote: That is what polymorphism is all about! Not in this context, sorry. This is a convention. Another one may give you an abomination, e.g., 1+sin means 1 plus the addres of the sin routine. (Of course not in a 'decent' language, but I know a few undecent. No, it is

Re: [Haskell-cafe] Re: Numeric type classes

2006-09-13 Thread Jacques Carette
Your solution would imply[1] that all Rational are multiplicatively invertible -- which they are not. The Rationals are not a multiplicative group -- although the _positive_ Rationals are. You can't express this in Haskell's type system AFAIK. Your basic point is correct: if you are willing

  1   2   >