<commit_before>import Library
import Prelude
import Prelude_UIKit
import UIKit
import XCPlayground

let liveView = UIView(frame: .init(x: 0, y: 0, width: 600, height: 600))
  |> UIView.lens.backgroundColor .~ .ksr_offWhite
XCPlaygroundPage.currentPage.liveView = liveView

let rootStackView = UIStackView(frame: liveView.bounds)
  |> UIStackView.lens.alignment .~ .Leading
  |> UIStackView.lens.axis .~ .Vertical
  |> UIStackView.lens.distribution .~ .FillEqually
  |> UIStackView.lens.layoutMarginsRelativeArrangement .~ true
  |> UIStackView.lens.layoutMargins .~ .init(top: 16, left: 16, bottom: 16, right: 16)
liveView.addSubview(rootStackView)

let positiveButton = positiveButtonStyle <> UIButton.lens.titleText(forState: .Normal) .~ "Positive button"
let neutralButton  = neutralButtonStyle  <> UIButton.lens.titleText(forState: .Normal) .~ "Neutral button"
let borderButton   = borderButtonStyle   <> UIButton.lens.titleText(forState: .Normal) .~ "Border button"

func disabled <C: UIControlProtocol> () -> (C -> C) {
  return C.lens.enabled .~ false
}

let buttonsStyles: [[UIButton -> UIButton]] = [
  [ positiveButton,       positiveButton      <> disabled() ],
  [ neutralButton,        neutralButton       <> disabled() ],
  [ facebookButtonStyle,  facebookButtonStyle <> disabled() ],
  [ borderButton,         borderButton        <> disabled() ]
]

let rowStackViewStyle =
  UIStackView.lens.alignment          .~ .Top
    <> UIStackView.lens.axis          .~ .Horizontal
    <> UIStackView.lens.distribution  .~ .EqualSpacing
    <> UIStackView.lens.spacing       .~ 24.0

for buttonStyles in buttonsStyles {
  rootStackView.addArrangedSubview(
    UIStackView()
      |> rowStackViewStyle
      |> UIStackView.lens.arrangedSubviews .~ buttonStyles.map { UIButton() |> $0 }
  )
}
<commit_msg>Very small clean up.<commit_after>import Library
import Prelude
import Prelude_UIKit
import UIKit
import XCPlayground

let liveView = UIView(frame: .init(x: 0, y: 0, width: 440, height: 600))
  |> UIView.lens.backgroundColor .~ .ksr_offWhite
XCPlaygroundPage.currentPage.liveView = liveView

let rootStackView = UIStackView(frame: liveView.bounds)
  |> UIStackView.lens.alignment .~ .Leading
  |> UIStackView.lens.axis .~ .Vertical
  |> UIStackView.lens.distribution .~ .FillEqually
  |> UIStackView.lens.layoutMarginsRelativeArrangement .~ true
  |> UIStackView.lens.layoutMargins .~ .init(all: 16)
liveView.addSubview(rootStackView)

let positiveButton = positiveButtonStyle <> UIButton.lens.titleText(forState: .Normal) .~ "Positive button"
let neutralButton  = neutralButtonStyle  <> UIButton.lens.titleText(forState: .Normal) .~ "Neutral button"
let borderButton   = borderButtonStyle   <> UIButton.lens.titleText(forState: .Normal) .~ "Border button"

func disabled <C: UIControlProtocol> () -> (C -> C) {
  return C.lens.enabled .~ false
}

let buttonsStyles: [[UIButton -> UIButton]] = [
  [ positiveButton,      positiveButton      <> disabled() ],
  [ neutralButton,       neutralButton       <> disabled() ],
  [ facebookButtonStyle, facebookButtonStyle <> disabled() ],
  [ borderButton,        borderButton        <> disabled() ]
]

let rowStackViewStyle =
  UIStackView.lens.alignment .~ .Top
    <> UIStackView.lens.axis .~ .Horizontal
    <> UIStackView.lens.distribution .~ .EqualSpacing
    <> UIStackView.lens.spacing .~ 24.0

for buttonStyles in buttonsStyles {
  rootStackView.addArrangedSubview(
    UIStackView()
      |> rowStackViewStyle
      |> UIStackView.lens.arrangedSubviews .~ buttonStyles.map { UIButton() |> $0 }
  )
}

{'fraction_non_alphanumeric': 0.12496489750070205, 'fraction_numerical': 0.009547879809042405, 'mean_word_length': 3.90633608815427, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4942381', 'n_tokens_mistral': 1225, 'n_tokens_neox': 1116, 'n_words': 225}