module Fresnel.Functor.Traversed1
( -- * Traversed1 functor
  runTraversed1
, Traversed1(..)
) where

import Data.Functor (void)
import Data.Functor.Apply

runTraversed1 :: Functor f => Traversed1 f a -> f ()
runTraversed1 :: forall (f :: * -> *) a. Functor f => Traversed1 f a -> f ()
runTraversed1 (Traversed1 f a
fa) = f a -> f ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void f a
fa

newtype Traversed1 f a = Traversed1 (f a)

instance Apply f => Semigroup (Traversed1 f a) where
  Traversed1 f a
a1 <> :: Traversed1 f a -> Traversed1 f a -> Traversed1 f a
<> Traversed1 f a
a2 = f a -> Traversed1 f a
forall (f :: * -> *) a. f a -> Traversed1 f a
Traversed1 (f a
a1 f a -> f a -> f a
forall a b. f a -> f b -> f b
forall (f :: * -> *) a b. Apply f => f a -> f b -> f b
.> f a
a2)