looking for a good name
Nov. 21st, 2008 02:07 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
/** * Injection (?) function (if you are a c+ programmer, you'd call it "downcast"). */ public static class WHATSMYNAME???<T, T1 extends T> extends Monomorphism<T1, T> { public T apply(T1 t) { return t; } }
I just could not figure out what name to give to this simple function. It is almost an identity function, but it is not.
no subject
Date: 2008-11-21 10:22 pm (UTC)Downcaster :)
no subject
Date: 2008-11-21 10:38 pm (UTC)no subject
Date: 2008-11-21 10:47 pm (UTC)no subject
Date: 2008-11-22 10:52 am (UTC)no subject
Date: 2008-11-22 03:43 pm (UTC)no subject
Date: 2008-11-22 03:54 pm (UTC)no subject
Date: 2008-11-22 04:02 am (UTC)no subject
Date: 2008-11-22 07:23 am (UTC)no subject
Date: 2008-11-22 08:55 am (UTC)no subject
Date: 2008-11-23 04:15 pm (UTC)Два смешных эпизода: а) кастить Set<Iterable<T>> to Iterable<Set<T>>, и интересный переход:
декартово произведение множеств {Pair(x0,y) | y in Y}, {Pair(x1,y) | y in Y}, ... представляется как Set<Iterable<Pair<X,Y>>>>; т.к. этот внутренний Iterable на самом деле Set, то нужно декартово произведение "представить" (отмапить) в виде Set<Iterable<Pair<X,Y>>>, после чего уже отмапить его в форму Set<Map<X,Y>>, чтобы достойно изображать YX.
Hi
Date: 2008-11-26 06:26 pm (UTC)Re: Hi
Date: 2008-11-26 07:09 pm (UTC)