added haddock comments and default menu return value
This commit is contained in:
parent
314b41b90b
commit
8f0bd22f90
|
@ -28,6 +28,7 @@ module Mtlstats.Types.Menu (
|
|||
-- * Lenses
|
||||
-- ** Menu Lenses
|
||||
menuTitle,
|
||||
menuDefault,
|
||||
menuItems,
|
||||
-- ** MenuItem Lenses
|
||||
miKey,
|
||||
|
@ -45,14 +46,21 @@ import Mtlstats.Types
|
|||
-- | Defines a menu
|
||||
data Menu a = Menu
|
||||
{ _menuTitle :: String
|
||||
-- ^ The menu title
|
||||
, _menuDefault :: a
|
||||
-- ^ The default value
|
||||
, _menuItems :: [MenuItem a]
|
||||
-- ^ The list of items in the menu
|
||||
}
|
||||
|
||||
-- | Defines a menu item
|
||||
data MenuItem a = MenuItem
|
||||
{ _miKey :: Char
|
||||
-- ^ The key that selects the menu item
|
||||
, _miDescription :: String
|
||||
-- ^ The description of the menu item
|
||||
, _miAction :: StateT ProgState C.Curses a
|
||||
-- ^ The action to be performed when selected
|
||||
}
|
||||
|
||||
makeLenses ''Menu
|
||||
|
|
|
@ -36,7 +36,7 @@ menuSpec = describe "Menu"
|
|||
showSpec :: Spec
|
||||
showSpec = describe "show" $
|
||||
it "should display correctly" $ let
|
||||
menu = Menu "Foo"
|
||||
menu = Menu "Foo" ()
|
||||
[ MenuItem '1' "Item 1" $ return ()
|
||||
, MenuItem '2' "Item 2" $ return ()
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue
Block a user