Convert Data.Sequence to list?

Is there a common way to convert Data.Sequence (Seq a) to list [a]?

I see fromList there, but not toList

+5
source share
1 answer

There is an Foldableinstance for Seq a, and it provides toList. for example, it will print [1,2,3,4,5,6,7,8,9,10]

import Data.Foldable (toList)
import Data.Sequence (fromList)

main = print . toList . fromList $ [1..10]
+14
source

All Articles