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

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -