Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shopProds :: V.Vector Int -> [Prod]
- -> View Html IO (Either Int Prod)
- shopProds cart products=
- br
- <++ -- add Html to the first widget
- p << "-----Shopping List-----"
- <++
- widget(Selection{
- stitle = bold << "choose an item",
- sheader= [ bold << "item" , bold << "price", bold << "times chosen"],
- sbody= [([toHtml pname, toHtml $ show pprice, toHtml $ show $ cart V.! i],i )
- | (Prod{..},i ) <- zip products [1..]]})
- <+> -- operator to mix two wdigets
- br
- <++ -- add Html to the second widget
- p << "---Add a new product---"
- <++
- table <<< -- <<< encloses a widget in HTML tags
- (tr <<< td ! [valign "top"]
- <<< widget (Form (Nothing :: Maybe Prod) )
- ++> -- append Html after the widget
- tr << td ! [align "center"]
- << hotlink "hello"
- (bold << "Hello World"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement