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] 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] 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] 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] 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

[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] 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,

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] 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] 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: 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] Re: [Haskell] installing streams library

2006-05-31 Thread Jacques Carette
[See comments at bottom] Bulat Ziganshin wrote: Finally i've implemented the following (you then would use 'withForeignPtr' to work with contents of ForeignPtr): -- - -- Encode/decode contents of memory buffer

Re: [Haskell-cafe] Re: [Haskell] installing streams library

2006-05-31 Thread Jacques Carette
You would need to define a type class (Binary a) = EncodedPtr a b where the 'a' is as you have it currently, and the b would be an enumerated type which tracks the memory representation. I agree they are different concepts - that is why an EncodedPtr would require 2 type parameters. Of

Re: [Haskell-cafe] Re: [Haskell] installing streams library

2006-05-31 Thread Jacques Carette
I have no problems with marshalling/unmarshalling (and even with the implicit casting going on). What I dislike is having a bunch of functions which are the same but with different names, where the difference boils down to enumerated types that end up being encoded in the function name.

Re: [Haskell-cafe] Re: [Haskell] installing streams library

2006-05-31 Thread Jacques Carette
Bulat Ziganshin wrote: i'm not against your idea, you absolutely right that this will be more Haskell way, but can this be implemented without additional complications for library users? C is a language which pushes the boundaries of no complications (ie convenience) quite far (and yet

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

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-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] 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: 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] 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: 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: 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] 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: [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

[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

[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] 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] 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] 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] 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] 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 =

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] 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

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

