Skip to content

Commit

Permalink
Add Tsil.toReverseList
Browse files Browse the repository at this point in the history
  • Loading branch information
ollef committed May 23, 2024
1 parent 93f58ee commit 77490e2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Data/Tsil.hs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ instance Foldable Tsil where
go acc Empty = acc
go acc (xs :> x) = go (x : acc) xs

toReverseList :: Tsil a -> [a]
toReverseList Empty = []
toReverseList (as :> a) = a : toReverseList as

null :: Tsil a -> Bool
null Empty = True
null (_ :> _) = False
Expand Down

0 comments on commit 77490e2

Please sign in to comment.