1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 09:15:01 +03:00

Define an Applicative instance for Row.

This commit is contained in:
Rob Rix 2016-02-29 08:44:36 -05:00
parent 8303fd08ad
commit 6fe2060e45

View File

@ -41,3 +41,7 @@ adjoinRowsBy _ _ rows row = row : rows
instance Show a => Show (Row a) where
show (Row left right) = "\n" ++ show left ++ " | " ++ show right
instance Applicative Row where
pure a = let a' = pure a in Row a' a'
Row f g <*> Row a b = Row (f <*> a) (g <*> b)