Skip to content

Commit

Permalink
[Chapter 5] Add a not on Unit
Browse files Browse the repository at this point in the history
  • Loading branch information
Zelenya committed Nov 4, 2023
1 parent 2e9176c commit 9c06df7
Showing 1 changed file with 8 additions and 0 deletions.
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

0 comments on commit 9c06df7

Please sign in to comment.