[prev in list] [next in list] [prev in thread] [next in thread] 

List:       haskell-fr
Subject:    [Haskell-fr] Re: Fractional etc...
From:       corentin.dupont () gmail ! com (Dupont Corentin)
Date:       2007-10-29 7:00:21
Message-ID: 18a05e6b0710290402i3cfcb163r264d0ce27e0acc86 () mail ! gmail ! com
[Download RAW message or body]

J'ai ghci 6.6.1.
Ce code ne passe pas:

*Prelude> let m = 5
Prelude> map (/m) [0..10]

<interactive>:1:4:
    No instance for (Fractional Integer)
      arising from use of `/' at <interactive>:1:4-7

*par contre ?a ?a passe dans ghci:

*Prelude> let foo m = map (/m) [0..10]
Prelude> foo 5
[0.0,0.2,0.4,0.6,0.8,1.0,1.2,1.4,1.6,1.8,2.0]*

Mais... Bien sur:

*Prelude> let n = 5*
*Prelude> let foo m = map (/m) [0..10]
Prelude> foo n*

Ne passe pas plus!

*
*



On 10/29/07, Stephane Bortzmeyer <bortzmeyer@nic.fr> wrote:
> On Mon, Oct 29, 2007 at 11:09:43AM +0100,
>  Dupont Corentin <corentin.dupont@gmail.com> wrote
>  a message of 43 lines which said:
>
> > let m = 5
> > map (/m) [0..10]
> >
> > il me sort:
> >     No instance for (Fractional Integer)
>
> Quelle version ? Avec ghci 6.6, c'est accept? sans probl?me. (J'ai
> essay? avec let et aussi avec :
>
> foobar m =
>  map (/m) [0..10]
>
> main = do
>  print (foobar 5)
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-fr/attachments/20071029/289298d0/attachment.htm

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic