]> Git — Sourcephile - doclang.git/blob - Hdoc/Utils.hs
Add Majority Judgment support.
[doclang.git] / Hdoc / Utils.hs
1 {-# OPTIONS_GHC -fno-warn-orphans #-}
2 module Hdoc.Utils where
3
4 import Data.Default.Class (Default(..))
5 import Data.Foldable (toList)
6 import Data.Function ((.))
7 import Data.Hashable (Hashable(..))
8 import Data.Sequence (Seq)
9 import qualified Data.HashMap.Strict as HM
10 import qualified Data.TreeSeq.Strict as TS
11
12 instance Default (HM.HashMap k a) where
13 def = HM.empty
14 instance Hashable a => Hashable (Seq a) where
15 hashWithSalt s = hashWithSalt s . toList
16 {-
17 instance Hashable a => Hashable (TS.Tree a) where
18 hashWithSalt s (TS.Tree a ts) =
19 s`hashWithSalt`a
20 `hashWithSalt`ts
21 -}