@@ -76,7 +76,7 @@ import Data.Monoid
76import Data.Function (on)
76import Data.Function (on)
77import GHC.Generics
77import GHC.Generics
79−import Control.Newtype.Generics
79+import Control.Newtype
81import Data.Void (Void)
81import Data.Void (Void)
@@ -315,16 +315,6 @@ if' _ e True = e
315 BoolTrie f t
315 BoolTrie f t
318−instance HasTrie a => HasTrie (Maybe a) where
319− data (:->:) (Maybe a) b = MaybeTrie b (a :->: b)
320− trie f = MaybeTrie (f Nothing) (trie (f . Just))
321− untrie (MaybeTrie nothing_val a_trie) = maybe nothing_val (untrie a_trie)
322− enumerate (MaybeTrie nothing_val a_trie) = (Nothing, nothing_val) : enum' Just a_trie
324−instance Newtype (Maybe a :->: x) where
325− type O (Maybe a :->: x) = (x, a :->: x)
326− pack (a,f) = MaybeTrie a f
327− unpack (MaybeTrie a f) = (a,f)
329instance (HasTrie a, HasTrie b) => HasTrie (Either a b) where
319instance (HasTrie a, HasTrie b) => HasTrie (Either a b) where
330 data (Either a b) :->: x = EitherTrie (a :->: x) (b :->: x)
320 data (Either a b) :->: x = EitherTrie (a :->: x) (b :->: x)
@@ -587,12 +577,7 @@ instance HasTrie a => Monad ((:->:) a) where
588instance (HasTrie a, Monoid b) => Monoid (a :->: b) where
578instance (HasTrie a, Monoid b) => Monoid (a :->: b) where
589 mempty = trie mempty
579 mempty = trie mempty
590−#if !MIN_VERSION_base(4,11,0)
591 mappend = inTrie2 mappend
580 mappend = inTrie2 mappend
593−instance (HasTrie a, Semigroup b) => Semigroup (a :->: b) where
597instance HasTrie a => Functor ((:->:) a) where
582instance HasTrie a => Functor ((:->:) a) where
598 fmap f = inTrie (fmap f)
583 fmap f = inTrie (fmap f)