/// Returns the visual representation of `$matrix` as a string
/// @group misc
/// @param {Matrix} $matrix - matrix to display
/// @return {String}
@function display($matrix) {
  $str: "";
  @each $line in $matrix {
    $tmp: "";
    @each $item in $line {
      $tmp: $tmp + " " + $item;
    }
    $str: $str + $tmp + "\A ";
  }
  @return $str;
}

/// Mixin displaying the matrix using body pseudo-elements
/// @group misc
/// @param {Matrix} $matrix - matrix to display
/// @param {String} $pseudo (before) - pseudo element to use
/// @require {function} display
@mixin display($matrix, $pseudo: before) {
  body:#{$pseudo} {
    content: display($matrix)                 !important;

    display: block                            !important;
    margin: 1em                               !important;
    padding: .5em                             !important;

    background: #EFEFEF                       !important;
    border: 1px solid #DDD                    !important;
    border-radius: .2em                       !important;

    color: #333                               !important;
    font: 1.5em/1.5 "Courier New", monospace  !important;
    text-shadow: 0 1px white                  !important;
    white-space: pre-wrap                     !important;
  }
}
