# smash

Combinators for Maybe types

https://github.com/emilypi/smash

 Version on this page: 0.1.1.0@rev:1 LTS Haskell 19.33: 0.1.3 Stackage Nightly 2022-03-17: 0.1.2@rev:1 Latest on Hackage: 0.1.3

See all snapshots `smash` appears in

Maintained by
This version can be pinned in stack with:`smash-0.1.1.0@sha256:593381bad038ff93898a8a1422c6e81fc4a2a6fb23b64afa2f758f56607b83dc,1583`

#### Module documentation for 0.1.1.0

• Data
Depends on 5 packages(full list with versions):
Used by 4 packages in lts-17.2(full list with versions):

# smash: Combinators for Maybe types

This package consists of 3 datatypes: Wedge, Can, and Smash.

You can imagine these three types as `Maybe (Either a b)`, `Maybe (Either a (Either b (a,b))`, and `Maybe (These a b)` respectively. It turns out that that each of these datatypes has spcial properties:

• the `Wedge` datatype represents the coproduct (like, `Either`) in the category Hask* of pointed Hask types, called a wedge sum. One can derive this by noting that units are the same in Haskell, and the sum of two pointed types is `(1 + a) + (1 + b) ~ 1 + a + b ~ Wedge a b`.

• the `Can` datatype represents the product (like, `(,)`) in Hask*. You can derive this by considering the product of two pointed types `(1 + a) * (1 + b) ~ 1 + a + b + a*b ~ Can a b`.

• the `Smash` datatype represents a special type of product, a smash product, in the category Hask*. The smash product is a symmetric, monoidal tensor in Hask* that plays nicely with the product, ‘Can’, and coproduct, ‘Wedge’.

Pictorially, these datatypes look like this:

``````'Can':
a
|
Non +---+---+ (a,b)
|
b

'Wedge':
a
|
Nowhere +-------+
|
b

'Smash':

``````

# Revision history for possibly-can

## 0.1.1

• Add `NFData`, `Binary` instances
• CPP to extend to 8.2.2 without warnings

## 0.1.0.0

• First version. Released on an unsuspecting world.