summaryrefslogtreecommitdiff
path: root/src/Hakyll/Core/Identifier/Pattorn.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Hakyll/Core/Identifier/Pattorn.hs')
-rw-r--r--src/Hakyll/Core/Identifier/Pattorn.hs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Hakyll/Core/Identifier/Pattorn.hs b/src/Hakyll/Core/Identifier/Pattorn.hs
new file mode 100644
index 0000000..0910320
--- /dev/null
+++ b/src/Hakyll/Core/Identifier/Pattorn.hs
@@ -0,0 +1,16 @@
+module Hakyll.Core.Identifier.Pattorn
+ ( Pattorn (..)
+ ) where
+
+import Prolog
+import Hakyll
+
+-- | Wrapper around 'Pattern' to get a semigroup with "or" as its operation
+newtype Pattorn = Pattorn { getPattern :: Pattern }
+ deriving newtype (Binary, Show, IsString)
+
+instance Semigroup Pattorn where
+ Pattorn a <> Pattorn b = Pattorn $ a .||. b
+
+instance Monoid Pattorn where
+ mempty = Pattorn $ complement mempty