summaryrefslogtreecommitdiff
path: root/src/Hakyll/Core/Identifier/Pattorn.hs
blob: e1767c461a26d52930b6a8d1b33222fda7c4744c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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
    {-# INLINE (<>) #-}

instance Monoid Pattorn where
    mempty = Pattorn $ complement mempty
    {-# INLINE mempty #-}