Skip to content

Commit 7169951

Browse files
rename prelude.ts to prelude-ts, release 0.8.2. Fixes #20 (#22)
* rename prelude.ts to prelude-ts, release 0.8.2. Fixes #20 cc @MartynasZilinskas
1 parent 01fc947 commit 7169951

File tree

5 files changed

+27
-27
lines changed

5 files changed

+27
-27
lines changed

README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# prelude.ts
1+
# prelude-ts
22
[![NPM version][npm-image]][npm-url]
33
[![Tests][circleci-image]][circleci-url]
44
[![apidoc][apidoc-image]][apidoc-url]
55

66
## Intro
77

8-
Prelude.ts is a typescript library which aims to make functional programming
8+
prelude-ts is a typescript library which aims to make functional programming
99
concepts accessible and productive in typescript. Note that even though it's
1010
written in typescript, it's perfectly usable from javascript (including ES5)!
1111

@@ -53,7 +53,7 @@ and concretely the [list library](https://github.com/funkia/list/), as of 0.7.7.
5353
In addition the library is written in idiomatic javascript style, with loops
5454
instead of recursion, so the performance should be good
5555
([see benchmarks here comparing to immutable.js and more](https://github.com/emmanueltouzery/prelude.ts/wiki/Benchmarks)).
56-
`list` and `hamt_plus` are the two only dependencies of prelude.ts.
56+
`list` and `hamt_plus` are the two only dependencies of prelude-ts.
5757

5858
## Set, Map and equality
5959

@@ -62,17 +62,17 @@ So, `1 === 1` is true. But `[1] === [1]` is not, and neither `{a:1} === {a:1}`.
6262
This poses problems for collections, because if you have a `Set`, you don't
6363
want duplicate elements because of this limited definition of equality.
6464

65-
For that reason, prelude.ts encourages you to define for your non-primitive types
65+
For that reason, prelude-ts encourages you to define for your non-primitive types
6666
methods `equals(other: any): boolean` and `hashCode(): number` (the same
6767
methods that [immutable.js uses](https://facebook.github.io/immutable-js/docs/#/ValueObject)).
6868
With these methods, structural equality is achievable, and indeed
6969
`Vector.of(1,2,3).equals(Vector.of(1,2,3))` is `true`. However this can only
7070
work if the values you put in collections have themselves properly defined equality
71-
([see how prelude.ts can help](https://github.com/emmanueltouzery/prelude.ts/wiki/Equality)).
71+
([see how prelude-ts can help](https://github.com/emmanueltouzery/prelude.ts/wiki/Equality)).
7272
If these values don't have structural equality, then we can get no better than
7373
`===` behavior.
7474

75-
prelude.ts attempts to assist the programmer with this; it tries to encourage
75+
prelude-ts attempts to assist the programmer with this; it tries to encourage
7676
the developer to do the right thing. First, it'll refuse types without obviously properly
7777
defined equality in Sets and in Maps keys, so `HashSet.of([1])`,
7878
or `Vector.of([1]).equals(Vector.of([2]))` will not compile.
@@ -82,7 +82,7 @@ For both of these, you get (a longer version of) this message:
8282
Property 'equals' is missing in type 'number[]'.
8383

8484
But in some less obvious cases, we can't detect the issue at compile-time, so
85-
prelude.ts will reject the code at runtime; for instance if you call
85+
prelude-ts will reject the code at runtime; for instance if you call
8686
`HashSet.of(Vector.of([1]))` you'll get an exception at runtime:
8787

8888
Error building a HashSet: element doesn't support true equality: Vector([1])
@@ -92,7 +92,7 @@ prelude.ts will reject the code at runtime; for instance if you call
9292
## Installation
9393

9494
Typescript must know about `Iterable`, an ES6 feature (but present in most browsers)
95-
to compile prelude.ts. If you use typescript and target ES5, a minimum change to your tsconfig.json
95+
to compile prelude-ts. If you use typescript and target ES5, a minimum change to your tsconfig.json
9696
could be to add:
9797

9898
```json
@@ -104,9 +104,9 @@ could be to add:
104104
### Using in nodejs
105105

106106
Just add the dependency in your `package.json` and start using it (like
107-
`import { Vector } from "prelude.ts";`, or `const { Vector } = require("prelude.ts");`
107+
`import { Vector } from "prelude-ts";`, or `const { Vector } = require("prelude-ts");`
108108
if you use commonjs).
109-
Everything should work, including type-checking if you use typescript. Prelude.ts also provides
109+
Everything should work, including type-checking if you use typescript. prelude-ts also provides
110110
pretty-printing in the node REPL.
111111

112112
### Using in the browser
@@ -122,13 +122,13 @@ include the relevant one in your index.html in script tags:
122122
<script src="node_modules/prelude.ts/dist/src/prelude_ts.min.js"></script>
123123
```
124124

125-
You shouldn't have an issue to import prelude.ts in your application, but if you use
125+
You shouldn't have an issue to import prelude-ts in your application, but if you use
126126
modules it gets a little more complicated; One solution if you use them is to create
127127
an `imports.d.ts` file with the following contents:
128128

129129
```typescript
130130
// https://github.com/Microsoft/TypeScript/issues/3180#issuecomment-283007750
131-
import * as _P from 'prelude.ts';
131+
import * as _P from 'prelude-ts';
132132
export as namespace prelude_ts;
133133
export = _P;
134134
```
@@ -144,15 +144,15 @@ To get the values without namespace.
144144
Finally, if you also include `dist/src/chrome_dev_tools_formatters.js` through
145145
a `script` tag, and [enable Chrome custom formatters](http://bit.ly/object-formatters),
146146
then you can get
147-
[a nice display of prelude.ts values in the chrome debugger](https://raw.githubusercontent.com/wiki/emmanueltouzery/prelude.ts/chrome_formatters.png).
147+
[a nice display of prelude-ts values in the chrome debugger](https://raw.githubusercontent.com/wiki/emmanueltouzery/prelude.ts/chrome_formatters.png).
148148

149149
## Wishlist/upcoming features
150150

151151
* CharSeq, a string wrapper?
152152
* Non-empty vector? (already have [non-empty linkedlist](http://emmanueltouzery.github.io/prelude.ts/latest/apidoc/classes/linkedlist.conslinkedlist.html))
153153
* More functions on existing classes
154154

155-
## Out of scope for prelude.ts
155+
## Out of scope for prelude-ts
156156

157157
* Free monads
158158
* Monad transformers
@@ -166,16 +166,16 @@ such as typescript.
166166

167167
* [monet.js](https://monet.github.io/monet.js/) -- only has the `List` and
168168
`Option` collections, implemented in functional-style ES5. The implementation,
169-
using recursion, means its list type is noticeably slower than prelude.ts's.
169+
using recursion, means its list type is noticeably slower than prelude-ts's.
170170
* [immutables.js](https://facebook.github.io/immutable-js/) -- doesn't have the
171171
`Option` concept, the types can be clunky.
172172
* [sanctuary](https://github.com/sanctuary-js/sanctuary)
173-
offers global functions like `S.filter(S.where(...))` while prelude.ts prefers a
173+
offers global functions like `S.filter(S.where(...))` while prelude-ts prefers a
174174
fluent-api style like `list.filter(..).sortBy(...)`. Also, sanctuary doesn't
175175
offer sets and maps. On the other hand, sanctuary has some JS runtime type system
176-
which prelude.ts doesn't have.
176+
which prelude-ts doesn't have.
177177
* [ramdajs](http://ramdajs.com/) offers global functions like
178-
`R.filter(R.where(...))` while prelude.ts prefers a
178+
`R.filter(R.where(...))` while prelude-ts prefers a
179179
fluent-api style like `list.filter(..).sortBy(...)`. Also, ramda doesn't offer
180180
sets and maps. Ramda also uses currying a lot out of the box, which may not
181181
be intuitive to a number of developers. In prelude,
@@ -184,8 +184,8 @@ such as typescript.
184184
are opt-in.
185185
* [lodash](https://lodash.com) also has the global functions, and many functions
186186
mutate the collections.
187-
* [vavr](http://www.vavr.io/) -- it's a java library, but it's the main inspiration for prelude.ts.
188-
Note that vavr is inspired by the scala library, so prelude.ts also is,
187+
* [vavr](http://www.vavr.io/) -- it's a java library, but it's the main inspiration for prelude-ts.
188+
Note that vavr is inspired by the scala library, so prelude-ts also is,
189189
transitively.
190190

191191
## Typescript version
@@ -206,7 +206,7 @@ requires typescript 3.0 or newer.
206206
npm run benchmarks
207207

208208
[npm-image]: https://img.shields.io/npm/v/prelude.ts.svg?style=flat-square
209-
[npm-url]: https://www.npmjs.com/package/prelude.ts
209+
[npm-url]: https://www.npmjs.com/package/prelude-ts
210210
[circleci-image]: https://circleci.com/gh/emmanueltouzery/prelude.ts.svg?style=shield&circle-token=6d8b74ef7ea7d1c204e77c4f88b05348682b4161
211211
[circleci-url]: https://circleci.com/gh/emmanueltouzery/prelude.ts
212212
[apidoc-image]: http://emmanueltouzery.github.io/prelude.ts/apidoc.svg

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "prelude.ts",
3-
"version": "0.8.1",
2+
"name": "prelude-ts",
3+
"version": "0.8.2",
44
"description": "A typescript functional programming library",
55
"main": "dist/src/index.js",
66
"typings": "dist/src/index.d.ts",

scripts/with_header.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ set -e
33

44
cat <<END
55
/**
6-
* prelude.ts v$(node -p 'require("./package.json").version')
6+
* prelude-ts v$(node -p 'require("./package.json").version')
77
* https://github.com/emmanueltouzery/prelude.ts
88
* (c) 2017-$(git show -s --format=%ai | cut -d - -f 1) Emmanuel Touzery
9-
* prelude.ts may be freely distributed under the ISC license.
9+
* prelude-ts may be freely distributed under the ISC license.
1010
*/
1111
END
1212
cat $*

src/Contract.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ let preludeTsContractViolationCb = (msg:string):void => { throw msg; };
88
* (for instance trying to setup a <code>HashSet</code> of <code>Option&lt;number[]&gt;</code>: you
99
* can't reliably compare a <code>number[]</code> therefore you can't compare
1010
* an <code>Option&lt;number[]&gt;</code>.. but we can't detect this error at compile-time
11-
* in typescript). So when we detect them at runtime, prelude.ts throws
11+
* in typescript). So when we detect them at runtime, prelude-ts throws
1212
* an exception by default.
1313
* This function allows you to change that default action
1414
* (for instance, you could display an error message in the console,

tests/Comments.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as ts from 'typescript';
66

77
/**
88
* In this little script we extract source code from the apidoc comments
9-
* all over the source of prelude.ts, generate for each source file which
9+
* all over the source of prelude-ts, generate for each source file which
1010
* has apidoc comments containing source code samples a special apidoc-*.ts
1111
* test file.
1212
*

0 commit comments

Comments
 (0)