mirror of
https://github.com/github/semantic.git
synced 2024-12-30 18:36:27 +03:00
Derive a Generic1 instance for OrderedMap.
This commit is contained in:
parent
05a2266aca
commit
cc24872a46
@ -17,12 +17,13 @@ module Data.OrderedMap (
|
|||||||
|
|
||||||
import Data.Align
|
import Data.Align
|
||||||
import Data.These
|
import Data.These
|
||||||
|
import GHC.Generics
|
||||||
import Prologue hiding (toList, empty)
|
import Prologue hiding (toList, empty)
|
||||||
import Test.QuickCheck
|
import Test.QuickCheck
|
||||||
|
|
||||||
-- | An ordered map of keys and values.
|
-- | An ordered map of keys and values.
|
||||||
newtype OrderedMap key value = OrderedMap { toList :: [(key, value)] }
|
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.
|
-- | Construct an ordered map from a list of pairs of keys and values.
|
||||||
fromList :: [(key, value)] -> OrderedMap key value
|
fromList :: [(key, value)] -> OrderedMap key value
|
||||||
|
Loading…
Reference in New Issue
Block a user