Closed jachymb closed 7 years ago
I would find it useful to have a function like this
constV :: forall a n. KnownNat n => a -> V n a
which creates a vector of given (type-level) length with some default value. It can be implemented quite easily:
constV = fromJust . fromVector . replicate (reflectDim (Proxy :: Proxy n))
but I find this somewhat ugly due to the use of fromJust. It would be nicer to have a library function which does not need this.
fromJust
Your constV is simply pure.
constV
pure
The fix for this would be to add documentation somewhere explaining how to use the library.
I would find it useful to have a function like this
which creates a vector of given (type-level) length with some default value. It can be implemented quite easily:
but I find this somewhat ugly due to the use of
fromJust
. It would be nicer to have a library function which does not need this.