For example, consider the failure monad Maybe. For every failure, it mashes them all to Nothing. Likewise, the list monad mashes every failure to empty list. So far from this observation, every failure seems to factor through fmap absurd :: Functor f => f Void -> f a. Is this true?
Some programming languages (Rust is one I can think of off the top of my head) provides mechanisms to have immutable variables but they also have constants. Isn't an immutable variable just a constant? What advantage is there in supporting both?
This is an example for the use of Rust's macro_rules!:
macro_rules! add{
($a:expr,$b:expr)=>{
{
$a+$b
}
};
($a:expr)=>{
{
$a
}
}
}
A similar example for Scheme using syntax-rules could be:
(define-syntax add
(syntax-rules ()
(...
While writing a question I noticed, that it seems to be impossible to get the indenting right.
The following screenshot shows, that the indent of the single $a is wrong, although it had been right in the source code of the question.