Re: [Haskell-cafe] Removing polymorphism from type classes (viz. Functor) (Again)

2010-08-15 Thread Ivan Lazar Miljenovic
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

Re: [Haskell-cafe] Removing polymorphism from type classes (viz. Functor) (Again)

2010-08-15 Thread Stephen Tetley
On 15 August 2010 08:50, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: Yeah, I'm working on something like this at the moment, but I'm currently stuck on naming: if I want to have Functor for kind * - *, what's a good name for a type class for kind *? Conor McBride has suggested

Re: [Haskell-cafe] Removing polymorphism from type classes (viz. Functor) (Again)

2010-08-15 Thread Alexey Karakulov
On Sun, Aug 15, 2010 at 10:50 AM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: Yeah, I'm working on something like this at the moment, but I'm currently stuck on naming: if I want to have Functor for kind * - *, what's a good name for a type class for kind *? I was thinking about

[Haskell-cafe] Removing polymorphism from type classes (viz. Functor) (Again)

2010-08-14 Thread Alexey Karakulov
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

Re: [Haskell-cafe] Removing polymorphism from type classes (viz. Functor) (Again)

2010-08-14 Thread Ivan Lazar Miljenovic
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

Re: [Haskell-cafe] Removing polymorphism from type classes (viz. Functor) (Again)

2010-08-14 Thread Alexey Karakulov
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

Re: [Haskell-cafe] Removing polymorphism from type classes (viz. Functor) (Again)

2010-08-14 Thread Stephen Tetley
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:

Re: [Haskell-cafe] Removing polymorphism from type classes (viz. Functor) (Again)

2010-08-14 Thread Stephen Tetley
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

Re: [Haskell-cafe] Removing polymorphism from type classes (viz. Functor)

2009-07-13 Thread Henning Thielemann
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

Re: [Haskell-cafe] Removing polymorphism from type classes (viz. Functor)

2009-07-13 Thread George Pollard
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

Re: [Haskell-cafe] Removing polymorphism from type classes (viz. Functor)

2009-07-09 Thread Edward Kmett
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 :: *

[Haskell-cafe] Removing polymorphism from type classes (viz. Functor)

2009-07-07 Thread George Pollard
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