File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -388,10 +388,10 @@ defmodule List do
388
388
end
389
389
390
390
@ doc """
391
- Wraps the argument in a list.
391
+ Wraps `term` in a list if this is not list.
392
392
393
- If the argument is already a list, returns the list.
394
- If the argument is `nil`, returns an empty list.
393
+ If `term` is already a list, it returns the list.
394
+ If `term` is `nil`, it returns an empty list.
395
395
396
396
## Examples
397
397
@@ -405,7 +405,11 @@ defmodule List do
405
405
[]
406
406
407
407
"""
408
- @ spec wrap ( list | any ) :: list
408
+ @ spec wrap ( nil ) :: [ ]
409
+ @ spec wrap ( list ) :: list when list: maybe_improper_list ( )
410
+ @ spec wrap ( term ) :: nonempty_list ( term ) when term: any ( )
411
+ def wrap ( term )
412
+
409
413
def wrap ( list ) when is_list ( list ) do
410
414
list
411
415
end
You can’t perform that action at this time.
0 commit comments