Skip to content

Commit 344a51e

Browse files
authored
Merge pull request #1028 from perl6/consistent-return-types
Consistent return types
2 parents cc2d14b + 138cd60 commit 344a51e

File tree

12 files changed

+107
-76
lines changed

12 files changed

+107
-76
lines changed

doc/Type/Any.pod6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ occur over C<(SELF,)> (if C<:$item> is set) or C<SELF>.
150150
151151
Defined as:
152152
153-
method deepmap(&block -->List) is nodal
153+
method deepmap(&block) returns List is nodal
154154
155155
C<deepmap> will apply C<&block> to each element and return a new C<List> with
156156
the return values of C<&block>, unless the element does the C<Iterable> role.

doc/Type/Bag.pod6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ with detailed explanations.
9797
9898
=head2 sub bag
9999
100-
sub bag(*@args --> Bag)
100+
sub bag(*@args) returns Bag
101101
102102
Creates a new C<Bag> from C<@args>.
103103

doc/Type/Date.pod6

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ Converts the invocant to L«C<DateTime>|/type/DateTime»
218218
219219
=head2 sub sleep
220220
221-
sub sleep($seconds = Inf --> Nil)
221+
sub sleep($seconds = Inf) returns Nil
222222
223223
Attempt to sleep for the given number of C<$seconds>. Returns C<Nil> on
224224
completion. Accepts C<Int>, C<Num>, C<Rat>, or C<Duration> types as an
@@ -246,7 +246,7 @@ seconds and C<sleep 5.2> sleeps for 5.2 seconds:
246246
247247
=head2 sub sleep-timer
248248
249-
sub sleep-timer(Real $seconds = Inf --> Duration)
249+
sub sleep-timer(Real $seconds = Inf) returns Duration
250250
251251
This function is just like C<sleep>, but returns the amount of time
252252
remaining to sleep as a C<Duration> (which will be 0 if the call was not
@@ -256,7 +256,7 @@ interrupted).
256256
257257
=head2 sub sleep-until
258258
259-
sub sleep-until(Instant $until --> Bool)
259+
sub sleep-until(Instant $until) returns Bool
260260
261261
Works just like C<sleep> but checks the current time and goes back to sleep
262262
if accidentally woken up early, to guarantee waiting until the specified

