summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMikolaj Konarski <mikolaj.konarski@funktory.com>2025-12-23 11:51:04 +0100
committerMikolaj Konarski <mikolaj.konarski@funktory.com>2025-12-23 11:51:04 +0100
commit0e649d03ef60bcedcff27bb95bc977d801624817 (patch)
tree89ad04154731db7b9cac5bd3a96201eec1342c2f /test
parent72abcebf6cfc5aa62b24bcf8bb06a2f517bff0fc (diff)
Hack the test to type-check again
Diffstat (limited to 'test')
-rw-r--r--test/Main.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/test/Main.hs b/test/Main.hs
index 4fdf4ad..209b88e 100644
--- a/test/Main.hs
+++ b/test/Main.hs
@@ -9,7 +9,6 @@ module Main where
import Data.Dependent.EnumMap.Strict qualified as DE
import Data.Dependent.Sum
-import Data.Some
data Tag = A | B | C
@@ -22,9 +21,9 @@ data STag tag where
deriving instance Show (STag tag)
instance DE.Enum1 STag where
- type Enum1Info STag = ()
- fromEnum1 = \case { SA -> (0, ()); SB -> (1, ()); SC -> (2, ()) }
- toEnum1 n () = case n of { 0 -> Some SA; 1 -> Some SB; 2 -> Some SC; _ -> error "invalid tag" }
+ type Enum1Info STag = STag
+ fromEnum1 = \case { SA -> (0, SA); SB -> (1, SB); SC -> (2, SC) }
+ toEnum1 n t = case (n, t) of { (0, SA) -> SA; (1, SB) -> SB; (2, SC) -> SC; _ -> error "invalid tag" }
data Value tag where
VA :: Int -> Value A