Hello, I still exist! Sorry for not updating for so long... school 😔
A bunch of this update is dedicated to bringing Rapid up-to-date with all the fancy-schmancy newness of Swift 6.
~=
operator forRegex
!!
operator for calling a never-returning function when optional unwrapping failsAnyType
andNothing
typealiases forAny.Type
andVoid
, respectivelysum()
andproduct()
methods forNumeric
sequencescompacted()
method forSequence
**
and**=
operatorsExpressibleByEmptyArrayLiteral
andExpressibleByEmptyDictionaryLiteral
protocols
- Updated
?!
operator with typedthrows
- There's now a
count(where:)
method in the standard library, rendering one of Rapid'scount(of:)
methods obsolete. This method has thus been deprecated, and will be removed in Rapid 4.count(where:)
should work as a drop-in replacement for your projects -- and if you were using trailing closures, you might not even have to update your code at all!- The overload of
count(of:)
that takes an element instead of a predicate was kept, since the standard library doesn't have a direct equivalent to it (yet).
++
,--
,&++
, and&--
operators
- Changed the
count
parameter ofString.*(_:_:)
to be aUInt
instead of anInt
- Changed license from the GNU GPL v3 to the MIT License
- What this practically means is that, from this version (3.0.0) onwards, Rapid can now legally be used in software that isn't open source (as well as some other things that stem from or alongside this). No existing users should be affected by this change.
- General documentation polish
- Migrated tests from Quick/Nimble to swift-testing
- Added
appendInterpolation(_:format:)
andappendInterpolation(_:if:)
string interpolation methods SetAlgebra
now has+
,+=
,-
, and-=
operators- Added
~=
operators forError
andKeyPath
- Added
sorted(by:)
andsorted(by:using:)
methods toSequence
- The package previously did not build on anything other than macOS. This has hopefully been fixed.
CollectionOfOne
now conforms toExpressibleByArrayLiteral
- Added an
asInt
property and aninit(fromInt:)
initializer toBool
- Minor documentation improvements
EmptyCollection
now conforms toExpressibleByArrayLiteral
andExpressibleByDictionaryLiteral
, with element types ofNever
to prevent use of non-empty literals
- Added
mutate(_:using:)
function to mutate values directly PartialRangeFrom
,PartialRangeThrough
, andPartialRangeUpTo
now conform toEquatable
Hashable
,CustomStringConvertible
,CustomDebugStringConvertible
, andCustomReflectable
- Added
AnyEquatable
, a type-erased wrapper forEquatable
isBetween(_:)
now accepts aRangeExpression
instead of only aClosedRange
- Replaced the
?!
operator'sErrorType
withsome Error
- The
++
,--
,&++
, and&--
operators have been marked as unavailable. They will be removed entirely in Rapid 3. - Added
minutes(_:)
,hours(_:)
,days(_:)
, andweeks(_:)
static methods toDuration
- Each method has two overloads: one taking
some BinaryInteger
, and one taking aDouble
- Each method has two overloads: one taking
- General documentation improvements (fixing typos and whatnot).
repeat(_:)
now starts iteration from 0 instead of 1, to more closely match the behavior of the standard library- Issues caused by this should be trivial to fix -- just add 1 to the loop index each time you use it
- Removed
@inlinable
from everything -- it doesn't make life any easier
- The
++
,--
,&++
, and&--
operators have been deprecated; see this Swift Evolution proposal for reasons as to why. Use+= 1
,-= 1
,&+= 1
, and&-= 1
instead. The operators will be marked as unavailable in Rapid 2, and will be removed entirely in Rapid 3. Clamped
now conforms toSendable
when itsValue
type isSendable
- Added the
<-
operator as an alias forconfigure(_:using:)
- Added
isNilOrEmpty
andisNotNilOrEmpty
for optional collections
- A
factorial()
method has been added toBinaryInteger
- Added
@Clamped
,@Transformed
, and@Validated
property wrappers - Added
clamped(to:)
andclamp(to:)
methods toComparable
I'm really bad at making incremental releases.
Here are the most major changes:
- Rapid now has vastly improved documentation all around
Chainable
has been removed in favor of global functionsthen(_:)
for value types has been moved toconfigure(_:using:)
- The dedicated
then(_:)
method for reference types has been removed do(_:)
has been moved torun(with:do:)
Other, more minor changes:
- Operator aliases --
≠
,≤
and≥
-- have been added - A global
π
constant forDouble.pi
has been added - The
@inlinable
attribute has been applied to most methods and properties - The implementation of
last(where:)
has been changed to usefirst(where:)
instead of afor
-in
loop - A default value for the
Component
associated type ofResultBuilder
has been added - The
throws
andrethrows
keywords have been added to theString
andArray
result builder initializers SimpleResultBuilder
has been renamed toResultBuilder
- The
?!
operator for throwing an error when optional unwrapping fails has been added
I've also decided that Rapid will be kept API stable from this point onward to the best of my ability.
- The
SimpleResultBuilder
protocol and related types have been added
- Initial release