Skip to content

Commit

Permalink
duplicate instances
Browse files Browse the repository at this point in the history
  • Loading branch information
mstksg committed Aug 9, 2019
1 parent e652de6 commit fccaf3f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Data/Type/Universe.hs
Original file line number Diff line number Diff line change
Expand Up @@ -406,3 +406,21 @@ instance Universe Identity where
$ f IId x
allProd f (SIdentity x) a = PIdentity $ f x (runWitAll a IId)
prodAll f (PIdentity x) = WitAll $ \case IId -> f x

instance (SDecide k, SingI (as :: [k])) => Decidable (In [] as) where
decide x = withSingI x $ pickElem

instance (SDecide k, SingI (as :: Maybe k)) => Decidable (In Maybe as) where
decide x = withSingI x $ pickElem

instance (SDecide k, SingI (as :: Either j k)) => Decidable (In (Either j) as) where
decide x = withSingI x $ pickElem

instance (SDecide k, SingI (as :: NonEmpty k)) => Decidable (In NonEmpty as) where
decide x = withSingI x $ pickElem

instance (SDecide k, SingI (as :: (j, k))) => Decidable (In ((,) j) as) where
decide x = withSingI x $ pickElem

instance (SDecide k, SingI (as :: Identity k)) => Decidable (In Identity as) where
decide x = withSingI x $ pickElem

0 comments on commit fccaf3f

Please sign in to comment.