# sanctuary-js/sanctuary

:see_no_evil: Refuge from unsafe JavaScript

Repository: https://github.com/sanctuary-js/sanctuary
Canonical: https://ross.abutalabs.com/products/sanctuary
Homepage: https://sanctuary.js.org
Language: JavaScript
License: MIT
License Family: permissive
Topics: sanctuary, fantasy-land
Last push: 2024-11-10T16:48:46+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 4244, "days_push": 661, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3052, forks 93 (observed 2026-08-28T04:07:39.660884+00:00)

## What it is
Sanctuary is a JavaScript functional programming library inspired by Haskell and PureScript, offering a stricter, safer alternative to Ramda. It provides total functions and Fantasy Land-compatible Maybe and Either data types that eliminate null checks and run-time type errors.

## Use cases
- avoid null checks in JavaScript
- handle possibly-failing operations like head of an empty array safely
- write pure functional programs in JavaScript
- use Maybe and Either types with Fantasy Land compatibility
- replace partial functions from Ramda with total functions
- add runtime type checking to functional JavaScript code

## When to choose
- you want Haskell-style functional programming in JavaScript
- you need total functions that never return undefined, NaN, or Infinity unexpectedly
- you want composable error handling via Maybe and Either
- you prefer stricter, safer code than Ramda provides

## When to avoid
- you want an object-oriented or Scala-like style (consider Folktale)
- your team is not comfortable with functional programming concepts
- you need a lightweight utility library with minimal learning curve

## Facets
- artifact type: library
- maturity: stable
- function: error-handling, serialization
- domain: programming-languages, developer-tools
- platform: browser
- tags: functional-programming, fantasy-land, maybe-type, either-type, type-safety, haskell-inspired, currying, algorithms, nodejs, javascript

## Member repositories
- sanctuary-js/sanctuary (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:39.660884+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:28:53.429775+00:00, confidence not recorded.
  - readme: https://github.com/sanctuary-js/sanctuary (fetched 2026-08-28T04:07:39.660884+00:00, sha bddc2b1ffc4f)
  - homepage: https://sanctuary.js.org (fetched 2026-08-29T09:44:16.666979+00:00, sha 6c2e80da203c)
  - registry_npm: https://registry.npmjs.org/sanctuary (fetched 2026-08-29T09:44:16.677385+00:00, sha 196772db305d)
- Data as of 2026-08-30T08:39:29.467469+00:00.
