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 Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -