From 42a2d42eecf551dd1990c97c1ae2586cd46674be Mon Sep 17 00:00:00 2001 From: Chris Wells Date: Mon, 30 Dec 2024 21:23:52 -0600 Subject: Started writing the main utilities for my webpage --- src/Hakyll/Core/Identifier/Pattorn.hs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/Hakyll/Core/Identifier/Pattorn.hs (limited to 'src/Hakyll/Core/Identifier/Pattorn.hs') 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 -- cgit v1.2.3