Displaying 1 to 13 from 13 results

maybe - Maybe is a type that wraps optional values

  •    Javascript

Maybe is a type that wraps optional values. It can either be a Just (has some value) or a Nothing (has no value). In JavaScript, it is a better way of handling null and undefined. Instead of writing an if statement, ternary expression, or && shorthand to check if a value is present you can just map over it instead and assign the result of this expression or return it. You can also chain operations together, often leading to much cleaner code.

node-options - The option type, also known as the maybe type, for JavaScript

  •    Javascript

An implementation of the option type, sometimes known as the maybe type. A function that returns an optional string isn't that different from a function that returns a string or null. The advantage over null is that options provide a number of functions that help with manipulating optional values.

results - Discriminated Unions including Maybe (an option type) and Result for javascript with fewer bugs

  •    Javascript

Results is a tiny library bringing Discriminated Unions (aka Sum Types or Algebraic Types) to JavaScript, with match for better program flow control. Results ships with full-featured Maybe (sometimes called an Option Type) and Result unions built-in, helping you safely deal with optional data and error handling.

giftbox - A lightweight Javascript library for the Option monad

  •    Javascript

Giftbox aims to provide a wrapper API around absent values and is highly motivated by Scala's Option. One of big source of bugs in production environments is missing data represented by nulls, undefined, empty strings, etc. Traditionally calling methods on null or 'empty' values causes NPE's, etc. and forces developers to create disorganized utilities with null/empty checks all over the codebase, adding further complexity.




scalike-typescript - Scala like utility for TypeScript.

  •    TypeScript

You can use map, flatMap like a Scala. Almost implements methods of Scala. and, of counse Immutable. Install scalike using npm.

ruby-possibly - A maybe monad

  •    Ruby

Maybe monad is a programming pattern that allows to treat nil values that same way as non-nil values. This is done by wrapping the value, which may or may not be nil to, a wrapper class. The implementation includes three different classes: Maybe, Some and None. Some represents a value, None represents a non-value and Maybe is a constructor, which results either Some, or None.

scalp - Some Scala useful classes ported to PHP.

  •    PHP

The Option type represents optional value. It can be either Some value or None. Option can be used as collection with map, flatMap or filter.

ts-option

  •    TypeScript

Scala like Option type for TypeScript/JavaScript. Create an Option instance from a value. It returns Some<A> when the value is not null/undefined, otherwise returns None.


option.ts - Option ~Monad for typescript

  •    TypeScript

option.ts can be used with either javascript or typescript. This Option wrapper is mostly meant to be used at call sites, where you want to create and transform optional value expressions. The advantage of only using it there, is that you keep neat, non wrapped JSON structures as your data. Creates an Option from a value. If the value is null or undefined, it will create a None, else a Some.

spacelift - Functional utils for Arrays, Objects

  •    TypeScript

By default, the library provides no operators to the Wrapped Arrays/Objects at all. You get to choose what to import.

tsoption - Correct, easy to use Option type for TypeScript. 🦄

  •    TypeScript

Correct, easy to use Option type for TypeScript. Like Scala options; see the introductory blog post. Note: You can use JavaScript instead of TypeScript, but it's not as fun.

data.maybe - Migrated to https://github.com/origamitower/folktale

  •    Javascript

A structure for values that may not be present, or computations that may fail. Maybe(a) explicitly models the effects that implicit in Nullable types, thus has none of the problems associated with using null or undefined — like NullPointerException or TypeError. Furthermore, being a Monad, Maybe(a) can be composed in manners similar to other monads, by using the generic sequencing and composition operations provided for the common interface in Fantasy Land.

dart_maybe - No more null check with an dart equivalent of Maybe (Haskel, Elm) / Option (F#).

  •    Dart

No more null check with an dart equivalent of Maybe (Haskel, Elm) / Option (F#). The key is that you need to call the some or when to access your potential value so you are forced to check its status before using it.





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.