Skip to content

Commit 874eefe

Browse files
authored
[Chapter 5] Add a not on Unit (#460)
1 parent 2e9176c commit 874eefe

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

text/chapter5.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,14 @@ Just like `pure`, we can apply the `guard` function in PSCi to understand how it
340340
forall (m :: Type -> Type). Alternative m => Boolean -> m Unit
341341
```
342342

343+
> The `Unit` type represents values with no computational content — the absence of a concrete meaningful value.
344+
>
345+
> 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.
346+
>
347+
> For example, the `main` function has the type `Effect Unit`. Main is an entry point to the project — we don't call it directly.
348+
>
349+
> We'll explain what `m` in the type signature means in Chapter 6.
350+
343351
In our case, we can assume that PSCi reported the following type:
344352

345353
```haskell

0 commit comments

Comments
 (0)