diff options
| author | Joey Hess <joeyh@joeyh.name> | 2017-02-03 15:42:21 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2017-02-03 15:42:21 -0400 |
| commit | b52c37df64ab2a3e261c7f9daba9e7b812e55706 (patch) | |
| tree | dc756130be9ced585d66d2c0f30d9400edc18e24 /doc/forum | |
| parent | 34e3477ccc051b3a291331da7f2c5d1d2962a506 (diff) | |
response
Diffstat (limited to 'doc/forum')
| -rw-r--r-- | doc/forum/Inherited_Variables.../comment_5_6fbd29f568ec8b97be47874e2aac57a3._comment | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/forum/Inherited_Variables.../comment_5_6fbd29f568ec8b97be47874e2aac57a3._comment b/doc/forum/Inherited_Variables.../comment_5_6fbd29f568ec8b97be47874e2aac57a3._comment new file mode 100644 index 00000000..16819bd6 --- /dev/null +++ b/doc/forum/Inherited_Variables.../comment_5_6fbd29f568ec8b97be47874e2aac57a3._comment @@ -0,0 +1,20 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 5""" + date="2017-02-03T19:32:58Z" + content=""" +What you're looking for is not a regexp, but Haskell's [pattern +matching](https://www.haskell.org/tutorial/patterns.html). + +For example: + + myproperty :: Property Debian + myproperty = withOS "some desc here" $ \w o -> case o of + -- Pattern match on the OS, to get the Debian stable release + (Just (System (Debian _kernel (Stable release)) _arch)) -> + ensureProperty w $ Apt.setSourcesListD (sourcesLines release) "mysources" + _ -> unsupportedOS + + sourcesLines :: Release -> [Line] + sourcesLines release = undefined +"""]] |
