From bc76b21859bceb63cc4bdf431141297071fd9ca2 Mon Sep 17 00:00:00 2001 From: Janus Troelsen Date: Fri, 23 Feb 2024 12:26:55 -0600 Subject: [PATCH] Add nominal role annotation for TaggedUnion --- src/Shrubbery/TaggedUnion.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Shrubbery/TaggedUnion.hs b/src/Shrubbery/TaggedUnion.hs index 8a3747b..c80721a 100644 --- a/src/Shrubbery/TaggedUnion.hs +++ b/src/Shrubbery/TaggedUnion.hs @@ -1,6 +1,7 @@ {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE RoleAnnotations #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} @@ -40,6 +41,8 @@ import Shrubbery.Union (Union, dissectUnion) newtype TaggedUnion (taggedTypes :: [Tag]) = TaggedUnion (Union (TaggedTypes taggedTypes)) +type role TaggedUnion nominal + instance ( TaggedTypes taggedTypes ~ types , ShowBranches types