summaryrefslogtreecommitdiff
path: root/src/Hakyll/Core/Identifier
diff options
context:
space:
mode:
authorChris Wells <chris@mathematicaster.org>2024-12-30 21:23:52 -0600
committerChris Wells <chris@mathematicaster.org>2024-12-30 21:23:52 -0600
commit42a2d42eecf551dd1990c97c1ae2586cd46674be (patch)
tree873e80c07aca811167aa06caa19de7334c94048d /src/Hakyll/Core/Identifier
downloadmain-42a2d42eecf551dd1990c97c1ae2586cd46674be.tar
main-42a2d42eecf551dd1990c97c1ae2586cd46674be.tar.gz
main-42a2d42eecf551dd1990c97c1ae2586cd46674be.tar.bz2
main-42a2d42eecf551dd1990c97c1ae2586cd46674be.tar.lz
main-42a2d42eecf551dd1990c97c1ae2586cd46674be.tar.xz
main-42a2d42eecf551dd1990c97c1ae2586cd46674be.tar.zst
main-42a2d42eecf551dd1990c97c1ae2586cd46674be.zip
Started writing the main utilities for my webpage
Diffstat (limited to 'src/Hakyll/Core/Identifier')
-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