mirror of
https://github.com/jtdaugherty/brick.git
synced 2024-12-04 17:36:43 +03:00
Derive List
instances: Functor, Foldable, Traversable
This commit is contained in:
parent
0787cc8438
commit
7f334b68a2
@ -1,6 +1,9 @@
|
|||||||
{-# LANGUAGE TupleSections #-}
|
{-# LANGUAGE TupleSections #-}
|
||||||
{-# LANGUAGE OverloadedStrings #-}
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
{-# LANGUAGE TemplateHaskell #-}
|
{-# LANGUAGE TemplateHaskell #-}
|
||||||
|
{-# LANGUAGE DeriveFunctor #-}
|
||||||
|
{-# LANGUAGE DeriveFoldable#-}
|
||||||
|
{-# LANGUAGE DeriveTraversable #-}
|
||||||
-- | This module provides a scrollable list type and functions for
|
-- | This module provides a scrollable list type and functions for
|
||||||
-- manipulating and rendering it.
|
-- manipulating and rendering it.
|
||||||
module Brick.Widgets.List
|
module Brick.Widgets.List
|
||||||
@ -36,6 +39,8 @@ where
|
|||||||
|
|
||||||
import Control.Applicative ((<$>))
|
import Control.Applicative ((<$>))
|
||||||
import Control.Lens ((^.), (&), (.~), _2)
|
import Control.Lens ((^.), (&), (.~), _2)
|
||||||
|
import Data.Foldable (Foldable)
|
||||||
|
import Data.Traversable (Traversable)
|
||||||
import Data.Maybe (fromMaybe)
|
import Data.Maybe (fromMaybe)
|
||||||
import Data.Monoid ((<>))
|
import Data.Monoid ((<>))
|
||||||
import Graphics.Vty (Event(..), Key(..))
|
import Graphics.Vty (Event(..), Key(..))
|
||||||
@ -60,7 +65,7 @@ data List e =
|
|||||||
, listSelected :: !(Maybe Int)
|
, listSelected :: !(Maybe Int)
|
||||||
, listName :: Name
|
, listName :: Name
|
||||||
, listItemHeight :: Int
|
, listItemHeight :: Int
|
||||||
}
|
} deriving (Functor, Foldable, Traversable)
|
||||||
|
|
||||||
suffixLenses ''List
|
suffixLenses ''List
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user