<commit_before>//: Playground - noun: a place where people can play

import Cocoa
import Starfish

let flux = Flux<Int>()
let wave = Wave<Int>()

flux.subscribe { event in
    print("Received flux event \(event)")
}

flux.append(Flux<Int>.Event.value(5))

wave.subscribe { event in
    print("Received wave event \(event)")
}

wave.append(Wave<Int>.Event.value(flux))<commit_msg>Added small map example to Playground<commit_after>//: Playground - noun: a place where people can play

import Cocoa
import Starfish

func section(_ title: String, closure: () -> ()) {
	print("\n\(title)\n")
	closure()
}


let flux = Flux<Int>()
let wave = Wave<Int>()

flux.subscribe { event in
    print("Received flux event \(event)")
}

flux.append(Flux<Int>.Event.value(5))

wave.subscribe { event in
    print("Received wave event \(event)")
}

wave.append(Wave<Int>.Event.value(flux))

section("Map Example") {
	Flux<Int>([1, 2, 3]).map { $0 * $0 }.subscribe { print($0) }
}
{'fraction_non_alphanumeric': 0.16857440166493237, 'fraction_numerical': 0.008324661810613945, 'mean_word_length': 4.314917127071824, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 13, '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': '3222591', 'n_tokens_mistral': 343, 'n_tokens_neox': 324, 'n_words': 90}