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

Popular posts from this blog

python - Installing PyDev in eclipse is failed -

PHP OOP-based login system -

c# - Nested Internal Class with Readonly Hashtable throws Null ref exception.. on assignment -