File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -291,8 +291,23 @@ funcRec = Lift (\x -> Const "String")
291291(<<*>>) = rapply
292292{-# INLINE (<<*>>) #-}
293293
294- -- | Given a section of some functor, records in that functor of any size are
295- -- inhabited.
294+ {- |
295+ Given a section of some functor, records in that functor of any size are
296+ inhabited. Note that you need a value that can inhabit any type in the record.
297+ It is not possible, with this function, to derive a default with a type class
298+ method. Here are a few examples:
299+
300+ >>> testRec :: Rec Maybe '[Double, String] = rpure Nothing
301+ >>> testRec
302+ {Nothing, Nothing}
303+ >>> testRec :: Rec [] '[Double, String] = rpure []
304+ >>> testRec
305+ {[], []}
306+ >>> import Data.Proxy (Proxy(Proxy))
307+ >>> testRec :: Rec Proxy '[Double, String] = rpure Proxy
308+ >>> testRec
309+ {Proxy, Proxy}
310+ -}
296311class RecApplicative rs where
297312 rpure
298313 :: (forall x . f x )
You can’t perform that action at this time.
0 commit comments