Skip to main content

Questions tagged [lambda]

Lambdas are anonymous functions (i.e. not having an identifier, like methods in a class) which can be used in a wide range of programming languages.

Filter by
Sorted by
Tagged with
2 votes
2 answers
309 views

import java.util.function.Function; public interface Printable { public String print(String s); public static void main(String[] args) { Function<String, String> fn = p -> p +...
releseabe's user avatar
  • 539
-2 votes
2 answers
240 views

I am currently writing an application that is going to be an adaptive quiz-like site for studying. The idea is a user is studying some topic and they are given questions on the site and enter their ...
Logan S's user avatar
  • 11
0 votes
0 answers
91 views

When working with functions that run a few short "procedures" in sequence that are not used anywhere else and it makes sense to keep it all inline, in a single function, a large part of the ...
Jake1234's user avatar
  • 129
1 vote
1 answer
777 views

If I have a discriminated union and want to write a function piecewise, the following code works just fine, but is taking advantage of some fairly tricky (at least to me) stuff involving overload ...
Daniel McLaury's user avatar
1 vote
0 answers
64 views

Our company is an aggregator of multiple payment services fragmented on the web. So instead of businesses integrating multiple services one by one, they will only need to integrate to our API, and we ...
kelvinleeweisern's user avatar
9 votes
5 answers
835 views

A few years ago, I wrote an application that allowed users to upload a file (it's a very specific file type) to a server. It then sends instructions to the server on how to visualise the data, and the ...
Mark's user avatar
  • 79
0 votes
1 answer
1k views

Is capture by value (x below) an early binding and capture by reference (y below) a late binding in C++ lambdas, or are they both early bindings—the first by value and the second by reference? #...
Géry Ogam's user avatar
1 vote
2 answers
624 views

How are these principles applied in the context of streams and lambda expressions? In particular, the applicability with respect to the following three principles: - Single Responsibility Principle (...
L m's user avatar
  • 133
4 votes
2 answers
494 views

I'm new to AWS serverless applications and am looking for something like ocelot request aggregation on the AWS serverless stack. Assume I have two AWS lambdas that return data needed by a SPA: A and ...
C.M.'s user avatar
  • 149
1 vote
0 answers
514 views

This is more a general question about this project I have on. We need to implement some UI for our costumers to upload multiple files (2000+) every month, so we can send them by email to another ...
jspasiuk's user avatar
4 votes
3 answers
1k views

I have a code at my local machine, with which I want to call an AWS Lambda function. I have configured AWS API Gateway as doorway to Lambda function, but I am concerned about security when sending ...
Malacophonous's user avatar
3 votes
1 answer
151 views

I am working on a SaaS project that will have a trial when the trial is ending I get a webhook notification when 3 days are remaining. I do some stuff with this and one of the things is I update user....
joshk132's user avatar
  • 161
0 votes
2 answers
117 views

Generally, we are looking to create a logging framework that can target human readable output as well as various structured data formats. So, a goal is minimizing code duplication in packaging the ...
John's user avatar
  • 109
2 votes
0 answers
166 views

I'm starting to use ES6 arrow functions more, but haven't found a coding style that I like, especially when chaining them together. e.g., Eric Elliott gives this code: mix = (...fns) => x => ...
user949300's user avatar
  • 9,029
6 votes
2 answers
3k views

I'm looking to improve the readability of a lengthy C++ function. This function contains a number (> a dozen) variables that are used throughout. The main logic of the code is a long list of condition ...
jwimberley's user avatar
2 votes
0 answers
572 views

I'm moving from a coupled architecture to a decoupled architecture using microservices with AWS Lambda. Here is my current architecture: Each API Gateway route is linked to a specific Lambda, each ...
Jean Lbr's user avatar
  • 179
13 votes
3 answers
4k views

Java 8 added the concept of functional interfaces, as well as numerous new methods that are designed to take functional interfaces. Instances of these interfaces can be succinctly created using ...
M. Justin's user avatar
  • 239
2 votes
2 answers
850 views

Hypothetical situation - can a currying function have an unknown number of arguments (kind of like varargs) Eg in Python: addByCurrying(1)(2)(3)(4) Should equal 10 addByCurrying(5)(6) Should equal ...
vikarjramun's user avatar
8 votes
0 answers
834 views

I'm working on a high-performance project where Java 8's lambda functions are enormously useful. I've found, however, that they're memory inefficient when used en masse. For example, suppose I need to ...
Dylan Knowles's user avatar
0 votes
2 answers
4k views

Having difficulties deciding which rules to apply on by value / by name evaulation. Say I have: (λz.zz)(λb.b) And I want to evaluate according to call by valute, will the next step be (λz.z)(λb.b) ...
Jayn's user avatar
  • 3
2 votes
2 answers
3k views

Lately I've started adding this to certain classes in an in-house API: public class MyClass { // I usually do this with classes I expect to // be printed out or tested a lot (particularly // ...
roundar's user avatar
  • 123
8 votes
1 answer
5k views

There are a bunch of methods in a class that I want to clean up. These just build up a data structure (with different values) over and over again and add them to a container passed in, like so: ...
Bhargav's user avatar
  • 306
4 votes
1 answer
3k views

Writing my own JVM compiler, I am facing a giant problem that I am desperately unable to solve: Lambda Return Type Inference 1. Overview of the compiler lifecycle More specifically, the order in ...
Clashsoft's user avatar
  • 143
3 votes
2 answers
424 views

So I have been using F# for a while and studying a bit of Haskell on the side and I have realized I could rewrite the exact same function one of three different ways. Either with implicit currying, ...
Alexander Ryan Baggett's user avatar
14 votes
2 answers
4k views

I recently run into the following situation. class A{ public: void calculate(T inputs); } Firstly, A represents an object in the physical world, which is a strong argument for not splitting the ...
Vorac's user avatar
  • 7,189