a
I guess what you're saying is that since I'm implementing a
typeswitch, then I lose the nice feature of typeclasses that I know it
can't do anything with the value except what the typeclass provides.
In a sense, it loses type safety because it's too generic. That's a
good point too. No free
I've been toying with using Data Types a la Carte to get type
representations, a `Typeable` class and dynamic types parameterized by a
possibly open universe:
If the universe is potentially open, and if we don't care about
exhaustive pattern-matching check (which is one of the principal
2013-09-15 11:16, o...@okmij.org skrev:
Evan Laforge wrote:
I have a typeclass which is instantiated across a closed set of 3
types. It has an ad-hoc set of methods, and I'm not too happy with
them because being a typeclass forces them to all be defined in one
place, breaking modularity. A
not enough power to express what typeclasses give you. Also it
seems like there's a fundamental difference between dispatching on
argument vs dispatching on result.
Is there a way to more formally understand the extents of what
typeclasses provide, and what a toTagged fromTagged scheme gives me,
so I can
val TypeChar = toEnum val
So, perhaps my intuition was wrong. toTagged and fromTagged methods
give you the power to go between value and type level, but apparently
that's not enough power to express what typeclasses give you.
You do get enough power to write that second function
Evan Laforge wrote:
I have a typeclass which is instantiated across a closed set of 3
types. It has an ad-hoc set of methods, and I'm not too happy with
them because being a typeclass forces them to all be defined in one
place, breaking modularity. A sum type, of course, wouldn't have that
. toTagged and fromTagged methods
give you the power to go between value and type level, but apparently
that's not enough power to express what typeclasses give you. Also it
seems like there's a fundamental difference between dispatching on
argument vs dispatching on result.
Is there a way to more
[I too had the problem sending this e-mail to Haskell list.
I got a reply saying the message awaits moderator approval]
Evan Laforge wrote:
I have a typeclass which is instantiated across a closed set of 3
types. It has an ad-hoc set of methods, and I'm not too happy with
them because being
Is there any particular reason IO functions in the standard libraries
aren't grouped into type-classes?
This might allow for:
1) Testing IO code without actual input and output. (I have done this on a
small scale, but it presently involves much ugliness).
2) Redirecting output of a function that
On Fri, Dec 30, 2011 at 4:47 PM, David Thomas davidleotho...@gmail.com wrote:
Is there any particular reason IO functions in the standard libraries aren't
grouped into type-classes?
I'm guessing it's to stop the report from getting too complicated. If
you want an IO abstraction, you can try
enjoy it. But now I want to get rows, and I don't
know what to do :( I want func something like this:
getRow :: Int - [MyTable]
- what should I write here ?
Possibly use this function:
getRow 23 :: MyTableTwo
(like haskell function Read for example: read 7 :: Int)
I try to use typeclasses
On 27 July 2011 10:45, Sergiy Nazarenko nazarenko.ser...@gmail.com wrote:
Hi everyone!
Hi,
I have data declaration like this:
I try to use typeclasses,
class GetRow a where
hasID :: Int - IO a
instance GetRow MyTableOne where
hasID myid = return [(MyTableOne 1 name)]
instance GetRow
Robert,
2011/5/16 Robert Clausecker fuz...@gmail.com:
I found out, that GHC implements typeclasses as an extra argument, a
record that stores all functions of the typeclass. So I was wondering,
is there a way (apart from using newtype) to pass a custom record as the
typeclass record
Hello!
I found out, that GHC implements typeclasses as an extra argument, a
record that stores all functions of the typeclass. So I was wondering,
is there a way (apart from using newtype) to pass a custom record as the
typeclass record, to modify the behavior of the typeclass? I thought
about
Robert Clausecker fuz...@gmail.com wrote:
I found out, that GHC implements typeclasses as an extra argument, a
record that stores all functions of the typeclass. So I was wondering,
is there a way (apart from using newtype) to pass a custom record as
the typeclass record, to modify
On Mon, May 16, 2011 at 8:10 AM, Robert Clausecker fuz...@gmail.com wrote:
I found out, that GHC implements typeclasses as an extra argument, a
record that stores all functions of the typeclass. So I was wondering,
is there a way (apart from using newtype) to pass a custom record
Hi,
I'm stuck at page 151 of Real World Haskell and hoping that perhaps some
of you can give me a hand here...
The code that is giving me trouble is below.
data JValue = JString String
| JNumber Double
| JBool Bool
| JNull
| JObject [(String,
How about:
*Main fromJValue (JBool True) :: Either JSONError Bool
Right True
*Main
Doaitse
On 26 jul 2010, at 15:16, Angel de Vicente wrote:
data JValue = JString String
| JNumber Double
| JBool Bool
| JNull
| JObject [(String, JValue)]
On Monday 26 July 2010 15:16:36, Angel de Vicente wrote:
Hi,
I'm stuck at page 151 of Real World Haskell and hoping that perhaps some
of you can give me a hand here...
The code that is giving me trouble is below.
data JValue = JString String
| JNumber Double
|
Hi,
thanks for the answer. This is my first attempt at Typeclasses, and I
think there is something deep that I don't understand...
On 26/07/10 15:03, Daniel Fischer wrote:
class JSON a where
toJValue :: a - JValue
fromJValue :: JValue - Either JSONError a
instance JSON JValue
On Monday 26 July 2010 21:03:10, Angel de Vicente wrote:
Hi,
thanks for the answer. This is my first attempt at Typeclasses, and I
think there is something deep that I don't understand...
On 26/07/10 15:03, Daniel Fischer wrote:
class JSON a where
toJValue :: a - JValue
Hi,
And now that we are at it... In the next page, 152 there is the
following instance definition, but no explanation is (I think) given of
what it means:
instance (JSON a) = JSON [a] where
until then all instance definitions where of the type
instance JSON Int where ...
How should I read
On Jul 27, 2010, at 1:16 AM, Angel de Vicente wrote:
data JValue = JString String
| JNumber Double
| JBool Bool
| JNull
| JObject [(String, JValue)]
| JArray [JValue]
deriving (Eq, Ord, Show)
type JSONError = String
: the operator you're giving it has to be
associative. I like to use typeclasses to express laws.
That's a valid point. Unfortunately, Haskell is not Coq, so there
is no guarantee that the monoid laws are actually satisfied. And
using a type-class has the downside that you can have only one
instance
, then a type class is how you capture that. It sounds
like you do have this structure in your example.
Further, with typeclasses, you can write methods that are generic over
any type with that structure. So:
class Temporal a where
time :: a - Time
temporalOrder :: Temporal
2009/11/27 Daniel Schüssler anotheraddr...@gmx.de
I think punning is a worthwhile goal on its own, since I find myself
wasting
quite some thought on whether to prefix a record field name somehow, and if
I
do, what I should use as a short but sufficiently unique prefix.
I agree, especially
class Cls c where
type Ret c :: (Bar *) = * -- or a better name
foo :: c - Ret c
which isn't legal Haskell.
OK, that's exactly the same thing I've met when developing
compose-trans. I needed guarantees that something is a Monad.
My way of doing that was to make Bar (Monad in my case)
foo = fuu
That should work (although I haven't tested it).
What type families do in this case is allow you to write not only
methods associated with typeclasses, but type functions associated
with them too. In this case you can think of Ret as a function that
takes a type (G
Ret c :: * -- or a better name
foo :: c - Ret c
instance Cls G where
type Ret G = FU
foo = fuu
That should work (although I haven't tested it).
What type families do in this case is allow you to write not only
methods associated with typeclasses, but type functions associated
N.B. I'm a newbie to Haskell, and this problem is a bit complex, so
bear with me.
I'm using typeclasses to implement a sort of common interface for all
things -- call them things of type 'Cls' -- that can be expected to
implement a set of functions -- an 'interface' in OOP-speak. (Yes,
yes, I'm
dnme...@gmail.com wrote:
N.B. I'm a newbie to Haskell, and this problem is a bit complex, so
bear with me.
I'm using typeclasses to implement a sort of common interface for all
things -- call them things of type 'Cls' -- that can be expected to
implement a set of functions -- an 'interface
haven't tested it).
What type families do in this case is allow you to write not only
methods associated with typeclasses, but type functions associated
with them too. In this case you can think of Ret as a function that
takes a type (G in the instance above) and returns another type (FU).
Each
it).
What type families do in this case is allow you to write not only
methods associated with typeclasses, but type functions associated
with them too. In this case you can think of Ret as a function that
takes a type (G in the instance above) and returns another type (FU).
Each instance can define
perimeters of each object using map perimerer list (in this case we also
have to modify Geometry data type).
So we could make instances of perimeter type class for all objects and
return zero in case if perimeter doesn't make sense.
Same as previous version but with typeclasses and with additional
type class for all objects and
return zero in case if perimeter doesn't make sense.
Same as previous version but with typeclasses and with additional
constructors (constructors for each type of object + constructors in
Geometry data). Looks a bit overcomplicated.
Any reasons to use type
make instances of perimeter type class for all objects and
return zero in case if perimeter doesn't make sense.
Same as previous version but with typeclasses and with additional
constructors (constructors for each type of object + constructors in
Geometry data). Looks a bit overcomplicated
-- Forwarded message --
From: Lyndon Maydwell maydw...@gmail.com
Date: Tue, Sep 15, 2009 at 10:03 PM
Subject: Re: [Haskell-cafe] Typeclasses vs simple functions?
To: Olex P hoknam...@gmail.com
I think it depends on what is going to be using the functions, data.
As far as I can
perimeter :: Geometry - Double
perimeter (Sphere _ r) = 0.0
perimeter (Circle _ r) = 2.0 * pi * r
The latter is even simpler because there is no need in extraction of Double
value from Maybe.
I'd strongly advise against this last one on style grounds. (0 :: Double)
isn't nearly as
make sense.
Same as previous version but with typeclasses and with additional
constructors (constructors for each type of object + constructors in
Geometry data). Looks a bit overcomplicated.
Any reasons to use type classes in this case? Maybe there is something I'm
missing?
If you're talking
using map perimerer list (in this case we also
have to modify Geometry data type).
So we could make instances of perimeter type class for all objects and
return zero in case if perimeter doesn't make sense.
Same as previous version but with typeclasses and with additional
constructors
but with typeclasses and with additional
constructors (constructors for each type of object + constructors in
Geometry data). Looks a bit overcomplicated.
Any reasons to use type classes in this case? Maybe there is something I'm
missing?
Cheers,
-O
___
Haskell
and
return zero in case if perimeter doesn't make sense.
Same as previous version but with typeclasses and with additional
constructors (constructors for each type of object + constructors in
Geometry data). Looks a bit overcomplicated.
Any reasons to use type classes in this case? Maybe
Existential types sounds a bit scary :)
It's unfortunate that they've developed a scariness feeling associated with
them. They can be used in strange ways, but simple uses are quite
approachable. One way to think of them is like implementing an
object-oriented interface. You know it's an
Thanks for explanation Sean!
On Tue, Sep 15, 2009 at 4:30 PM, Sean Leather leat...@cs.uu.nl wrote:
Existential types sounds a bit scary :)
It's unfortunate that they've developed a scariness feeling associated with
them. They can be used in strange ways, but simple uses are quite
Dear Haskellers,
I am using multi parameter typeclasses to represent images consisting of
pixels (e.g. bitmap images).
{-# OPTIONS_GHC -XMultiParamTypeClasses #-}
module Bitmap where
-- | a pixel could be a Word8 (e.g. a graysclale image)
-- | or a 3-tuple for RGB images
However, I do not really understand the cause of the original problem. Why
do I need the functional dependency to make this work ?
Suppose you have an instance:
instance Pixel MyPixel where...
instance Image MyImage MyPixel where
width i = countPixels i
...
And somebody (not necessarily
Hello Harald,
Monday, August 24, 2009, 3:17:28 PM, you wrote:
class Pixel p where
-- | an image could be a UArray or a list of lists of pixels
class Pixel p = Image a p where
read http://haskell.org/haskellwiki/OOP_vs_type_classes
here you say that Image is a particular
Hello, cafe visitors!
I'm trying to learn Haskell typeclasses, - about how to use them, - but
can't handle some conceptiual problems, which confuses me a lot. I took one
real problem (ErrorInfo gragual gathering), to tackle it in my studies: I
have a class of situations: there is an object
Hello Belka,
Saturday, May 16, 2009, 9:22:54 PM, you wrote:
I'm trying to learn Haskell typeclasses, - about how to use them, - but
am i correctly understood that you've started learning type classes
with multi-parameter ones? this may be a bit too brave, especially for
a woman :D
i suggest
Bulat Ziganshin wrote:
Hello Belka,
Saturday, May 16, 2009, 9:22:54 PM, you wrote:
I'm trying to learn Haskell typeclasses, - about how to use them, - but
am i correctly understood that you've started learning type classes
with multi-parameter ones? this may be a bit too brave, especially
Jason and everybody interested,
Please check out a package I recently (just by coincidence: I haven't
seen this topic on the list until after I uploaded it) uploaded to
Hackage:
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/jsmw-0.1
This is a basic monadic interface to Javascript
I can't speak for Jason, but for me, this is not very useful. I don't
want to write in a Haskell DSL, I want to write in Haskell. And not
the whole program, either, just the parts that really lend themselves
to functional programming (parsers, numeric computations, code
generators,
2009/04/26 John A. De Goes j...@n-brain.net:
I can't speak for Jason, but for me, this is not very useful.
I don't want to write in a Haskell DSL, I want to write in
Haskell. And not the whole program, either, just the parts
that really lend themselves to functional programming
(parsers,
On Apr 26, 2009, at 10:18 AM, Jason Dusek wrote:
This was what I was originally writing in about, yeah.
However, thinking it over I realize there are some serious
problems. We really do want to work with a restricted subset
of Haskell that is more amenable to translation -- one with
finite
John wrote:
I can't speak for Jason, but for me, this is not very useful. I don't
want to write in a Haskell DSL, I want to write in Haskell. And not
the whole program, either, just the parts that really lend themselves
to functional programming (parsers, numeric computations, code
2009/04/26 John A. De Goes j...@n-brain.net:
2009/04/26 Jason Dusek:
This was what I was originally writing in about, yeah.
However, thinking it over I realize there are some serious
problems. We really do want to work with a restricted subset
of Haskell that is more amenable to translation
2009/04/26 Dimitry Golubovsky golubov...@gmail.com:
John wrote:
I can't speak for Jason, but for me, this is not very useful.
I don't want to write in a Haskell DSL, I want to write in
Haskell. And not the whole program, either, just the parts
that really lend themselves to functional
There's a tool for converting SML to JavaScript:
Such tools converting between different languages, are usually called
compilers, by the way.
Stefan
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
I'd like to be able to translate Haskell to JavaScript.
Many Haskell/JS bridges provide libraries for writing complete
JavaScript programs in Haskell; some of them even include
jQuery. However, my goals are more limited -- I'd like to be
able to take a Haskell module and turn it into a
On 25 Apr 2009, at 21:53, Jason Dusek wrote:
Many Haskell/JS bridges provide libraries for writing complete
JavaScript programs in Haskell; some of them even include
jQuery. However, my goals are more limited -- I'd like to be
able to take a Haskell module and turn it into a JavaScript
I tried using the jhc javascript compiler back end a year or so ago.
It was too rough to use in production, but it did output javascript
from haskell.
thomas.
2009/4/25 Miguel Mitrofanov miguelim...@yandex.ru:
On 25 Apr 2009, at 21:53, Jason Dusek wrote:
Many Haskell/JS bridges provide
On second thought, it was yhc, not jhc:
http://lambda-the-ultimate.org/node/1836
2009/4/25 Thomas Hartman tphya...@gmail.com:
I tried using the jhc javascript compiler back end a year or so ago.
It was too rough to use in production, but it did output javascript
from haskell.
thomas.
On Apr 25, 2009, at 13:53 , Jason Dusek wrote:
I'd like to be able to translate Haskell to JavaScript.
http://haskell.org/haskellwiki/Yhc/Javascript ?
Many Haskell/JS bridges provide libraries for writing complete
JavaScript programs in Haskell; some of them even include
jQuery. However,
2009/04/25 Brandon S. Allbery KF8NH allb...@ece.cmu.edu:
2009/04/25 Jason Dusek:
I'd like to be able to translate Haskell to JavaScript.
http://haskell.org/haskellwiki/Yhc/Javascript ?
Dead.
Many Haskell/JS bridges provide libraries for writing
complete JavaScript programs in Haskell;
2009/04/25 Miguel Mitrofanov miguelim...@yandex.ru:
2009/04/25 Jason Dusek wrote:
Many Haskell/JS bridges provide libraries for writing
complete JavaScript programs in Haskell; some of them even
include jQuery. However, my goals are more limited -- I'd
like to be able to take a Haskell module
2009/04/25 Thomas Hartman tphya...@gmail.com:
2009/04/25 Thomas Hartman tphya...@gmail.com:
I tried using the jhc javascript compiler back end a year or so ago.
On second thought, it was yhc, not jhc:
http://lambda-the-ultimate.org/node/1836
Yeah, I think that thing has been dead for
I'd like this functionality, as well, but it doesn't exist, at least
for Haskell.
If you don't need a 100% pure functional language, and don't need the
bells and whistles of the Haskell type system, you might be interested
in SML -- a purer relative of the more widely-known Ocaml.
For parsers, there is also a LALR(1) generator -
http://jscc.jmksf.com/ - though I have not had personal experience
with it.
--A
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Interesting, thank you.
--
Jason Dusek
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Jonathan Cast wrote:
Type case is easy:
genericShow :: Typeable a = a - String
genericShow x = fromJust $ do
s - cast x :: Maybe String
return s
`mplus` do
n -
On Mon, Apr 21, 2008 at 10:58 PM, Jonathan Cast
[EMAIL PROTECTED] wrote:
I must have failed to communicate well. To me, the point of giving a class
a name is that then you can write a program that is parametric over the
elements of that class. Knowing that I can implement monads in Ruby
On Mon, 2008-04-21 at 22:58 -0700, Jonathan Cast wrote:
class Forceable alpha where
seq :: alpha - beta - beta
Instances derived automatically by the compiler, when possible, for
every type (like Typeable should be). We can omit functions if
desired (I don't remember why I thought
On 22 Apr 2008, at 8:03 PM, Derek Elkins wrote:
On Mon, 2008-04-21 at 22:58 -0700, Jonathan Cast wrote:
class Forceable alpha where
seq :: alpha - beta - beta
Instances derived automatically by the compiler, when possible, for
every type (like Typeable should be). We can omit functions if
On 22 Apr 2008, at 9:53 AM, Ryan Ingram wrote:
On Mon, Apr 21, 2008 at 10:58 PM, Jonathan Cast
[EMAIL PROTECTED] wrote:
I must have failed to communicate well. To me, the point of
giving a class
a name is that then you can write a program that is parametric
over the
elements of that class.
the authors have conveniently already made instances of useful
typeclasses. Then I try to add some new functionality and run into a
lot of friction because now every library I use needs an
implementation which matches.
Have you ever tried to write a monad transformer that is compatible
with the MTL
On Apr 21, 2008, at 3:50 , Ryan Ingram wrote:
is almost unnecessary; (btw., functions /are/ instances of Show).
Now it's my turn to call:
Prelude Test.QuickCheck show ((\x - x) :: Int - Int)
interactive:1:0:
No instance for (Show (Int - Int))
import Data.Function. (but it is indeed a
On Apr 21, 2008, at 14:21 , Brandon S. Allbery KF8NH wrote:
http://www.cmu.edu.edu/~allbery/FuncShow.hs; note that it only
works for monomorphic functions (more
Note to self: be more careful when you just woke up. http://
www.ece.cmu.edu/~allbery/FuncShow.hs
--
brandon s. allbery
to
embed system F in Haskell via GADTs, but I use a lot of them; and many
of them the authors have conveniently already made instances of useful
typeclasses. Then I try to add some new functionality and run into a
lot of friction because now every library I use needs an
implementation which matches
On Sun, Apr 20, 2008 at 4:46 AM, Jonathan Cast
[EMAIL PROTECTED] wrote:
On 19 Apr 2008, at 5:02 AM, David MacIver wrote:
Independently of the rant...
On Sat, Apr 19, 2008 at 6:01 AM, Jonathan Cast
[EMAIL PROTECTED] wrote:
But why do I need to jump through these hoops for a
On 20 Apr 2008, at 3:05 AM, David MacIver wrote:
On Sun, Apr 20, 2008 at 4:46 AM, Jonathan Cast
[EMAIL PROTECTED] wrote:
On 19 Apr 2008, at 5:02 AM, David MacIver wrote:
Independently of the rant...
On Sat, Apr 19, 2008 at 6:01 AM, Jonathan Cast
[EMAIL PROTECTED] wrote:
But why do I need
David MacIver wrote:
Sure. I'm just saying, it's more of a Jump through this hoop and you
shall have moist, delicious cake. And by the way, here's a leg up set
up. There are rewards for the hoop jumping, and assistance on the way
there (which is more than can be said for a lot of languages which
Independently of the rant...
On Sat, Apr 19, 2008 at 6:01 AM, Jonathan Cast
[EMAIL PROTECTED] wrote:
But why do I need to jump through these hoops for a perfectly safe
commonly desired operation?
It's called a proof obligation. Haskell is not here to stop you from
jumping through
David MacIver wrote:
Independently of the rant...
On Sat, Apr 19, 2008 at 6:01 AM, Jonathan Cast
[EMAIL PROTECTED] wrote:
But why do I need to jump through these hoops for a perfectly safe
commonly desired operation?
It's called a proof obligation. Haskell is not here to stop you from
On 19 Apr 2008, at 5:02 AM, David MacIver wrote:
Independently of the rant...
On Sat, Apr 19, 2008 at 6:01 AM, Jonathan Cast
[EMAIL PROTECTED] wrote:
But why do I need to jump through these hoops for a perfectly safe
commonly desired operation?
It's called a proof obligation. Haskell is
WARNING: RANT AHEAD. Hopefully this fires off some productive
discussion on how to fix these problems!
Don't get me wrong: I think the idea of typeclasses is great. Their
implementation in Haskell comes so close to being awesome and then
falls short, and that's almost worse than not being
want to work is precisely what this allows.
Don't get me wrong: I think the idea of typeclasses is great. Their
implementation in Haskell comes so close to being awesome and then
falls short, and that's almost worse than not being awesome in the
first place!
We've noticed. The literature
G'day all.
Quoting Chung-chieh Shan [EMAIL PROTECTED]:
Yes. You can even do this portably, using nothing unsafe, with Dylan
Thurston's technique:
That paper gives you a choice between inefficient and leaky. I think I'll
take unsafeCoerce#. :-)
Cheers,
Andrew Bromage
| -- Hugs allows this. GHC rejects it on the grounds that a is unused
| -- on the right-hand side of the (=). I think this is arguably a bug
| -- in GHC.
| f3 :: (Show a, ?foo :: a) = String
| f3 = show ?foo
Hugs is right here. GHC 6.8 accepts this too, and has done for some time;
there's
G'day all.
Quoting Simon Peyton-Jones [EMAIL PROTECTED]:
| -- GHC rejects this. Hugs compiles it, but I can't call it as
| -- let ?foo = Hello in show Foo
| --
| -- Is there a good reason to disallow this?
| data Foo = Foo
|
| instance (?foo :: String) = Show Foo where
| showsPrec _ Foo =
On Thu, Sep 06, 2007 at 06:49:21AM -0400, [EMAIL PROTECTED] wrote:
For completeness, here's the final solution, courtesy of int-e (whose
real name I don't know; sorry), which is much more elegant than I
Bertram Felgenhauer
bindString :: (forall s. StringAsType s = Mark s a) - String - a
[EMAIL PROTECTED] wrote in article [EMAIL PROTECTED] in
gmane.comp.lang.haskell.cafe:
That higher-rank type makes all the difference.
Yes. You can even do this portably, using nothing unsafe, with Dylan
Thurston's technique:
Oleg Kiselyov and Chung-chieh Shan. 2004. Functional pearl: Implicit
{-# OPTIONS -fglasgow-exts #-}
-- G'day everyone.
-- This is okay.
f1 :: (?foo :: String) = String
f1 = ?foo
-- So is this.
f2 :: (Show a, ?foo :: a) = a - String
f2 _ = show ?foo
-- Hugs allows this. GHC rejects it on the grounds that a is unused
-- on the right-hand side of the (=). I
like
data Color = Red | Green | Blue
can be implemented with typeclasses and without |. Thus, we don't need
them... :)
The other point is that using existentials for sums has a problem: I
think it's impossible to implement many functions that take multiple
arguments of the existential type
term algebra
Initial (term) algebra for a state monad
http://www.haskell.org/pipermail/haskell-cafe/2005-January/008241.html
Implementing an interpreter in HOAS with fix
Even higher-order abstract syntax: typeclasses vs GADT
http://www.haskell.org/pipermail
monad in a free term algebra
Initial (term) algebra for a state monad
http://www.haskell.org/pipermail/haskell-cafe/2005-January/008241.html
Implementing an interpreter in HOAS with fix
Even higher-order abstract syntax: typeclasses vs GADT
http://www.haskell.org
| Will I run into problems using typeclasses with GADTs?
No, you shouldn't, provided you use the HEAD compiler. I did a fairly major
upgrade, after the 6.6 fork, which makes the interaction between type classes
and GADTs work properly. This upgrade isn't in 6.6, and I regard the
type-class
Will I run into problems using typeclasses with GADTs? I've come up with this
to model a fragment of ASN.1. I'd hate to spend a lot of time on this only to
find out it's well known that these two features don't mix very well.
Thanks, Dominic.
data Type :: * - * where
INTEGER
I don't think I'm the only one confused here. Henrik Nilson in his
paper on adding GADTs to Yampa comments that:
However, the recent addition of Generalized Algebraic Data
Types (GADTs) [26] to the list of Haskell extensions supported
by the Glasgow Haskell Compiler (GHC) gives
On Thursday 07 December 2006 09:44, S. Alexander Jacobson wrote:
I guess I'm also not sure what belongs in a GADT and what belongs in a
typeclass e.g. here is an Arrow GADT
data Arrow b c where
Arr::(b-c) - Arrow b c
Compose::Arrow b c - Arrow c d - Arrow b d
First::Arrow
Hi Alex,
S. Alexander Jacobson wrote:
I guess I'm also not sure what belongs in a GADT and what belongs in a
typeclass e.g. here is an Arrow GADT
data Arrow b c where
Arr::(b-c) - Arrow b c
Compose::Arrow b c - Arrow c d - Arrow b d
First::Arrow a b - Arrow (a,c) (b,c)
1 - 100 of 132 matches
Mail list logo