From 766ef144654532a8321118ded4ffc02515e0d19d Mon Sep 17 00:00:00 2001 From: Danial Baitakov <104984914+qixdev@users.noreply.github.com> Date: Wed, 9 Oct 2024 20:22:21 +0500 Subject: [PATCH] fix typo resons -> reasons --- part1.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/part1.html b/part1.html index 655f9198..1e51ae08 100644 --- a/part1.html +++ b/part1.html @@ -3216,7 +3216,7 @@
In addition to the data
keyword, there are two additional ways of defining types in Haskell.
The newtype
keyword works like data
, but you can only have a single constructor with a single field. It’s sometimes wise to use newtype
for performance resons, but we’ll get back to those in part 2.
The newtype
keyword works like data
, but you can only have a single constructor with a single field. It’s sometimes wise to use newtype
for performance reasons, but we’ll get back to those in part 2.
The type
keyword introduces a type alias. Type aliases don’t affect type checking, they just offer a shorthand for writing types. For example the familiar String
type is an alias for [Char]
:
type String = [Char]
This means that whenever the compiler reads String
, it just immediately replaces it with [Char]
. Type aliases seem useful, but they can easily make reading type errors harder.