pub fn flat_map(&self, monad: CellRef, map_fn: CellRef, frame: Frame) -> (Frame, RuntimeResult) {
        match &*self.flat_map {
            SafasCell::FrameMonad(action) => {
                // Call the flat map function with the monad and the supplied mapping function
                let mut frame   = frame;
                frame.cells[0]  = SafasCell::List(monad, map_fn).into();
                action.execute(frame)
            },
            _ => return (frame, Err(RuntimeError::NotAFunction(Arc::clone(&self.flat_map))))
        }
    }
///
/// Performs the flat_map operation on a monad value
///
Performs the flat_map operation on a monad value
Performs the flat_map operation on a monad value
pub fn flat_map(&self, monad: CellRef, map_fn: CellRef, frame: Frame) -> (Frame, RuntimeResult) {
        match &*self.flat_map {
            SafasCell::FrameMonad(action) => {
                // Call the flat map function with the monad and the supplied mapping function
                let mut frame   = frame;
                frame.cells[0]  = SafasCell::List(monad, map_fn).into();
                action.execute(frame)
            },
            _ => return (frame, Err(RuntimeError::NotAFunction(Arc::clone(&self.flat_map))))
        }
    }
pub fn flat_map ( & self , monad : CellRef , map_fn : CellRef , frame : Frame ) -> ( Frame , RuntimeResult ) { match & * self . flat_map { SafasCell :: FrameMonad ( action ) => { // Call the flat map function with the monad and the supplied mapping function let mut frame = frame ; frame . cells [ 0 ] = SafasCell :: List ( monad , map_fn ) . into ( ) ; action . execute ( frame ) } , _ => return ( frame , Err ( RuntimeError :: NotAFunction ( Arc :: clone ( & self . flat_map ) ) ) ) } }
Performs the flat_map operation on a monad value
Performs the flat_map operation on a monad value
&self
monad
CellRef
map_fn
CellRef
frame
Frame
&self
monad
CellRef
map_fn
CellRef
frame
Frame