From e94a09b3ec92c46dbdcd40195e40842830e7472b Mon Sep 17 00:00:00 2001 From: Tissevert Date: Tue, 17 Mar 2020 15:25:12 +0100 Subject: [PATCH] Add a Traversable instance for IdMap, needed in reveal and useful in general to be able to use atAll --- src/Data/Id.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Data/Id.hs b/src/Data/Id.hs index b96afb0..b79bd33 100644 --- a/src/Data/Id.hs +++ b/src/Data/Id.hs @@ -1,4 +1,5 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE FlexibleContexts #-} module Data.Id ( Id(..) @@ -34,7 +35,7 @@ newtype Id a = Id { } deriving (Eq, Enum, Ord, Show) newtype IdMap a b = IdMap { intMap :: IntMap b - } deriving (Show, Functor, Semigroup, Monoid, Foldable) + } deriving (Show, Functor, Semigroup, Monoid, Foldable, Traversable) type Indexed a = IdMap a a at :: IdMap a b -> Id a -> b