module Control.Monad.One (One(..)) where
import Control.Applicative
import Data.Foldable
import Data.Traversable
import Data.Monoid
import Data.Distributive
import Control.Monad
import Data.Typeable
data One a = One deriving (Show, Read, Eq, Ord, Enum, Functor, Foldable, Traversable, Typeable)
instance Monoid (One a) where
mempty = One
mappend _ _ = One
instance Monad One where
return _ = One
_ >>= _ = One
instance Applicative One where
pure _ = One
_ <*> _ = One
instance Alternative One where
empty = One
_ <|> _ = One
instance MonadPlus One where
mzero = One
mplus _ _ = One
instance Distributive One where
distribute _ = One
collect _ _ = One