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

[Chapter 5] Add a note on Unit #460

Merged
merged 1 commit into from
Nov 11, 2023
Merged
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
8 changes: 8 additions & 0 deletions text/chapter5.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,14 @@ Just like `pure`, we can apply the `guard` function in PSCi to understand how it
forall (m :: Type -> Type). Alternative m => Boolean -> m Unit
```

> The `Unit` type represents values with no computational content — the absence of a concrete meaningful value.
>
> We often use `Unit` "wrapped" in a type constructor as the return type of a computation where we only care about the _effects_ of the computation (or a "shape" of the result) and not some concrete value.
>
> For example, the `main` function has the type `Effect Unit`. Main is an entry point to the project — we don't call it directly.
>
> We'll explain what `m` in the type signature means in Chapter 6.

In our case, we can assume that PSCi reported the following type:

```haskell
Expand Down
Loading