Is there a generally accepted way of converting a Data.Sequence (Seq a) to a list [a]?
I see there's a fromList, but no toList
There is a Foldable
instance for Seq a
, and this provides a toList
method. e.g. this 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]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With