git.iko.soy/rowtype-yoga/purescript-yoga-fetch-om
on main help sign in
Make client functions polymorphic in context and error rows

- Client functions now return Om (Record ctx) errorRow result where ctx and errorRow can be any types - Previously hardcoded Om {} which only allowed empty context - Uses unsafeCoerce to widen types for polymorphism - All existing tests pass BREAKING CHANGE: Function return types are now polymorphic, which should be backwards compatible in practice but may affect some type inference scenarios

commit0703bd7214a4b61522c0884cc58f2ec9773edc68 authorMark <mark.eibes@gmail.com> dateMon 9 Feb 2026, 14:27 (8 months ago) parent944ca7d
38 files changed+283−27
.psci_modules/Data.Int.Bits/externs.cbor .psci_modules/Data.Int.Bits/foreign.js+48 .psci_modules/Data.Int.Bits/index.js+12 .psci_modules/Data.NaturalTransformation/externs.cbor .psci_modules/Data.NaturalTransformation/index.js+1 .psci_modules/Data.String.Unsafe/externs.cbor .psci_modules/Data.String.Unsafe/foreign.js+11 .psci_modules/Data.String.Unsafe/index.js+7 .psci_modules/Record.Unsafe/externs.cbor .psci_modules/Record.Unsafe/foreign.js+38 .psci_modules/Record.Unsafe/index.js+14 .psci_modules/Spago.Generated.BuildInfo/externs.cbor .psci_modules/Spago.Generated.BuildInfo/index.js+13 .psci_modules/Type.Equality/externs.cbor .psci_modules/Type.Equality/index.js+35 .psci_modules/Type.Function/externs.cbor .psci_modules/Type.Function/index.js+1 .psci_modules/Type.Proxy/externs.cbor .psci_modules/Type.Proxy/index.js+58 .psci_modules/Type.Row/externs.cbor .psci_modules/Type.Row/index.js+1 .psci_modules/Unsafe.Coerce/externs.cbor .psci_modules/Unsafe.Coerce/foreign.js+5 .psci_modules/Unsafe.Coerce/index.js+5 .psci_modules/Web.DOM.Internal.Types/externs.cbor .psci_modules/Web.DOM.Internal.Types/index.js+1 .psci_modules/Web.Event.Internal.Types/externs.cbor .psci_modules/Web.Event.Internal.Types/index.js+1 .psci_modules/Yoga.HTTP.API.Route.Encoding/externs.cbor .psci_modules/Yoga.HTTP.API.Route.Encoding/index.js+1 .psci_modules/Yoga.HTTP.API.Route.Method/externs.cbor .psci_modules/Yoga.HTTP.API.Route.Method/index.js+1 .psci_modules/cache-db.json+1 .psci_modules/package.json+1 .purs-repl+1 package.json+1−1 src/Yoga/Fetch/Om.purs+9−9 src/Yoga/Fetch/Om/ClientFn.purs+17−17
.psci_modules/Data.Int.Bits/externs.cbornew file

Binary file not shown.

.psci_modules/Data.Int.Bits/foreign.jsnew file+48
@@ -0,0 +1,48 @@
1+// module Data.Int.Bits
2+
3+export const and = function (n1) {
4+ return function (n2) {
5+ /* jshint bitwise: false */
6+ return n1 & n2;
7+ };
8+};
9+
10+export const or = function (n1) {
11+ return function (n2) {
12+ /* jshint bitwise: false */
13+ return n1 | n2;
14+ };
15+};
16+
17+export const xor = function (n1) {
18+ return function (n2) {
19+ /* jshint bitwise: false */
20+ return n1 ^ n2;
21+ };
22+};
23+
24+export const shl = function (n1) {
25+ return function (n2) {
26+ /* jshint bitwise: false */
27+ return n1 << n2;
28+ };
29+};
30+
31+export const shr = function (n1) {
32+ return function (n2) {
33+ /* jshint bitwise: false */
34+ return n1 >> n2;
35+ };
36+};
37+
38+export const zshr = function (n1) {
39+ return function (n2) {
40+ /* jshint bitwise: false */
41+ return n1 >>> n2;
42+ };
43+};
44+
45+export const complement = function (n) {
46+ /* jshint bitwise: false */
47+ return ~n;
48+};
.psci_modules/Data.Int.Bits/index.jsnew file+12
@@ -0,0 +1,12 @@
1+// | This module defines bitwise operations for the `Int` type.
2+import * as $foreign from "./foreign.js";
3+
4+export {
5+ and,
6+ or,
7+ xor,
8+ shl,
9+ shr,
10+ zshr,
11+ complement
12+} from "./foreign.js";
.psci_modules/Data.NaturalTransformation/externs.cbornew file

