From 9c06df7037c65494dcec9307748d3d03bf9e635c Mon Sep 17 00:00:00 2001 From: Zelenya Date: Sat, 4 Nov 2023 11:20:57 -0700 Subject: [PATCH] [Chapter 5] Add a not on Unit --- text/chapter5.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/text/chapter5.md b/text/chapter5.md index 23547984..030d73f0 100644 --- a/text/chapter5.md +++ b/text/chapter5.md @@ -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