Re: [Haskell-cafe] accessing a type variable in instance declaration

2013-05-22 Thread Roman Cheplyaka
* TP [2013-05-22 18:45:06+0200] > Ok, thanks, I understand. Now, I'm stuck to compile this code (independent > from my previous post, but related to it): > > --- > {-# LANGUAGE DataKinds #-} > {-# LANGUAGE KindSignatures #-} > > data Nat = Zero | Succ Nat > type One = Succ Zero > ty

Re: [Haskell-cafe] accessing a type variable in instance declaration

2013-05-22 Thread TP
Roman Cheplyaka wrote: > You are confusing type and value variables. > > c2num order > > means apply the function 'c2num' to the value variable 'order', which is > not defined. > > To get from a type to a value you can use a type class 'Sing' (for > 'singleton') > > class Sing a where >

Re: [Haskell-cafe] accessing a type variable in instance declaration

2013-05-22 Thread Roman Cheplyaka
* TP [2013-05-22 16:18:55+0200] > Hi all, > > I wonder if there is some means to get a type variable value in the body of > a class instance definition. It seems it is not possible (a workaround has > already been given on this list), but I would like a confirmation. > For example, imagine that

[Haskell-cafe] accessing a type variable in instance declaration

2013-05-22 Thread TP
Hi all, I wonder if there is some means to get a type variable value in the body of a class instance definition. It seems it is not possible (a workaround has already been given on this list), but I would like a confirmation. For example, imagine that I have a Tensor type constructor, that takes