Binary file not shown.

.psci_modules/Data.NaturalTransformation/index.jsnew file+1
@@ -0,0 +1 @@
1+
.psci_modules/Data.String.Unsafe/externs.cbornew file

Binary file not shown.

.psci_modules/Data.String.Unsafe/foreign.jsnew file+11
@@ -0,0 +1,11 @@
1+export const charAt = function (i) {
2+ return function (s) {
3+ if (i >= 0 && i < s.length) return s.charAt(i);
4+ throw new Error("Data.String.Unsafe.charAt: Invalid index.");
5+ };
6+};
7+
8+export const char = function (s) {
9+ if (s.length === 1) return s.charAt(0);
10+ throw new Error("Data.String.Unsafe.char: Expected string of length 1.");
11+};
.psci_modules/Data.String.Unsafe/index.jsnew file+7
@@ -0,0 +1,7 @@
1+// | Unsafe string and character functions.
2+import * as $foreign from "./foreign.js";
3+
4+export {
5+ char,
6+ charAt
7+} from "./foreign.js";
.psci_modules/Record.Unsafe/externs.cbornew file

Binary file not shown.

.psci_modules/Record.Unsafe/foreign.jsnew file+38
@@ -0,0 +1,38 @@
1+export const unsafeHas = function (label) {
2+ return function (rec) {
3+ return {}.hasOwnProperty.call(rec, label);
4+ };
5+};
6+
7+export const unsafeGet = function (label) {
8+ return function (rec) {
9+ return rec[label];
10+ };
11+};
12+
13+export const unsafeSet = function (label) {
14+ return function (value) {
15+ return function (rec) {
16+ var copy = {};
17+ for (var key in rec) {
18+ if ({}.hasOwnProperty.call(rec, key)) {
19+ copy[key] = rec[key];
20+ }
21+ }
22+ copy[label] = value;
23+ return copy;
24+ };
25+ };
26+};
27+
28+export const unsafeDelete = function (label) {
29+ return function (rec) {
30+ var copy = {};
31+ for (var key in rec) {
32+ if (key !== label && {}.hasOwnProperty.call(rec, key)) {
33+ copy[key] = rec[key];
34+ }
35+ }
36+ return copy;
37+ };
38+};
.psci_modules/Record.Unsafe/index.jsnew file+14
@@ -0,0 +1,14 @@
1+// | The functions in this module are highly unsafe as they treat records like
2+// | stringly-keyed maps and can coerce the row of labels that a record has.
3+// |
4+// | These function are intended for situations where there is some other way of
5+// | proving things about the structure of the record - for example, when using
6+// | `RowToList`. **They should never be used for general record manipulation.**
7+import * as $foreign from "./foreign.js";
8+
9+export {
10+ unsafeHas,
11+ unsafeGet,
12+ unsafeSet,
13+ unsafeDelete
14+} from "./foreign.js";
.psci_modules/Spago.Generated.BuildInfo/externs.cbornew file

Binary file not shown.

.psci_modules/Spago.Generated.BuildInfo/index.jsnew file+13
@@ -0,0 +1,13 @@
1+// @inline export packages always
2+// @inline export pursVersion always
3+// @inline export spagoVersion always
4+var spagoVersion = "1.0.3";
5+var pursVersion = "0.15.15";
6+var packages = {
7+ "yoga-fetch-om": "0.3.0"
8+};
9+export {
10+ packages,
11+ pursVersion,
12+ spagoVersion
13+};
.psci_modules/Type.Equality/externs.cbornew file

