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