Demonstrate in your programming language the following:

Construct a Maybe Monad by writing the 'bind' function and the 'unit' (sometimes known as 'return') function for that Monad (or just use what the language already has implemented)
Make two functions, each which take a number and return a monadic number, e.g. Int -> Maybe Int and Int -> Maybe String
Compose the two functions with bind


A Monad is a single type which encapsulates several other types, eliminating boilerplate code. In practice it acts like a dynamically typed computational sequence, though in many cases the type issues can be resolved at compile time.

A Maybe Monad is a monad which specifically encapsulates the type of an undefined value.

/*REXX program mimics a bind operation when trying to perform addition upon arguments.  */
call add 1, 2
call add 1, 2.0
call add 1, 2.0, -6
call add self, 2
exit 0                                           /*stick a fork in it,  we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
add:   void= 'VOID';                       f=    /*define in terms of a function&binding*/
                     do j=1  for arg()           /*process, classify, bind each argument*/
                     call bind( arg(j) );  f= f arg(j)
                     end   /*j*/
       say
       say 'adding'  f;    call sum f            /*telegraph what's being performed next*/
       return                                    /*Note: REXX treats INT & FLOAT as num.*/
/*──────────────────────────────────────────────────────────────────────────────────────*/
bind:  arg a;  type.a= datatype(a);  return      /*bind argument's kind with its "type".*/
/*──────────────────────────────────────────────────────────────────────────────────────*/
sum:   parse arg a;  $= 0                        /*sum all arguments that were specified*/
                             do k=1  for words(a);  ?= word(a, k)
                             if type.?==num & $\==void  then $= ($ + word(a, k)) / 1
                                                        else $= void
                             end   /*k*/
       say 'sum='  $
       return $