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

asp.net mvc - SSO between MVCForum and Umbraco7 -

python - Exception while importing pymorphy2 -

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