From 706bacd344bf89a91f9400e828e91bcb68e210a0 Mon Sep 17 00:00:00 2001 From: Lennart Spitzner Date: Thu, 3 Aug 2017 20:36:46 +0200 Subject: [PATCH] Add another showcase/example --- doc/showcases/Layout_Alignment.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/showcases/Layout_Alignment.md b/doc/showcases/Layout_Alignment.md index 64fec3e..26d4d7c 100644 --- a/doc/showcases/Layout_Alignment.md +++ b/doc/showcases/Layout_Alignment.md @@ -8,7 +8,7 @@ these without any alignment) and pass it through brittany, you would (again) get the below versions. -#### basic nested alignment example +#### nested alignment for patterns ~~~~.hs func (MyLongFoo abc def) = 1 @@ -16,6 +16,15 @@ func (Bar a d ) = 2 func _ = 3 ~~~~ +~~~~.hs +go [] "" = True +go [WildCard ] "" = True +go (WildCard :rest) (c:cs) = go rest (c : cs) || go (WildCard : rest) cs +go (Union globs:rest) cs = any (\glob -> go (glob ++ rest) cs) globs +go [] (_:_) = False +go (_:_) "" = False +~~~~ + #### alignment of function args and monadcomp bindings ~~~~.hs