doc/Type/IO.pod6

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,8 @@ sub spurt($where, $what,
293293
Str :$enc = 'utf8',
294294
Bool :$bin = False,
295295
Bool :$append = False,
296-
Bool :$createonly = False,
297-
--> Bool ) is export
296+
Bool :$createonly = False
297+
) returns Bool
298298
299299
Writes the indicated contents (2nd positional parameter, C<$what>) to the
300300
location indicated by the first positional parameter, C<$where> (which can

doc/Type/IO/Handle.pod6

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -52,67 +52,67 @@ Returns C<True> if the read operations have exhausted the content of the file.
5252
5353
=head2 method e
5454
55-
method e(--> Bool)
55+
method e returns Bool
5656
5757
Returns C<Bool::True> if the invocant is a valid path that exists.
5858
5959
=head2 method d
6060
61-
method d(--> Bool)
61+
method d returns Bool
6262
6363
Returns C<Bool::True> if the invocant is a path and the directory exists.
6464
6565
=head2 method f
6666
67-
method f(--> Bool)
67+
method f returns Bool
6868
6969
Returns C<Bool::True> if the invocant is a path and the file exists.
7070
7171
=head2 method s
7272
73-
method s(--> Bool)
73+
method s returns Bool
7474
7575
Returns C<Bool::True> if the invocant is a path and the size is bigger then 0.
7676
7777
=head2 method l
7878
79-
method l(--> Bool)
79+
method l returns Bool
8080
8181
Returns C<Bool::True> if the invocant is a path and a symlink.
8282
8383
=head2 method r
8484
85-
method r(--> Bool)
85+
method r returns Bool
8686
8787
Returns C<Bool::True> if the invocant is a path and accessible.
8888
8989
=head2 method w
9090
91-
method w(--> Bool)
91+
method w returns Bool
9292
9393
Returns C<Bool::True> if the invocant is a path and writable.
9494
9595
=head2 method rw
9696
97-
method rw(--> Bool)
97+
method rw returns Bool
9898
9999
Returns C<Bool::True> if the invocant is a path, read and writable.
100100
101101
=head2 method x
102102
103-
method x(--> Bool)
103+
method x returns Bool
104104
105105
Returns C<Bool::True> if the invocant is a path and executable.
106106
107107
=head2 method rwx
108108
109-
method rwx(--> Bool)
109+
method rwx returns Bool
110110
111111
Returns C<Bool::True> if the invocant is a path, executable, read and writable.
112112
113113
=head2 method z
114114
115-
method z(--> Bool)
115+
method z returns Bool
116116
117117
Returns C<Bool::True> if the invocant is a path and the size is 0.
118118
@@ -175,7 +175,7 @@ $fn.comb(3, close => True); # Comb file contents by 3 characters and close after
175175
176176
=head2 method print
177177
178-
method print(*@text --> Bool)
178+
method print(*@text) returns Bool
179179
180180
Text writing; writes the given C<@text> to the filehandle. See L<write>
181181
to write bytes.
@@ -229,13 +229,13 @@ $fh.close;
229229
230230
=head2 method read
231231
232-
method read(IO::Handle:D: Int(Cool:D) $bytes --> Blob)
232+
method read(IO::Handle:D: Int(Cool:D) $bytes) returns Blob
233233
234234
Binary reading; reads and returns up to C<$bytes> bytes from the filehandle.
235235
236236
=head2 method readchars
237237
238-
method readchars(IO::Handle:D: Int(Cool:D) $chars --> Str)
238+
method readchars(IO::Handle:D: Int(Cool:D) $chars) returns Str
239239
240240
Reading chars; reads and returns up to C<$chars> chars (graphemes) from the
241241
filehandle.
@@ -271,14 +271,14 @@ offset if you want to position before the end of the file.
271271
272272
=head2 method tell
273273
274-
method tell(IO::Handle:D: --> Int)
274+
method tell(IO::Handle:D:) returns Int
275275
276276
Return the current position of the file pointer in bytes.
277277
278278
=head2 method slurp-rest
279279
280-
multi method slurp-rest(IO::Handle:D: :$bin!, :$close --> Buf)
281-
multi method slurp-rest(IO::Handle:D: :$enc, :$close --> Str)
280+
multi method slurp-rest(IO::Handle:D: :$bin!, :$close) returns Buf
281+
multi method slurp-rest(IO::Handle:D: :$enc, :$close) returns Str
282282
283283
Returns the remaining content of the file from the current file position
284284
(which may have been set by previous reads or by C<seek>.) If the
@@ -294,7 +294,7 @@ my $rest-of-file = $fh.slurp-rest(:close);
294294
295295
=head2 method Supply
296296
297-
multi method Supply(IO::Handle:D: :$size = 65536, :$bin --> Supply)
297+
multi method Supply(IO::Handle:D: :$size = 65536, :$bin) returns Supply
298298
299299
Returns a C<Supply> that will emit the contents of the handle in chunks.
300300
The size of the chunks is determined by the optional C<:size> named parameter
@@ -335,13 +335,13 @@ argument such as C<fcntl> or C<ioctl>.
335335
336336
=head2 method opened
337337
338-
method opened(IO::Handle:D: --> Bool)
338+
method opened(IO::Handle:D:) returns Bool
339339
340340
Returns C<True> if the handle is open.
341341
342342
=head2 method t
343343
344-
method t(IO::Handle:D: --> Bool)
344+
method t(IO::Handle:D:) returns Bool
345345
346346
Returns C<True> if the handle is opened to a tty.
347347

0 commit comments

Comments
 (0)