Skip to content

Commit 789d0ac

Browse files
committed
Add Functor instance for Builder
1 parent 7c9d723 commit 789d0ac

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Data/Builder/Catenable.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{-# LANGUAGE BangPatterns #-}
2+
{-# LANGUAGE DeriveFunctor #-}
3+
{-# LANGUAGE DerivingStrategies #-}
24
{-# LANGUAGE PatternSynonyms #-}
5+
{-# LANGUAGE StandaloneDeriving #-}
36
{-# LANGUAGE TypeFamilies #-}
47

58
{- | Builder with cheap concatenation. Like the builder type from
@@ -63,6 +66,8 @@ data Builder a
6366
| Snoc !(Builder a) a
6467
| Append !(Builder a) !(Builder a)
6568

69+
deriving stock instance Functor Builder
70+
6671
instance Monoid (Builder a) where
6772
{-# INLINE mempty #-}
6873
mempty = Empty

0 commit comments

Comments
 (0)