Skip to content

Commit 6eeebaa

Browse files
committed
Change docs
1 parent 0fa2c96 commit 6eeebaa

File tree

3 files changed

+97
-42
lines changed

3 files changed

+97
-42
lines changed

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# purescript-ts-bridge
22

3-
<img
4-
src="https://media.tenor.com/MRCIli40TYoAAAAi/under-construction90s-90s.gif" width="30">
5-
63
A **PureScript** library for type class based **TypeScript** type generation (`.d.ts` files).
74

85
## Documentation
@@ -37,6 +34,6 @@ spago install ts-bridge
3734

3835
# Support
3936

40-
If you find a bug or have a feature idea feel free to make a PR or file an issue. Or just []()
37+
If you find a bug or have a feature idea feel free to make a PR or file an issue.
4138

4239
<a href='https://ko-fi.com/C0C3HQFRF' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://storage.ko-fi.com/cdn/kofi4.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>

docs/type-comparison.md

Lines changed: 67 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
- [Function](#function)
1616
- [Promise](#promise)
1717
- [Effect](#effect)
18+
- [Unit](#unit)
1819
<!-- AUTO-GENERATED-CONTENT:END -->
1920

2021
The following is a list of default implementations for types that are provided in this library. Since the generation typeclass is defined on your side, you can choose a subset of the provided implementations.
@@ -412,7 +413,7 @@ type Maybe<A> = {
412413
<td colspan=3>
413414
<h2>Either</h2>
414415

415-
`Either` is represented as opaque type using TypeScript __branded types. So there is no direct way to create a `Either` in TypeScript. See the FAQ for the general decision to represent ADTs as opaque types.
416+
`Either` is represented as opaque type using TypeScript branded types. So there is no direct way to create a `Either` in TypeScript. See the FAQ for the general decision to represent ADTs as opaque types.
416417

417418
</td>
418419
</tr>
@@ -481,7 +482,7 @@ type Either<A, B> = {
481482
<td colspan=3>
482483
<h2>Tuple</h2>
483484

484-
`Tuple` is represented as opaque type using TypeScript __branded types. So there is no direct way to create a `Either` in TypeScript. See the FAQ for the general decision to represent ADTs as opaque types.
485+
`Tuple` is represented as opaque type using TypeScript branded types. So there is no direct way to create a `Either` in TypeScript. See the FAQ for the general decision to represent ADTs as opaque types.
485486

486487
</td>
487488
</tr>
@@ -940,7 +941,70 @@ Effect a
940941

941942
`~/Effect.purs`
942943
```hs
943-
foreign import data Effect :: Type -> Type
944+
foreign import data Effect
945+
:: Type -> Type
946+
```
947+
948+
</td>
949+
<td valign="top">
950+
951+
952+
`<builtin>`
953+
954+
955+
</td>
956+
</tr>
957+
<tr></tr>
958+
959+
960+
<tr>
961+
<td colspan=3>
962+
<h2>Unit</h2>
963+
964+
`Unit` is represented as TypeScript's `void`
965+
966+
967+
</td>
968+
</tr>
969+
<tr></tr>
970+
<tr>
971+
<th></th>
972+
<th align="left">PureScript</th>
973+
<th align="left">TypeScript</th>
974+
</tr>
975+
<tr></tr>
976+
977+
978+
<tr>
979+
<td valign="top">Ref</td>
980+
<td valign="top">
981+
982+
```ts
983+
Unit
984+
```
985+
986+
</td>
987+
<td valign="top">
988+
989+
990+
```ts
991+
void
992+
```
993+
994+
995+
</td>
996+
</tr>
997+
<tr></tr>
998+
999+
1000+
<tr>
1001+
<td valign="top">Def</td>
1002+
<td valign="top">
1003+
1004+
`~/Data/Unit.purs`
1005+
```hs
1006+
foreign import data Unit
1007+
:: Type
9441008
```
9451009

9461010
</td>

gen-docs/data.js

Lines changed: 29 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export const data = [
9696
],
9797
[
9898
"Either",
99-
"`Either` is represented as opaque type using TypeScript __branded types. So there is no direct way to create a `Either` in TypeScript. See the FAQ for the general decision to represent ADTs as opaque types.",
99+
"`Either` is represented as opaque type using TypeScript branded types. So there is no direct way to create a `Either` in TypeScript. See the FAQ for the general decision to represent ADTs as opaque types.",
100100
[
101101
[
102102
"Ref",
@@ -128,7 +128,7 @@ export const data = [
128128
],
129129
[
130130
"Tuple",
131-
"`Tuple` is represented as opaque type using TypeScript __branded types. So there is no direct way to create a `Either` in TypeScript. See the FAQ for the general decision to represent ADTs as opaque types.",
131+
"`Tuple` is represented as opaque type using TypeScript branded types. So there is no direct way to create a `Either` in TypeScript. See the FAQ for the general decision to represent ADTs as opaque types.",
132132
[
133133
[
134134
"Ref",
@@ -324,43 +324,37 @@ export const data = [
324324
[
325325
"~/Effect.purs",
326326
[
327-
"foreign import data Effect :: Type -> Type",
327+
"foreign import data Effect",
328+
" :: Type -> Type"
329+
].join("\n"),
330+
],
331+
null,
332+
],
333+
],
334+
],
335+
[
336+
"Unit",
337+
[
338+
"`Unit` is represented as TypeScript's `void`",
339+
"",
340+
].join("\n"),
341+
[
342+
[
343+
"Ref",
344+
["Unit"].join("\n"),
345+
["void"].join("\n"),
346+
],
347+
[
348+
"Def",
349+
[
350+
"~/Data/Unit.purs",
351+
[
352+
"foreign import data Unit",
353+
" :: Type"
328354
].join("\n"),
329355
],
330356
null,
331357
],
332358
],
333359
],
334-
// [
335-
// "",
336-
// "",
337-
// [
338-
// ["Ref", "", ""],
339-
// ["Def", "", ""],
340-
// ],
341-
// ],
342-
// [
343-
// "",
344-
// "",
345-
// [
346-
// ["Ref", "", ""],
347-
// ["Def", "", ""],
348-
// ],
349-
// ],
350-
// [
351-
// "",
352-
// "",
353-
// [
354-
// ["Ref", "", ""],
355-
// ["Def", "", ""],
356-
// ],
357-
// ],
358-
// [
359-
// "",
360-
// "",
361-
// [
362-
// ["Ref", "", ""],
363-
// ["Def", "", ""],
364-
// ],
365-
// ],
366360
];

0 commit comments

Comments
 (0)