1{-# LANGUAGE CPP #-}
2-----------------------------------------------------------------------------
3-- |
4-- Copyright   :  (C) 2011-2015 Edward Kmett
5-- License     :  BSD-style (see the file LICENSE)
6--
7-- Maintainer  :  Edward Kmett <ekmett@gmail.com>
8-- Stability   :  provisional
9-- Portability :  portable
10--
11----------------------------------------------------------------------------
12module Data.Semigroup.Bitraversable
13  ( Bitraversable1(..)
14  , bifoldMap1Default
15  ) where
16
17import Control.Applicative
18#if !(MIN_VERSION_base(4,11,0))
19import Data.Semigroup
20#endif
21import Data.Semigroup.Traversable.Class
22
23bifoldMap1Default :: (Bitraversable1 t, Semigroup m) => (a -> m) -> (b -> m) -> t a b -> m
24bifoldMap1Default f g = getConst . bitraverse1 (Const . f) (Const . g)
25{-# INLINE bifoldMap1Default #-}
26