1
1
mirror of https://github.com/github/semantic.git synced 2024-12-25 07:55:12 +03:00

Compute a Source from a list of children.

This commit is contained in:
Rob Rix 2016-05-20 21:49:29 -04:00
parent aff7fbbc47
commit 2541405fdc

View File

@ -187,6 +187,9 @@ data Child = Child
, childMargin :: String
}
toSource :: [Child] -> Source.Source Char
toSource = Source.fromList . concatMap show
instance Arbitrary Child where
arbitrary = Child <$> key <*> contents <*> margin
where key = listOf1 (elements (['a'..'z'] ++ ['A'..'Z'] ++ ['0'..'9']))