1
1
mirror of https://github.com/github/semantic.git synced 2024-12-19 21:01:35 +03:00

Derive a Generic1 instance for OrderedMap.

This commit is contained in:
Rob Rix 2016-07-11 12:18:11 -04:00
parent 05a2266aca
commit cc24872a46

View File

@ -17,12 +17,13 @@ module Data.OrderedMap (
import Data.Align
import Data.These
import GHC.Generics
import Prologue hiding (toList, empty)
import Test.QuickCheck
-- | An ordered map of keys and values.
newtype OrderedMap key value = OrderedMap { toList :: [(key, value)] }
deriving (Eq, Foldable, Functor, Generic, Ord, Show, Traversable)
deriving (Eq, Foldable, Functor, Generic, Generic1, Ord, Show, Traversable)
-- | Construct an ordered map from a list of pairs of keys and values.
fromList :: [(key, value)] -> OrderedMap key value