packages feed

digestive-functors-hsp 0.4.4 → 0.4.5

raw patch · 2 files changed

+1/−21 lines, 2 files

Files

Text/Digestive/HSP/Html4.hs view
@@ -203,26 +203,6 @@          -> Form m i e [HSX.GenXML x] a setAttrs form attrs = mapView (map (`set` attrs)) form -inputChoices :: (Monad m, Functor m, FormInput i f, Monoid v, Eq a)-            => (FormId -> String -> Bool -> a -> v)  -- ^ Choice constructor-            -> [a]                                   -- ^ Default options-            -> [a]                                   -- ^ Choices-            -> Form m i e v [a]                      -- ^ Resulting form-inputChoices toView defaults choices = Form $ do-    inputKeys <- maybe [] getInputStrings <$> getFormInput-    id' <- getFormId-    formInput <- isFormInput-    let -- Find the actual input, based on the key, or use the default input-        inps = if formInput -               then mapMaybe (\inputKey -> lookup inputKey $ zip (ids id') choices) inputKeys-               else defaults-        -- Apply the toView' function to all choices-        view' = mconcat $ zipWith (toView' id' inps) (ids id') choices-    return (View (const view'), Ok inps)-  where-    ids id' = map (((show id' ++ "-") ++) . show) [1 .. length choices]-    toView' id' inps key x = toView id' key (x `elem` inps) x- lookups :: (Eq a) => a -> [(a, b)] -> [b] lookups a = map snd . filter ((== a) . fst) 
digestive-functors-hsp.cabal view
@@ -1,5 +1,5 @@ Name:                digestive-functors-hsp-Version:             0.4.4+Version:             0.4.5 Synopsis:            HSP support for digestive-functors Description:         This is an HSP frontend for the digestive-functors library. Homepage:            http://src.seereason.com/digestive-functors-hsp