Skip to content

Commit 819dada

Browse files
author
Alex Gryzlov
committed
more fixes and explanations
1 parent 00a9f32 commit 819dada

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/Basics.lidr

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,14 +230,17 @@ data Bool = True | False
230230
```
231231

232232
This definition is written in the simplified style, similar to `Day`. It can
233-
also be written in the verbose style (which is more powerful):
233+
also be written in the verbose style:
234234

235235
```idris
236236
data Bool : Type where
237237
True : Bool
238238
False : Bool
239239
```
240240

241+
The verbose style is more powerful because it allows us to assign precise
242+
types to individual constructors. This will become very useful later on.
243+
241244
Although we are rolling our own booleans here for the sake of building up
242245
everything from scratch, Idris does, of course, provide a default
243246
implementation of the booleans in its standard library, together with a
@@ -279,8 +282,8 @@ truth table -- for the `orb` function:
279282
-- TODO: Edit this
280283

281284
We can also introduce some familiar syntax for the boolean operations we have
282-
just defined. The `syntax` command defines a new notation for an existing
283-
definition, and `infixl` specifies left-associative fixity.
285+
just defined. The `syntax` command defines a new symbolic notation for an
286+
existing definition, and `infixl` specifies left-associative fixity.
284287
\color{black}
285288

286289
> infixl 4 /\, \/
@@ -301,7 +304,7 @@ definition, and `infixl` specifies left-associative fixity.
301304
Fill in the hole `?nandb_rhs` and complete the following function; then make
302305
sure that the assertions below can each be verified by Idris. (Fill in each of
303306
the holes, following the model of the `orb` tests above.) The function should
304-
return `True` if either or both of its inputs `False`.
307+
return `True` if either or both of its inputs are `False`.
305308

306309
> nandb : (b1 : Bool) -> (b2 : Bool) -> Bool
307310
> nandb b1 b2 = ?nandb_rhs

0 commit comments

Comments
 (0)