profile
viewpoint
Brandon Williams mbrandonw @pointfreeco Brooklyn, NY http://www.fewbutripe.com Subterranean Homesick Mathematician.

bkase/DoctorPretty 184

Wadler's "A prettier printer" embedded pretty-printer DSL for Swift

mbrandonw/learn-transducers-playground 80

A little tutorial written in Swift playgrounds to learn about transducers.

mbrandonw/In-App-App-Store 22

A simple UIViewController that can be used to display an "app store" within your app.

mbrandonw/DragAndThrow 9

How to do drag and throw behavior on the iPhone/iPad

chriseidhof/functional-swift-conf-2015 5

Functional Swift Conf 2015 website

mbrandonw/cocos2d-iphone 3

cocos2d for iPhone

mbrandonw/Algebra 1

Abstract Algebraic Structures in Swift

mbrandonw/Argo 1

Functional JSON parsing library for Swift

mbrandonw/BigNum 1

A Swift wrapper for NSDecimalNumber so that we have access to very large numbers.

mbrandonw/Curry 1

Swift implementations for function currying

push eventpointfreeco/pointfreeco

Brandon Williams

commit sha fd1beeea87311d5197ce5c331cb68a7ce3351132

Add parser recap to parser collection.

view details

push time in 17 hours

issue commentpointfreeco/pointfreeco

Uppdatera payment options doesn’t remove banner

Hi @barksten, thanks for the report! This does seem like a bug, or at the least a strange user experience. What is happening is that after you update your payment info there is a bit of delay before your card will actually be charged to bring your account into good standing. So the banner remains during that time. We will look into ways of closing that gap.

Thanks again!

barksten

comment created time in 17 hours

push eventpointfreeco/episode-code-samples

Brandon Williams

commit sha b5c578a76b12bde6518bb229fb1e6b267484b432

wip

view details

push time in 2 days

push eventpointfreeco/pointfreeco

Brandon Williams

commit sha 852dc26158eec3ce14d14db08932c58f3a87a58f

Update transcripts.

view details

push time in 2 days

Pull request review commentmaitreebain/QParenting

Fix search

 class ResourcesViewController: UIViewController {             }             return isMatch         }++        var snapshot = NSDiffableDataSourceSnapshot<SectionKind, AnyHashable>()+        snapshot.appendSections([.tag, .article])+        snapshot.appendItems(Tag.allCases, toSection: .tag)+        snapshot.appendItems(linkSources, toSection: .article)+        dataSource.apply(snapshot, animatingDifferences: false)

Since you moved to the diffable data source / snapshot API for collection views you cannot simply do .reloadData() and have the collection view render the freshest data. Instead, you need to create a new snapshot, add your data to it, and then apply it to the data source.

mbrandonw

comment created time in 7 days

PullRequestReviewEvent

Pull request review commentmaitreebain/QParenting

