Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish alleycats docs on website #4393

Merged
merged 1 commit into from
Feb 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions alleycats-core/README.md → docs/alleycats.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Alleycats
# Alleycats

### Overview
## Overview

Alleycats is a module of the [Cats](https://github.com/typelevel/cats)
project that exists to support types which are not entirely savory or
Expand All @@ -16,12 +16,12 @@ some notion of "emptiness").
Rather than argue about whether to permit these types in Cats proper, we
provide a (slightly disreputable) home for them here.

### Type classes
## Type classes

Alleycats introduces several new type classes. Here is an overview of
the instances introduced.

#### Empty[A], Zero[A], and One[A]
### Empty\[A\], Zero\[A\], and One\[A\]

A commonly-requested type class is one that encodes the idea of a set
having an identity element. Normally this would be done by defining a
Expand Down Expand Up @@ -49,7 +49,7 @@ effect).
The same rules apply to `Zero[A]` and `One[A]` and their respective
associative operations.

#### Pure[F[\_]] and Extract[F[\_]]
### Pure\[F\[\_\]\] and Extract\[F\[\_\]\]

The `Pure[F]` type class represents the `pure` method of
`Applicative[F]` separated from its `map` and `ap` methods. Like the
Expand All @@ -62,18 +62,18 @@ Similarly, `Extract[F]` represents the `extract` method of
and `CoflatMap[F]` are available, they should provide a valid
`Comonad[F]` instance.

#### EmptyK[F[\_]]
### EmptyK\[F\[\_\]\]

Finally, `EmptyK[F]` generalizes the `empty[A]` method from
`MonoidK[F]`. The pattern here is the same as before --
`SemigroupK[F]` and `EmptyK[F]` should provide a valid `MonoidK[F]`
instance.

### Instances
## Instances

Alleycats also provides some "disreputable" type class instances.

#### Set[\_] instances
### Set\[\_\] instances

Scala's `Set[_]` takes advantage of the universal availability of
`.hashCode` and `.equals`. This makes it difficult to use
Expand All @@ -84,7 +84,7 @@ and monads.
Alleycats provides `Monad[Set]` and `Traverse[Set]`. You can import
these instances via `import alleycats.std.set._`.

#### Try[\_] instances
### Try\[\_\] instances

Scala's `Try[_]` is intended to replace the need for `try { ... }
catch { ... }` syntax in Scala programs, to ease error-handling, and
Expand All @@ -95,7 +95,7 @@ that `Try` fulfills the necessary functor/monad laws.
Alleycats provides a `Monad[Try]`. You can import this instance via
`import alleycats.std.try._`.

#### Iterable[\_] instances
### Iterable\[\_\] instances

Scala's `collection.Iterable[_]` offers no guarantees that it's immutable,
since it abstracts over the `mutable` and `immutable` variants. However it's
Expand All @@ -110,7 +110,7 @@ import alleycats.std.iterable._
Map(1 -> "Apple", 2 -> "Orange").values.combineAll
```

### Contributing
## Contributing

This module's goal is to be very liberal about accepting type class
instances, but to only provide instances which are absent from
Expand Down
1 change: 1 addition & 0 deletions docs/directory.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ laika.navigationOrder = [
typeclasses.md
datatypes.md
algebra.md
alleycats.md
motivations.md
resources_for_learners.md
jump_start_guide.md
Expand Down