mirror of
https://github.com/jtdaugherty/brick.git
synced 2024-09-11 15:55:54 +03:00
ListDemo: missing uses of Vector API
This commit is contained in:
parent
5b5db6feaf
commit
74aa344564
@ -31,7 +31,7 @@ drawUI l = [ui]
|
||||
cur = case l^.(L.listSelectedL) of
|
||||
Nothing -> "-"
|
||||
Just i -> str (show (i + 1))
|
||||
total = str $ show $ length $ l^.(L.listElementsL)
|
||||
total = str $ show $ V.length $ l^.(L.listElementsL)
|
||||
box = B.borderWithLabel label $
|
||||
hLimit 25 $
|
||||
vLimit 15 $
|
||||
@ -46,7 +46,7 @@ appEvent :: L.List Int -> V.Event -> M.EventM (M.Next (L.List Int))
|
||||
appEvent l e =
|
||||
case e of
|
||||
V.EvKey (V.KChar '+') [] ->
|
||||
let el = length $ l^.(L.listElementsL)
|
||||
let el = V.length $ l^.(L.listElementsL)
|
||||
in M.continue $ L.listInsert el el l
|
||||
|
||||
V.EvKey (V.KChar '-') [] ->
|
||||
|
Loading…
Reference in New Issue
Block a user