monadic 0.5.5

macros to define Haskell style monadic action blocks for IntoIterators, Reader, Writer, State, and macros for the transformers ReaderT and WriterT over Vec, LinkedList and VecDeque
Documentation
//! Semigroup and Monoid to use with Writer

pub trait Semigroup {

   fn mappend(self, other: &mut Self) -> Self;
}

pub trait Monoid: Semigroup {
   fn mempty() -> Self;
}

//--------------------------------------------

impl Semigroup for String {

  fn mappend( mut self, other: &mut Self) -> Self {
   self.push_str( other);
   self
  }
}

impl Monoid for String {
  fn mempty() -> Self { Self::new()}
}

//--------------------------------------------

use std::clone::Clone;

impl<T: Clone> Semigroup for Vec<T> {

  fn mappend( mut self, other: &mut Self) -> Self {
   self.append( other);
   self
  }
}

impl<T: Clone> Monoid for Vec<T> {
  fn mempty() -> Self { Self::new()}
}