Derive List instances: Functor, Foldable, Traversable

This commit is contained in:
Markus Hauck 2015-12-27 19:30:19 +01:00
parent 0787cc8438
commit 7f334b68a2

View File

@ -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