Skip to content

Commit

Permalink
fix EqBy
Browse files Browse the repository at this point in the history
  • Loading branch information
mstksg committed Nov 22, 2018
1 parent 000a89a commit 03158a9
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/Data/Type/Predicate/Param.hs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,14 @@ type instance Apply (ConstPP p k) v = p @@ v
--
-- See 'IsTC' for a useful specific application.
--
-- @
-- 'EqBy' :: (v ~> k) -> 'ParamPred' k v
-- 'Found' ('EqBy' f) :: 'Predicate' k
-- @
--
-- @since 0.1.5.0
type EqBy f = PPMapV f (TyPP (:~:))
data EqBy :: (v ~> k) -> ParamPred k v
type instance Apply (EqBy f x) y = x :~: (f @@ y)

-- | @Found ('IsTC' t) \@\@ x@ is true if @x@ was made using the unary type
-- constructor @t@.
Expand All @@ -125,6 +131,20 @@ type EqBy f = PPMapV f (TyPP (:~:))
--
-- For a more general version, see 'EqBy'
--
-- The kind of 'IsTC' is:
--
-- @
-- 'IsTC' :: (v -> k) -> 'ParamPred' k v
-- 'Found' ('IsTC' t) :: 'Predicate' k
-- @
--
-- Applied to specific things:
--
-- @
-- 'IsTC' ''Just' :: 'ParamPred' (Maybe v) v
-- 'Found' ('IsTC' ''Just'') :: 'Predicate' (Maybe v)
-- @
--
-- @since 0.1.5.0
type IsTC t = EqBy (TyCon1 t)

Expand Down

0 comments on commit 03158a9

Please sign in to comment.