Skip to content

Commit

Permalink
refactor: generalize join to Monoid
Browse files Browse the repository at this point in the history
  • Loading branch information
arkeros committed Dec 24, 2024
1 parent 56b9d3c commit 1d7ddee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion 23/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ inputP = edge `sepBy` newline
(∈) :: (Ord a) => a -> Set a -> Bool
(∈) = Set.member

join :: (Foldable t) => String -> t String -> String
join :: (Foldable t, Monoid a) => a -> t a -> a
join sep = foldr1 (\a b -> a <> sep <> b)

solve :: Input -> (Int, String)
Expand Down

0 comments on commit 1d7ddee

Please sign in to comment.