Skip to content

Commit

Permalink
More types.
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanburke committed Dec 20, 2024
1 parent 46be7ce commit 49e9e85
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "functype",
"version": "0.8.43",
"version": "0.8.44",
"description": "A smallish functional library for TypeScript",
"author": "jordan.burke@gmail.com",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion src/iterable/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export type IterableType<A extends Type> = {

get size(): number

toArray<B extends A = A>(): readonly B[]
toArray<B = A>(): readonly B[]

toValue: () => { _tag: string; value: A[] }
} & Iterable<A> &
Expand Down
4 changes: 2 additions & 2 deletions src/list/List.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export type List<A> = {
readonly head: A
readonly headOption: Option<A>
readonly isEmpty: boolean
toArray: <B extends A = A>() => B[]
toArray: <B = A>() => B[]
reduce: (f: (prev: A, curr: A) => A) => A
reduceRight: (f: (prev: A, curr: A) => A) => A
foldLeft: <B>(z: B) => (op: (b: B, a: A) => B) => B
Expand Down Expand Up @@ -102,7 +102,7 @@ const createList = <A>(values?: Iterable<A>): List<A> => {
return array.length === 0
},

toArray: <B extends A = A>(): B[] => [...array] as B[],
toArray: <B = A>(): B[] => [...array] as unknown as B[],

reduce: (f: (prev: A, curr: A) => A) => array.reduce(f),

Expand Down

0 comments on commit 49e9e85

Please sign in to comment.