On Sat, Nov 14, 2009 at 17:55, Mark Lentczner wrote:
Would I be correct in thinking: The difference between these two is that
the type b can be fixed upon application of amy to the first two arguments
(given context), whereas bob applied to two arguments MUST return a function
that is
Mark Lentczner wrote:
I also think I understand that the implicit 'forall' inherent in Haskell falls
at different places in various constructs, which also had me confused. For
example, while the above two function type declarations are equivalent, these
two data declarations aren't:
On Nov 12, 2009, at 2:59 PM, Sean Leather wrote:
foo :: forall x y. (x - x) - y
bar :: forall y. (forall x . x - x) - y
While neither function is seemingly useful, the second says that the
higher-order argument must be polymorphic. I see two options:
AHA! This is the bit of insight I
Of the two declarations
data Fizzle a = Fizzle (b - (a, b)) a
data Fizzle a = forall b. Fizzle (b - (a, b)) a
only the second one is allowed (with some suitable extension).
Personally I think the first one should be allowed as well, with the
same meaning as the second one.
Some
On Sun, Nov 15, 2009 at 01:14:34AM +, Lennart Augustsson wrote:
Of the two declarations
data Fizzle a = Fizzle (b - (a, b)) a
data Fizzle a = forall b. Fizzle (b - (a, b)) a
only the second one is allowed (with some suitable extension).
Personally I think the first one
Dan Piponi wrote:
To use these types with ghc you need to use the compilation flag
-XExistentialQuantification.
Or, more portably, add {-# LANGUAGE ExistentialQuantification #-} at the
top of the source file. It should now compile in any computer that
supports this feature without any
Joe Fredette wrote:
Forall means the same thing as it means in math
...which not everybody already knows about. ;-)
Even I am still not 100% sure how placing forall in different positions
does different things. But usually it's not something I need to worry
about. :-)
2009/11/12 Andrew Coppin andrewcop...@btinternet.com:
Joe Fredette wrote:
Forall means the same thing as it means in math
...which not everybody already knows about. ;-)
Even I am still not 100% sure how placing forall in different positions does
different things. But usually it's not
Eugene Kirpichov wrote:
2009/11/12 Andrew Coppin andrewcop...@btinternet.com:
Even I am still not 100% sure how placing forall in different positions does
different things. But usually it's not something I need to worry about. :-)
To me it does not look like it does different things:
2009/11/12 Neil Brown nc...@kent.ac.uk:
Eugene Kirpichov wrote:
2009/11/12 Andrew Coppin andrewcop...@btinternet.com:
Even I am still not 100% sure how placing forall in different positions
does
different things. But usually it's not something I need to worry about.
:-)
To me it does
On Thu, Nov 12, 2009 at 2:50 AM, Eugene Kirpichov ekirpic...@gmail.com wrote:
But that's not an issue of semantics of forall, just of which part of
the rather broad and universal semantics is captured by which language
extensions.
The forall for existential type quantification is wierd.
data
Eugene Kirpichov wrote:
2009/11/12 Andrew Coppin andrewcop...@btinternet.com:
Joe Fredette wrote:
Forall means the same thing as it means in math
...which not everybody already knows about. ;-)
Even I am still not 100% sure how placing forall in different positions does
2009/11/12 Ryan Ingram ryani.s...@gmail.com:
On Thu, Nov 12, 2009 at 2:50 AM, Eugene Kirpichov ekirpic...@gmail.com
wrote:
But that's not an issue of semantics of forall, just of which part of
the rather broad and universal semantics is captured by which language
extensions.
The forall for
On Thu, Nov 12, 2009 at 8:52 PM, Andrew Coppin
andrewcop...@btinternet.com wrote:
I just meant it's not immediately clear how
foo :: forall x. (x - x - y)
is different from
foo :: (forall x. x - x) - y
It takes a bit of getting used to.
That still confuses me.
David Virebayre wrote:
On Thu, Nov 12, 2009 at 8:52 PM, Andrew Coppin
andrewcop...@btinternet.com wrote:
I just meant it's not immediately clear how
foo :: forall x. (x - x - y)
is different from
foo :: (forall x. x - x) - y
It takes a bit of
Andrew Coppin wrote:
I just meant it's not immediately clear how
foo :: forall x. (x - x - y)
is different from
foo :: (forall x. x - x) - y
Uhm, I guess you meant
foo :: forall x. ((x - x) - y)
VS.
foo :: (forall x. x - x) - y
, didn't you?
I just meant it's not immediately clear how
foo :: forall x. (x - x - y)
is different from
foo :: (forall x. x - x) - y
It takes a bit of getting used to.
Those are different functions all together, so perhaps you meant these.
foo :: forall x y. (x - x) - y
bar :: forall y.
Forall means the same thing as it means in math, it means for any
type -- call it `b` -- then the type of the following it `Branch
(PermParser tok st (b - a)`
`tok`, `st` and `a` are all given by the declaration of the datatype
itself.
Hope that makes sense,
/Joe
On Nov 11, 2009, at
On Wed, Nov 11, 2009 at 4:24 PM, zaxis z_a...@163.com wrote:
data Branch tok st a = forall b. Branch (PermParser tok st (b - a))
(GenParser tok st b)
I have hoogled the `forall` but i cannot find any appropriate answer!
That's an example of an existential type. What that line is saying is
Without `forall`, the ghci will complain: Not in scope: type variable `b'
It is clear now. thank you!
Dan Piponi-2 wrote:
On Wed, Nov 11, 2009 at 4:24 PM, zaxis z_a...@163.com wrote:
data Branch tok st a = forall b. Branch (PermParser tok st (b - a))
(GenParser tok st b)
I have
20 matches
Mail list logo