data MyMonId a = MyMonId a deriving Show

instance Monad MyMonId where
  MyMonId x >>= f = f x
  return x = MyMonId x

data CountOps a = CountOps Int a deriving Show

instance Monad CountOps where
  return x = CountOps 0 x
  CountOps i x >>= f =
    let
      (CountOps j y) = f x
    in
     CountOps (i+j+1) y

data PairMon a = PairMon a a deriving Show

instance Monad PairMon where
  return x = PairMon x x
  PairMon x1 x2 >>= f =
    let
      (PairMon z1 _) = f x1
      (PairMon _ z2) = f x2
    in
     PairMon z1 z2

