CurryInfo: wui2-3.1.0 / HTML.WUI.wSelect

definition:
wSelect :: Eq a => (a -> String) -> [a] -> WuiSpec a
wSelect showelem selset =
  WuiSpec (head, "?", const True)
          (checkLegalInput selWidget)
          (\wparams -> conditionOf wparams)
          (\env s -> selset !! read (env (state2cgiRef s)))
 where
  selWidget render v =
    let ref free
        idx = elemIndex v selset
        namevalues = zip (map showelem selset) (map show [0..])
     in (render [maybe (selection ref namevalues)
                       (\i -> selectionInitial ref namevalues i)
                       idx],
         cgiRef2state ref)
demand:
no demanded arguments
deterministic:
possibly non-deterministic operation
documentation:
------------------------------------------------------------------------------
--- A widget to select a value from a given list of values.
--- The current value should be contained in the value list and is preselected.
--- The first argument is a mapping from values into strings to be shown
--- in the selection widget.
failfree:
<FAILING>
indeterministic:
referentially transparent operation
infix:
no fixity defined
iotype:
{(_,_,_) |-> {WuiSpec}}
name:
wSelect
precedence:
no precedence defined
result-values:
{WuiSpec}
signature:
Prelude.Eq a => (a -> String) -> [a] -> WuiSpec a
solution-complete:
operation might suspend on free variables
terminating:
possibly non-terminating
totally-defined:
possibly non-reducible on same data term