Andy Gill's Html library
Thomas L. Bevan
Mon, 24 Jun 2002 18:10:02 +0000
I've been working through the source code of Andy Gill's Html library for=
Andrew makes the following definitions.
instance (Show a) =3D> Show (BlockTable a) where
showsPrec p =3D showsTable
type TableI a =3D [[(a,(Int,Int))]] -> [[(a,(Int,Int))]]
data BlockTable a =3D Table (Int -> Int -> TableI a) Int Int
You can create a (1x1) table entry
single :: a -> BlockTable a
single a =3D Table (\ x y z -> [(a,(x+1,y+1))] : z) 1 1
Can someone explain the reasoning behind using=20
a function to describe a Table rather than just a list of lists?