git.iko.soy/rowtype-yoga/yoga-r3f
on main help sign in
115 lines 3.4 kB history raw
1// Generated by purs version 0.15.16
2import * as $foreign from "./foreign.js";
3import * as Control_Applicative from "../Control.Applicative/index.js";
4import * as Control_Bind from "../Control.Bind/index.js";
5import * as Control_Monad_Except_Trans from "../Control.Monad.Except.Trans/index.js";
6import * as Data_Function from "../Data.Function/index.js";
7import * as Foreign from "../Foreign/index.js";
8var unsafeReadProp = function (dictMonad) {
9 var fail = Foreign.fail(dictMonad);
10 var pure = Control_Applicative.pure(Control_Monad_Except_Trans.applicativeExceptT(dictMonad));
11 return function (k) {
12 return function (value) {
13 return $foreign.unsafeReadPropImpl(fail(new Foreign.TypeMismatch("object", Foreign.typeOf(value))), pure, k, value);
14 };
15 };
16};
17var readProp = function (dictMonad) {
18 return unsafeReadProp(dictMonad);
19};
20var readIndex = function (dictMonad) {
21 return unsafeReadProp(dictMonad);
22};
23var ix = function (dict) {
24 return dict.ix;
25};
26var index = function (dict) {
27 return dict.index;
28};
29var indexableExceptT = function (dictMonad) {
30 var bindFlipped = Control_Bind.bindFlipped(Control_Monad_Except_Trans.bindExceptT(dictMonad));
31 return {
32 ix: function (dictIndex) {
33 var index1 = index(dictIndex);
34 return function (f) {
35 return function (i) {
36 return bindFlipped(Data_Function.flip(index1)(i))(f);
37 };
38 };
39 }
40 };
41};
42var indexableForeign = function (dictMonad) {
43 return {
44 ix: function (dictIndex) {
45 return index(dictIndex);
46 }
47 };
48};
49var hasPropertyImpl = function (v) {
50 return function (v1) {
51 if (Foreign.isNull(v1)) {
52 return false;
53 };
54 if (Foreign.isUndefined(v1)) {
55 return false;
56 };
57 if (Foreign.typeOf(v1) === "object" || Foreign.typeOf(v1) === "function") {
58 return $foreign.unsafeHasProperty(v, v1);
59 };
60 return false;
61 };
62};
63var hasProperty = function (dict) {
64 return dict.hasProperty;
65};
66var hasOwnPropertyImpl = function (v) {
67 return function (v1) {
68 if (Foreign.isNull(v1)) {
69 return false;
70 };
71 if (Foreign.isUndefined(v1)) {
72 return false;
73 };
74 if (Foreign.typeOf(v1) === "object" || Foreign.typeOf(v1) === "function") {
75 return $foreign.unsafeHasOwnProperty(v, v1);
76 };
77 return false;
78 };
79};
80var indexInt = function (dictMonad) {
81 return {
82 index: Data_Function.flip(readIndex(dictMonad)),
83 hasProperty: hasPropertyImpl,
84 hasOwnProperty: hasOwnPropertyImpl,
85 errorAt: Foreign.ErrorAtIndex.create
86 };
87};
88var indexString = function (dictMonad) {
89 return {
90 index: Data_Function.flip(readProp(dictMonad)),
91 hasProperty: hasPropertyImpl,
92 hasOwnProperty: hasOwnPropertyImpl,
93 errorAt: Foreign.ErrorAtProperty.create
94 };
95};
96var hasOwnProperty = function (dict) {
97 return dict.hasOwnProperty;
98};
99var errorAt = function (dict) {
100 return dict.errorAt;
101};
102export {
103 readProp,
104 readIndex,
105 ix,
106 index,
107 hasProperty,
108 hasOwnProperty,
109 errorAt,
110 indexString,
111 indexInt,
112 indexableForeign,
113 indexableExceptT
114};
115//# sourceMappingURL=index.js.map