{-# LANGUAGE NoImplicitPrelude #-}

module Stack.Types.IsMutable
  ( IsMutable (..)
  ) where

import           Stack.Prelude

data IsMutable
  = Mutable
  | Immutable
  deriving (IsMutable -> IsMutable -> Bool
(IsMutable -> IsMutable -> Bool)
-> (IsMutable -> IsMutable -> Bool) -> Eq IsMutable
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: IsMutable -> IsMutable -> Bool
== :: IsMutable -> IsMutable -> Bool
$c/= :: IsMutable -> IsMutable -> Bool
/= :: IsMutable -> IsMutable -> Bool
Eq, Int -> IsMutable -> ShowS
[IsMutable] -> ShowS
IsMutable -> String
(Int -> IsMutable -> ShowS)
-> (IsMutable -> String)
-> ([IsMutable] -> ShowS)
-> Show IsMutable
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> IsMutable -> ShowS
showsPrec :: Int -> IsMutable -> ShowS
$cshow :: IsMutable -> String
show :: IsMutable -> String
$cshowList :: [IsMutable] -> ShowS
showList :: [IsMutable] -> ShowS
Show)

instance Semigroup IsMutable where
  IsMutable
Mutable <> :: IsMutable -> IsMutable -> IsMutable
<> IsMutable
_ = IsMutable
Mutable
  IsMutable
_ <> IsMutable
Mutable = IsMutable
Mutable
  IsMutable
Immutable <> IsMutable
Immutable = IsMutable
Immutable

instance Monoid IsMutable where
  mempty :: IsMutable
mempty = IsMutable
Immutable
  mappend :: IsMutable -> IsMutable -> IsMutable
mappend = IsMutable -> IsMutable -> IsMutable
forall a. Semigroup a => a -> a -> a
(<>)