Merge pull request #258 from 4eUeP/master

Focus: add focusRingToList function
This commit is contained in:
Jonathan Daugherty 2020-02-01 08:15:39 -08:00 committed by GitHub
commit 3fd5a2af07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,6 +10,7 @@ module Brick.Focus
, focusGetCurrent , focusGetCurrent
, focusSetCurrent , focusSetCurrent
, focusRingLength , focusRingLength
, focusRingToList
, focusRingCursor , focusRingCursor
, withFocusRing , withFocusRing
, focusRingModify , focusRingModify
@ -81,6 +82,11 @@ focusSetCurrent n r@(FocusRing l) =
focusRingLength :: FocusRing n -> Int focusRingLength :: FocusRing n -> Int
focusRingLength (FocusRing l) = C.size l focusRingLength (FocusRing l) = C.size l
-- | Starting with the currently-focused, go right and accumulate all
-- resource names of the FocusRing in a list.
focusRingToList :: FocusRing n -> [n]
focusRingToList (FocusRing l) = C.rightElements l
-- | Modify the internal circular list structure of a focus ring -- | Modify the internal circular list structure of a focus ring
-- directly. This function permits modification of the circular list -- directly. This function permits modification of the circular list
-- using the rich Data.CircularList API. -- using the rich Data.CircularList API.