greghendershott / functional

Functional interfaces and datatypes for Racket

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

functional Build Status Coverage Status

This library provides functional programming utilities for Racket, including interfaces, such as functors and monads, and common data types that implement those interfaces, such as maybe and either.

Here’s an example of performing monadic computations using functional:

#lang racket

(require data/applicative
         data/monad
         data/maybe)

(define try-bytes->string/utf8
  (curry exn->maybe exn:fail:contract? bytes->string/utf-8))

(define input-char-length
  (do [str <- (try-bytes->string/utf-8 (port->bytes))]
      (pure (length str))))

For more information, see the documentation.

About

Functional interfaces and datatypes for Racket


Languages

Language:Racket 100.0%