on develop help sign in
Revert "Make the Functor1Constraint family sensible"
e659610David Feuer
src/Reflex/Dom/Builder/Class.hs+7−13
@@ -462,20 +462,14 @@ instance (DomBuilder t m, Monoid w, MonadHold t m, MonadFix m) => DomBuilder t (
462
462
463-- * Convenience functions
463-- * Convenience functions
464
464
465−class Unconstrained g h
466−instance Unconstrained g h
467−
468−class DomBuilderSpace a ~ DomBuilderSpace b => SameDomBuilderSpace a b
469−instance DomBuilderSpace a ~ DomBuilderSpace b => SameDomBuilderSpace a b
470−
471--TODO: Move/replace
465--TODO: Move/replace
472class Functor1 (f :: (k -> *) -> *) where
466class Functor1 (f :: (k -> *) -> *) where
473− type Functor1Constraint f :: (k -> *) -> (k -> *) -> Constraint
467+ type Functor1Constraint f (a :: k -> *) (b :: k -> *) :: Constraint
474− type Functor1Constraint f = Unconstrained
468+ type Functor1Constraint f a b = ()
475 fmap1 :: Functor1Constraint f a b => (forall x. a x -> b x) -> f a -> f b
469 fmap1 :: Functor1Constraint f a b => (forall x. a x -> b x) -> f a -> f b
476
470
477instance Functor1 (ElementConfig er t) where
471instance Functor1 (ElementConfig er t) where
478− type Functor1Constraint (ElementConfig er t) = SameDomBuilderSpace
472+ type Functor1Constraint (ElementConfig er t) a b = DomBuilderSpace a ~ DomBuilderSpace b
479 {-# INLINABLE fmap1 #-}
473 {-# INLINABLE fmap1 #-}
480 fmap1 _ cfg = cfg
474 fmap1 _ cfg = cfg
481 { _elementConfig_eventSpec = _elementConfig_eventSpec cfg
475 { _elementConfig_eventSpec = _elementConfig_eventSpec cfg
@@ -488,19 +482,19 @@ instance Reflex t => Functor1 (PlaceholderConfig above t) where
488 }
482 }
489
483
490instance Functor1 (InputElementConfig er t) where
484instance Functor1 (InputElementConfig er t) where
491− type Functor1Constraint (InputElementConfig er t) = Functor1Constraint (ElementConfig er t)
485+ type Functor1Constraint (InputElementConfig er t) a b = Functor1Constraint (ElementConfig er t) a b
492 fmap1 f cfg = cfg & inputElementConfig_elementConfig %~ fmap1 f
486 fmap1 f cfg = cfg & inputElementConfig_elementConfig %~ fmap1 f
493
487
494instance Functor1 (TextAreaElementConfig er t) where
488instance Functor1 (TextAreaElementConfig er t) where
495− type Functor1Constraint (TextAreaElementConfig er t) = Functor1Constraint (ElementConfig er t)
489+ type Functor1Constraint (TextAreaElementConfig er t) a b = Functor1Constraint (ElementConfig er t) a b
496 fmap1 f cfg = cfg & textAreaElementConfig_elementConfig %~ fmap1 f
490 fmap1 f cfg = cfg & textAreaElementConfig_elementConfig %~ fmap1 f
497
491
498instance Functor1 (SelectElementConfig er t) where
492instance Functor1 (SelectElementConfig er t) where
499− type Functor1Constraint (SelectElementConfig er t) = Functor1Constraint (ElementConfig er t)
493+ type Functor1Constraint (SelectElementConfig er t) a b = Functor1Constraint (ElementConfig er t) a b
500 fmap1 f cfg = cfg & selectElementConfig_elementConfig %~ fmap1 f
494 fmap1 f cfg = cfg & selectElementConfig_elementConfig %~ fmap1 f
501
495
502instance Functor1 (RawElementConfig er t) where
496instance Functor1 (RawElementConfig er t) where
503− type Functor1Constraint (RawElementConfig er t) = SameDomBuilderSpace
497+ type Functor1Constraint (RawElementConfig er t) a b = DomBuilderSpace a ~ DomBuilderSpace b
504 {-# INLINABLE fmap1 #-}
498 {-# INLINABLE fmap1 #-}
505 fmap1 _ cfg = cfg
499 fmap1 _ cfg = cfg
506 { _rawElementConfig_eventSpec = _rawElementConfig_eventSpec cfg
500 { _rawElementConfig_eventSpec = _rawElementConfig_eventSpec cfg