psibi / shell-conduit

Write shell scripts with Conduit
BSD 3-Clause "New" or "Revised" License
96 stars 15 forks source link

Add 'Semigroup' and 'Monoid' instances for 'Segment' #13

Open chshersh opened 6 years ago

chshersh commented 6 years ago

These instance would be really useful!

instance Semigroup r => Semigroup (Segment r) where
    (<>) = liftA2 (<>)

instance Monoid r => Monoid (Segment r) where
    mempty  = pure mempty
    mappend = liftA2 mappend
psibi commented 6 years ago

Sorry for my late reply. The instances sound useful. Can you send a PR ?