-
-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
simplify definitions of polymorphic functions
- Loading branch information
1 parent
37134e3
commit e732768
Showing
19 changed files
with
238 additions
and
435 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,28 @@ | ||
import {add, sub, pipe} from '../..'; | ||
import {add, pipe} from '../..'; | ||
|
||
// $ExpectType any | ||
pipe([add(1), sub(1)])(10); | ||
// $ExpectType {} | ||
pipe([])(0); | ||
|
||
// $ExpectType any | ||
pipe([add(1), sub(1)])('x'); | ||
// $ExpectType number | ||
pipe([add(1)])(0); | ||
|
||
// $ExpectType number | ||
pipe([add(1), add(1)])(0); | ||
|
||
// $ExpectType number | ||
pipe([add(1), add(1), add(1)])(0); | ||
|
||
// $ExpectType number | ||
pipe([add(1), add(1), add(1), add(1)])(0); | ||
|
||
// $ExpectType number | ||
pipe([add(1), add(1), add(1), add(1), add(1)])(0); | ||
|
||
// $ExpectType number | ||
pipe([add(1), add(1), add(1), add(1), add(1), add(1)])(0); | ||
|
||
// $ExpectType number | ||
pipe([add(1), add(1), add(1), add(1), add(1), add(1), add(1)])(0); | ||
|
||
// $ExpectType string | ||
pipe([(s: string) => s.length, add(1), add(1), (n: number) => n.toFixed(2)])(''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import {pluck} from '../..'; | ||
|
||
// $ExpectType any[] | ||
// $ExpectType Functor<any> | ||
pluck('x')([{x: 1}, {x: 2, y: 3}]); | ||
|
||
// $ExpectType any[] | ||
// $ExpectType Functor<any> | ||
pluck('x')([{x: 'foo'}, {x: 'bar', y: 'baz'}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters