Report a paste

Please put a quick comment for the admin.

If it looks like spam, the admin will mark it as spam so that the spam filter picks it up in the future.

If the paste contains something private or offensive, it'll probably just be deleted.

messy

storeInputs :: (MonadWidget t m)
            => Dynamic t StoreNetwork
            -> m (Event t StoreNetwork)
storeInputs dstoreMap =
  elClass "div" "row" $ do
    ms <- for (fmap (Map.toList . unStoreNetwork) dstoreMap) $ \(k,store) -> do
      storeInputE <- storeInputWidget
      pure $ (,) k <$> storeInputE
    pure $ StoreNetwork $ Map.fromList ms

storeInputWidget :: MonadWidget t m => m (Event t StoreInput)
storeInputWidget = do
  i <- elAttr "div" storeStyle $ do -- Event t Float
    UI.h3' "Lead Time"
    updated $ Widget.simpleRangeInput 1 7 (Just "days")
  pure $ fmap (StoreInput . floor) i


newtype StoreNetwork = StoreNetwork { unStoreNetwork :: (Map Int StoreInput) } deriving (Show)