[Haskell-cafe] partially applied data constructor and corresponding type

TP paratribulations at free.fr
Sat Apr 27 21:33:17 CEST 2013


Hello,

I ask myself if there is a way to do the following.
Imagine that I have a dummy type:

data Tensor = TensorVar Int String

where the integer is the order, and the string is the name of the tensor.
I would like to make with the constructor TensorVar a type "Vector", such 
that, in "pseudo-language":

data Vector = TensorVar 1 String

Because a vector is a tensor of order 1.

Is this possible? I have tried type synonyms and newtypes without any success.

Thanks a lot,

TP



More information about the Haskell-Cafe mailing list