[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

#### 2.7.14.4 Transpose

The `transpose` operation has the following representation in virtual code.

T31

  [[`transpose`]] = `((nil,nil),((nil,nil),(nil,nil)))`

This function takes a list of equal length lists as an argument, and returns a list of lists as a result. In the resulting list, the first item is the list of all first items of lists in the argument. The next item is the list of all second items, and so on.

In the specification of the semantics, the `silly` mnemonic `flat` is defined by `flat = reduce(cat,nil)` in the standard `silly` prelude, which means that it flattens a list of lists into one long list.

P41

  [[`transpose`]] `x` = `nil` if [[`flat`]] `x` = `nil`

P42

  [[`transpose`]] `x` = `(`[[`map left`]] `x,`[[`transpose`]] [[`map right`]] `x)`
  if [[`flat`]] `x` is a non-`nil` tree

This document was generated on November 8, 2012 using texi2html 1.82.