ArchiveOrangemail archive

The Haskell Cafe


haskell-cafe.haskell.org
(List home) (Recent threads) (38 other Haskell lists)

Subscription Options

  • RSS or Atom: Read-only subscription using a browser or aggregator. This is the recommended way if you don't need to send messages to the list. You can learn more about feed syndication and clients here.
  • Conventional: All messages are delivered to your mail address, and you can reply. To subscribe, send an email to the list's subscribe address with "subscribe" in the subject line, or visit the list's homepage here.
  • Moderate traffic list: up to 30 messages per day
  • This list contains about 107,368 messages, beginning Oct 2000
  • 14 messages added yesterday
Report the Spam
This button sends a spam report to the moderator. Please use it sparingly. For other removal requests, read this.
Are you sure? yes no

(+1) vs let inc=(+1)

Ad
Greg Fitzgerald 1337714929Tue, 22 May 2012 19:28:49 +0000 (UTC)
In ghci 7.4.1:

Prelude> :t (+1)
(+1) :: Num a => a -> a

Prelude> let inc=(+1)
Prelude> :t inc
inc :: Integer -> Integer

Why the difference?

Thanks,
Greg
Artyom Kazak 1337715287Tue, 22 May 2012 19:34:47 +0000 (UTC)
Sean Leather 1337716050Tue, 22 May 2012 19:47:30 +0000 (UTC)
Greg Fitzgerald 1337716603Tue, 22 May 2012 19:56:43 +0000 (UTC)
Thanks!

$ ghci -XNoMonomorphismRestriction

Prelude> :t (+1)
(+1) :: Num a => a -> a

Prelude> let inc=(+1)
Prelude> :t inc
inc ::  Num a => a -> a

Cool.

-GregOn Tue, May 22, 2012 at 12:34 PM, Artyom Kazak wrote:

> http://www.haskell.org/**haskellwiki/Monomorp...<http://www.haskell.org/haskellwiki/Monomorphi...>
>
>
> ______________________________**_________________
> Haskell-Cafe mailing list
> 
> http://www.haskell.org/**mailman/listinfo/has...<http://www.haskell.org/mailman/listinfo/haske...>
>
Home | About | Privacy