24 Jun
2002
24 Jun
'02
6:10 p.m.
Hi, I've been working through the source code of Andy Gill's Html library for my own edification. Andrew makes the following definitions. \begin{code} instance (Show a) => Show (BlockTable a) where showsPrec p = showsTable type TableI a = [[(a,(Int,Int))]] -> [[(a,(Int,Int))]] data BlockTable a = Table (Int -> Int -> TableI a) Int Int \end{code} You can create a (1x1) table entry \begin{code} single :: a -> BlockTable a single a = Table (\ x y z -> [(a,(x+1,y+1))] : z) 1 1 \end{code} Can someone explain the reasoning behind using a function to describe a Table rather than just a list of lists? Tom
8584
Age (days ago)
8584
Last active (days ago)
0 comments
1 participants
participants (1)
-
Thomas L. Bevan