Re: [racket-users] compose in Typed Racket

2020-12-16 Thread unlimitedscolobb
Oh wow, that's impressively better than what I wrote! I didn't know one could have *recursive* macros, to say nothing about the proper usage of syntax-parse. Thank you very much for your quick answer! - Sergiu On Wednesday, December 16, 2020 at 11:03:49 PM UTC+1 sorawe...@gmail.com wrote:

Re: [racket-users] compose in Typed Racket

2020-12-16 Thread Sorawee Porncharoenwase
syntax-parse can already perform pattern matching. No need to use match (define-syntax (multi-compose stx) (syntax-parse stx [(_ f:expr g:expr) #'(compose f g)] [(_ f:expr funcs:expr ...) #'(compose f (multi-compose funcs ...))])) On Wed, Dec 16, 2020 at 1:37 PM

Re: [racket-users] compose in Typed Racket

2020-12-16 Thread unlimitedscolobb
On Thursday, December 10, 2020 at 6:01:52 PM UTC+1 unlimitedscolobb wrote: > On Thursday, December 10, 2020 at 5:49:43 PM UTC+1 hen...@topoi.pooq.com > wrote: > > A macro might be able to generate either of the above from >> (comp f g h k) >> . >> > Indeed. I'm re-reading the docs on macros

Re: [racket-users] compose in Typed Racket

2020-12-10 Thread unlimitedscolobb
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

Re: [racket-users] compose in Typed Racket

2020-12-10 Thread Ben Greenman
>> 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

Re: [racket-users] compose in Typed Racket

2020-12-10 Thread unlimitedscolobb
On Thursday, December 10, 2020 at 5:49:43 PM UTC+1 hen...@topoi.pooq.com wrote: > On Wed, Dec 09, 2020 at 10:16:16PM -0800, unlimitedscolobb wrote: > > > I'm not sure whether macros could be of use here. I'll give it a think. > > Idea: Have a look at parendown >

Re: [racket-users] compose in Typed Racket

2020-12-10 Thread Hendrik Boom
On Wed, Dec 09, 2020 at 10:16:16PM -0800, unlimitedscolobb wrote: > On Wednesday, December 9, 2020 at 11:50:26 PM UTC+1 Ben Greenman wrote: > > > > If the answer is no, is there any interest in including these three > > > functions (as well as compose-5, 6, 7, 8) into Typed Racket? > > > > I

Re: [racket-users] compose in Typed Racket

2020-12-09 Thread unlimitedscolobb
On Wednesday, December 9, 2020 at 11:50:26 PM UTC+1 Ben Greenman wrote: > > If the answer is no, is there any interest in including these three > > functions (as well as compose-5, 6, 7, 8) into Typed Racket? > > I think these would be excellent in a package. > > A package for compose-n and

Re: [racket-users] compose in Typed Racket

2020-12-09 Thread Ben Greenman
> If the answer is no, is there any interest in including these three > functions (as well as compose-5, 6, 7, 8) into Typed Racket? I think these would be excellent in a package. Someday later, perhaps poly dots and #:rest-star can combine to improve the built-in type. -- You received this

[racket-users] compose in Typed Racket

2020-12-08 Thread unlimitedscolobb
Hello, I've found out that compose in Typed Racket has the type (: compose (All (a b c) (-> (-> b c) (-> a b) (-> a c which means that Typed Racket's compose can only combine two functions at a time. In untyped code, I tend to use compose to combine more functions (e.g., 7), so I wrote