Fix search

 class ResourcesViewController: UIViewController {     override func viewDidLoad() {         super.viewDidLoad()         +        resources = fetchResources()+        linkSources = resources

just like with randomImages, we need to make sure that resources are loaded before we start configuring data sources.

mbrandonw

comment created time in 7 days

PullRequestReviewEvent

PR opened maitreebain/QParenting

Fix search

This makes it so that search will once again filter the articles in the app.

+9 -4

0 comment

1 changed file

pr created time in 7 days

create barnchmbrandonw/QParenting

branch : search-fix

created branch time in 7 days

push eventpointfreeco/swift-composable-architecture

Brandon Williams

commit sha 584a1384e4ec85ca1e9993dc1d0520bec3f97b08

Remove some CustomDebugOutputConvertible conformances. (#312) * Remove some CustomDebugOutputConvertible conformances. * fix tests

view details

push time in 9 days

delete branch pointfreeco/swift-composable-architecture

delete branch : remove-some-conformances

delete time in 9 days

PR merged pointfreeco/swift-composable-architecture

Remove some CustomDebugOutputConvertible conformances.

These conformances from a time we were experimenting coming up with debug output for running effects.

+0 -154

0 comment

2 changed files

mbrandonw

pr closed time in 9 days

push eventpointfreeco/swift-composable-architecture

Brandon Williams

commit sha cccac60fe4d62fe4c0fb81b084ed8d9cb20a79a7

fix tests

view details

push time in 9 days

PR opened pointfreeco/swift-composable-architecture

Reviewers
Remove some CustomDebugOutputConvertible conformances.

These conformances from a time we were experimenting coming up with debug output for running effects.

+0 -110

0 comment

1 changed file

pr created time in 9 days

push eventmbrandonw/mbrandonw

Brandon Williams

commit sha b0dc9c188715b91f927564cf042e6debe19e2902

Update README.md

view details

push time in 9 days

push eventpointfreeco/pointfreeco

Brandon Williams

commit sha 3f1f8d18e531722c23196b647930992464d2126b

Update transcripts.

view details

push time in 9 days

push eventpointfreeco/episode-code-samples

Ryan Stone @ Work

commit sha ebec59a44d4813cde7c05582ae6fdaa2aadeb5b2

Fix episode URL (#68) - Episode URL was incorrect

view details

push time in 12 days

PullRequestReviewEvent

issue commentpointfreeco/swift-composable-architecture

@ObservedObject doesn't get notified from computed properties on iOS14

Hi @barksten, thanks for the issue. It would help if you could provide a full code sample that we can compile to see the problem.

There are few things that caught my attention in your code. First, your view store doesn't need @ObservedObject because that property wrapper is only intended to work with SwiftUI views. Right now it isn't doing anything special by being in a UIViewController.

Second, just because someState changes in your AppState it does not mean it will automatically propagate those changes to the status bar. You are in charge of doing that explicitly, which you could do by subscribing to the viewStore.publisher and calling setNeedsStatusBarAppearanceUpdate on the view controller whenever it changes.

Third, the preferredStatusBarStyle property is called by UIKit only in certain situations, such as app start up, and I believe when pushing/popping/presenting controllers, as well as when you explicitly call setNeedsStatusBarAppearanceUpdate. So, if this code was working in iOS 13 but not 14 I believe it would be because something was causing preferredStatusBarStyle to be called more often previously than it is now.

All in all I believe that this issue doesn't have to do with TCA directly, but rather how UIKit is being used, and possibly some internal changes that happened to UIKit between iOS 13 and 14.

barksten

comment created time in 15 days

PullRequestReviewEvent

push eventpointfreeco/episode-code-samples

Brandon Williams

commit sha 9fafd9c8dd81f0234450ffb45345dc09aba17a8d

wip

view details

push time in 19 days

push eventpointfreeco/episode-code-samples

Brandon Williams

commit sha 9729483486447f6b51eabf4e67f85d9b30d2cbd8

wip

view details

push time in 19 days

push eventpointfreeco/pointfreeco

Brandon Williams

commit sha 9e0db8a990c666f5d3281cb807c3b475d5b155dd

Fix typo.

view details

push time in 22 days

push eventpointfreeco/pointfreeco

Brandon Williams

commit sha 48289a1357abd713222a54e418295b66c72f6004

Add corretion for int parser.

view details

push time in 22 days

push eventpointfreeco/pointfreeco

Brandon Williams

commit sha f669853293e0007421feeafd8f76613c9c5495e5

Update transcripts.

view details

push time in 23 days

push eventpointfreeco/swift-composable-architecture

Stephen Celis

commit sha 24be50fe1cf779dabc6c9c8f3df96dca3e71d1da

Update Todos app to run its forEach reducer first (#301) Fix #300.

view details

push time in 23 days

delete branch pointfreeco/swift-composable-architecture

delete branch : todos-foreach

delete time in 23 days

issue closedpointfreeco/swift-composable-architecture

Example issue with Todo

https://pointfreeco.github.io/swift-composable-architecture/Reducer/#reducer.foreach(state:action:environment:::)

states

Take care when combining forEach reducers into parent domains, as order matters. Always combine forEach reducers before parent reducers that can modify the collection

The example Todo reducer has parent first.

Thanks

closed time in 23 days

fatlazycat
PullRequestReviewEvent

push eventpointfreeco/pointfreeco

Brandon Williams

commit sha 32a74476dd9c7f1848d92b4f2660407f0d4e23bd

Update transcripts.

view details

push time in 23 days

push eventpointfreeco/pointfreeco

Brandon Williams

commit sha 3fe4142d730c0009bdf57782c8df84930f458148

Update transcripts.

view details

push time in 23 days

push eventpointfreeco/swift-composable-architecture

Brandon Williams

commit sha e906ee1616203660736c1c9856196d22ba988199

wip

view details

push time in a month

push eventpointfreeco/swift-composable-architecture

Brandon Williams

commit sha 207e560221f67cbe93fbaf7b0ec6fe7c28bdf16f

optional paths

view details

push time in a month

push eventpointfreeco/episode-code-samples

Point-Free

commit sha ccd010471df7543b00bddda94b623d4e9a206e11

wip

view details

push time in a month

push eventpointfreeco/episode-code-samples

Point-Free

commit sha 43bd660aa689ef813a057a0a24ca2c1e4cfa22b0

wip

view details

push time in a month

push eventpointfreeco/pointfreeco

Brandon Williams

commit sha 109c08befee36bee7551a0f546d52a7cec49c8d6

Update transcripts.

view details

push time in a month

pull request commentpointfreeco/swift-composable-architecture

Buffer actions when sent recursively

@kristojorg great to hear! Do keep in mind that this does not make Store thread safe. send should only ever be called on the main thread and effects should deliver their outputs on the main thread. So whatever Map API was being called on a background thread needs a DispatchQueue.main.async or receive(on:) to make it correct.

mbrandonw

comment created time in a month

PullRequestReviewEvent

push eventpointfreeco/episode-code-samples

Brandon Williams

commit sha 54833a149aed8e7de6f8c4070d6ee97ea783c915

Update README.md

view details

push time in a month

push eventpointfreeco/episode-code-samples

Brandon Williams

commit sha ab14c0b3461a1db2cb22e53d28e6cac3ce236acc

Update README.md

view details

push time in a month

push eventpointfreeco/episode-code-samples

Brandon Williams

commit sha 18373cf475c6cc7a260cd7298b0971a344f7ee4e

Update README.md

view details

push time in a month

push eventpointfreeco/swift-composable-architecture

Brandon Williams

commit sha 7e526ba503a5a11ada05b5216d5dd7c3e742207b

Buffer actions when sent recursively (#287) * wip * wip * explicit test store * test * test * clean up Co-authored-by: Stephen Celis <stephen@stephencelis.com>

view details

push time in a month

delete branch pointfreeco/swift-composable-architecture

delete branch : send-fix

delete time in a month

PR merged pointfreeco/swift-composable-architecture

Buffer actions when sent recursively

Right now we do an assertionFailure when an action is sent to the store while it is processing an action. This is done for correctness reasons so that the 2nd action can't make state changes or return effects before the 1st action has had time to complete.

This situations arises mostly when one tries to execute an effect directly in a reducer (which is not an appropriate thing to do in general) or when multiple threads send actions to the store (also not appropriate). However, it also happens when simply presenting a UIKit view controller that uses viewDidLoad to send an action, which is a totally appropriate thing to do.

So, we want to get rid of the precondition, and instead properly buffer the actions to the store so that they can be processed in a well-defined order.

More info here: https://forums.swift.org/t/uikit-and-racing-actions/40293/2

+55 -26

0 comment

2 changed files

mbrandonw

pr closed time in a month

PR opened pointfreeco/swift-composable-architecture

Reviewers
Buffer actions when sent recursively

Right now we do an assertionFailure when an action is sent to the store while it is processing an action. This is done for correctness reasons so that the 2nd action can't make state changes or return effects before the 1st action has had time to complete.

This situations arises mostly when one tries to execute an effect directly in a reducer (which is not an appropriate thing to do in general) or when multiple threads send actions to the store (also not appropriate). However, it also happens when simply presenting a UIKit view controller that uses viewDidLoad to send an action, which is a totally appropriate thing to do.

So, we want to get rid of the precondition, and instead properly buffer the actions to the store so that they can be processed in a well-defined order.

More info here: https://forums.swift.org/t/uikit-and-racing-actions/40293/2

+55 -26

0 comment

2 changed files

pr created time in a month

push eventpointfreeco/swift-composable-architecture

Brandon Williams

commit sha 17fd6354e5ee0cb4e36ecd47a796af5624027ce8

clean up

view details

push time in a month

push eventpointfreeco/swift-composable-architecture

Brandon Williams

commit sha 1c5fad5451e9cf8381b9f66fadad7417bd4b5d81

test

view details

Brandon Williams

commit sha d8d10394e563fde4192ef49d7f9635592dea9c11

test

view details

push time in a month

push eventpointfreeco/swift-composable-architecture

Brandon Williams

commit sha d40d5c5a2362babf537c679ac7ddd61fee436233

wip

view details

push time in a month

create barnchpointfreeco/swift-composable-architecture

branch : send-fix

created branch time in a month

push eventpointfreeco/pointfreeco

Brandon Williams

commit sha 25ce7c01da21c47fb7004f7f31c0a6ef189b57fc

Updated transcripts.

view details

Brandon Williams

commit sha 9c03409baaf0fc0e039f562f5d4f3b061fb0fd9b

Merge branch 'main' of https://github.com/pointfreeco/pointfreeco into main

view details

Brandon Williams

commit sha 9778c89230de2820421c3dc1bfe935b935f2b3fb

Update transcripts.

view details

push time in a month

push eventpointfreeco/swift-composable-architecture

Brandon Williams

commit sha ec3c4c67ab15dc938a57335dc91e41b8a1be8492

send with animation

view details

push time in 2 months

push eventpointfreeco/combine-schedulers

Brandon Williams

commit sha 3f50fc8baa1a5036a0cd889ecc92ab0c3c575c59

unimplemented scheduler

view details

push time in 2 months

PullRequestReviewEvent

PR opened pointfreeco/swift-web

Reviewers
Parse headers for requests.

I think we'll need to parse stuff from headers soon and apparently this parser doesn't support it yet...

+50 -5

0 comment

4 changed files

pr created time in 2 months

push eventpointfreeco/swift-web

Brandon Williams

commit sha a9392c0941c7e2ba359624eddcbc4040b0071862

wip

view details

push time in 2 months

create barnchpointfreeco/swift-web

branch : header-parser

created branch time in 2 months

issue commentpointfreeco/swift-composable-architecture

ForEachStore is not included in the documentation

Hey @MaxDesiatov, thanks for the heads up. However, I'm able to find the docs for ForEachStore:

https://pointfreeco.github.io/swift-composable-architecture/ForEachStore/

And it's listed on the homepage:

image

The docs are a little scant right now, we should probably improve that soon 😬.

MaxDesiatov

comment created time in 2 months

issue commentpointfreeco/swift-composable-architecture

Optional reducer crash when onAppear used from TabView

Sadly this is a SwiftUI bug :( I can even reproduce it with plain SwiftUI:

struct ContentView: View {
  @State var isLoggedIn = false
  
  var body: some View {
    if self.isLoggedIn {
      TabView {
        Text("A")
          .tabItem{ Text("1") }
          .onAppear{ print("❌ This is called when logging out, even though it should not be.") }

        Button("logout") {self.isLoggedIn = false }
          .tabItem{ Text("2") }
      }
    } else {
      NavigationView {
        Button("Login"){
          self.isLoggedIn = true
        }
      }
    }
  }
}

I've filed a feedback (FB8653218), but you may want to also.

To work around you could implement your own version of .optional() without the precondition just so that you can keep moving forward. This is definitely not ideal because the precondition can really help you catch subtle bugs, such as forgetting to cancel an inflight request when you log out. But at least it's possible to do if you want.

Maybe we need to make an escape hatch for optional() to work around these SwiftUI bugs :/

maciejczechowski

comment created time in 2 months

PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent

push eventpointfreeco/pointfreeco

Brandon Williams

commit sha 91e002f705131b76638d15e3e61d6c51b5708a2a

Add generative art to randomness collection. (#678)

view details

push time in 2 months

delete branch pointfreeco/pointfreeco

delete branch : randomness-collection

delete time in 2 months

PR merged pointfreeco/pointfreeco

Add generative art to randomness collection.

Currently we have generative art episodes in the related section, but seems to make more sense as a dedicated section of the collection. not sure why we did it like that.

+21 -11

0 comment

1 changed file

mbrandonw

pr closed time in 2 months

PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent

push eventpointfreeco/swift-gen

Stephen Celis

commit sha 207391c2a3a4409e7327560e7b10a9e356d5f339

Update README.md (#18)

view details

push time in 2 months

delete branch pointfreeco/swift-gen

delete branch : readme-badges

delete time in 2 months

PR merged pointfreeco/swift-gen

Update README.md
+1 -2

0 comment

1 changed file

stephencelis

pr closed time in 2 months

PullRequestReviewEvent

push eventpointfreeco/pointfreeco

Brandon Williams

commit sha fb7ae0c9b70855a49d503fa2738e6f1211db3dfe

Update transcripts.

view details

push time in 2 months

PullRequestReviewEvent
PullRequestReviewEvent

issue commentpointfreeco/swift-composable-architecture

fireAndForget Environment Side Effect

Hey everyone, thanks for the discussions, this API is definitely not perfect right now and we'd love to improve it.

In our opinion the strangeness is kind of combing from inconsistencies in the Combine APIs. For example, Combine as a ignoreOutput for converting Publisher<Output, _> to a Publisher<_, Failure>, but not corresponding method ignoreFailure to do the same for failures.

Also Combine as .setFailureType(to:) for converting Publisher<_, Never> into Publisher<_, Failure> for any type Failure, but no corresponding .setOutputType(to:) that works for publishers of Never outputs.

These tools could be used to accomplish everything you want without us needing to come up with new APIs for it. Your first example could be:

env.save(value)
  .ignoreOutput()
  .ignoreFailure()
  .setOutputType(to: AppAction.self)
  .eraseToEffect()

It's a lil verbose, but at least it's super descriptive that you are wanting to ignore everything about what this effect can produce. Maybe the APIs could even be a little more succinct so that you could do ignore+set in the same step:

env.save(value)
  .ignoreOutput(setOutputType: AppAction.self)
  .ignoreFailure()
  .eraseToEffect()

That would be pretty nice. So really we should probably file some feedbacks with Apple to have them fix the weird asymmetries in their APIs, and in the meantime @stephencelis and I will think a bit more about how to handle this situation no the TCA side.

Until then you can use something like the following to "fire and forget" effects that output non-Never values:

env.save(value)
  .ignoreOutput()
  .eraseToEffect()
  .fireAndForget()
wendyliga

comment created time in 2 months

PR opened pointfreeco/pointfreeco

Reviewers
Add generative art to randomness collection.

Currently we have generative art episodes in the related section, but seems to make more sense as a dedicated section of the collection. not sure why we did it like that.

+21 -11

0 comment

1 changed file

pr created time in 2 months

create barnchpointfreeco/pointfreeco

branch : randomness-collection

created branch time in 2 months

push eventpointfreeco/swift-composable-architecture

Stephen Celis

commit sha 13cb3c3165eb436fd8da1276f5d549fa2617548e

Update CI to include Xcode 12 (#266) * Update CI to include Xcode 12 * Use CurrentValueSubject

view details

Brandon Williams

commit sha 3f897d9ac77c3eca684590d075c46b00cf31d8e8

Adds Hashable conformance to a bunch of our motion/location types (#265) * Add hashable conformances to location/motion types. * clean up * clean up * clean up * clean * wip * fix * fix

view details

Brandon Williams

commit sha 21bbc7179e70f789c33a7240647a76273fca9e82

Merge remote-tracking branch 'origin/main' into iso

view details

push time in 2 months

push eventpointfreeco/swift-composable-architecture

Brandon Williams

commit sha 3f897d9ac77c3eca684590d075c46b00cf31d8e8

Adds Hashable conformance to a bunch of our motion/location types (#265) * Add hashable conformances to location/motion types. * clean up * clean up * clean up * clean * wip * fix * fix

view details

push time in 2 months

delete branch pointfreeco/swift-composable-architecture

delete branch : hashable

delete time in 2 months

PullRequestReviewEvent

push eventpointfreeco/swift-composable-architecture

Brandon Williams

commit sha b3ddf16165b99997c5ecf490ccc9cfc8d30c5504

clean up

view details

push time in 2 months

push eventpointfreeco/swift-composable-architecture

Stephen Celis

commit sha 31f58da4f2bf406fb38549259d588a85fe26674c

Fix Recursive Reducer (#267)

view details

Stephen Celis

commit sha 32acc6a8592f838c3d83ef79096390989ffc7295

Document ScrollViewReader problem (#268)

view details

Brandon Williams

commit sha 0bf4b25a2e065356c02590f4ed23812a7f333921

Better error messages for uncompleted effects. (#270)

view details

nmccann

commit sha 66d19499bc56b18f582a605b1a956379522e5320

Added some tests for Shared State case study. (#262) * Added some tests for Shared State case study. * Expanded upon tests by also validating that state is mirrored State is expected to be mirrored (or shared) between the Counter and Profile - the tests have been updated to verify this. * Modified tests to focus more on what is changing between steps Co-authored-by: Noah McCann <>

view details

mbrandonw

commit sha 6db4cf39e0c85efea24af449bb0d572c75c41282

Run swift-format

view details

Brandon Williams

commit sha 3307576bfa1e508d9c4494d17c23504389f1fd8a

Merge remote-tracking branch 'origin/main' into iso

view details

push time in 2 months

issue commentpointfreeco/swift-gen

Build fails on DTK

Awesome, we'll cut a release today!

finestructure

comment created time in 2 months

push eventpointfreeco/pointfreeco

Stephen Celis

commit sha 3a5057570687e617f68a0c62502fbe2702aae55f

Stripe card country can be optional (#677)

view details

push time in 2 months

delete branch pointfreeco/pointfreeco

delete branch : relax-stripe-card

delete time in 2 months

PR merged pointfreeco/pointfreeco

Stripe card country can be optional

Turns out country can be null!

+1 -1

0 comment

1 changed file

stephencelis

pr closed time in 2 months

PullRequestReviewEvent

push eventpointfreeco/swift-composable-architecture

Brandon Williams

commit sha 0a969972a7e0fcb0216ff3243551966c5d921c2d

fix

view details

push time in 2 months

push eventpointfreeco/swift-composable-architecture

nmccann

commit sha 66d19499bc56b18f582a605b1a956379522e5320

Added some tests for Shared State case study. (#262) * Added some tests for Shared State case study. * Expanded upon tests by also validating that state is mirrored State is expected to be mirrored (or shared) between the Counter and Profile - the tests have been updated to verify this. * Modified tests to focus more on what is changing between steps Co-authored-by: Noah McCann <>

view details

push time in 2 months

PR merged pointfreeco/swift-composable-architecture

Added some tests for Shared State case study.

This is a follow up to #260 - rather than removing something that I (erroneously) thought was unused, I've added tests to verify it's behaviour.

I attempted to write some other tests for the shared behaviour, for example by incrementing the counter, then asserting that the profile's count has the correct value, but was unable to test this because the setters for ProfileState are private. I had two ideas to address this:

  1. Remove the private access modifier (but they may be there for some reason - ex. to further indicate that these should just "mirror" state from elsewhere rather than being changed directly)
  2. Add a new type of Step that allows you to delegate to XCTAssert, similar to do but it would pass in the current state, allowing you to assert it's current values without having to construct a new instance of the state. Not sure how feasible/desirable this is however.
+112 -3

3 comments

3 changed files

nmccann

pr closed time in 2 months

push eventpointfreeco/swift-composable-architecture

Brandon Williams

commit sha 0bf4b25a2e065356c02590f4ed23812a7f333921

Better error messages for uncompleted effects. (#270)

view details

push time in 2 months

delete branch pointfreeco/swift-composable-architecture

delete branch : better-effect-failures

delete time in 2 months

PR merged pointfreeco/swift-composable-architecture

Better error messages for uncompleted effects.

Inspired by @mackoj's PR #263 we wanted to take a pass at making the error messaging better for when you get a test failure due to unfinished effects. We can now tell you what action started the uncompleted effect, which should help you track down what is going on:

image

+20 -6

0 comment

2 changed files

mbrandonw

pr closed time in 2 months

more