Binary file not shown.

.psci_modules/Type.Equality/index.jsnew file+35
@@ -0,0 +1,35 @@
1+var To = function (x) {
2+ return x;
3+};
4+var From = function (x) {
5+ return x;
6+};
7+var refl = {
8+ proof: function (a) {
9+ return a;
10+ },
11+ Coercible0: function () {
12+ return undefined;
13+ }
14+};
15+var proof = function (dict) {
16+ return dict.proof;
17+};
18+var to = function (dictTypeEquals) {
19+ var v = proof(dictTypeEquals)(function (a) {
20+ return a;
21+ });
22+ return v;
23+};
24+var from = function (dictTypeEquals) {
25+ var v = proof(dictTypeEquals)(function (a) {
26+ return a;
27+ });
28+ return v;
29+};
30+export {
31+ proof,
32+ to,
33+ from,
34+ refl
35+};
.psci_modules/Type.Function/externs.cbornew file

Binary file not shown.

.psci_modules/Type.Function/index.jsnew file+1
@@ -0,0 +1 @@
1+
.psci_modules/Type.Proxy/externs.cbornew file

Binary file not shown.

.psci_modules/Type.Proxy/index.jsnew file+58
@@ -0,0 +1,58 @@
1+// | The `Proxy` type and values are for situations where type information is
2+// | required for an input to determine the type of an output, but where it is
3+// | not possible or convenient to provide a _value_ for the input.
4+// |
5+// | A hypothetical example: if you have a class that is used to handle the
6+// | result of an AJAX request, you may want to use this information to set the
7+// | expected content type of the request, so you might have a class something
8+// | like this:
9+// |
10+// | ``` purescript
11+// | class AjaxResponse a where
12+// | responseType :: a -> ResponseType
13+// | fromResponse :: Foreign -> a
14+// | ```
15+// |
16+// | The problem here is `responseType` requires a value of type `a`, but we
17+// | won't have a value of that type until the request has been completed. The
18+// | solution is to use a `Proxy` type instead:
19+// |
20+// | ``` purescript
21+// | class AjaxResponse a where
22+// | responseType :: Proxy a -> ResponseType
23+// | fromResponse :: Foreign -> a
24+// | ```
25+// |
26+// | We can now call `responseType (Proxy :: Proxy SomeContentType)` to produce
27+// | a `ResponseType` for `SomeContentType` without having to construct some
28+// | empty version of `SomeContentType` first. In situations like this where
29+// | the `Proxy` type can be statically determined, it is recommended to pull
30+// | out the definition to the top level and make a declaration like:
31+// |
32+// | ``` purescript
33+// | _SomeContentType :: Proxy SomeContentType
34+// | _SomeContentType = Proxy
35+// | ```
36+// |
37+// | That way the proxy value can be used as `responseType _SomeContentType`
38+// | for improved readability. However, this is not always possible, sometimes
39+// | the type required will be determined by a type variable. As PureScript has
40+// | scoped type variables, we can do things like this:
41+// |
42+// | ``` purescript
43+// | makeRequest :: URL -> ResponseType -> Aff _ Foreign
44+// | makeRequest = ...
45+// |
46+// | fetchData :: forall a. (AjaxResponse a) => URL -> Aff _ a
47+// | fetchData url = fromResponse <$> makeRequest url (responseType (Proxy :: Proxy a))
48+// | ```
49+var $$Proxy = /* #__PURE__ */ (function () {
50+ function $$Proxy() {
51+
52+ };
53+ $$Proxy.value = new $$Proxy();
54+ return $$Proxy;
55+})();
56+export {
57+ $$Proxy as Proxy
58+};
.psci_modules/Type.Row/externs.cbornew file

Binary file not shown.

.psci_modules/Type.Row/index.jsnew file+1
@@ -0,0 +1 @@
1+
.psci_modules/Unsafe.Coerce/externs.cbornew file

Binary file not shown.

