Skip to content

Commit 811a702

Browse files
committed
add example for <+>
1 parent 8d90e99 commit 811a702

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Data/Vinyl/Core.hs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,16 @@ rappend
125125
rappend RNil ys = ys
126126
rappend (x :& xs) ys = x :& (xs `rappend` ys)
127127

128-
-- | A shorthand for 'rappend'.
128+
{- |
129+
A shorthand for 'rappend'.
130+
131+
>>> :set -XScopedTypeVariables
132+
>>> testRec1 :: Rec Maybe '[Int, String] = Just 3 :& Just "Hi" :& RNil
133+
>>> testRec2 :: Rec Maybe '[Double, [Double]] = Nothing :& Just [3.0, 2.2] :& RNil
134+
>>> combinedTestRec = testRec1 <+> testRec2
135+
>>> :t combinedTestRec
136+
combinedTestRec :: Rec Maybe '[Int, [Char], Double, [Double]]
137+
-}
129138
(<+>)
130139
:: Rec f as
131140
-> Rec f bs

0 commit comments

Comments
 (0)