On Thursday, December 10, 2020 at 9:51:50 PM UTC+1 Ben Greenman wrote: > >> A package for compose-n and compose-3 to like 10 or 20? > > Yes > > I like the idea of _small packages that do one thing_ better than > _one-stop all-utility packages_ ... but do what you think makes sense. >
Sounds reasonable to me, I'll create that package soon. Thanks for the advice. > >> Someday later, perhaps poly dots and #:rest-star can combine to > >> improve the built-in type. > >> > > > > From my naive viewpoint, I don't really see other natural ways of > improving > > the type of compose other than what I wrote, the problem being that > writing > > the type for arbitrary-arity composition would require specifying > equality > > between the return type of every function and the argument type of the > > preceding one. I'm not sure even Coq and Agda have that facility > directly, > > certainly not Haskell or Idris to the best of my knowledge. I don't > expect > > them to go beyond binary compose, because it's sufficient to do any > > compositions. It's that in Racket I find writing chains of nested > compose > > calls somewhat clunky. > > Typed Racket already has some domain-specific ideas to support the > #:rest-star option. The equality-chaining constraint is definitely > new, but doesn't seem out of the question. > > > https://github.com/racket/typed-racket/blob/master/typed-racket-lib/typed-racket/rep/type-rep.rkt#L586-L612 I see, #:rest-star seems quite powerful. I'm curious to see what kind of stuff will come out of it. I think other languages (Coq Agda Haskell Idris) have a harder time > here because they want to support currying. And even if they added > #:rest-star logic, their users might call it an anti-pattern because > it doesn't fit with partial application. > That's a good point. I started forgetting how important implicit currying is in these languages. - Sergiu -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/164ca420-75dc-4241-b512-dea79fe6e0aan%40googlegroups.com.

