Skip to content

Commit

Permalink
changed smartReplicate implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasDS-0 committed Nov 9, 2021
1 parent baf3230 commit 3222eb4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Chapter2.hs
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ value of the element itself
-}

smartReplicate :: [Int] -> [Int]
smartReplicate = foldr (\x -> (++) $ replicate x x) []
smartReplicate = concatMap (\x -> replicate x x)

{- |
=⚔️= Task 9
Expand Down

0 comments on commit 3222eb4

Please sign in to comment.