If you create a vector with two generic components, such as:
data Vector a = MakeVector a a
(I put MakeVector
instead of Vector
on purpose)
( Vector a
) is the type constructor while
( MakeVector
) is the data constructor.
if I do
:t MakeVector 1 2
MakeVector 1 2 :: Num a => Vector a
I can see that it makes sense to say that MakeVector
is a constructor since I get an instance of type ( Vector a
) with a
of type Num
but why is it called ( Vector a
) type contructor ?, I can not do anything with ( Vector a
), I can not build anything, it is the identifier of the type itself depending on the type that has a
.
even more, personally I would find it right to call MakeVector
type constructor (since I get a type) instead of data constructor, why do not you call it that?
Thank you.