decorator - Function decorators for Elixir

  •        10

A function decorator is a "@decorate" annotation that is put just before a function definition. It can be used to add extra functionality to Elixir functions. The runtime overhead of a function decorator is zero, as it is executed on compile time. Examples of function decorators include: loggers, instrumentation (timing), precondition checks, et cetera.

https://github.com/arjan/decorator

Tags
Implementation
License
Platform

   




Related Projects

babel-plugin-transform-decorators-legacy - A plugin for Babel 6 that (mostly) replicates the old decorator behavior from Babel 5

  •    Javascript

This is a plugin for Babel 6 that is meant to replicate the old decorator behavior from Babel 5 in order to allow people to more easily transition to Babel 6 without needing to be blocked on updates to the decorator proposal or for Babel to re-implement it. If you are including your plugins manually and using transform-class-properties, make sure that transform-decorators-legacy comes before transform-class-properties.

class-validator - Validation made easy using TypeScript decorators.

  •    TypeScript

Allows use of decorator and non-decorator based validation. Internally uses validator.js to perform validation. Class-validator works on both browser and node.js platforms. Note: Please use at least npm@6 when using class-validator as from npm@6 the dependency tree is flatterned what is good for us.

elixirscript - Converts Elixir to JavaScript

  •    Elixir

The goal is to convert a subset (or full set) of Elixir code to JavaScript, providing the ability to write JavaScript in Elixir. This is done by taking the Elixir AST and converting it into JavaScript AST and then to JavaScript code. This is done using the Elixir-ESTree library.

wrapt - A Python module for decorators, wrappers and monkey patching.

  •    Python

The aim of the wrapt module is to provide a transparent object proxy for Python, which can be used as the basis for the construction of function wrappers and decorator functions. The wrapt module focuses very much on correctness. It therefore goes way beyond existing mechanisms such as functools.wraps() to ensure that decorators preserve introspectability, signatures, type checking abilities etc. The decorators that can be constructed using this module will work in far more scenarios than typical decorators and provide more predictable and consistent behaviour.

elixir-pipes - Macros for more flexible composition with the Elixir Pipe operator

  •    Elixir

Elixir Pipes is an Elixir extension that extends the pipe (|>) operator through macros. The return value of each function is used as the first argument of the next function in the pipe. It's a beautiful expression that makes the intent of the programmer clear.


cachetools - Extensible memoizing collections and decorators

  •    Python

This module provides various memoizing collections and decorators, including variants of the Python 3 Standard Library @lru_cache function decorator. For the purpose of this module, a cache is a mutable mapping of a fixed maximum size. When the cache is full, i.e. by adding another item the cache would exceed its maximum size, the cache must choose which item(s) to discard based on a suitable cache algorithm. In general, a cache's size is the total size of its items, and an item's size is a property or function of its value, e.g. the result of sys.getsizeof(value). For the trivial but common case that each item counts as 1, a cache's size is equal to the number of its items, or len(cache).

react-decoration - A collection of decorators for React Components

  •    Javascript

Attention - In order to use react-decoration you have to use babel 5 or use this plugin for babel 6. Check this page for information. If you aren't using npm in your project, you can include reactDecoration using UMD build in the dist folder with <script> tag.

decorator - Dynamic inheritance library

  •    Java

You had one job. ONE JOB. Fixing the broken dream of the single responsibility principle. The idea behind the decorator pattern is to decouple responsibilities from the parent class into reusable components. Individual decorators can then be attached to otherwise empty parent classes to do a single job. This allows a simple java class to have multiple and dynamic inheritance. In order to make this pattern scalable with minimal boilerplate, an easy to use code-generation library was created to automate most of its creation.

mock - Mocking library for Elixir language

  •    Elixir

A mocking library for the Elixir language. We use the Erlang meck library to provide module mocking functionality for Elixir. It uses macros in Elixir to expose the functionality in a convenient manner for integrating in Elixir tests.

OK - Elegant error/exception handling in Elixir, with result monads.

  •    Elixir

Elegant error/exception handling in Elixir, with result monads. The OK module works with result tuples by treating them as a result monad.

macropy - Macros in Python: quasiquotes, case classes, LINQ and more!

  •    Python

