Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bodyElement :: MonadWidget t m => m ()
- bodyElement = el "div" $ do
- el "h2" $ text "Dropdown"
- text "Select country "
- dd <- dropdown 2 (constDyn countries) def
- el "p" $ return ()
- let selItem = result <$> value dd
- dynText selItem
- countries :: Map.Map Int T.Text
- countries = Map.fromList [(1, "France"), (2, "Switzerland"), (3, "Germany"), (4, "Italy"), (5, "USA")]
- result :: Int -> T.Text
- result key = "You selected: " <> fromJust (Map.lookup key countries)
- The data model:
- data Event :: Type -> Type where
- Event_PracticeTypeSolo :: Event SoloPersonPracticeType
- data SoloPersonPracticeType =
- Solo_Workout -- Jumprope, pushups, weightlifting etc.
- | Solo_Run
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement