[Haskell-fr] Re: inférence

Dan Popa popavdan at yahoo.com
Tue Sep 18 09:02:27 EDT 2007


--- Dupont Corentin <corentin.dupont at gmail.com> wrote:

1)
> Salut,
> 
> Personne ne peut me répondre sur mon erreur
> ci-dessous?
> comment caster de Float en Double?
> 
If you really need a datatype for a Point you may use
something like :

Num a => Point a a

specifying that:
I) a may be every numeric type and
II) a point is something which includes 2 pieces of
date which belongs to that type  a.
As a result the system will use the needed kind of
points everywhere.


2)
> J'ai d'autres questions:
> Je n'ai pas très bien compris ce que signifie le '.
> Apparemment ça a à voir avec l'impératif...

Nothing special. It is like _ in other languages.
 
> Je ne comprend pas très bien ce que font des
> opérateurs comme &&&:
> (&&&) :: (Arrow a) => a b c -> a b c' -> a b (c, c')
Translation: In the hypothesis that a is a type froma
a class of types called Arrow then the type of the &&&
function (operator) is: a b c -> a b c' -> a b (c, c')

Remark: you may presume that  a and b are  type
constructors (like m for monads). 
So:
a b c means: the a type constructor applied to ( b
type constructor applied to a data fromthe type c).
This is a complex datatype.
a b c' means:  the a type constructor applied to ( b
type constructor applied to a data the type c'). This
is a complex datatype. c' may or may not be the same
with c.

a b (c, c') means: the a type constructor applied to (
b type constructor applied to the pair formed by last
c and last c'). This is a complex datatype. c' may or
may not be the same with c but both are the previously
c and c', now alltogether.

(c,c') means: pair made by c and c'

> Dans la signature, que signifient les espaces entre
> les a,b,c...?

Application of the typeconstructor from the left to
the  datatype from the right. It's something like:
a(b(c)) in mathematics.
> 
> Merci!
> Corentin

You are wellcome !
Dan 

P.S. Can I use the question rised, for example as
examples for my students or by posting them to
haskell.org in any language ?

Or would you like to translate the explanations in
french for Haskell-fr ?




       
____________________________________________________________________________________
Pinpoint customers who are looking for what you sell. 
http://searchmarketing.yahoo.com/


More information about the Haskell-fr mailing list