Skip to content

Commit 5d03bda

Browse files
committed
add note that SWCoercibly incurs UndecInsts
1 parent f783d16 commit 5d03bda

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

src/Strongweak/Weaken.hs

+18-8
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,24 @@ type family WeakenedN (n :: Natural) a :: Type where
4545
WeakenedN 0 a = a
4646
WeakenedN n a = Weakened (WeakenedN (n-1) a)
4747

48-
-- | A "via type" newtype for defining strongweak instances for zero-invariant,
49-
-- coercible newtypes.
50-
--
51-
-- Use like so:
52-
--
53-
-- @
54-
-- deriving via 'SWCoercibly' a instance 'Weaken' ('Identity' a)
55-
-- @
48+
{- | A "via type" newtype for defining strongweak instances for zero-invariant,
49+
coercible newtypes.
50+
51+
Use like so:
52+
53+
@
54+
deriving 'Weaken' via 'SWCoercibly' a
55+
@
56+
57+
Or standalone:
58+
59+
@
60+
via 'SWCoercibly' a instance 'Weaken' ('Identity' a)
61+
@
62+
63+
Note that usage of this incurs UndecidableInstances. That's life. You can
64+
write the trivial instances this generates yourself if you so wish
65+
-}
5666
newtype SWCoercibly a = SWCoercibly { unSWCoercibly :: a }
5767
instance Weaken (SWCoercibly a) where
5868
type Weakened (SWCoercibly a) = a

0 commit comments

Comments
 (0)