From 87ac008ea6267a71736e0b7ff9e2add6b2fa1c05 Mon Sep 17 00:00:00 2001 From: Orion Kindel Date: Tue, 28 Nov 2023 11:18:16 -0600 Subject: [PATCH] fix: eq, show method --- src/HTTP/Request.purs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/HTTP/Request.purs b/src/HTTP/Request.purs index 8fa90c2..d42ad76 100644 --- a/src/HTTP/Request.purs +++ b/src/HTTP/Request.purs @@ -20,11 +20,14 @@ import Prelude import Control.Promise (Promise) import Control.Promise as Promise import Data.ArrayBuffer.Types (ArrayBuffer) +import Data.Eq.Generic (genericEq) +import Data.Generic.Rep (class Generic) import Data.Map (Map) import Data.Map as Map import Data.Maybe (Maybe(..)) import Data.Newtype (unwrap) import Data.Nullable as Nullable +import Data.Show.Generic (genericShow) import Data.Tuple.Containing (extract) import Data.Tuple.Nested (type (/\)) import Data.URL (URL) @@ -108,6 +111,13 @@ data Method | DELETE | PATCH +derive instance Generic Method _ +instance Eq Method where + eq = genericEq + +instance Show Method where + show = genericShow + class Request :: Type -> Constraint class Request a where requestUrl :: forall m. MonadAff m => a -> m URL