>> 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.

>> 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 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.

-- 
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/CAFUu9R5o7WMvewXTLgafdX-Ei%2B6MnsM13xHW-pauSGs3scTJBA%40mail.gmail.com.

Reply via email to