Skip to content

Commit be0e9fb

Browse files
committed
Fix spelling of Perl 6
1 parent 73f6e6f commit be0e9fb

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

doc/Language/haskell-to-p6.pod6

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
55
=SUBTITLE Learning Perl 6 from Haskell, in a nutshell: What do I already know?
66
7-
Haskell and Perl6 are I<very> different languages. This is obvious. However, that
7+
Haskell and Perl 6 are I<very> different languages. This is obvious. However, that
88
does not mean there are not similarities or shared ideas! This page attempts to
9-
get a Haskell user up and running with Perl6. The Haskell user may find that they need
10-
not abandon all of their Haskelly thoughts while scripting in Perl6.
9+
get a Haskell user up and running with Perl 6. The Haskell user may find that they need
10+
not abandon all of their Haskelly thoughts while scripting in Perl 6.
1111
1212
Note that this should not be mistaken for a beginner tutorial or overview of Perl
1313
6; it is intended as a technical reference for Perl 6 learners with a strong
@@ -32,7 +32,7 @@ You do not mix types and values in Haskell like the below
3232
plusTwo Integer -- This is not valid
3333
=end code
3434
35-
In Perl6, types (AKA type objects) live on the same level as values
35+
In Perl 6, types (AKA type objects) live on the same level as values
3636
3737
=begin code
3838
sub plus-two(Int $x --> Int) { $x + 2 }
@@ -41,7 +41,7 @@ In Perl6, types (AKA type objects) live on the same level as values
4141
plus-two(Int); # This is valid
4242
=end code
4343
44-
I will illustrate this unique aspect of Perl6 with one more example:
44+
I will illustrate this unique aspect of Perl 6 with one more example:
4545
4646
=begin code
4747
multi sub is-string(Str $ --> True) {}
@@ -64,7 +64,7 @@ Let's say you have a hypothetical function that parses a String to an Integer:
6464
Nothing -> 0
6565
=end code
6666
67-
In Perl6, since type objects coexist with regular objects, we have the concept of Defined
67+
In Perl 6, since type objects coexist with regular objects, we have the concept of Defined
6868
and Undefined objects. Plain type objects are undefined while instantiated objects are defined.
6969
7070
=begin code
@@ -77,7 +77,7 @@ and Undefined objects. Plain type objects are undefined while instantiated objec
7777
}
7878
=end code
7979
80-
So in Perl6 we have type constraints that indicate the definedness of a type. These are
80+
So in Perl 6 we have type constraints that indicate the definedness of a type. These are
8181
8282
=begin code
8383
Int:D; # This is a defined Int.
@@ -116,7 +116,7 @@ The C<with> operator that you see above is like C<if>, except it explicitly test
116116
passes the result to the following block. Similarly, C<without> tests that the object is undefined and also
117117
passes the result to the following block.
118118
119-
For more natural control flow with undefined and defined types, Perl6 introduces C<andthen> and C<orelse>.
119+
For more natural control flow with undefined and defined types, Perl 6 introduces C<andthen> and C<orelse>.
120120
121121
=begin code
122122
sub parse-int(Str $s --> Int:_) { ... }
@@ -130,11 +130,11 @@ For more natural control flow with undefined and defined types, Perl6 introduces
130130
131131
TODO: include a better example for andthen that makes sense. Maybe using promise objects?
132132
133-
So in practice, Perl6 does not have the concept of a null type, but rather of defined or undefined types.
133+
So in practice, Perl 6 does not have the concept of a null type, but rather of defined or undefined types.
134134
135135
=head2 Data Definitions
136136
137-
Perl6 is fundamentally an Object Oriented language. However, it also gives you the freedom
137+
Perl 6 is fundamentally an Object Oriented language. However, it also gives you the freedom
138138
to write in virtually any paradigm you wish. If you only want to pure functions that take an
139139
object and return a new object, you can certainly do so.
140140
@@ -147,7 +147,7 @@ Here is a Haskell code example:
147147
moveUp (Point x y) = Point x (y + 1)
148148
=end code
149149
150-
And an equivalent Perl6 example:
150+
And an equivalent Perl 6 example:
151151
152152
=begin code
153153
class Point { has $.x; has $.y; }
@@ -158,7 +158,7 @@ And an equivalent Perl6 example:
158158
=end code
159159
160160
The code I illustrated above is an example of a Product Type. If instead you'd like to
161-
write a Sum Type, there is not an exact equivalent in Perl6. The closest thing would be
161+
write a Sum Type, there is not an exact equivalent in Perl 6. The closest thing would be
162162
an Enum.
163163
164164
=begin code :skip-test
@@ -169,7 +169,7 @@ an Enum.
169169
testAnimal Horse = "Neigh"
170170
=end code
171171
172-
A Perl6 Enum does not fit the same exact use cases, but it can be used in putting
172+
A Perl 6 Enum does not fit the same exact use cases, but it can be used in putting
173173
constraints on types.
174174
175175
=begin code
@@ -195,15 +195,15 @@ existing types.
195195
fullName first last = first ++ last
196196
=end code
197197
198-
The equivalent in Perl6 is the following.
198+
The equivalent in Perl 6 is the following.
199199
200200
=begin code
201201
my constant Name = Str;
202202
203203
sub full-name ( Name \first, Name \last --> Name ) { first ~ last }
204204
=end code
205205
206-
It should be noted that in Perl6, one can also create a subset of an existing type.
206+
It should be noted that in Perl 6, one can also create a subset of an existing type.
207207
208208
=begin code :skip-test
209209
subset Name of Str where *.chars < 20;
@@ -220,7 +220,7 @@ It should be noted that in Perl6, one can also create a subset of an existing ty
220220
221221
TODO
222222
223-
explain how Perl6 roles compare to Haskell typeclasses
223+
explain how Perl 6 roles compare to Haskell typeclasses
224224
225225
=head1 Functions
226226
@@ -237,7 +237,7 @@ Haskell makes heavy use of pattern matching in function definitions.
237237
greeting name = "Hello, " ++ name ++ "!"
238238
=end code
239239
240-
Perl6 does this as well! You just use the C<multi> keyword to signify that it is a multiple dispatch
240+
Perl 6 does this as well! You just use the C<multi> keyword to signify that it is a multiple dispatch
241241
function.
242242
243243
=begin code
@@ -257,7 +257,7 @@ more information in error messages, and for introspection.
257257
say &greeting.signature; # (Str \name --> Str)
258258
=end code
259259
260-
An interesting thing to note in the Perl6 code above is that passing values like C<'bub'> as a
260+
An interesting thing to note in the Perl 6 code above is that passing values like C<'bub'> as a
261261
function parameter is just syntax sugar for a C<where> guard.
262262
263263
=Guards
@@ -341,7 +341,7 @@ Haskell makes heavy use of case matching like the below:
341341
_ -> "don't care"
342342
=end code
343343
344-
In Perl6 you can achieve this same thing with the given/when structure:
344+
In Perl 6 you can achieve this same thing with the given/when structure:
345345
346346
=begin code
347347
my $number = {...};
@@ -367,11 +367,11 @@ data shapes become quite intuitive, but it takes a bit of practice.
367367
368368
=head2 List Comprehensions
369369
370-
TODO compare haskell list comprehensions to Perl6 gather/take
370+
TODO compare haskell list comprehensions to Perl 6 gather/take
371371
372372
=head2 Fold
373373
374-
Fold in Haskell is called Reduce in Perl6.
374+
Fold in Haskell is called Reduce in Perl 6.
375375
376376
=begin code :skip-test
377377
mySum = foldl `+` 0 numList
@@ -383,7 +383,7 @@ Fold in Haskell is called Reduce in Perl6.
383383
@numbers.reduce({$^a + $^b}, with => 0)
384384
=end code
385385
386-
However, in Perl6, if you want to use an infix operator (+ - / % etc) there is a nice little
386+
However, in Perl 6, if you want to use an infix operator (+ - / % etc) there is a nice little
387387
helper called the Reduction Metaoperator.
388388
389389
=begin code
@@ -394,7 +394,7 @@ helper called the Reduction Metaoperator.
394394
395395
It inserts the operator in between all values in the list and produces a result, just like Fold.
396396
397-
In Haskell you, you have foldl and foldr. In Perl6, this difference is determined by the
397+
In Haskell you, you have foldl and foldr. In Perl 6, this difference is determined by the
398398
associativity attached to the operator/subroutine.
399399
400400
=begin code
@@ -426,7 +426,7 @@ TODO
426426
427427
=head2 Ranges
428428
429-
Haskell and Perl6 both allow you to specify ranges of values.
429+
Haskell and Perl 6 both allow you to specify ranges of values.
430430
431431
=begin code :skip-test
432432
myRange1 = 10..100
@@ -442,7 +442,7 @@ Haskell and Perl6 both allow you to specify ranges of values.
442442
443443
=head2 Laziness vs Eagerness
444444
445-
In the examples above, you have the concept of laziness displayed very plainly. Perl6 has laziness
445+
In the examples above, you have the concept of laziness displayed very plainly. Perl 6 has laziness
446446
only where it makes the most sense. For example, in the range 10..100, this is eager because it has
447447
a definite end. If a list does not have a definite end, then the list should clearly be lazy.
448448
@@ -451,7 +451,7 @@ a definite end. If a list does not have a definite end, then the list should cle
451451
(1 .. Inf).is-lazy; # True
452452
=end code
453453
454-
These are the "sane defaults" that Perl6 takes pride in. But they are still defaults and can be
454+
These are the "sane defaults" that Perl 6 takes pride in. But they are still defaults and can be
455455
changed into one or the other.
456456
457457
=begin code

0 commit comments

Comments
 (0)