axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] Map


From: Ralf Hemmecke
Subject: Re: [Axiom-developer] Map
Date: Sun, 02 Apr 2006 02:34:33 +0200
User-agent: Thunderbird 1.5 (X11/20051201)

On 04/01/2006 09:15 PM, Antoine Hersen wrote:
Sorry,

Here it is http://wiki.axiom-developer.org/SandBoxSpad

If I try to use the map the compilation fail

I am used to Ocaml who do a terrific job at inferring type( which are
more simple) and I have trouble figuring out where to add type
information.

Actually, I don't understand you Antoine.
[degree i for i in a]
does the same job as your map stuff. And it works.

Second, please start using Aldor. I don't understand why you insist on using SPAD. Take for example

(i) +-> degree i

You put this (anonymous) function without giving types. So you rely on what the compiler thinks is appropriate in your case.

What can the compiler do if it sees

map(f, a)

where f is the (untyped) function from above.
It figures out the type of a, that is clearly "List P".
OK, it also sees that List(P) provides a function
map: (P -> P, %) -> %
Now the compiler must somehow try to fit your anonymous untyped function to the type P->P. Which is actually impossible, since there is no
degree: P->P. The compiler must complain!!!
The bad thing is only that the error message does not say much about the reason if you are (like me) unfamiliar with that output.

Well, anyway, use Aldor and enjoy better error messages.

Ralf





reply via email to

[Prev in Thread] Current Thread [Next in Thread]