How would you name a function of type `((T)->Unit)...
# random
t
How would you name a function of type
((T)->Unit)->Unit
? "Executor" perhaps?
a
it's a preference. I normally call things (make new types) according to the domain i am working on
👍 1
t
Yeah I noticed that conventionally people do name these kinds of functions according to the domain, its just a function with the "callback pattern" I was just wondering if theres a general named for these 🤔
a
not that i know of. im not familiar with such pattern
t
Like, people call
(T)->Boolean
predicates,
()->T
producers/suppliers etc
a
I see what you mean. I do not know
s
By that logic maybe it should be a
ProducerConsumer
ConsumerConsumer
😄
😂 1
r
Java has a Consumer type so you could actually write this as
Consumer<Consumer<T>>
success baby
very nice 1
t
yes, i would say its just a consumer accepting a consumer.