anchor.diff:  
     /* Create a fixed width string with additional prefix to match
        required width.
  +
  +     This function will fail if the input string is longer than the
  +     requested length.
  +
  +     Type: fixedWidthString :: int -> string -> string
   
        Example:
          fixedWidthString 5 "0" (toString 15)
  
positive.code:        removeSuffix "xxx" "homefront"
         => "homefront"
    */
    removeSuffix = suf: s:
      let
        sufLen = stringLength suf;
        sLen = stringLength s;
      in
        if sufLen <= sLen && suf == substring (sLen - sufLen) sufLen s then
          substring 0 (sLen - sufLen) s
        else
          s;
  
    /* Return true iff string v1 denotes a version older than v2.
  
       Example:
         versionOlder "1.1" "1.2"
  
negative.code:        hasPrefix "foo" "barfoo"
         => false
    */
    hasPrefix =
      # Prefix to check for
      pref:
      # Input string
      str: substring 0 (stringLength pref) str == pref;
  
    /* Determine whether a string has given suffix.
  
       Type: hasSuffix :: string -> string -> bool
  
       Example:
         hasSuffix "foo" "foobar"
  