[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

[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.

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

Re: [Haskell-cafe] Re: [Haskell] Typing in haskell and mathematics

2005-01-28 Thread Jacques Carette
[I have now subscribed to haskell-cafe] Henning Thielemann [EMAIL PROTECTED] wrote: This seems to be related to what I wrote yesterday http://www.haskell.org/pipermail/haskell-cafe/2005-January/008893.html Yes, very much. Except that rather than trying to tell mathematicians that they are

[Haskell-cafe] Re: [Haskell] Typing in haskell and mathematics

2005-01-31 Thread Jacques Carette
[My apologies for not seeing the related discussion yesterday on haskell-cafe, I was not subscribed until just now] Iavor Diatchki [EMAIL PROTECTED] wrote: On Fri, 28 Jan 2005 10:01:33 -0500, Jacques Carette [EMAIL PROTECTED] wrote: The previous post on record syntax reminded me of some

[Haskell-cafe] Top 20 ``things'' to know in Haskell

2005-02-07 Thread Jacques Carette
The recent post of Graham Klyne (below) reminds me that I have meant to ask: is there a ``top 20'' things a serious programmer should know when writing code in Haskell? Of course there is a lot of programming language theory that would be great to know, but I mean really down-to-earth things like

Re: [Haskell-cafe] What is MonadPlus good for?

2005-02-14 Thread Jacques Carette
Josef Svenningsson [EMAIL PROTECTED] wrote: You claimed that monad transformers break the mzero-is-right-identity-for-bind law because they can be applied to IO. I say, it's not the monad transformers fault. They cannot possibly be expected to repair the law if they are given a faulty monad.

Re: [Haskell-cafe] Point-free style

2005-02-14 Thread Jacques Carette
Thomas Jäger [EMAIL PROTECTED] wrote: On Mon, 14 Feb 2005 11:07:48 +0100, Daniel Fischer And could one define \f g h x y - f (g x) (h y) point-free? sure, ((flip . ((.) .)) .) . (.) That occurence of flip cannot (AFAIK) be removed, indicating that as far as natural composition is concerned,

Re: [Haskell-cafe] module Crypt_Discordian - code critique requested

2005-02-23 Thread Jacques Carette
Were I to write the same code as Terrence Brannon [EMAIL PROTECTED] wrote: module Crypt_Discordian where import List vowel_list = aeiouAEIOU is_vowel c = c `elem` vowel_list move_vowels lis = move_vowels' lis [] [] move_vowels' [] c v = v ++ c move_vowels' (x:xs) c v | is_vowel x =

RE: [Haskell-cafe] Symbolic differentation using GHC's simplificationrules

2005-03-22 Thread Jacques Carette
I tried to implement symbolic differentation using GHC's simplification rules. I assume that someone has already thought about this, right? You are trying to do 'intensional programming' via GHC's simplification rules, ouch! You are likely to hit limits very very quickly. However, if you

Re: [Haskell-cafe] RFE: Extensible algebraic user-defined data types?

2005-04-29 Thread Jacques Carette
Philippa Cowderoy [EMAIL PROTECTED] wrote: On Fri, 29 Apr 2005, Simon Peyton-Jones wrote: 2. Use sub-typing, so that a value (Left x) is *both* in type Either and in type NEither. This opens a very large and complicated design space, as Ben mentioned. I've been playing with this design space

Re: [Haskell-cafe] Re: Haskell vs OCaml

2005-05-04 Thread Jacques Carette
There is also Template Haskell vs MetaOCaml. For the life of me, I still cannot fathom why Template Haskell is untyped, while MetaOCaml is fully typed. Which is the main reason I write meta-program in MetaOCaml and 'other' programs in Haskell. There is the additional aspect that my

Re: [Haskell-cafe] Re: Haskell vs OCaml

2005-05-05 Thread Jacques Carette
Duncan Coutts wrote: On Wed, 2005-05-04 at 18:29 -0400, Jacques Carette wrote: There is also Template Haskell vs MetaOCaml. For the life of me, I still cannot fathom why Template Haskell is untyped, while MetaOCaml is fully typed. Which is the main reason I write meta-program

Re: [Haskell-cafe] Python?

2005-05-11 Thread Jacques Carette
Jerzy Karczmarczuk [EMAIL PROTECTED] wrote: Syntax for 3D arrays? Give me one single language where this is natural and immediate. I can think of 3: Mathematica, Maple and APL. But I hope you don't try to convince us that Mathematica is good at number crunching... For linear algebra, Maple,

Re: [Haskell-cafe] Python?

2005-05-11 Thread Jacques Carette
[EMAIL PROTECTED] wrote: Jacques Carette writes: Jerzy Karczmarczuk wrote: Syntax for 3D arrays? Give me one single language where this is natural and immediate. I can think of 3: Mathematica, Maple and APL. I can't see how Maple makes things more *natural and immediate* than Matlab

On Eq, was Re: [Haskell-cafe] When to use fancy types [Re: NumberTheory library]

2005-05-13 Thread Jacques Carette
Wonderful post! I just want to throw a minor wrench in: [EMAIL PROTECTED] wrote: Eq is not merely a function of type a - a - Bool. It's a concept with semantics. It must be an equivalence relation, and it also must mean semantic equality. Functions that respect semantic equality have the

Re: On Eq, was Re: [Haskell-cafe] When to use fancy types [Re: NumberTheory library]

2005-05-13 Thread Jacques Carette
Marcin 'Qrczak' Kowalczyk [EMAIL PROTECTED] wrote: Jacques Carette [EMAIL PROTECTED] writes: [EMAIL PROTECTED] wrote: Eq is not merely a function of type a - a - Bool. It's a concept with semantics. It must be an equivalence relation, and it also must mean semantic equality. Functions

Re: On Eq, was Re: [Haskell-cafe] When to use fancy types [Re: NumberTheory library]

2005-05-14 Thread Jacques Carette
Lennart Augustsson [EMAIL PROTECTED] wrote: Jacques Carette wrote: Such people have the nasty habit of also thinking that ALL functions are continuous! You might think they were constructivists or something. Why would a constructivist think that all functions are continuous? It makes

Re: On Eq, was Re: [Haskell-cafe] When to use fancy types [Re: NumberTheory library]

2005-05-14 Thread Jacques Carette
[EMAIL PROTECTED] wrote: Why do you think that constructivists are against +0 /= -0? Because they can't prove it - either way. Or that they think that all functions are continuous? [See previous email] Because all constructible functions are provably continuous. Do you think that Per Martin-Lf

Re: [Haskell-cafe] type inference and named fields

2005-06-23 Thread Jacques Carette
I was under the impression that, in ghc 6.4 at least, GADTs did just that: use information gained by matching on the type constructor to refine types. I sort-of expected that the extension to pattern matching would follow. Or is that a nice paper waiting to be written? Jacques Lennart

Re: [Haskell-cafe] matrix computations based on the GSL

2005-06-29 Thread Jacques Carette
I would recommend that you look very closely at the design of the LinearAlgebra package, the Matrix and Vector constructors, and the underlying implementation data-structure rtable() for Maple's implementation of all these ideas. About 250 person-days were spent on just the high-level design,

Re: [Haskell-cafe] matrix computations based on the GSL

2005-06-29 Thread Jacques Carette
Henning Thielemann wrote: On Wed, 29 Jun 2005, Jacques Carette wrote: 9. There are row vectors and column vectors, and these are different types. You get type errors if you mix them incorrectly. What do you mean with row vectors and column vectors are different types? Do you mean

Re: [Haskell-cafe] matrix computations based on the GSL

2005-06-29 Thread Jacques Carette
Henning Thielemann wrote: Mathematical notation has the problem that it doesn't distinguish between things that are different but in turn discriminates things which are essentially the same. I used to think that too. And while that is sometimes true, it is actually quite rare! When common

Re: [Haskell-cafe] matrix computations based on the GSL

2005-06-29 Thread Jacques Carette
[EMAIL PROTECTED] wrote: One of the things I appreciate and I hate simultaneously in your postings is that you are so categorical. 'tis indeed simultaneously one of my strengths and one of my weaknesses ;-) I also like to play Devil's Advocate, to draw out the interesting arguments.

Re: [Haskell-cafe] matrix computations based on the GSL

2005-06-29 Thread Jacques Carette
Henning Thielemann wrote: I'm also aware of that I mean different objects when I write uniformly '1'. But I know that they are somehow different. Since '1' can safely be used to denote the unit of any monoid, it does indeed have a lot of applications. And of course the syntactic artifact

Re: [Haskell-cafe] matrix computations based on the GSL

2005-06-30 Thread Jacques Carette
David Roundy and Henning Thielemann have been arguing about the nature of vectors and matrices, in particular saying: On Thu, Jun 30, 2005 at 02:20:16PM +0200, Henning Thielemann wrote: On Thu, 30 Jun 2005, David Roundy wrote: Matrices _and_ vectors! Because matrices represent

Re: [Haskell-cafe] matrix computations based on the GSL

2005-06-30 Thread Jacques Carette
Henning Thielemann wrote: I'm uncertain about how who want to put the different kinds of multiplication into one method, even with multi-parameter type classes. You need instances (*) :: Matrix - Matrix - Matrix (*) :: RowVector - Matrix - RowVector [many other instances removed.]

Re: [Haskell-cafe] matrix computations based on the GSL

2005-06-30 Thread Jacques Carette
Henning Thielemann wrote: Data Orientation = Row | Column Data Vector a = Vector Orientation [a] In the first mail you wrote 9. There are row vectors and column vectors, and these are different types. You get type errors if you mix them incorrectly. I interpreted that you want to

Re: [Haskell-cafe] Monadic vs pure style

2005-09-01 Thread Jacques Carette
Bulat Ziganshin wrote: Language.Haskell.TH.Lib is full of definitions like this: infixP p1 n p2 = do p1' - p1 p2' - p2 return (InfixP p1' n p2') btw, such definitions can be simplified by using liftM/ap operations: instance (Monad m, MyNum v) = MyNum (m

Re: [Haskell-cafe] Haskell versus Lisp

2005-09-16 Thread Jacques Carette
Glynn Clements wrote: Every other language (including Haskell) tends to have the problem that eventually you will encounter a situation where the language's own worldview gets in the way. Or, to put it another way: if Haskell is so flexible, why do we need Template Haskell? I can't imagine a

Re: [Haskell-cafe] Re: Proper way to write this

2005-12-27 Thread Jacques Carette
Max Vasin wrote: Pupeno wrote: What about this runDaytimeServer :: DaytimeServer - IO DaytimeServer runDaytimeServer dts = do dts' - runStreamDaytimeServer dts dts' - runDgramDaytimeServer dts' return dts' runDaytimeServer dts = runStreamDaytimeServer dts = runDgramDaytimeServer

Re: [Haskell-cafe] Comparing programs

2006-03-06 Thread Jacques Carette
I believe you might be able to use (commutative) anti-unification, also known as generalization for this task. Jacques Harry Chesley wrote: This is more of an algorithm question than a language question, but any insights would be much appreciated. The problem is to input a series of programs

Re: [Haskell-cafe] Justification for Ord inheriting from Eq?

2006-04-07 Thread Jacques Carette
Robert Dockins wrote: The behaviour of NaN actually makes perfect sense when you realise that it is Not a Number. Things that are not numbers are incomparable with things that are. Yes, NaN can be of type Float. But it's not a Float. If you take that tack, then you have to concede that

Re: [Haskell-cafe] Justification for Ord inheriting from Eq?

2006-04-07 Thread Jacques Carette
Robert Dockins wrote: On Apr 7, 2006, at 9:43 AM, Jacques Carette wrote: [Lots of stuff about IEEE 754] Is this an H' worthy item? It is worth taking a serious look in conjunction with completely redoing the Num class. Minor tweaking of the behaviour on NaNs (which requires a large amount

Re: [Haskell-cafe] Proposal for restructuring Number classes

2006-04-19 Thread Jacques Carette
Andrew U. Frank wrote: should * always be commutative or is its use for non-commutative types acceptable? This very question caused much agony in many design meetings for the CAS Maple. The list of pros and cons on each side is quite large! There are too many really nice optimizations

Re: [Haskell-cafe] Problem trying to get class Bounded to work

2006-05-23 Thread Jacques Carette
Bulat Ziganshin wrote: malloc :: Storable a = IO (Ptr a) malloc = doMalloc undefined where doMalloc :: Storable b = b - IO (Ptr b) doMalloc dummy = mallocBytes (sizeOf dummy) Is there any reason to not code this as malloc :: Storable a = IO (Ptr a) malloc = mallocBytes $

Re: [Haskell-cafe] Problem trying to get class Bounded to work

2006-05-23 Thread Jacques Carette
Bertram Felgenhauer wrote: Jacques Carette wrote: Bulat Ziganshin wrote: malloc :: Storable a = IO (Ptr a) malloc = doMalloc undefined where doMalloc :: Storable b = b - IO (Ptr b) doMalloc dummy = mallocBytes (sizeOf dummy) Is there any reason to not code

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] 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] 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] 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] 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]

[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

[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] 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] 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

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

  1   2   >