MacroPy is an implementation of Syntactic Macros in the Python Programming Language. MacroPy provides a mechanism for user-defined functions (macros) to perform transformations on the abstract syntax tree (AST) of a Python program at import time. This is an easy way to enhance the semantics of a Python program in ways which are otherwise impossible, for example providing an extremely concise way of declaring classes. and more! See the docs at http://macropy3.readthedocs.io/en/latest/.

elixir_express

  •    Elixir

Elixir provides the joy and productivity of Ruby with the concurrency and fault-tolerance of Erlang. Together, we'll take a guided tour through the language, going from the very basics to macros and distributed programming. Along the way, we'll see how Elixir embraces concurrency and how we can construct self-healing programs that restart automatically on failure. Attendees should leave with a great head-start into Elixir, some minor language envy, and a strong desire to continue exploration. Erlang is a functional language with focuses on concurrency and fault tolerance. It first appeared in 1986 as part of Ericsson's quest to build fault tolerant, scalable telecommunication systems. It was open-sourced in 1998 and has gone on to power large portions of the worlds telecom systems, in addition to some of the most popular online services.

excheck - Property-based testing library for Elixir (QuickCheck style).

  •    Elixir

Property-based testing for Elixir (QuickCheck style). It uses Erlang's triq library for underlying checking engine, and ExCheck's modules provide wrapper macros for ExUnit tests. First add ExCheck and triq to your project's dependencies in mix.exs.

core-decorators - Library of stage-0 JavaScript decorators (aka ES2016/ES7 decorators but not accurate) inspired by languages that come with built-ins like @​override, @​deprecate, @​autobind, @​mixin and more

  •    Javascript

Library of JavaScript stage-0 decorators (aka ES2016/ES7 decorators but that's not accurate) inspired by languages that come with built-ins like @​override, @​deprecate, @​autobind, @​mixin and more. Popular with React/Angular, but is framework agnostic. Similar to Annotations in Java but unlike Java annotations, decorators are functions which are applied at runtime. This can be consumed by any transpiler that supports stage-0 of the decorators spec, like babel.js version 5. Babel 6 does not yet support decorators natively, but you can include babel-plugin-transform-decorators-legacy or use the applyDecorators() helper.

chronic - Half profiler, half timer, 100% fun.

  •    Python

Chronic is halfway between a simple timer and a profiler. Add decorators or wrap code in with statements to get the execution time. Chronic keeps track of the call hierarchy to tell you what timed blocks executed within other timed blocks. Attach an event listener to log your timings however you want. To time a block of code, you can use either the @time decorator or the Timer context manager.

vue-typescript - Typescript decorators to make vue feel more typescripty

  •    TypeScript

I built this mostly to remove the red squiggles on VSCode, but also to make Vue work seamlessly while still writing code that feels like typescript. While you can just declare all your components as 'any' and carry on, you lose all the fantastic features of typescript. However, i also wanted to make sure i still had access to the entirety of Vue's features; so vue-typescript is built in such a way that you can pick and chose how much of it you want to use and what you would rather stick to standard Vue syntax for.

amnesia - Mnesia wrapper for Elixir.

  •    Elixir

amnesia wraps everything exposed by mnesia, from fragments to fragment hash, access and backup behaviors. It provides a simplified table and database definition with some macros and allows you to use the nice Enum functions on tables by implementing the Enum.Iterator protocol.

exactor - Helpers for simpler implementation of GenServer based processes

  •    Elixir

Simplifies implementation of GenServer based processes in Elixir. For other cases, you may need to use plain GenServer functions (which can be used together with ExActor macros). ExActor is not meant to fully replace GenServer. It just tries to reduce boilerplate in most common cases.

class-validator - Validation made easy using TypeScript decorators.

  •    TypeScript

Class-based validation with Typescript / ES6 / ES5 using decorators or validation schemas. Supports both node.js and browser

lodash-decorators - A collection of decorators using lodash at it's core.

  •    TypeScript

Decorators using lodash functions. View the API docs for more in depth documentation. This library requires Map and WeakMap to be available globally. If Map or WeakMap is not supported in your environment then use a polyfill.





We have large collection of open source products. Follow the tags from Tag Cloud >>


Open source products are scattered around the web. Please provide information about the open source projects you own / you use. Add Projects.