From ac21c06d4c7214a7e1fa75891b10689115b82345 Mon Sep 17 00:00:00 2001 From: Joseph Sumabat Date: Fri, 9 Feb 2024 17:03:38 -0500 Subject: [PATCH] moat set instance from haskell set --- src/Moat/Class.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Moat/Class.hs b/src/Moat/Class.hs index a2e4d58..adb8ac2 100644 --- a/src/Moat/Class.hs +++ b/src/Moat/Class.hs @@ -17,6 +17,7 @@ import Data.List.NonEmpty (NonEmpty) import qualified Data.Map as M import qualified Data.Primitive as Prim import Data.Proxy (Proxy (..)) +import Data.Set (Set) import qualified Data.Text as TS import qualified Data.Text.Lazy as TL import Data.Time (UTCTime) @@ -117,6 +118,9 @@ instance {-# OVERLAPPABLE #-} forall a. ToMoatType a => ToMoatType [a] where instance {-# OVERLAPPING #-} ToMoatType [Char] where toMoatType _ = Str +instance forall a. ToMoatType a => ToMoatType (Set a) where + toMoatType _ = Set (toMoatType (Proxy @a)) + instance ToMoatType TL.Text where toMoatType _ = Str instance ToMoatType TS.Text where toMoatType _ = Str