work :: Int -> Int -> [String] -> Vty.Vty -> IO (Vty.Vty,Maybe Int)
work requestedPosition offset items vt = do
-- displays items 
    let position = max 0 (min requestedPosition (length items - 1))
    (cols, rows) <- Vty.displayBounds $ Vty.outputIface vt
    let
     (cols2, rows2) = (fromEnum cols, fromEnum rows)
     screenPosition = position + offset
     offset2 =
      if screenPosition >= rows2
       then offset - (screenPosition - rows2 + 1)
       else if screenPosition < 0
             then offset - screenPosition
             else offset
     items2 = drop (0 - offset2) $ zip [0..] items
     itemImages =
      map
       (\(line, item) -> itemImage item (line == position))
       items2
     imagesUnified = Vty.vertCat itemImages
     pic = Vty.picForImage $ imagesUnified
    Vty.update vt pic
    eventLoop position offset2 items vt
work :: Int -> Int -> [String] -> Vty.Vty -> IO (Vty.Vty,Maybe Int)
work requestedPosition offset items vt = do
-- displays items 
    let position = max 0 (min requestedPosition (length items - 1))
    (cols, rows) <- Vty.displayBounds $ Vty.outputIface vt
    let
     (cols2, rows2) = (fromEnum cols, fromEnum rows)
     screenPosition = position + offset
     offset2 =
      if screenPosition >= rows2
       then offset - (screenPosition - rows2 + 1)
       else if screenPosition < 0
             then offset - screenPosition
             else offset
     items2 = drop (0 - offset2) $ zip [0..] items
     itemImages =
      map
       (\(line, item) -> itemImage item (line == position))
       items2
     imagesUnified = Vty.vertCat itemImages
     pic = Vty.picForImage $ imagesUnified
    Vty.update vt pic
    eventLoop position offset2 items vt
work requestedPosition offset items vt = do
-- displays items 
    let position = max 0 (min requestedPosition (length items - 1))
    (cols, rows) <- Vty.displayBounds $ Vty.outputIface vt
    let
     (cols2, rows2) = (fromEnum cols, fromEnum rows)
     screenPosition = position + offset
     offset2 =
      if screenPosition >= rows2
       then offset - (screenPosition - rows2 + 1)
       else if screenPosition < 0
             then offset - screenPosition
             else offset
     items2 = drop (0 - offset2) $ zip [0..] items
     itemImages =
      map
       (\(line, item) -> itemImage item (line == position))
       items2
     imagesUnified = Vty.vertCat itemImages
     pic = Vty.picForImage $ imagesUnified
    Vty.update vt pic
    eventLoop position offset2 items vt