All Projects → troyp → fn.el

troyp / fn.el

Licence: GPL-3.0 license
Concise anonymous functions for Emacs Lisp

Programming Languages

emacs lisp
2029 projects

Projects that are alternatives of or similar to fn.el

aws-sam-typescript-layers-example
Example project for developing AWS Lambda functions on TypeScript with all goodies: local development, tests, debugging, shared layers (3rd party and your own), and deploy.
Stars: ✭ 168 (+546.15%)
Mutual labels:  lambda
aws-turn-off-my-account
📦 🚀 📦 Lambda stack to turn off and destroy all resources from your personal AWS Account to avoid billing surprises
Stars: ✭ 63 (+142.31%)
Mutual labels:  lambda
eksutil
Sample project to call Kubernetes API of an Amazon EKS cluster from AWS Lambda
Stars: ✭ 26 (+0%)
Mutual labels:  lambda
scanii-lambda
A Sam-Packaged AWS Lambda client to the scanii.com content processing service
Stars: ✭ 25 (-3.85%)
Mutual labels:  lambda
ecs-drain-lambda
Automation of Draining ECS instances with Lambda, based on Autoscaling Group Lifecycle hooks or Spot Instance Interruption Notices
Stars: ✭ 56 (+115.38%)
Mutual labels:  lambda
terraform-aws-lambda-auto-package
A terraform module to define a lambda function which source files are automatically built and packaged for lambda deployment.
Stars: ✭ 23 (-11.54%)
Mutual labels:  lambda
kula
Lightweight and highly extensible .NET scripting language.
Stars: ✭ 43 (+65.38%)
Mutual labels:  lambda
guitarteacher
Guitar Teacher skill for the Amazon Alexa platform
Stars: ✭ 16 (-38.46%)
Mutual labels:  lambda
serverless-media-portal
Ready-to-deploy webapp for sharing home videos: a React frontend with a AWS Lambda backend using FFmpeg to process videos. Created using Serverless Framework.
Stars: ✭ 90 (+246.15%)
Mutual labels:  lambda
lambda-acm-validate
Automatically validate ACM requests with Lambda
Stars: ✭ 34 (+30.77%)
Mutual labels:  lambda
GoblinDB
Fear the Goblin! - An amazing, simple and fun database for humans
Stars: ✭ 54 (+107.69%)
Mutual labels:  lambda
leto-serverless
Angular server(less) side rendering
Stars: ✭ 13 (-50%)
Mutual labels:  lambda
terraform-aws-lambda
A Terraform module to create AWS Lambda ressources.
Stars: ✭ 40 (+53.85%)
Mutual labels:  lambda
blueauth
🔐 Serverless passwordless authentication. No databases needed. Use in just 1 line in serverless, middleware, express, next.js, and more.
Stars: ✭ 56 (+115.38%)
Mutual labels:  lambda
serverless-aws-rust-http
⚡🏗️ template for new aws lambda serverless rust http apps
Stars: ✭ 85 (+226.92%)
Mutual labels:  lambda
aws-nestjs-starter
Serverless, AWS, NestJS, GraphQL and DynamoDB starter
Stars: ✭ 200 (+669.23%)
Mutual labels:  lambda
home-energy-monitor
ESP32-based Home Energy Monitor
Stars: ✭ 152 (+484.62%)
Mutual labels:  lambda
sqs-to-lambda-async
Process SQS messages with Lambda, asynchronously
Stars: ✭ 27 (+3.85%)
Mutual labels:  lambda
SecretsManagerwithCloudFormation
Implements a Lambda-backed CloudFormation Custom Resource for AWS Secrets Manager
Stars: ✭ 20 (-23.08%)
Mutual labels:  lambda
telegram-stepfunctions-bot
Serverless Telegram bot made on 4 AWS Lambda chained by AWS Step Functions. All of this written on Serverless Framework using plugins.
Stars: ✭ 26 (+0%)
Mutual labels:  lambda

fn.el -- Concise anonymous functions for Emacs Lisp.

fn.el provides macros for writing concise and readable anonymous functions.

MELPA MELPA Stable


Installation

  • Install from melpa using M-x list-packages.

  • Or, place fn.el in any directory on your load-path and execute:

    (require 'fn)


API

  • fn (&rest body)
  • fn: (&rest body)

fn (&rest BODY)

Return a function defined by BODY.

Intended for inline use where concision is desired. If creating a function to bind as a function value, use lambda or -lambda.

The definition BODY may use anaphoric parameters to refer to the arguments. For a single-argument function, <> can be used. For a multiple-argument function, use <1> to refer to the first argument, <2> to refer to the second, and so on up to <9>. The parameter <rest> refers to a list containing the (n+1)st and later arguments, where <n> is the highest numerical parameter supplied.

If applied to a literal, creates a constant function, or equivalently, a thunk (since it can be called with any number of arguments).

(-map (fn (* <> <>)) (number-sequence 0 10))
;; (0 1 4 9 16 25 36 49 64 81 100)

(-map (fn (/ (-sum <>)
            (length <>)))
      '((3.0 4.0 5.0 5.0 10.0)
        (1.5 2.5 2.0)
        (1 5)))
;; (5.4 2.0 3)
;; find average of each list

(-filter (fn (zerop (mod <> 3)))
        (number-sequence 1 10))
;; (3 6 9)

(funcall (fn 7))
;; 7

(funcall (fn (-map #'list <rest>)) 1 2 3 4)
;; ((1) (2) (3) (4))

fn: (&rest BODY)

Return a function defined by (BODY).

Intended for inline use where concision is desired. If creating a function to bind as a function value, use lambda or -lambda.

Identical to fn except that BODY is automatically parenthesized.

The definition BODY may use the anaphoric parameter <> for the sole argument, or <1> ... <9> to refer to multiple positional arguments. The parameter <rest> refers to a list containing the (n+1)st and later arguments, where <n> is the highest numerical parameter supplied.

(-map (fn: * <> <>) (number-sequence 0 10))
;; (0 1 4 9 16 25 36 49 64 81 100)

(-filter (fn: > <> 0)
        '(-5 2 0 0 3 -1 0 4))
;; (2 3 4)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].