<commit_before># Box

This is a Swift microframework which implements `Box<T>` & `MutableBox<T>`, with implementations of `==`/`!=` where `T`: `Equatable`.

`Box` is typically used to work around limitations of value types:

- recursive `struct`s/`enum`s
- type-parameterized `enum`s where more than one `case` has a value

## Use

Wrapping & unwrapping a `Box`:

```swift
// Wrap:
let box = Box(1)

// Unwrap:
let value = box.value
```

Changing the value of a `MutableBox`:

```
swift
// Mutation:
let mutableBox = MutableBox(1)
mutableBox.value = 2
```

Building a recursive value type:

```swift
struct BinaryTree<T> {
	let value: T
	let left: Box<BinaryTree<T>>?
	let right: Box<BinaryTree<T>>?
}
```

Building a parameterized `enum`:

```swift
enum Result<T> {
	case Success(Box<T>)
	case Failure(NSError)
}
```
<commit_msg>Fix a bad code block.<commit_after># Box

This is a Swift microframework which implements `Box<T>` & `MutableBox<T>`, with implementations of `==`/`!=` where `T`: `Equatable`.

`Box` is typically used to work around limitations of value types:

- recursive `struct`s/`enum`s
- type-parameterized `enum`s where more than one `case` has a value

## Use

Wrapping & unwrapping a `Box`:

```swift
// Wrap:
let box = Box(1)

// Unwrap:
let value = box.value
```

Changing the value of a `MutableBox`:

```swift
// Mutation:
let mutableBox = MutableBox(1)
mutableBox.value = 2
```

Building a recursive value type:

```swift
struct BinaryTree<T> {
	let value: T
	let left: Box<BinaryTree<T>>?
	let right: Box<BinaryTree<T>>?
}
```

Building a parameterized `enum`:

```swift
enum Result<T> {
	case Success(Box<T>)
	case Failure(NSError)
}
```

{'fraction_non_alphanumeric': 0.15296940611877624, 'fraction_numerical': 0.003599280143971206, 'mean_word_length': 4.5049504950495045, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, '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': '4680951', 'n_tokens_mistral': 642, 'n_tokens_neox': 587, 'n_words': 194}