File: UseAT.hs

package info (click to toggle)
washngo 2.9-4.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,876 kB
  • ctags: 273
  • sloc: haskell: 54,162; makefile: 1,086; ansic: 305; sh: 153; sql: 13
file content (31 lines) | stat: -rw-r--r-- 963 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import WASH.CGI.CGI

import Monad

main = 
  run page1

page1 =
  do at <- table_io $ return [["Ratio"], ["Complex"], ["Numeric"], ["Ix"], ["Array"], ["List"], ["Maybe"], ["Char"], ["Monad"], ["IO"], ["Directory"], ["System"], ["Time"], ["Locale"], ["CPUTime"], ["Random"]]
     standardQuery "Haskell Library Modules" $
       do sg <- selectionGroup
	  let makeRow row = tr (mapM (makeCol row) [0..(as_cols at -1)])
	      makeCol row col = td (getText at row col)
				   
	      makeRow' row = selectionDisplay sg at row dispRow
	      dispRow button texts = tr (do td button
					    sequence (Prelude.map td texts))
	  p $ table (mapM makeRow' [0..(as_rows at -1)])
	  submit sg page2 empty

page2 sg =
  let lib = unAR (value sg) in
  standardQuery "Selected Haskell Library Module" $
  do text "You selected "
     text (show lib)

page2a lib =
  standardQuery "Directly Selected Haskell Library Module" $
  do text "You selected "
     text (show lib)