On Sun, Jul 04, 2010 at 10:31:34AM +0100, Andrew Coppin wrote:
I have literally no idea what a type family is. I understand ATs (I think!),
but TFs make no sense to me.
ATs are just TFs which happen to be associated with a particular
class. So if you understand ATs then you understand TFs
Brent Yorgey wrote:
On Sun, Jul 04, 2010 at 10:31:34AM +0100, Andrew Coppin wrote:
I have literally no idea what a type family is. I understand ATs (I think!),
but TFs make no sense to me.
ATs are just TFs which happen to be associated with a particular
class. So if you understand
Andrew Coppin wrote:
Brent Yorgey wrote:
On Sun, Jul 04, 2010 at 10:31:34AM +0100, Andrew Coppin wrote:
I have literally no idea what a type family is. I understand ATs (I
think!), but TFs make no sense to me.
ATs are just TFs which happen to be associated with a particular
class. So
Sjoerd Visscher wrote:
On Jul 3, 2010, at 4:39 PM, Andrew Coppin wrote:
class Container c = Functor c where
fmap :: (Functor cx, Functor cy, Element cx ~ x, Element cy ~ y) = (x - y) -
(cx - cy)
However, this fails horribly: The type signature fails to mention c.
You have to
On Jul 4, 2010, at 11:31 AM, Andrew Coppin wrote:
type family F f a :: *
class RFunctor f where
(%) :: f a b - (a - b) - F f a - F f b
I have literally no idea what a type family is. I understand ATs (I think!),
but TFs make no sense to me.
(For this reason, most if not all of
On 07/04/2010 01:49 PM, Sjoerd Visscher wrote:
On Jul 4, 2010, at 11:31 AM, Andrew Coppin wrote:
type family F f a :: *
class RFunctor f where
(%) :: f a b - (a - b) - F f a - F f b
I have literally no idea what a type family is. I understand ATs (I think!),
but TFs make no
On Jul 4, 2010, at 1:58 PM, Steffen Schuldenzucker wrote:
This works (on my ghc-6.12.2):
class Rfunctor f where
type F f :: * - *
(%) :: f a b - (a - b) - F f a - F f b
Yes, but then this isn't allowed:
data BSFunctor :: * - * - * where
BS :: BSFunctor Word8 Word8
instance
Andrew Coppin andrewcop...@btinternet.com writes:
Currently we have
class Functor c where
fmap :: (x - y) - (c x - c y)
This relies on c having kind * - *. For example, Bytestring cannot be
an instance of Functor.
A cleaner solution would be to have something like
class Container
Hello Andrew
The non-type-changing map is sometimes useful 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
For the graphics I want objects to be parametric on unit (which is
usually Double),
On Jul 3, 2010, at 4:39 PM, Andrew Coppin wrote:
class Container c = Functor c where
fmap :: (Functor cx, Functor cy, Element cx ~ x, Element cy ~ y) = (x -
y) - (cx - cy)
However, this fails horribly: The type signature fails to mention c.
You have to mention c, this means an extra
10 matches
Mail list logo