[The image shows a screenshot of VS Code. The visible code reads as follows:]
static Function5<Either<L, A>, Either<L, B>, Either<L, C>, Either<L, D>, Either<L, E>, Either<L, F>> lift5<L, A, B,
C, D, E, F>(F f(A a, B b, C c, D d, E e)) => (Either<L, A> fa, Either<L, B> fb, Either<L, C> fc, Either<L, D> fd,
Either<L, E> fe) => map5(fa, fb, fc, fd, fe, f);
static Function6<Either<L, A>, Either<L, B>, Either<L, C>, Either<L, D>, Either<L, E>, Either<L, F>, Either<L, G>>
lift6<L, A, B, C, D, E, F, G>(G f(A a, B b, C c, D d, E e, F f)) => (Either<L, A> fa, Either<L, B> fb, Either<L, C>
fc, Either<L, D> fd, Either<L, E> fe, Either<L, F> ff) => map6(fa, fb, fc, fd, fe, ff, f);
static Function7<Either<L, A>, Either<L, B>, Either<L, C>, Either<L, D>, Either<L, E>, Either<L, F>, Either<L, G>,
Either<L, H>> lift7<L, A, B, C, D, E, F, G, H>(H f(A a, B b, C c, D d, E e, F f, G g)) => (Either<L, A> fa, Either<L,
B> fb, Either<L, C> fc, Either<L, D> fd, Either<L, E> fe, Either<L, F> ff, Either<L, G> fg) => map7(fa, fb, fc, fd,
fe, ff, fg, f);
static Function8<Either<L, A>, Either<L, B>, Either<L, C>, Either<L, D>, Either<L, E>, Either<L, F>, Either<L, G>,
Either<L, H>, Either<L, I>> lift8<L, A, B, C, D, E, F, G, H, I>(I f(A a, B b, C c, D d, E e, F f, G g, H h)) =>
(Either<L, A> fa, Either<L, B> fb, Either<L, C> fc, Either<L, D> fd, Either<L, E> fe, Either<L, F> ff, Either<L, G>
fg, Either<L, H> fh) => map8(fa, fb, fc, fd, fe, ff, fg, fh, f);
static Function9<Either<L, A>, Either<L, B>, Either<L, C>, Either<L, D>, Either<L, E>, Either<L, F>, Either<L, G>,
Either<L, H>, Either<L, I>, Either<L, J>> lift9<L, A, B, C, D, E, F, G, H, I, J>(J f(A a, B b, C c, D d, E e, F f, G
g, H h, I i)) => (Either<L, A> fa, Either<L, B> fb, Either<L, C> fc, Either<L, D> fd, Either<L, E> fe, Either<L, F>
ff, Either<L, G> fg, Either<L, H> fh, Either<L, I> fi) => map9(fa, fb, fc, fd, fe, ff, fg, fh, fi, f);
static Function10<Either<L, A>, Either<L, B>, Either<L, C>, Either<L, D>, Either<L, E>, Either<L, F>, Either<L, G>,
Either<L, H>, Either<L, I>, Either<L, J>, Either<L, K>> lift10<L, A, B, C, D, E, F, G, H, I, J, K>(K f(A a, B b, C c,
D d, E e, F f, G g, H h, I i, J j)) => (Either<L, A> fa, Either<L, B> fb, Either<L, C> fc, Either<L, D> fd, Either<L,
E> fe, Either<L, F> ff, Either<L, G> fg, Either<L, H> fh, Either<L, I> fi, Either<L, J> fj) => map10(fa, fb, fc, fd,
fe, ff, fg, fh, fi, fj, f);
static Function11<Either<L, A>, Either<L, B>, Either<L, C>, Either<L, D>, Either<L, E>, Either<L, F>, Either<L, G>,
Either<L, H>, Either<L, I>, Either<L, J>, Either<L, K>, Either<L, LL>> lift11<L, A, B, C, D, E, F, G, H, I, J, K, LL>
(LL f(A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k)) => (Either<L, A> fa, Either<L, B> fb, Either<L, C> fc,
Either<L, D> fd, Either<L, E> fe, Either<L, F> ff, Either<L, G> fg, Either<L, H> fh, Either<L, I> fi, Either<L, J>
fj, Either<L, K> fk) => map11(fa, fb, fc, fd, fe, ff, fg, fh, fi, fj, fk f);
static Function12<Either<L, A>, Either<L, B>, Either<L, C>, Either<L, D>, Either<L, E>, Either<L, F>, Either<L, G>,
Either<L, H>, Either<L, I>, Either<L, J>, Either<L, K>, Either<L, LL>, Either<L, M>> lift12<L, A, B, C, D, E, F, G,
H, I, J, K, LL, M>(M f(A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, LL l)) => (Either<L, A> fa, Either<L,
B> fb, Either<L, C> fc, Either<L, D> fd, Either<L, E> fe, Either<L, F> ff, Either<L, G> fg, Either<L, H> fh,
[The rest of the code is cut off, however, a code map to the right indicates that huge blocks such as this make up the majority of th efile, continuing a long way both above and below the readable section.]
Looks like a bunch of functions that wrap the arguments and result of other functions with Either. Tbh I don't think there's a better way to do this.
Actually in haskell, instead of doing lift you can do
lift3 :: Either l a -> Either l b -> Either l c -> Either l d
lift3 a b c = test <$> a <*> b <*> c -- <- like this,
-- any function with any arguments
-- can be "lift"ed with this pattern
fn :: a -> b -> c -> d
fn = undefined
No real need for this crazy amount of lift declarations (although haskell does still have them anyway, they are slightly convenient for specific situations)
These lines were written in Dart which doesn't have Either type. So this is a library that can add functional programming. I was curious to see how the developer implements the either type but I've found this.
Assuming it's generated code, maybe there's some optimisation option which happens to generate small variable names along with various other optimisations?
19
u/MurdoMaclachlan public boolean isInt(int i) { return true; } Feb 27 '22
Image Transcription: Code
[The image shows a screenshot of VS Code. The visible code reads as follows:]
[The rest of the code is cut off, however, a code map to the right indicates that huge blocks such as this make up the majority of th efile, continuing a long way both above and below the readable section.]
I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!
11
u/Servious Feb 26 '22 edited Feb 26 '22
Looks like a bunch of functions that wrap the arguments and result of other functions with Either. Tbh I don't think there's a better way to do this.
Actually in haskell, instead of doing
liftyou can doNo real need for this crazy amount of
liftdeclarations (although haskell does still have them anyway, they are slightly convenient for specific situations)5
u/purbub Feb 27 '22
Is it from dartz library?
51
u/rgnkn Feb 26 '22
Either<bad, shit>25
u/Willinton06 Feb 26 '22
Minifying anything that doesn’t end up in a browser is pure madness
21
u/TheBigerGamer Feb 27 '22
To the transcriber: Here's my contribution. Do not go through the pain it was to transcribe this.
static Function6<Either<L, A>, Elther<L, B>, Either<L, C>, Elther<L, D>, Either<L, E>, Either<L, F>, Either<L, G>> Lift6<L, A, B, C, D, E, F, G>(G f(A a, B b, C c, D d, E e, F f)}) => (Either<L, A> fa, Either<L, B> fb, Either<L, C> fc, Either<L, D> fd, Either<L, E> fe, Either<L, F> ff) => map6(fa, fb, fc, fd, fe, ff, f); static Function7<Either<L, A>, Elther<L, B>, Either<L, C>, Elther<L, D>, Either<L, E>, Either<L, F>, Either<L, G>, Either<L, H>> lift7<L, A, B, C, D, E, F, G, H>(H f(A a, B b, C c, D d, E e, F f, G g)) => (Either<L, A> fa, Either<L, B> fb, Either<L, C> fc, Either<L, D> fd, Either<L, E> fe, Either<L, F> ff, Either<L, G> fg) => map7(fa, fb, fc, fd, fe, ff, fg, f); static Function8<Either<L, A>, Elther<L, B>, Either<L, C>, Elther<L, D>, Either<L, E>, Either<L, F>, Either<L, G>, Either<L, H>, Either<L, I>> lift8<L, A, B, C, D, E, F, G, H, I>(I f(A a, B b, C c, D d, E e, F f, G g, H h)) => (Either<L, A> fa, Either<L, B> fb, Either<L, C> fc, Either<L, D> fd, Either<L, E> fe, Either<L, F> ff, Either<L, G> fg, Either<L, H> fh) => map8(fa, fb, fc, fd, fe, ff, fg, fh, f); static Function9<Either<L, A>, Elther<L, B>, Either<L, C>, Elther<L, D>, Either<L, E>, Either<L, F>, Either<L, G>, Either<L, H>, Either<L, I>, Either<L, J>> Lift9<L, A, B, C, D, E, F, G, H, I, J>(J f(A a, B b, C c, D d, E e, F f, G g, H h, I i)) => (Either<L, A> fa, Either<L, B> fb, Either<L, C> fc, Either<L, D> fd, Either<L, E> fe, Either<L, F> ff, Either<L, G> fg, Either<L, H> fh, Either<L, I> fi) => map9(fa, fb, fc, fd, fe, ff, fg, fh, fi, f); static Function10<Either<L, A>, Elther<L, B>, Either<L, C>, Elther<L, D>, Either<L, E>, Either<L, F>, Either<L, G>, Either<L, H>, Either<L, I>, Either<L, J>, Either<L, K>> lift10<L, A, B, C, D, E, F, G, H, I, J, K>(K f(A a, B b, C c, D d, E e, F f, G g, H h, I i, J j)) => (Either<L, A> fa, Either<L, B> fb, Either<L, C> fc, Either<L, D> fd, Either<L, E> fe, Either<L, F> ff, Either<L, G> fg, Either<L, H> fh, Either<L, I> fi, Either<L, J> fj) => map10(fa, fb, fe, fd, fe, ff, fg, fh, fi, fj, f); static Function11<Either<L, A>, Elther<L, B>, Either<L, C>, Elther<L, D>, Either<L, E>, Either<L, F>, Either<L, G>, Either<L, H>, Either<L, I>, Either<L, J>, Either<L, K>, Either<L, LL>> lift11<L, A, B, C, D, E, F, G, H, I, J, K, LL>(LL f(A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k)) => (Either<L, A> fa, Either<L, B> fb, Either<L, C> fc, Either<L, D> fd, Either<L, E> fe, Either<L, F> ff, Either<L, G> fg, Either<L, H> fh, Either<L, I> fi, Either<L, J> fj, Either<L, K> fk) => map11(fa, fb, fe, fd, fe, ff, fg, fh, fi, fj, fk, f); static Function12<Either<L, A>, Elther<L, B>, Either<L, C>, Elther<L, D>, Either<L, E>, Either<L, F>, Either<L, G>, Either<L, H>, Either<L, I>, Either<L, J>, Either<L, K>, Either<L, LL>, Either<L, M>> lift12<L, A, B, C, D, E, F, G, H, I, J, K, LL, M>(M f(A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, LL l)) = (Either<L, A> fa, Either<L, B> fb, Either<L, C> fc, Either<L, D> fd, Either<L, E> fe, Either<L, F> ff, Either<L, G> fg, Either<L, H> fh
14
u/LucienZerger Feb 26 '22
looks minified, but further down it doesn't.. wtf..
1
u/I_DontUseReddit_Much Feb 28 '22
Please tell me this is just obfuscated code.
0
u/[deleted] Feb 26 '22
[deleted] — view deleted comment