Revision | f8698468d2fb7956da8d5feba8a871b003ad0f2c (tree) |
---|---|
Zeit | 2010-09-10 19:24:05 |
Autor | lorenzo |
Commiter | lorenzo |
I added another trivial function to find the [i[j]] entry of a list of lists.
@@ -49,6 +49,13 @@ | ||
49 | 49 | |
50 | 50 | print second_col |
51 | 51 | |
52 | + let my_el=find_ij trans 1 3 | |
53 | + | |
54 | + putStrLn "The element [1,3] (counted from zero!) in my list is, " | |
55 | + | |
56 | + print my_el | |
57 | + | |
58 | + | |
52 | 59 | |
53 | 60 | |
54 | 61 |
@@ -57,3 +64,6 @@ | ||
57 | 64 | firstColumn xss = head (transpose xss) |
58 | 65 | |
59 | 66 | nthColumn xss n = (transpose xss) !! n -- my first haskell function! |
67 | + | |
68 | +find_ij xss i j = (xss !! i) !! j -- for the case of this function, each entry of a list of lists (i.e. each sublist) is meant to be | |
69 | + --a row. | |
\ No newline at end of file |