Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 1 KB

README.md

File metadata and controls

24 lines (16 loc) · 1 KB

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.