On 12/15/2015 06:48 AM, John Berry wrote:
> In Heresy I did something like the (pipe ...) function above:
Oh for a nice chart comparing all the nice (partial) application variants!
--
Anthony Carrico
--
You received this message because you are subscribed to the Google Groups
"Racket Users" g
In Heresy I did something like the (pipe ...) function above:
; (:> *initial-value* *fn1* ...); The forward pipe operator. Given an
initial value and a list of one-argument functions; applys functions
in order from left to right and returns the result(def fn :>
(initial-value . fns)
(for (f in f
> This is an area in which there are probably too many options, but opinions
> are strong, and we have not standardized (yet). Feedback is welcome!
Speaking of which, there's also the `threading` package, which I really should
add the point-free version of ~> to.
--
You received this message b
Oft-forgotten feature about the curly-fn package: if you don’t include any
arguments, it works as a shorthand for curry. So really, the idiomatic curly-fn
solution would just be #{map sqr}, the shortest of the four. (Disclaimer: I
wrote the curly-fn package.)
Tongue-in-cheek comments aside, the
2015年12月13日日曜日 2時21分21秒 UTC+9 Alex Knauth:
> > On Dec 12, 2015, at 9:18 AM, Taro Annual wrote:
>
> > In racket libraries, rackjure module looks usable.
> > But, rackjure's threading(~>) denys lambda.
> >
> >
> > #lang rackjure
> >
> >> (#fn(map sqr %) '(1 2))
> > '(1 4)
> >> (~> '(1 2) #fn
> On Dec 12, 2015, at 9:18 AM, Taro Annual wrote:
> In racket libraries, rackjure module looks usable.
> But, rackjure's threading(~>) denys lambda.
>
>
> #lang rackjure
>
>> (#fn(map sqr %) '(1 2))
> '(1 4)
>> (~> '(1 2) #fn(map sqr %))
> [Error] lambda: not an identifier, identifier wit
Hi,
I want to make method chains like this:
#lang racket
(define (pipe init . procs)
(foldl (lambda (x y) (x y)) init procs))
(pipe '(3 4)
(lambda (l) (map sqr l))
(lambda (l) (apply + l))
sqrt)
5
In racket libraries, rackjure module looks usable.
But, rackjure's
7 matches
Mail list logo