Life Itself has been evolved distinct markers or tags to be attached to the beginning and end of a sequence of codons on a DNA strand.

Enzymes pattern-match against these tags (unique sequences of "letters" or codons) to find out where exactly to start and stop the process of transcription.

map f []     = []
map f (x:xs) = f x : map f xs

Here pattern-matching on an end-marker, which is [] is required and absolutely necessary. Otherwise the second clause will be non-terminating.

The first clause, which is called the base case, provides the answer to a fundamental question - "where to stop".

Tags are as fundamental as nested linear structures (sequences) themselves. No wonder, Lisp discovered type-tagging and type-constructors in ML are nothing but additional (nested) tags on values of primitive types.

Last modified 2 years ago Last modified on Nov 15, 2018, 5:57:31 AM
Note: See TracWiki for help on using the wiki.