Hi, as any one encounter this type of class def an...
# announcements
a
Hi, as any one encounter this type of class def and can explain the pattern
Copy code
Class A cosntructor(...) : (String) -> B {

}
r
it's a class that implements the
(String) -> B
interface (you can think of it like
Function<String, B>
from Java).
a
What would be a good use case for that? or a pattern ?
r
That's difficult to answer. Basically when you want a function type that has state. Whether that makes much sense is up for debate, but could possibly be necessary to work around libraries/APIs that don't envision your use case.
a
Cheers will have a look into it
OK, i looked on the Function interface it is indeed in order to force apply impel. probably sort of Command Pattern
e
Function1<String, B> maybe :)