Add a Traversable instance for IdMap, needed in reveal and useful in general to be able to use atAll
This commit is contained in:
parent
ba7dd6a690
commit
e94a09b3ec
1 changed files with 2 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
||||||
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
|
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
|
||||||
|
{-# LANGUAGE DeriveTraversable #-}
|
||||||
{-# LANGUAGE FlexibleContexts #-}
|
{-# LANGUAGE FlexibleContexts #-}
|
||||||
module Data.Id (
|
module Data.Id (
|
||||||
Id(..)
|
Id(..)
|
||||||
|
@ -34,7 +35,7 @@ newtype Id a = Id {
|
||||||
} deriving (Eq, Enum, Ord, Show)
|
} deriving (Eq, Enum, Ord, Show)
|
||||||
newtype IdMap a b = IdMap {
|
newtype IdMap a b = IdMap {
|
||||||
intMap :: IntMap b
|
intMap :: IntMap b
|
||||||
} deriving (Show, Functor, Semigroup, Monoid, Foldable)
|
} deriving (Show, Functor, Semigroup, Monoid, Foldable, Traversable)
|
||||||
type Indexed a = IdMap a a
|
type Indexed a = IdMap a a
|
||||||
|
|
||||||
at :: IdMap a b -> Id a -> b
|
at :: IdMap a b -> Id a -> b
|
||||||
|
|
Loading…
Reference in a new issue