Digging through the source:
https://github.com/slamdata/purescript-affjax/blob/v5.0.0/src/Network/HTTP/Affjax.purs#L92
stumbled upon the signature of get
:
get :: forall e a. Respondable a => URL -> Affjax e a
and ventured into psci:
> import Network.HTTP.Affjax
> :t get
forall e a.
Respondable a => String
-> Aff
( ajax :: AJAX
| e
)
{ status :: StatusCode
, headers :: Array ResponseHeader
, response :: a
}
Focusing on the tail part of return type, how is:
Respondable a =>
{ status :: StatusCode
, headers :: Array ResponseHeader
, response :: a
}
matched against Respondable a
from the first signature -- a
from Respondable a => Affjax e a
? Zilch of the instances of Respondable
:
instance responsableBlob :: Respondable Blob where
instance responsableDocument :: Respondable Document where
instance responsableForeign :: Respondable Foreign where
instance responsableString :: Respondable String where
instance responsableUnit :: Respondable Unit where
instance responsableArrayBuffer :: Respondable A.ArrayBuffer where
instance responsableJson :: Respondable Json where
matche Record
. Waat's going on?!
Elucidate the lone rabbit how to dig herself out of similar deep holes in the future. Tnx!