Jon Fairbairn ([EMAIL PROTECTED]) writes:
 > On 11 Jul, Wolfram Kahl wrote:
 > >  [...]
 > >  The core function here is
 > >  
 > > > (diagonalize (1 :: Integer)) :: [[a]] -> [a]
 > >  
 > >  This function diagonalises finite or infinite lists
 > >  with arbitrary finite or infinite element lists.
 > >  
 > >  [..]
 > I got rather lost in the ensuing discussion, so I've composed this
 > reply from back here.  It seems to me that the core function is (//),
 > which can be written like this:
 > 
 > > module Diagonalise ((//)) where
 > > import List
 > 
 > A diagonalisation function that doesn't use numbers.
 > 
 > > (//):: [a] -> [b] -> [(a,b)]
 > 
 > [...]
 > Or have I totally lost it?

I confess guilty to have diverged from this simpler problem

> (//) :: [a] -> [b] -> [(a,b)]

to the more general problem

> diagonalise :: [[a]] -> [a]

The first can be reconstructed from the latter via:

> (//) as bs = diagonalise [ [ (a,b) | b <- bs ] | a <- as ]

HTH!


Wolfram


Reply via email to