Proof of concept for leftmostLongest function
This commit is contained in:
5
test.hs
Normal file
5
test.hs
Normal file
@@ -0,0 +1,5 @@
|
||||
leftmostLongest :: (Foldable t) => [t a] -> t a
|
||||
leftmostLongest xs =
|
||||
let lastElem = (last xs)
|
||||
filteredLst = (filter (\val -> (length val) == (length lastElem)) xs)
|
||||
in head filteredLst
|
Reference in New Issue
Block a user