Libraryless. Click here for Pure Java version (7469L/42K).
1 | ifclass F0 |
2 | static <A> A pcallF_typed(F0<A> f) { |
3 | pcall { ret f?!; } null; |
4 | } |
5 | endif |
6 | |
7 | ifclass F1 |
8 | static <A, B> B pcallF_typed(F1<A, B> f, A a) { |
9 | pcall { ret f?.get(a); } null; |
10 | } |
11 | endif |
12 | |
13 | ifclass VF1 |
14 | static <A> void pcallF_typed(VF1<A> f, A a) { |
15 | pcall { |
16 | f?.get(a); |
17 | } |
18 | } |
19 | endif |
20 | |
21 | static <A> void pcallF_typed(IVF1<A> f, A a) { |
22 | pcall { |
23 | f?.get(a); |
24 | } |
25 | } |
26 | |
27 | static <A, B> void pcallF_typed(IVF2<A, B> f, A a, B b) { |
28 | pcall { |
29 | f?.get(a, b); |
30 | } |
31 | } |
32 | |
33 | sO pcallF_typed(Runnable r) { |
34 | pcall { r?.run(); } null; |
35 | } |
36 | |
37 | static <A> A pcallF_typed(IF0<A> f) { |
38 | pcall { ret f?!; } null; |
39 | } |
40 | |
41 | static <A, B> B pcallF_typed(IF1<A, B> f, A a) { |
42 | pcall { ret f?.get(a); } null; |
43 | } |
Began life as a copy of #1005301
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1034618 |
Snippet name: | pcallF_typed |
Eternal ID of this version: | #1034618/4 |
Text MD5: | 7d3eba405202018ab714bbc8d92e153f |
Transpilation MD5: | f8910b82569aad74ab7f6b34ca8ed8ba |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-03-26 02:04:28 |
Source code size: | 709 bytes / 43 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 148 / 236 |
Version history: | 3 change(s) |
Referenced in: | [show references] |