Skip to content

Remove BooleanType from docs/StdlibRationales.rst #32677

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions docs/StdlibRationales.rst
Original file line number Diff line number Diff line change
Expand Up @@ -174,21 +174,6 @@ call an API with a different name, say ``lazyEnumerate()`` to opt into
laziness. The problem is that the eager API, which would have a shorter and
less obscure name, would be less efficient for the common case.

Use of ``BooleanType`` in library APIs
--------------------------------------

Use ``Bool`` instead of a generic function over a ``BooleanType``, unless there
are special circumstances (for example, ``func &&`` is designed to work on all
boolean values so that ``&&`` feels like a part of the language).

``BooleanType`` is a protocol to which only ``Bool`` and ``ObjCBool`` conform.
Users don't usually interact ``ObjCBool`` instances, except when using certain
specific APIs (for example, APIs that operate on pointers to ``BOOL``). If
someone already has an ``ObjCBool`` instance for whatever strange reason, they
can just convert it to ``Bool``. We think this is the right tradeoff:
simplifying function signatures is more important than making a marginal
usecase a bit more convenient.

Possible future directions
==========================

Expand Down