Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
Initial release (#5)
Browse files Browse the repository at this point in the history
Co-authored-by: Giulio Canti <giulio.canti@gmail.com>
  • Loading branch information
IMax153 and gcanti authored Jul 9, 2023
1 parent 7c01623 commit 0b273fb
Show file tree
Hide file tree
Showing 60 changed files with 2,496 additions and 1,065 deletions.
10 changes: 10 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "Effect-TS/typeclass" }],
"commit": false,
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/tender-monkeys-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/typeclass": minor
---

initial release
3 changes: 2 additions & 1 deletion docs/modules/Bounded.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ Added in v1.0.0
**Signature**
```ts
export interface Bounded<A> extends Order<A> {
export interface Bounded<A> {
readonly compare: Order<A>
readonly maxBound: A
readonly minBound: A
}
Expand Down
24 changes: 0 additions & 24 deletions docs/modules/Covariant.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Added in v1.0.0

- [do notation](#do-notation)
- [let](#let)
- [letDiscard](#letdiscard)
- [mapping](#mapping)
- [as](#as)
- [asUnit](#asunit)
Expand Down Expand Up @@ -50,29 +49,6 @@ export declare const let: <F extends TypeLambda>(
Added in v1.0.0
## letDiscard
**Signature**
```ts
export declare const letDiscard: <F extends TypeLambda>(
F: Covariant<F>
) => {
<N extends string, A extends object, B>(name: Exclude<N, keyof A>, b: B): <R, O, E>(
self: Kind<F, R, O, E, A>
) => Kind<F, R, O, E, { [K in N | keyof A]: K extends keyof A ? A[K] : B }>
<R, O, E, A extends object, N extends string, B>(self: Kind<F, R, O, E, A>, name: Exclude<N, keyof A>, b: B): Kind<
F,
R,
O,
E,
{ [K in N | keyof A]: K extends keyof A ? A[K] : B }
>
}
```
Added in v1.0.0
# mapping
## as
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/Invariant.ts.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Invariant.ts
nav_order: 13
nav_order: 12
parent: Modules
---

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/Monad.ts.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Monad.ts
nav_order: 14
nav_order: 13
parent: Modules
---

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/Monoid.ts.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Monoid.ts
nav_order: 15
nav_order: 14
parent: Modules
---

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/Of.ts.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Of.ts
nav_order: 16
nav_order: 15
parent: Modules
---

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/Pointed.ts.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Pointed.ts
nav_order: 17
nav_order: 16
parent: Modules
---

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/Product.ts.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Product.ts
nav_order: 18
nav_order: 17
parent: Modules
---

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/SemiAlternative.ts.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: SemiAlternative.ts
nav_order: 19
nav_order: 18
parent: Modules
---

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/SemiApplicative.ts.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: SemiApplicative.ts
nav_order: 20
nav_order: 19
parent: Modules
---

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/SemiCoproduct.ts.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: SemiCoproduct.ts
nav_order: 21
nav_order: 20
parent: Modules
---

Expand Down
8 changes: 4 additions & 4 deletions docs/modules/SemiProduct.ts.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: SemiProduct.ts
nav_order: 23
nav_order: 22
parent: Modules
---

Expand All @@ -15,7 +15,7 @@ Added in v1.0.0
- [constructors](#constructors)
- [productMany](#productmany)
- [do notation](#do-notation)
- [bindDiscard](#binddiscard)
- [andThenBind](#andthenbind)
- [type class](#type-class)
- [SemiProduct (interface)](#semiproduct-interface)
- [utils](#utils)
Expand Down Expand Up @@ -52,12 +52,12 @@ Added in v1.0.0
# do notation
## bindDiscard
## andThenBind
**Signature**
```ts
export declare const bindDiscard: <F extends TypeLambda>(
export declare const andThenBind: <F extends TypeLambda>(
F: SemiProduct<F>
) => {
<N extends string, A extends object, R2, O2, E2, B>(name: Exclude<N, keyof A>, that: Kind<F, R2, O2, E2, B>): <
Expand Down
13 changes: 1 addition & 12 deletions docs/modules/Semigroup.ts.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Semigroup.ts
nav_order: 22
nav_order: 21
parent: Modules
---

Expand Down Expand Up @@ -377,17 +377,6 @@ export declare const intercalate: {
}
```
**Example**
```ts
import { intercalate } from '@effect/typeclass/Semigroup'
import { Semigroup } from '@effect/data/String'

const S = intercalate(Semigroup, ' + ')

assert.strictEqual(S.combine('a', 'b'), 'a + b')
```

Added in v1.0.0
## reverse
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/Traversable.ts.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Traversable.ts
nav_order: 24
nav_order: 23
parent: Modules
---

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/TraversableFilterable.ts.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: TraversableFilterable.ts
nav_order: 25
nav_order: 24
parent: Modules
---

Expand Down
2 changes: 1 addition & 1 deletion dtslint/FlatMap.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as _ from "@effect/typeclass/FlatMap"
import type { TypeLambda } from "@effect/typeclass/HKT"
import type { TypeLambda } from "@effect/data/HKT"
import { pipe } from "@effect/data/Function"

interface RAW<R, E, A> {
Expand Down
9 changes: 0 additions & 9 deletions dtslint/HKT.ts

This file was deleted.

16 changes: 7 additions & 9 deletions dtslint/Monoid.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
import * as _ from "@effect/data/typeclass/Monoid"
import * as Number from "@effect/data/Number"
import * as String from "@effect/data/String"
import * as Monoid from "@effect/typeclass/Monoid"

//
// tuple
//

// $ExpectType Monoid<readonly [string, number]>
_.tuple(
String.Monoid,
Number.MonoidSum
Monoid.tuple(
Monoid.string,
Monoid.numberSum
)

//
// struct
//

// $ExpectType Monoid<{ readonly a: string; readonly b: number; }>
_.struct({
a: String.Monoid,
b: Number.MonoidSum
Monoid.struct({
a: Monoid.string,
b: Monoid.numberSum
})
2 changes: 1 addition & 1 deletion dtslint/Product.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as _ from "@effect/data/typeclass/Product"
import * as _ from "@effect/typeclass/Product"
import type { TypeLambda } from "@effect/data/HKT"

interface RAW<R, E, A> {
Expand Down
3 changes: 1 addition & 2 deletions dtslint/SemiAlternative.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as _ from "@effect/data/typeclass/SemiAlternative"
import * as _ from "@effect/typeclass/SemiAlternative"
import type { TypeLambda } from "@effect/data/HKT"
import { pipe } from "@effect/data/Function"

interface RAW<R, E, A> {
(r: R): () => Promise<readonly [E, A]>
Expand Down
2 changes: 1 addition & 1 deletion dtslint/SemiProduct.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OptionTypeLambda } from "@effect/data/Option"
import * as _ from "@effect/data/typeclass/SemiProduct"
import * as _ from "@effect/typeclass/SemiProduct"

export declare const SemiProduct: _.SemiProduct<OptionTypeLambda>

Expand Down
16 changes: 7 additions & 9 deletions dtslint/Semigroup.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
import * as _ from "@effect/data/typeclass/Semigroup"
import * as Number from "@effect/data/Number"
import * as String from "@effect/data/String"
import * as Semigroup from "@effect/typeclass/Semigroup"

//
// tuple
//

// $ExpectType Semigroup<readonly [string, number]>
_.tuple(
String.Semigroup,
Number.SemigroupSum
Semigroup.tuple(
Semigroup.string,
Semigroup.numberSum
)

//
// struct
//

// $ExpectType Semigroup<{ readonly a: string; readonly b: number; }>
_.struct({
a: String.Semigroup,
b: Number.SemigroupSum
Semigroup.struct({
a: Semigroup.string,
b: Semigroup.numberSum
})
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0b273fb

Please sign in to comment.