data ListRequest a = ReplaceItems Int Int [a] | HighlightItems [Int] | PickItem Int replaceAll :: [a] -> ListRequest a replaceAllFrom :: Int -> [a] -> ListRequest a deleteItems :: Int -> Int -> ListRequest a insertItems :: Int -> [a] -> ListRequest a appendItems :: [a] -> ListRequest a changeItems :: Int -> [a] -> ListRequest a replaceItems :: Int -> Int -> [a] -> ListRequest a highlightItems :: [Int] -> ListRequest a pickItem :: Int -> ListRequest a applyListRequest :: ListRequest a -> [a] -> [a]
ListRequest
is the type of messages accepted by fudgets that display lists, e.g.,
textF and pickListF. the displayed list
can be modified by ListRequest
messages.
replaceAll list
replaces all the list with a new list.
replaceAllFrom from items
replaces all items from position
from
with items
. The first item is has position 0.
deleteItems from count
deletes count
items starting at
position from
.
insertItems at items
inserts items
before position at
.
appendText items
appends items
after the last item of the
old list.
changeItems at items
replaces the same number of items at position
at
as there are items in items
with items
. If
at
is so close to the end that there isn't enough items to
replace, the rest of items
are appended.
replaceItems from to text
replaces the items between and
including positions from
and to
with items
.
highlightText positions
will highlight all items included in
positions
, and dehighlight the rest.
pickText at
is used to simulate that the user has clicked on
the item at position at
.
applyListRequest request list
returns the result of performing
request
on list
.
ListRequest
should be an abstract type.