Skip to content

Releases: coconutpalm/righttypes

Version 0.7.4

07 Jun 00:33

Choose a tag to compare

Fix bugs in convert multimethod and reduce approved scope

v0.7.3

26 May 00:59

Choose a tag to compare

Full Changelog: v0.7.1...v0.7.3

v0.7.1

11 May 02:31

Choose a tag to compare

Try to make cljdoc.

v0.7.0-snapshot

11 May 02:25

Choose a tag to compare

v0.7.0-SNAPSHOT

Update SCM tag

v0.7.0

11 May 02:16

Choose a tag to compare

First Clojars release

Full Changelog: v0.6.0...v0.7.0

Version 0.6.0

12 Apr 19:09

Choose a tag to compare

Summary

This release adds indexed, a small but useful feature for using RightTypes to create an in-memory database using Clojure. and fixes a few small bugs. Any breaking changes should be reported as bugs.

Indexed

Added indexed type constructor macro for constructing a map of maps, indexed by a some field in the maps. Here's some example usage, taken from the tests:

(def Person (T {:key keyword? :first-name string? :last-name string?}))
(def PersonDB (indexed Person :key)))

(tests
    "Happy path"
    (let [testee (PersonDB {:key :franken :first-name "Franken" :last-name "Stein"}
                           {:key :charlie :first-name "Charlie" :last-name "Brown"})]
      (-> testee :franken :last-name) := "Stein"
      (-> testee :charlie :last-name) := "Brown"))

(tests
    "Sadness: A field value fails type checking"
    (let [failure (PersonDB {:key :franken :first-name "Franken" :last-name :stein})]
      (-> failure :errors count)       := 1
      (-> failure :errors first :path) := '(:franken :last-name)
      (-> failure :errors first :msg)  := ":last-name:(:last-name string? :stein)"))

The failure messages could be improved somewhat, but I'm leaving that for a future release.

Bugs fixed

Just a bunch of small things. git log is your friend, if you care.

Version 0.5.0

11 Nov 01:54
0027c70

Choose a tag to compare

Version 0.5.0

Initial release. This code has been used in a single small production application.

As far as I know, all verifications pass and fail appropriately and as expected. I expect all of the main APIs to remain stable through the 0.x.x series at this point.

Known defects

Nested validations generate more verbose errors than are strictly necessary. I expect to address this in a future release.