How to convert a Haskell Traversable into a Vector? -
if have traversable
instance, xs
, how convert vector
?
all traversable
instances foldable
, can write like
tovector :: foldable t => t -> vector tovector = vector.fromlist . foldable.tolist {-# inline tovector #-}
this might make intermediate list though, if doesn't fused away. inlining should make fusion more likely.
Comments
Post a Comment