Skip to content

Commit

Permalink
Re-Indent + refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
glebfann committed Jul 10, 2024
1 parent e3d1c09 commit ab97519
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 295 deletions.
1 change: 0 additions & 1 deletion Sources/compose.swift
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,3 @@ func compose<Arg1, Arg2, Arg3, Arg4>(
) -> (Arg1) throws -> Arg4 {
{ (arg1: Arg1) -> Arg4 in try f3(f2(f1(arg1))) }
}

16 changes: 8 additions & 8 deletions Sources/curry.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/// - f: The function to curry.
///
/// - Returns: Curried function
@inlinable
@inlinable @inline(__always)
public func curry<Arg1, Return>(
_ f: @escaping (Arg1) -> Return
) -> (Arg1) -> Return {
Expand All @@ -22,25 +22,25 @@ public func curry<Arg1, Return>(
}
}

@inlinable
@inlinable @inline(__always)
public func curry<Arg1, Arg2, Return>(
_ f: @escaping ((Arg1, Arg2)) -> Return
) -> (Arg1) -> (Arg2) -> Return {
{ (arg1: Arg1) -> (Arg2) -> Return in
{ (arg1: Arg1) -> (Arg2) -> Return in
{ (arg2: Arg2) -> Return in
f((arg1, arg2))
}
}
}

@inlinable
@inlinable @inline(__always)
public func curry<Arg1, Arg2, Arg3, Return>(
_ f: @escaping ((Arg1, Arg2, Arg3)) -> Return
) -> (Arg1) -> (Arg2) -> (Arg3) -> Return {
{
(arg1: Arg1) -> (Arg2) -> (Arg3) -> Return in {
(arg2: Arg2) -> (Arg3) -> Return in {
(arg3: Arg3) -> Return in f((arg1, arg2, arg3))
{ (arg1: Arg1) -> (Arg2) -> (Arg3) -> Return in
{ (arg2: Arg2) -> (Arg3) -> Return in
{ (arg3: Arg3) -> Return in
f((arg1, arg2, arg3))
}
}
}
Expand Down
51 changes: 0 additions & 51 deletions Sources/internal/MemoizedKeys.swift

This file was deleted.

21 changes: 0 additions & 21 deletions Sources/internal/ParameterPacksHelpers.swift

This file was deleted.

155 changes: 0 additions & 155 deletions Sources/memoized.swift

This file was deleted.

6 changes: 3 additions & 3 deletions Sources/uncurry.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/// - Returns: Uncurried function
@inlinable @inline(__always)
public func uncurry<Arg1, Return>(
_ f: @escaping (Arg1) -> Return
_ f: @escaping (Arg1) -> Return
) -> (Arg1) -> Return {
{ (arg1: Arg1) -> Return in
f(arg1)
Expand All @@ -23,7 +23,7 @@ public func uncurry<Arg1, Return>(

@inlinable @inline(__always)
public func uncurry<Arg1, Arg2, Return>(
_ f: @escaping (Arg1) -> (Arg2) -> Return
_ f: @escaping (Arg1) -> (Arg2) -> Return
) -> (Arg1, Arg2) -> Return {
{ (arg1: Arg1, arg2: Arg2) -> Return in
f(arg1)(arg2)
Expand All @@ -32,7 +32,7 @@ public func uncurry<Arg1, Arg2, Return>(

@inlinable @inline(__always)
public func uncurry<Arg1, Arg2, Arg3, Return>(
_ f: @escaping (Arg1) -> (Arg2) -> (Arg3) -> Return
_ f: @escaping (Arg1) -> (Arg2) -> (Arg3) -> Return
) -> (Arg1, Arg2, Arg3) -> Return {
{ (arg1: Arg1, arg2: Arg2, arg3: Arg3) -> Return in
f(arg1)(arg2)(arg3)
Expand Down
Loading

0 comments on commit ab97519

Please sign in to comment.