# smash: Combinators for Maybe types

[ bsd3, data, library ] [ Propose Tags ]

This package provides the calculus for pointed types, including the pointed product, Can, the pointed coproduct, Wedge, and the smash product.

Versions [faq] 0.1.0.0, 0.1.1.0 CHANGELOG.md base (>=4.10 && <5.0), bifunctors (==5.5.*), binary (==0.8.*), deepseq (==1.4.*), hashable (==1.3.*) [details] BSD-3-Clause (c) 2020 Emily Pillmore Emily Pillmore emilypi@cohomolo.gy Revision 1 made by topos at 2020-04-07T16:38:04Z Data https://github.com/emilypi/smash https://github.com/emilypi/smash/issues head: git clone https://github.com/emilypi/smash.git by topos at 2020-04-07T16:36:37Z NixOS:0.1.1.0 225 total (24 in the last 30 days) (no votes yet) [estimated by Bayesian average] λ λ λ Docs available Last success reported on 2020-04-07

## Modules

[Index] [Quick Jump]

• Data

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

#### Maintainer's Corner

For package maintainers and hackage trustees

[back to package description]

# 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':