on develop help sign in
Fix for later constraints-extras
commitc70dce3880df6edd807753ba0d97be100dcc1a1c authorAli Abrar <aliabrar@gmail.com> dateThu 14 Feb 2019, 18:51 (8 years ago) parent475fc49
1 file changed+4−14
reflex-dom-core/test/hydration.hs+4−14
reflex-dom-core/test/hydration.hs+4−14
@@ -9,6 +9,7 @@
99{-# LANGUAGE LambdaCase #-}
1010{-# LANGUAGE MultiParamTypeClasses #-}
1111{-# LANGUAGE OverloadedStrings #-}
12+{-# LANGUAGE PolyKinds #-}
1213{-# LANGUAGE RankNTypes #-}
1314{-# LANGUAGE RecursiveDo #-}
1415{-# LANGUAGE ScopedTypeVariables #-}
@@ -25,6 +26,7 @@ import Control.Monad.IO.Class
2526import Control.Monad.Ref
2627import Data.Constraint (Dict(..))
2728import Data.Constraint.Extras
29+import Data.Constraint.Extras.TH
2830import Data.Dependent.Map (DMap)
2931import Data.Dependent.Sum (DSum(..), (==>), EqTag(..), ShowTag(..))
3032import Data.Foldable (traverse_)
@@ -93,14 +95,6 @@ data DKey a where
9395 Key_Char :: DKey Char
9496 Key_Bool :: DKey Bool
9597
96−instance ArgDict DKey where
97− type ConstraintsFor DKey c = (c Int, c Char, c Bool)
98− type ConstraintsFor' DKey c g = (c (g Int), c (g Char), c (g Bool))
99− argDict = \case
100− Key_Int -> Dict
101− Key_Char -> Dict
102− Key_Bool -> Dict
103− argDict' = undefined -- Missing constraints?
10498
10599textKey :: DKey a -> Text
106100textKey = \case
@@ -108,6 +102,7 @@ textKey = \case
108102 Key_Char -> "Key_Char"
109103 Key_Bool -> "Key_Bool"
110104
105+deriveArgDict ''DKey
111106deriveGEq ''DKey
112107deriveGCompare ''DKey
113108deriveGShow ''DKey
@@ -1436,6 +1431,7 @@ data Key2 a where
14361431deriveGEq ''Key2
14371432deriveGCompare ''Key2
14381433deriveGShow ''Key2
1434+deriveArgDict ''Key2
14391435
14401436instance ShowTag Key2 Identity where
14411437 showTaggedPrec = \case
@@ -1445,9 +1441,3 @@ instance ShowTag Key2 Identity where
14451441instance EqTag Key2 Identity where
14461442 eqTagged (Key2_Int _) (Key2_Int _) = (==)
14471443 eqTagged (Key2_Char _) (Key2_Char _) = (==)
1448−
1449−instance ArgDict Key2 where
1450− type ConstraintsFor Key2 c = (c Int, c Char)
1451− argDict = \case
1452− Key2_Int _ -> Dict
1453− Key2_Char _ -> Dict