.psci_modules/Unsafe.Coerce/foreign.jsnew file+5
@@ -0,0 +1,5 @@
1+// module Unsafe.Coerce
2+
3+export const unsafeCoerce = function (x) {
4+ return x;
5+};
.psci_modules/Unsafe.Coerce/index.jsnew file+5
@@ -0,0 +1,5 @@
1+import * as $foreign from "./foreign.js";
2+
3+export {
4+ unsafeCoerce
5+} from "./foreign.js";
.psci_modules/Web.DOM.Internal.Types/externs.cbornew file

Binary file not shown.

.psci_modules/Web.DOM.Internal.Types/index.jsnew file+1
@@ -0,0 +1 @@
1+
.psci_modules/Web.Event.Internal.Types/externs.cbornew file

Binary file not shown.

.psci_modules/Web.Event.Internal.Types/index.jsnew file+1
@@ -0,0 +1 @@
1+
.psci_modules/Yoga.HTTP.API.Route.Encoding/externs.cbornew file

Binary file not shown.

.psci_modules/Yoga.HTTP.API.Route.Encoding/index.jsnew file+1
@@ -0,0 +1 @@
1+
.psci_modules/Yoga.HTTP.API.Route.Method/externs.cbornew file

Binary file not shown.

.psci_modules/Yoga.HTTP.API.Route.Method/index.jsnew file+1
@@ -0,0 +1 @@
1+
.psci_modules/cache-db.jsonnew file+1
@@ -0,0 +1 @@
1+{"Data.Int.Bits":{".spago/p/integers-6.0.0/src/Data/Int/Bits.js":["1970-01-01T06:00:00Z","bdbabdb4bf0d318a750d7ff7e1542735731877a33803a87011e670bafa8d59c8c3ef42107be1ca1b86dc7b8222c11008895341e36760cf7989a0da098d848100"],".spago/p/integers-6.0.0/src/Data/Int/Bits.purs":["1970-01-01T06:00:00Z","61f10b047f013a5b4505df8cc49e566ce827bce1272b471cdcc2a2b849e39db49f0850613e036931a4d2efd7a2cc727bbd8a8a310498ea28552cc4d6547fc800"]},"Data.NaturalTransformation":{".spago/p/prelude-6.0.2/src/Data/NaturalTransformation.purs":["1970-01-01T00:00:00Z","6b9fc42ec524a517d464dea99867c64345cdbcbada4260a772373a956961ad1c9a4a3a4f8ed4a0c7c7f3e36120068954141841c5d6bdc4e5898ea06435104bb7"]},"Data.String.Unsafe":{".spago/p/strings-6.0.1/src/Data/String/Unsafe.js":["1970-01-01T06:00:00Z","81c79d607f04aaa23089d717e10d358971deec3254ee25837a9d14e947c4d28444e4057abd2cdc1c114327a43584c3cef2cbec957b011ab4ed412e1a25596812"],".spago/p/strings-6.0.1/src/Data/String/Unsafe.purs":["1970-01-01T06:00:00Z","c3bddfdcefc7c46316a573e2af253df77fae08a64ad096f692391d33266d0f77623c0a6c8008a15bcae0d440670734399edd547ed335f5beecf9042b49fa2d9b"]},"Record.Unsafe":{".spago/p/prelude-6.0.2/src/Record/Unsafe.js":["1970-01-01T00:00:00Z","667d613a0e1265a710e98c9f6e64ff791b9e9b7227cdf699c3a25724077c02e42726c807c0387ca4484454fd853d5b41522bf2e048887f22a894413ef80cbb92"],".spago/p/prelude-6.0.2/src/Record/Unsafe.purs":["1970-01-01T00:00:00Z","af8a7c83127f5e61853ad0e572be799c04e321562a375d51ab133706ac6a6777e169b057f01a709ad7aae2d8c7a5ae8daa28eae8793c4fe92e2e8f0cfaecf870"]},"Spago.Generated.BuildInfo":{".spago/BuildInfo.purs":["2026-02-09T12:42:13.813485312Z","abfa99370d332ed1138a8d9f7ec91fe0377758e01f2520a6d390bdec7c3b5bacd6778fca0e5571642cde24de431c68071562941dde9fadc7a1dcb8de511370d8"]},"Type.Equality":{".spago/p/type-equality-4.0.1/src/Type/Equality.purs":["1970-01-01T05:00:00Z","2713b8d5621912fe0dad9cd588cf4579181566459fe200f5089de472d00e29ab4a1c020f73a8e89f04f3ef02b94ec28082d17d395b89349d6c5f8016426a009e"]},"Type.Function":{".spago/p/typelevel-prelude-7.0.0/src/Type/Function.purs":["1970-01-01T06:00:00Z","d1b8eb136c5e23ded6dcd622ef352200ea9a323dd4f3dec0328fe0dbcf673ee4c959a495efecc5605fedcb7824bb086faaf8684fa30afe0625b1d03fc921b149"]},"Type.Proxy":{".spago/p/prelude-6.0.2/src/Type/Proxy.purs":["1970-01-01T00:00:00Z","333d0ae90b05098eada860ad476ed9e1eacd67d969dc1573c74375610cf8de22e85a358a7783a0a461d7ffa6fe322d8c3e90696be02555a02793ac99aba687f2"]},"Type.Row":{".spago/p/typelevel-prelude-7.0.0/src/Type/Row.purs":["1970-01-01T06:00:00Z","cee5ad6bca731f76da8388f32d1e2f644b0dd976734261a01d2a5dd1671924e4534168e085f843f1576c754c917ccdf7fb0e68925fd23a2e121a1bed33d9a4c0"]},"Unsafe.Coerce":{".spago/p/unsafe-coerce-6.0.0/src/Unsafe/Coerce.js":["1970-01-01T05:00:00Z","031c3187f7ce65110a359260041309506e1ff39a97b6eb22c9a8f2e5c14b35db87d509bb5929f245c5d80df6ccd6dadf83579ebe4ac46650acdfa34a493cfc0d"],".spago/p/unsafe-coerce-6.0.0/src/Unsafe/Coerce.purs":["1970-01-01T05:00:00Z","04b214d9cbbf0c438bb2af4b25f8db5d04f247059241982f718c6d83322c3180f0eced0eb5c410860dcdb35650e9129a1cffe87f7279308cc4cf6c6570bba74f"]},"Web.DOM.Internal.Types":{".spago/p/web-dom-6.0.0/src/Web/DOM/Internal/Types.purs":["1970-01-01T05:00:00Z","c113e0d6553a99ad7dc85145336ddf709dd07893a49db715d8ab460be7ed42f6a17df038966e06b02fe7896b6347893fab0caf216dcd4262dd53a15d9d4b6596"]},"Web.Event.Internal.Types":{".spago/p/web-events-4.0.0/src/Web/Event/Internal/Types.purs":["1970-01-01T06:00:00Z","f7497de5e0b09a66fc33a8959bdbe979d56bd185d5a032894a357db7195e82454e55d4a672311d5a4cfb0fed2f55897d3bda655c9a7a68b39e84d7a04619b9ba"]},"Yoga.HTTP.API.Route.Encoding":{".spago/p/yoga-http-api-0.1.0/src/Yoga/HTTP/API/Route/Encoding.purs":["1970-01-01T00:00:00Z","7f41a999eace3d73aacf6ea69c91f9a49a6948959fcfb0fb784ff83479345f88c6e5970783ce7fb4d38e2648caf506e68f889fc185a80a91b029ccfd2c269c0b"]},"Yoga.HTTP.API.Route.Method":{".spago/p/yoga-http-api-0.1.0/src/Yoga/HTTP/API/Route/Method.purs":["1970-01-01T00:00:00Z","344b6850269f52ff385b364d9bebb1e884269d46a900dda3d451028770793c7ec6308ccaaec047664c6b6db9be3861a1039a6af5230c98a588ea47e62bdbea7c"]}}
.psci_modules/package.jsonnew file+1
@@ -0,0 +1 @@
1+{"type":"module"}
.purs-replnew file+1
@@ -0,0 +1 @@
1+import Prelude
package.json+1−1
@@ -1,6 +1,6 @@
11{
22 "name": "purescript-yoga-fetch-om",
3− "version": "0.2.0",
3+ "version": "0.4.0",
44 "description": "Derive type-safe fetch clients from yoga HTTP API definitions",
55 "type": "module",
66 "scripts": {
src/Yoga/Fetch/Om.purs+9−9
@@ -59,8 +59,8 @@ else instance Homogeneous headers String => ToHeaders headersRL headers where
5959
6060class DeriveClientFn :: forall k1. Type -> k1 -> Type -> Row Type -> Row Type -> Row Type -> Type -> Type -> Constraint
6161class
62− DeriveClientFn method segments request response errorRow successRow result fn
63− | method segments request response -> errorRow successRow result fn where
62+ DeriveClientFn method segments request response routeErrors successRow result fn
63+ | method segments request response -> routeErrors successRow result fn where
6464 deriveClientFn :: String -> Proxy (Route method segments request response) -> fn
6565
6666instance
@@ -72,8 +72,8 @@ instance
7272 , BuildUrl segments pathParams queryParams
7373 , MakeRequest method
7474 , SerializeBody body
75− , SplitResponses response successRow errorRow
76− , ParseResponse errorRow successRow
75+ , SplitResponses response successRow routeErrors
76+ , ParseResponse routeErrors successRow
7777 , RowToList successRow successRL
7878 , VariantOrValue successRL successRow result
7979 , Row.Union pathParams queryParams pathQuery
@@ -82,18 +82,18 @@ instance
8282 , RowToList headers headersRL
8383 , ToHeaders headersRL headers
8484 , CheckBodyIsUnit body bodyFlag
85− , BuildClientFn pathQueryRL headersRL bodyFlag body pathQuery headers errorRow result fn
85+ , BuildClientFn pathQueryRL headersRL bodyFlag body pathQuery headers routeErrors result fn
8686 ) =>
87− DeriveClientFn method segments request response errorRow successRow result fn where
87+ DeriveClientFn method segments request response routeErrors successRow result fn where
8888 deriveClientFn baseUrl _ =
8989 buildClientFn (Proxy :: _ pathQueryRL) (Proxy :: _ headersRL) (Proxy :: _ bodyFlag) impl
9090 where
91− impl :: Record pathQuery -> Record headers -> body -> Om {} errorRow result
91+ impl :: Record pathQuery -> Record headers -> body -> Om (Record ()) routeErrors result
9292 impl pathQueryRec headersRec bodyVal = do
9393 let url = buildUrl baseUrl (Proxy :: _ segments) pathParamsRec queryParamsRec
9494 let hdrs = toHeaders (Proxy :: _ headersRL) headersRec
9595 fetchResp <- makeRequest (Proxy :: _ method) url hdrs (serializeBody bodyVal) # fromAff
96− variant <- parseResponse fetchResp :: Om {} errorRow (Variant successRow)
96+ variant <- parseResponse fetchResp :: Om (Record ()) routeErrors (Variant successRow)
9797 variantOrValue (Proxy :: _ successRL) variant # pure
9898 where
9999 pathParamsRec = unsafeCoerce pathQueryRec :: Record pathParams
@@ -136,7 +136,7 @@ instance DeriveClientRL RL.Nil acc acc where
136136
137137instance
138138 ( IsSymbol label
139− , DeriveClientFn method segments request response errorRow successRow result fn
139+ , DeriveClientFn method segments request response routeErrors successRow result fn
140140 , DeriveClientRL tail acc1 acc2
141141 , Row.Cons label fn acc2 out
142142 , Row.Lacks label acc2
src/Yoga/Fetch/Om/ClientFn.purs+17−17
@@ -31,7 +31,7 @@ class
3131 :: Proxy pathQueryRL
3232 -> Proxy headersRL
3333 -> Proxy bodyFlag
34− -> (Record pathQuery -> Record headers -> body -> Om {} errorRow result)
34+ -> (Record pathQuery -> Record headers -> body -> Om (Record ()) errorRow result)
3535 -> fn
3636
3737-- No path/query, no headers, no body
@@ -44,8 +44,8 @@ instance
4444 h
4545 errorRow
4646 result
47− (Om {} errorRow result) where
48− buildClientFn _ _ _ f = f (unsafeCoerce {}) (unsafeCoerce {}) unit
47+ (Om (Record ()) errorRow result) where
48+ buildClientFn _ _ _ f = unsafeCoerce (f (unsafeCoerce {}) (unsafeCoerce {}) unit)
4949
5050-- No path/query, no headers, with body
5151instance
@@ -57,8 +57,8 @@ instance
5757 h
5858 errorRow
5959 result
60− (body -> Om {} errorRow result) where
61− buildClientFn _ _ _ f = \b -> f (unsafeCoerce {}) (unsafeCoerce {}) b
60+ (body -> Om (Record ()) errorRow result) where
61+ buildClientFn _ _ _ f = unsafeCoerce (\b -> f (unsafeCoerce {}) (unsafeCoerce {}) b)
6262
6363-- No path/query, with headers, no body
6464instance
@@ -70,8 +70,8 @@ instance
7070 h
7171 errorRow
7272 result
73− (Record h -> Om {} errorRow result) where
74− buildClientFn _ _ _ f = \hdrs -> f (unsafeCoerce {}) hdrs unit
73+ (Record h -> Om (Record ()) errorRow result) where
74+ buildClientFn _ _ _ f = unsafeCoerce (\hdrs -> f (unsafeCoerce {}) hdrs unit)
7575
7676-- No path/query, with headers, with body
7777instance
@@ -83,8 +83,8 @@ instance
8383 h
8484 errorRow
8585 result
86− (Record h -> body -> Om {} errorRow result) where
87− buildClientFn _ _ _ f = \hdrs b -> f (unsafeCoerce {}) hdrs b
86+ (Record h -> body -> Om (Record ()) errorRow result) where
87+ buildClientFn _ _ _ f = unsafeCoerce (\hdrs b -> f (unsafeCoerce {}) hdrs b)
8888
8989-- With path/query, no headers, no body
9090instance
@@ -96,8 +96,8 @@ instance
9696 h
9797 errorRow
9898 result
99− (Record pq -> Om {} errorRow result) where
100− buildClientFn _ _ _ f = \pqr -> f pqr (unsafeCoerce {}) unit
99+ (Record pq -> Om (Record ()) errorRow result) where
100+ buildClientFn _ _ _ f = unsafeCoerce (\pqr -> f pqr (unsafeCoerce {}) unit)
101101
102102-- With path/query, no headers, with body
103103instance
@@ -109,8 +109,8 @@ instance
109109 h
110110 errorRow
111111 result
112− (Record pq -> body -> Om {} errorRow result) where
113− buildClientFn _ _ _ f = \pqr b -> f pqr (unsafeCoerce {}) b
112+ (Record pq -> body -> Om (Record ()) errorRow result) where
113+ buildClientFn _ _ _ f = unsafeCoerce (\pqr b -> f pqr (unsafeCoerce {}) b)
114114
115115-- With path/query, with headers, no body
116116instance
@@ -122,8 +122,8 @@ instance
122122 h
123123 errorRow
124124 result
125− (Record pq -> Record h -> Om {} errorRow result) where
126− buildClientFn _ _ _ f = \pqr hdrs -> f pqr hdrs unit
125+ (Record pq -> Record h -> Om (Record ()) errorRow result) where
126+ buildClientFn _ _ _ f = unsafeCoerce (\pqr hdrs -> f pqr hdrs unit)
127127
128128-- With path/query, with headers, with body
129129instance
@@ -135,5 +135,5 @@ instance
135135 h
136136 errorRow
137137 result
138− (Record pq -> Record h -> body -> Om {} errorRow result) where
139− buildClientFn _ _ _ f = f
138+ (Record pq -> Record h -> body -> Om (Record ()) errorRow result) where
139+ buildClientFn _ _ _ f = unsafeCoerce f