I was inspired by George Pollard's
posthttp://www.haskell.org/pipermail/haskell-cafe/2009-July/063981.htmlat
haskell-cafe and tried to implement the non-polymorphic Functor class
( I
named it Functor' ). I changed some names and added reasonable constraints.
type family NewPt f a
class
Alexey Karakulov ankaraku...@gmail.com writes:
(Ord b) must be deduced from (Functor (Set b)) but it doesn't. I don't know
whether it's my mistake somewhere or ghc problem.
I've come across this problem as well; the best solution I've seen so
far is the one taken by Ganesh in his rmonad
On Sat, Aug 14, 2010 at 2:27 PM, Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com wrote:
Alexey Karakulov ankaraku...@gmail.com writes:
(Ord b) must be deduced from (Functor (Set b)) but it doesn't. I don't
know
whether it's my mistake somewhere or ghc problem.
I've come across this
The non-type-changing map can be implemented as a type class - in my
graphics lib Wumpus, I call it pointwise:
class Pointwise sh where
type Pt sh :: *
pointwise :: (Pt sh - Pt sh) - sh - sh
I think other people have posted it to the cafe under a different
name, before I did:
On 14 August 2010 20:27, Stephen Tetley stephen.tet...@gmail.com wrote:
If I was doing Wumpus again though, I'd probably do with Pointwise.
Ahem, do without Pointwise
Originally the types I operated on with Pointwise were more
complicated than they are now and Pointwise seemed a benefit. But
Andrew Coppin andrewcop...@btinternet.com writes:
In summary, I think we need to devise a way of better-documenting
class instances.
Haddock 2.7 supports documenting instance implementations; I don't know
how this works, but according to the Changelog it's available.
--
Ivan Lazar
On Sun, Jul 04, 2010 at 09:55:53PM +1000, Ivan Lazar Miljenovic wrote:
Andrew Coppin andrewcop...@btinternet.com writes:
In summary, I think we need to devise a way of better-documenting
class instances.
Haddock 2.7 supports documenting instance implementations; I don't know
how this
Ross Paterson r...@soi.city.ac.uk writes:
On Sun, Jul 04, 2010 at 09:55:53PM +1000, Ivan Lazar Miljenovic wrote:
Andrew Coppin andrewcop...@btinternet.com writes:
In summary, I think we need to devise a way of better-documenting
class instances.
Haddock 2.7 supports documenting instance
2010/7/4 Ivan Lazar Miljenovic ivan.miljeno...@gmail.com:
Andrew Coppin andrewcop...@btinternet.com writes:
In summary, I think we need to devise a way of better-documenting
class instances.
Haddock 2.7 supports documenting instance implementations; I don't know
how this works, but
On Sunday 04 July 2010 14:07:03, Ivan Lazar Miljenovic wrote:
Ross Paterson r...@soi.city.ac.uk writes:
On Sun, Jul 04, 2010 at 09:55:53PM +1000, Ivan Lazar Miljenovic wrote:
Andrew Coppin andrewcop...@btinternet.com writes:
In summary, I think we need to devise a way of better-documenting
On Sunday 04 July 2010 14:03:51, Ross Paterson wrote:
Now we need to go round and document our instances.
Hmm, it seems only partial: documentation attached to an instance is
shown in the list of instances under a type, but not the list under a
class.
Not much of a problem. Right-click on
2010/7/4 Daniel Fischer daniel.is.fisc...@web.de:
Hmm, it seems only partial: documentation attached to an instance is
shown in the list of instances under a type, but not the list under a
class.
I'm guessing that's to reduce noise...
I'm guessing it might have something to do with the
On Sun, Jul 04, 2010 at 02:32:35PM +0200, Daniel Fischer wrote:
On Sunday 04 July 2010 14:07:03, Ivan Lazar Miljenovic wrote:
Ross Paterson r...@soi.city.ac.uk writes:
Hmm, it seems only partial: documentation attached to an instance is
shown in the list of instances under a type, but not
David Waern david.wa...@gmail.com writes:
2010/7/4 Ivan Lazar Miljenovic ivan.miljeno...@gmail.com:
Andrew Coppin andrewcop...@btinternet.com writes:
In summary, I think we need to devise a way of better-documenting
class instances.
Haddock 2.7 supports documenting instance
2010/7/4 Ivan Lazar Miljenovic ivan.miljeno...@gmail.com:
David Waern david.wa...@gmail.com writes:
2010/7/4 Ivan Lazar Miljenovic ivan.miljeno...@gmail.com:
Andrew Coppin andrewcop...@btinternet.com writes:
In summary, I think we need to devise a way of better-documenting
class instances.
2010/7/4 Ross Paterson r...@soi.city.ac.uk:
It could be either way: sometimes you define a new class with instances
for existing types, and with the current implementation that produces
no documentation.
(I tested with type, class and instance in the same package.)
Hi Ross, thanks for
2010/7/4 David Waern david.wa...@gmail.com:
2010/7/4 Daniel Fischer daniel.is.fisc...@web.de:
Hmm, it seems only partial: documentation attached to an instance is
shown in the list of instances under a type, but not the list under a
class.
I'm guessing that's to reduce noise...
I'm
David Waern wrote:
I found the bug and fixed it, it's in the latest darcs version
Open Source Works.(tm)
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Hello,
I am trying to understand why I am getting an ambigious type variable error,
and what I can do to work around it. The problem is occurring while trying
to use syb-with-class, but I have stripped it down to it's bare essentials,
so the following code is self-contained, and does not require
On Fri, May 21, 2010 at 12:30 PM, Jeremy Shaw jer...@n-heptane.com wrote:
Adding all the scoped type variable stuff does not seem to help. Alas,
I can not figure out if this is a limitation of the type-checker, or
something that is fundamentally impossible. Nor can I figure out how
to work
On Sun, Apr 18, 2010 at 9:02 PM, Brent Yorgey byor...@seas.upenn.eduwrote:
Conal,
Thanks for looking into this! Making (:-*) into a proper type seems
promising. I did try wrapping (:-*) in a newtype but that didn't
help (although I didn't expect it to).
What do you mean by a proper type?
On Mon, Apr 19, 2010 at 09:40:25AM -0700, Conal Elliott wrote:
On Sun, Apr 18, 2010 at 9:02 PM, Brent Yorgey byor...@seas.upenn.eduwrote:
Conal,
Thanks for looking into this! Making (:-*) into a proper type seems
promising. I did try wrapping (:-*) in a newtype but that didn't
help
Conal,
Thanks for looking into this! Making (:-*) into a proper type seems
promising. I did try wrapping (:-*) in a newtype but that didn't
help (although I didn't expect it to).
I see you just uploaded a new version of vector-space; what's new in
0.6.2?
-Brent
On Sat, Apr 17, 2010 at
On 17/04/2010, at 11:00, Conal Elliott wrote:
I'm unsure now, but I think I tried making Basis a data type (not syn) and
ran into the problem I mentioned above. The Basis *synonyms* also have
HasTrie instances, which is crucially important. If we switch to (injective)
data types, then we
Oh! I'd completely forgotten about this idea. Looking at Data.LinearMap in
vector-space, I see a comment about exactly this ambiguity, as well as the
start of a new module that wraps a data type around the linear map
representation. I don't recall whether I got stuck or just distracted.
On
Hi Brent,
I'm sorry to hear that the non-injectivity issue bit you. It's bitten me
also at times, leading me to choose associated data types (injective)
instead of associated synonyms (potentially non-injective). And sometimes,
the data types route is problematic, as the new types aren't
On 14 April 2010 03:48, Brent Yorgey byor...@seas.upenn.edu wrote:
Can someone more well-versed in the intricacies of type checking with
associated types explain this? Or is this a bug in GHC?
Hi Brent
Maybe you can't compose linear maps of the same type, and thus can't
build a valid monoid
On Wed, Apr 14, 2010 at 09:51:52AM +0100, Stephen Tetley wrote:
On 14 April 2010 03:48, Brent Yorgey byor...@seas.upenn.edu wrote:
Can someone more well-versed in the intricacies of type checking with
associated types explain this? Or is this a bug in GHC?
If you take the definition of
On 15/04/2010, at 00:30, Brent Yorgey wrote:
On Wed, Apr 14, 2010 at 09:51:52AM +0100, Stephen Tetley wrote:
On 14 April 2010 03:48, Brent Yorgey byor...@seas.upenn.edu wrote:
Can someone more well-versed in the intricacies of type checking with
associated types explain this? Or is this a
On Thu, Apr 15, 2010 at 12:48:20AM +1000, Roman Leshchinskiy wrote:
Right, this seems weird to me. Why is there still a 'u' mentioned in
the constraints? Actually, I don't even see why there ought to be
both v and v1. The type of (*.*) mentions three type variables, u, v, and
w:
Hi all,
Consider the following declarations.
-- from vector-space package:
(*.*) :: (HasBasis u, HasTrie (Basis u),
HasBasis v, HasTrie (Basis v),
VectorSpace w,
Scalar v ~ Scalar w)
= (v :-* w) - (u :-* v) - u :-* w
-- my code:
data
On Thu, Apr 8, 2010 at 7:29 PM, Doug Burke doug_j_bu...@yahoo.com wrote:
--- On Thu, 4/8/10, Gregory Crosswhite gcr...@phys.washington.edu wrote:
From: Gregory Crosswhite gcr...@phys.washington.edu
On a tangental note, I've considered coding up a package
with an AlmostEq typeclass
Dear Carter,
Although I'm not an active Haskell programmer, I'd like to add my
support for you to write up your GSOC application.
In the first five chapters of the book /Elements of Programming/
(Addison-Wesley, 2009), my coauthor Alex Stepanov and I undertook a
somewhat similar effort,
Hi Carter
The proposal is interesting - but maybe there is not a great community
benefit to a 'covers everything' library considering Henning
Thielemann and others 'numeric prelude' already exists:
http://hackage.haskell.org/package/numeric-prelude
As a not especially mathematically inclined
type classes which a user wouldn't often encounter or deal with
unless they're doing real math, in which case understanding them is probably
key for correctly writing the desired code anyways.
For those reading this who don't know the abstract algebra terminology:
*a monoid* is a set
On Thu, Apr 8, 2010 at 2:09 PM, Edward Kmett ekm...@gmail.com wrote:
Template Haskell can help dull the pain, but the result seems hardly
idiomatic.
Well, since this is dealing with types and type classes, much of the
required boilerplate could also be straightforwardly derived in full
On Thu, Apr 8, 2010 at 3:25 PM, Casey McCann syntaxgli...@gmail.com wrote:
On Thu, Apr 8, 2010 at 2:09 PM, Edward Kmett ekm...@gmail.com wrote:
Template Haskell can help dull the pain, but the result seems hardly
idiomatic.
Well, since this is dealing with types and type classes, much
On Apr 8, 2010, at 12:25 PM, Casey McCann wrote:
Seriously, floating point so-called numbers don't even have
reflexive equality!
They don't? I am pretty sure that a floating point number is always equal to
itself, with possibly a strange corner case for things like +/- 0 and NaN.
Cheers,
Gregory Crosswhite wrote:
On Apr 8, 2010, at 12:25 PM, Casey McCann wrote:
Seriously, floating point so-called numbers don't even have
reflexive equality!
They don't? I am pretty sure that a floating point number is always equal to
itself, with possibly a strange corner case for things
On Thu, Apr 8, 2010 at 7:58 PM, wren ng thornton w...@freegeek.org wrote:
They don't? I am pretty sure that a floating point number is always equal
to itself, with possibly a strange corner case for things like +/- 0 and
NaN.
Exactly. NaN /= NaN.
Other than that, I believe that let x = ...
On Apr 8, 2010, at 5:30 PM, Casey McCann wrote:
On Thu, Apr 8, 2010 at 7:58 PM, wren ng thornton w...@freegeek.org wrote:
Exactly. NaN /= NaN
[...]
Indeed. NaN means that equality is not reflexive for floats in
general, only a subset of them.
First of all, it isn't clear to me that NaN /=
Am Freitag 09 April 2010 02:51:23 schrieb Gregory Crosswhite:
On Apr 8, 2010, at 5:30 PM, Casey McCann wrote:
On Thu, Apr 8, 2010 at 7:58 PM, wren ng thornton w...@freegeek.org
wrote:
Exactly. NaN /= NaN
[...]
Indeed. NaN means that equality is not reflexive for floats in
general,
On Apr 8, 2010, at 6:53 PM, Daniel Fischer wrote:
Am Freitag 09 April 2010 02:51:23 schrieb Gregory Crosswhite:
Yes, but 1/0 isn't a NaN:
Prelude isNaN (1.0/0.0)
False
Prelude isNaN (0.0/0.0)
True
Prelude 1.0/0.0
Infinity
Prelude 0.0/0.0
NaN
Prelude (0.0/0.0) == (0.0/0.0)
False
On Thu, Apr 8, 2010 at 8:51 PM, Gregory Crosswhite
gcr...@phys.washington.edu wrote:
First of all, it isn't clear to me that NaN /= NaN, since in ghci the
expression 1.0/0.0 == 1.0/0.0 evaluates to True. But even if that were the
case, I would call that more of a technicality then meaning
--- On Thu, 4/8/10, Gregory Crosswhite gcr...@phys.washington.edu wrote:
From: Gregory Crosswhite gcr...@phys.washington.edu
On a tangental note, I've considered coding up a package
with an AlmostEq typeclass that allows one to test for
approximate equality. The problem is that different
engine . This part is easy, just a lot of
support type classes which a user wouldn't often encounter or deal with
unless they're doing real math, in which case understanding them is probably
key for correctly writing the desired code anyways.
For those reading this who don't know the abstract algebra
Thanks for the pointers again - you are of great help every time!
On 23 March 2010 17:44, Josef Svenningsson josef.svennings...@gmail.comwrote:
On Tue, Mar 23, 2010 at 11:52 AM, Ozgur Akgun ozgurak...@gmail.com
wrote:
Can a user define a derivable type class of her own? If yes, how?
GHC
Can a user define a derivable type class of her own? If yes, how?
Cheers,
--
Ozgur Akgun
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Ozgur Akgun ozgurak...@gmail.com writes:
Can a user define a derivable type class of her own?
No.
The derivable classes are defined in the Haskell Report; GHC does allow
some others to be derived with extensions however.
There is one exception to this: using the GeneralizedNewtypeDeriving
No. A solution for this (depending on the type class you want to derive) is
Generic Programming. Using Generic Programming, you can define functions that
work on the structure of the type.
For example, take a look at the regular package [1]. It provides all the
functionality to write your own
On Tue, Mar 23, 2010 at 11:52 AM, Ozgur Akgun ozgurak...@gmail.com wrote:
Can a user define a derivable type class of her own? If yes, how?
GHC has a feature which lets you define classes such that making an
instance of them is as easy as deriving. It's called Generic classes.
See GHC's
I've needed something similar in the past.
I used it in the reflection library, and its present on its own on hackage
as 'tagged'.
http://hackage.haskell.org/packages/archive/tagged/0.0/doc/html/Data-Tagged.html
I talked a bit about using it here:
Hi Edward
Does Tagged have a common synonym as its the 'opposite' of Const?
I thought I'd seen the same construction used with Strafunski /
StrategyLib, but if I did I can no longer find the examples.
Thanks
Stephen
___
Haskell-Cafe mailing list
Hi Edward,
Nothing new under the sun it would seem :).
Perhaps these functions could be useful in the Tagged library?
on1 :: Tagged a v - Tagged (x a) v
on1 = retag
on2 :: Tagged a v - Tagged (x a x0) v
on2 = retag
on3 :: Tagged a v - Tagged (x a x0 x1) v
on3 = retag
on4 :: Tagged a v -
Hi,
This literate haskell file was intended to be a quick question about a
problem i have been pondering, but it developed into a short
presentation instead. What i want to know is if there is already
something like this (and suggestions for improvement of course).
{-#LANGUAGE
for, but it seems related.
Oleg Kiselyov, Chung-chieh Shan. Functional pearl: Implicit
configurations-or, type classes reflect the values of types, in Haskell
2004. ACM, 2004, pp. 33-44.
http://www.citeulike.org/user/spl/article/313800
Regards,
Sean
___
Haskell-Cafe
Hello all,
few days ago I made some experiments with Haskell type classes. I wrote
a small Haskell program for searching in sorted lists, defining my own
type classes for equality (MyEq) and order (MyOrd) so that they only
have one member function
Am Donnerstag 04 Februar 2010 16:32:24 schrieb Enrique Martín:
Hello all,
few days ago I made some experiments with Haskell type classes. I wrote
a small Haskell program for searching in sorted lists, defining my own
type classes for equality (MyEq) and order (MyOrd) so that they only
have
some experiments with Haskell type classes. I wrote
a small Haskell program for searching in sorted lists, defining my own
type classes for equality (MyEq) and order (MyOrd) so that they only
have one member function:
class MyEq
Consider the real numbers. They are a group. We have an
identity element `0', inverses and closure under the associative
operation `+'.
Group+ = (+, 0, -1 * _)
They are another group, too -- the group with `*':
Group* = (*, 1, 1 / _)
This seems like a real problem with the
can't encode equational laws in the type system anyway). But if there were,
we'd probably want something more like ML modules (or dependent records).
And of course, that's essentially what type classes are. They're
records/modules that are uniquely determined by the type(s) in question, so
On Tue, Dec 29, 2009 at 6:22 PM, Jason Dusek jason.du...@gmail.com wrote:
Consider the real numbers. They are a group. We have an
identity element `0', inverses and closure under the associative
operation `+'.
Group+ = (+, 0, -1 * _)
They are another group, too -- the group with `*':
2009/12/29 Luke Palmer lrpal...@gmail.com:
They are another group, too -- the group with `*':
Group* = (*, 1, 1 / _)
Ignoring 0 for sake of discussion.
Doh.
--
Jason Dusek
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
I'm playing around with some types to represent a game board (like Go,
Chess, Scrabble, etc).
I'm using a type class to represent the basic Board interface, so I can
change the implementation freely:
class Board b pos piece where
-- Update board with piece played at pos
play :: b pos
Am Dienstag 01 Dezember 2009 23:34:46 schrieb Jeremy Fitzhardinge:
I'm playing around with some types to represent a game board (like Go,
Chess, Scrabble, etc).
I'm using a type class to represent the basic Board interface, so I can
change the implementation freely:
class Board b pos piece
On 12/01/09 15:12, Daniel Fischer wrote:
Am Dienstag 01 Dezember 2009 23:34:46 schrieb Jeremy Fitzhardinge:
I'm playing around with some types to represent a game board (like Go,
Chess, Scrabble, etc).
I'm using a type class to represent the basic Board interface, so I can
change the
Am Mittwoch 02 Dezember 2009 01:43:04 schrieb Jeremy Fitzhardinge:
On 12/01/09 15:12, Daniel Fischer wrote:
Am Dienstag 01 Dezember 2009 23:34:46 schrieb Jeremy Fitzhardinge:
I'm playing around with some types to represent a game board (like Go,
Chess, Scrabble, etc).
I'm using a type
On 12/01/09 17:38, Daniel Fischer wrote:
Am Mittwoch 02 Dezember 2009 01:43:04 schrieb Jeremy Fitzhardinge:
On 12/01/09 15:12, Daniel Fischer wrote:
Am Dienstag 01 Dezember 2009 23:34:46 schrieb Jeremy Fitzhardinge:
I'm playing around with some types to represent a game board
any value
of a type). The type class can be easily generalized to most haskell
data types and it's easy to write instance derivation using Template
Haskell.
I used multiparameter type classes because support for type families
in Template Haskell was incomplete in 6.10.1 and prior versions
(followup to my previous letter with the same subject)
I found the way to break 6.8.2 type checker.
It's as easy as to uncomment Div case alternative in valueIndex.
Weird.
I found a solution, though. Instead of (valueIndex (x_38,(x_36,x_37)))
in that Div alternative I should create expression
it does.
--
View this message in context:
http://www.nabble.com/Essentials-about-type-classes--tp25393728p25405022.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
George Pollard schrieb:
Ok, so I have a small idea I'm trying to work on; call it a
Prelude-rewrite if you want. For this I want to be able to have the
hierarchy Functor → Applicative → Monad.
For Functor, I would like to be able to implement it for a wider
variety of types, as there are
It does seem that having quantified contexts would make this *much* easier...
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Well, you're going to wind up with a lot of cases where you really want a
quantified context, even with just your Functor definition, but in that same
spirit you can build an 'Applicative-like' instance as well.
type family Arg f :: *
type instance Arg [a - b] = [a]
type family Result f :: *
Ok, so I have a small idea I'm trying to work on; call it a
Prelude-rewrite if you want. For this I want to be able to have the
hierarchy Functor → Applicative → Monad.
For Functor, I would like to be able to implement it for a wider
variety of types, as there are types which have aren't
module IOStream where
import System.IO
import System.IO.Unsafe
class Out a where
out :: a → String
instance Show a ⇒ Out a where
out = show
instance Out String where
{-# SPECIALISE out :: String → String #-}
out = id
instance Out Char where
{-# SPECIALISE out :: Char → String #-}
Now there's also a stackoverflow question for this:
http://stackoverflow.com/questions/955711/specialization-in-type-classes-using-ghc
Any help highly appreciated!
2009/6/5 Cetin Sert cetin.s...@gmail.com
module IOStream where
import System.IO
import System.IO.Unsafe
class Out a where
out function that the
default)
But this isn't in the language currently.
-- ryan
2009/6/5 Cetin Sert cetin.s...@gmail.com:
Now there's also a stackoverflow question for this:
http://stackoverflow.com/questions/955711/specialization-in-type-classes-using-ghc
Any help highly appreciated!
2009
could probably even be extended and turned into a
tutorial on the topic.
Of course type classes are not only important just for making dictionary
passing implicit, but also because of their interactions, which is
nicely demonstrated by the sigfpe blog entry that someone also linked
from
Hi folks
I have been known to venture the viewpoint that the
newtype trick might benefit from improved library
support, for example, here
http://www.mail-archive.com/haskell-cafe@haskell.org/msg37213.html
This is in a similar vein to Derek's approach, if
accompanied by a little more
Hello,
I don't mean to be negative here but I really fail to see how do any
of these ideas help the situation. (I do think it would be cool to
have a generic way to lift functions from one type to another that is
isomorphic to it). The fundamental problem is that there are multiple
functions of
Luke Palmer wrote:
On Mon, Jan 19, 2009 at 3:58 AM, Patai Gergely patai_gerg...@fastmail.fmwrote:
However, there are other type classes that are too general to assign
such concrete uses to. For instance, if a data structure can have more
than one meaningful (and useful) Functor or Monoid
type classes that are too general to assign
such concrete uses to. For instance, if a data structure can have more
than one meaningful (and useful) Functor or Monoid instance, what should
one do? Should one refrain from instantiating these classes altogether
and just use the names of operations
call
it a use case?) which of these we actually want, e.g. human readable
form, debug information, serialisation for later reading and so on, and
one of the solutions was to propose a family of show functions that
carry the intended use in their name.
However, there are other type classes that are too
form, debug information, serialisation for later reading and so on, and
one of the solutions was to propose a family of show functions that
carry the intended use in their name.
However, there are other type classes that are too general to assign
such concrete uses to. For instance, if a data
On Mon, Jan 19, 2009 at 3:58 AM, Patai Gergely patai_gerg...@fastmail.fmwrote:
However, there are other type classes that are too general to assign
such concrete uses to. For instance, if a data structure can have more
than one meaningful (and useful) Functor or Monoid instance,
As a side
2009/1/19 Luke Palmer lrpal...@gmail.com:
As a side curiosity, I would love to see an example of any data structure
which has more than one Functor instance. Especially those which have more
than one useful functor instance.
(,) ?
-Antoine
___
2009/1/19 Luke Palmer lrpal...@gmail.com:
On Mon, Jan 19, 2009 at 3:58 AM, Patai Gergely patai_gerg...@fastmail.fm
wrote:
However, there are other type classes that are too general to assign
such concrete uses to. For instance, if a data structure can have more
than one meaningful
Am Montag, 19. Januar 2009 14:31 schrieb Antoine Latter:
2009/1/19 Luke Palmer lrpal...@gmail.com:
As a side curiosity, I would love to see an example of any data structure
which has more than one Functor instance. Especially those which have
more than one useful functor instance.
(,) ?
Am Montag, den 19.01.2009, 14:47 +0100 schrieb Daniel Fischer:
Am Montag, 19. Januar 2009 14:31 schrieb Antoine Latter:
2009/1/19 Luke Palmer lrpal...@gmail.com:
As a side curiosity, I would love to see an example of any data structure
which has more than one Functor instance. Especially
The desugaring of (, a) would involve some type level lambda, and
that's not something that is available (yet).
-- Lennart
On Mon, Jan 19, 2009 at 1:49 PM, Holger Siegel holgersiege...@yahoo.de wrote:
Am Montag, den 19.01.2009, 14:47 +0100 schrieb Daniel Fischer:
Am Montag, 19. Januar 2009
As a side curiosity, I would love to see an example of any data structure
which has more than one Functor instance. Especially those which have
more than one useful functor instance.
data Record a b = R { field1 :: a, field2 :: b }
If I want to use fmap to transform either field, I have to
Hello,
The multitude of newtypes in the Monoid module are a good indication
that the Monoid class is not a good fit for the class system (it is
ironic that discussing it resulted in such a huge thread recently :-).
How I'd approach the situation that you describe would depend on
the context
On Mon, 2009-01-19 at 10:59 -0800, Iavor Diatchki wrote:
Hello,
The multitude of newtypes in the Monoid module are a good indication
that the Monoid class is not a good fit for the class system
I would say rather that the class system is not a good fit for Monoid.
Proposals for local
Hi,
On Mon, Jan 19, 2009 at 11:06 AM, Jonathan Cast
jonathancc...@fastmail.fm wrote:
On Mon, 2009-01-19 at 10:59 -0800, Iavor Diatchki wrote:
Hello,
The multitude of newtypes in the Monoid module are a good indication
that the Monoid class is not a good fit for the class system
I would say
Palmer lrpal...@gmail.com:
On Mon, Jan 19, 2009 at 3:58 AM, Patai Gergely
patai_gerg...@fastmail.fm
wrote:
However, there are other type classes that are too general to assign
such concrete uses to. For instance, if a data structure can have more
than one meaningful (and useful) Functor
that, if
we're going to restrict type classes to only those cases where we never
want to specialize an overloaded function to a non-standard instance,
that we're going to end up with Eq, Num, and maybe Functor as classes.
I'm not sure a general language mechanism is really needed just for
those three
patai_gerg...@fastmail.fm
wrote:
However, there are other type classes that are too general
to assign
such concrete uses to. For instance, if a data structure
can have more
than one meaningful (and useful) Functor or Monoid
19, 2009 at 3:58 AM, Patai Gergely patai_gerg...@fastmail.fm
wrote:
However, there are other type classes that are too general to
assign
such concrete uses to. For instance, if a data structure can have
more
than one meaningful (and useful) Functor or Monoid instance,
As a side
On Mon, 2009-01-19 at 12:10 -0800, Iavor Diatchki wrote:
Hi,
On Mon, Jan 19, 2009 at 11:06 AM, Jonathan Cast
jonathancc...@fastmail.fm wrote:
On Mon, 2009-01-19 at 10:59 -0800, Iavor Diatchki wrote:
Hello,
The multitude of newtypes in the Monoid module are a good indication
that the
201 - 300 of 676 matches
Mail list logo