<commit_before># specium
[![Clojars Project](https://img.shields.io/clojars/v/specium.svg)](https://clojars.org/specium)
[![CircleCI](https://circleci.com/gh/athos/specium.svg?style=shield)](https://circleci.com/gh/athos/specium)

Specium provides the inverse function of `clojure.spec(.alpha)/form`, reducing `eval` calls as much as possible.

## Installation

Add the following to your `:dependencies`:

[![Clojars Project](https://clojars.org/specium/latest-version.svg)](http://clojars.org/specium)

## Usage

A common way of getting a `s/form`ed spec form back into a spec object is to call `eval` with it:

```clj
=> (s/form (s/map-of keyword? integer?))
(clojure.spec.alpha/map-of clojure.core/keyword? clojure.core/integer?)
=> (eval *1)
#object[clojure.spec.alpha$every_impl$reify__946 0x6d47d0b2 "clojure.spec.alpha$every_impl$reify__946@6d47d0b2"]
=> (s/conform *1 {:key "wrong value"})
:clojure.spec.alpha/invalid
=> (s/explain *2 {:key "wrong value"})
In: [:key 1] val: "wrong value" fails at: [1] predicate: integer?
:clojure.spec.alpha/spec  #object[clojure.spec.alpha$every_impl$reify__946 0x6d47d0b2 "clojure.spec.alpha$every_impl$reify__946@6d47d0b2"]
:clojure.spec.alpha/value  {:key "wrong value"}
nil
=> 
```

Though it perfectly works, in some cases you might not be able to overlook `eval`'s inefficiency (eg. where lots of spec forms have to be dealt with).
<commit_msg>Add Codecov badge to README<commit_after># specium
[![Clojars Project](https://img.shields.io/clojars/v/specium.svg)](https://clojars.org/specium)
[![CircleCI](https://circleci.com/gh/athos/specium.svg?style=shield)](https://circleci.com/gh/athos/specium)
[![codecov](https://codecov.io/gh/athos/specium/branch/master/graph/badge.svg)](https://codecov.io/gh/athos/specium)

Specium provides the inverse function of `clojure.spec(.alpha)/form`, reducing `eval` calls as much as possible.

## Installation

Add the following to your `:dependencies`:

[![Clojars Project](https://clojars.org/specium/latest-version.svg)](http://clojars.org/specium)

## Usage

A common way of getting a `s/form`ed spec form back into a spec object is to call `eval` with it:

```clj
=> (s/form (s/map-of keyword? integer?))
(clojure.spec.alpha/map-of clojure.core/keyword? clojure.core/integer?)
=> (eval *1)
#object[clojure.spec.alpha$every_impl$reify__946 0x6d47d0b2 "clojure.spec.alpha$every_impl$reify__946@6d47d0b2"]
=> (s/conform *1 {:key "wrong value"})
:clojure.spec.alpha/invalid
=> (s/explain *2 {:key "wrong value"})
In: [:key 1] val: "wrong value" fails at: [1] predicate: integer?
:clojure.spec.alpha/spec  #object[clojure.spec.alpha$every_impl$reify__946 0x6d47d0b2 "clojure.spec.alpha$every_impl$reify__946@6d47d0b2"]
:clojure.spec.alpha/value  {:key "wrong value"}
nil
=> 
```

Though it perfectly works, in some cases you might not be able to overlook `eval`'s inefficiency (eg. where lots of spec forms have to be dealt with).

{'fraction_non_alphanumeric': 0.16238437821171633, 'fraction_numerical': 0.02672147995889003, 'mean_word_length': 5.532438478747204, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2288038', 'n_tokens_mistral': 1172, 'n_tokens_neox': 1099, 'n_words': 245}