Hi list,
GHC 6.10.1:
Prelude :t let f x y = return x == return y in f
let f x y = return x == return y in f :: (Eq (m a), Monad m) = a - a -
Bool
Hugs (Sep 2006):
Hugs :t let f x y = return x == return y in f
ERROR - Ambiguous type signature in inferred type
*** ambiguous type : (Eq (a b),
Hi list,
GHC 6.10.1:
Prelude :t let f x y = return x == return y in f
let f x y = return x == return y in f :: (Eq (m a), Monad m) = a - a -
Bool
Hugs (Sep 2006):
Hugs :t let f x y = return x == return y in f
ERROR - Ambiguous type signature in inferred type
*** ambiguous type : (Eq (a b),
I find the following instance very convenient:
import Data.Monoid
import Control.Applicative
instance Monoid a = Monoid (ZipList a) where
mempty = pure mempty
mappend = liftA2 mappend
See our previous discussion on this topic here:
http://www.nabble.com/Fwd:-Unification-for-rank-N-types-td23942179.html
Thanks,
Vladimir
On Wed, Oct 14, 2009 at 10:35 PM, Martijn van Steenbergen
mart...@van.steenbergen.nl wrote:
Dear café,
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE
Hi,
Consider the following definitions:
---
{-# LANGUAGE RankNTypes, ImpredicativeTypes #-}
foo :: [forall a. [a] - [a]]
foo = [reverse]
bar :: [a - b] - a - b
bar fs = head fs
---
Hi,
Consider the following definitions:
---
{-# LANGUAGE RankNTypes, ImpredicativeTypes #-}
foo :: [forall a. [a] - [a]]
foo = [reverse]
bar :: [a - b] - a - b
bar fs = head fs
---
Forwarding to GH list.
-- Forwarded message --
From: Vladimir Reshetnikov v.reshetni...@gmail.com
Date: Tue, 9 Jun 2009 16:51:59 +0500
Subject: Re: Unification for rank-N types
To: haskell-cafe haskell-c...@haskell.org
One more example:
This does not type-check
Hi,
I have the following code:
---
{-# LANGUAGE RankNTypes #-}
f :: ((forall a. a - a) - b) - b
f x = x id
g :: (forall c. Eq c = [c] - [c]) - ([Bool],[Int])
g y = (y [True], y [1])
h :: ([Bool],[Int])
h = f g
= foldr (\g - (.) g) id
---
What is the reason for this?
Thanks,
Vladimir
On 6/9/09, Vladimir Reshetnikov v.reshetni...@gmail.com wrote:
Hi,
I have the following code:
---
{-# LANGUAGE
Hi Zsolt,
fs :: (((a, a) - a) - t) - (t, t)
fs g = (g fst, g snd)
examples = (fs fmap, fs liftA, fs liftM, fs id, fs ($(1,2)), fs
((,)id), fs (:[]), fs repeat)
No instance for (Num [Char])
arising from the literal `1' at M.hs:6:54
Possible fix: add an instance declaration for (Num
Hi,
I have the following code:
fs g = (g fst, g snd)
examples = (fs fmap, fs liftA, fs liftM, fs id, fs ($(1,2)), fs
((,)id), fs (:[]), fs repeat)
Hi,
I tried this code:
---
f, g :: a - a
(f, g) = (id, id)
---
Hugs: OK
GHC:
Couldn't match expected type `forall a. a - a'
against inferred type `a - a'
In the expression: id
In the expression: (id, id)
In a pattern binding:
:
Am Montag 01 Juni 2009 14:44:37 schrieb Vladimir Reshetnikov:
Hi,
I tried this code:
---
f, g :: a - a
(f, g) = (id, id)
---
Hugs: OK
GHC:
Couldn't match expected type `forall a. a - a'
against inferred type
Hi,
Consider this Haskell code:
---
class A a where
foo :: a b
class B a
class (A a, B a) = C a
---
GHC compiles it without errors, but Hugs rejects it: Illegal type in
class constraint.
What is the
Hi,
Consider this (a bit pathological) Haskell code:
--
class A a where
foo :: A (b d) = a (c b)
--
GHC compiles it successfully, but Hugs rejects it:
Ambiguous type signature in class declaration
*** ambiguous type : (A
Hi,
Seems that Haskell allows to specify dummy type variables in a
declaration of a type synonym, which do not appear in its right-hand
side. This can lead to interesting effects, which appears differently
in GHC and Hugs. I would like to know, what behavior is correct
according to the haskell 98
Hi,
I tried to evaluate this expression:
head[[]{}]
GHCi: []
Hugs: ERROR - Empty field list in update
What is the correct behavior?
Thanks,
Vladimir
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Hi,
The following expression evaluates to 1 in GHCi, but results in an
error in Hugs:
let f x = let g y = [x,y] in (g 1, g []) in 1
What is the correct behavior?
Thanks
Vladimir
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
,
Vladimir Reshetnikov (aka nikov),
Microsoft MVP
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
19 matches
Mail list logo