<commit_before>//===--- dump_api.swift ---------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
// RUN: %target-swift-ide-test -dump-api -source-filename %s > %t.swift
// RUN: diff -du %S/Inputs/dumped_api.swift %t.swift

//===--- Definitions needed only while experimental -----------------------===//
public struct _Distance {}
public struct _InitializeTo {}
extension _InitializeTo {  }
extension _ContiguousArrayBuffer {
}

//===----------------------------------------------------------------------===//



//===--- Generator --------------------------------------------------------===//
//===----------------------------------------------------------------------===//

public class _AnyGeneratorBase {}

/// An abstract `GeneratorType` base class over `T` elements.
///
/// Use this as a `Sequence`'s associated `Generator` type when you
/// don't want to expose details of the concrete generator, a subclass.
///
/// It is an error to create instances of `AnyGenerator` that are not
/// also instances of an `AnyGenerator` subclass.
///
/// See also:
///
///     struct AnySequence<S: SequenceType>
///     func anyGenerator<G: GeneratorType>(base: G) -> AnyGenerator<G.Element>
///     func anyGenerator<T>(nextImplementation: ()->T?) -> AnyGenerator<T>
public class AnyGenerator<T> : _AnyGeneratorBase, GeneratorType {
  /// Initialize the instance.  May only be called from a subclass
  /// initializer.
  override public init() 

  /// Advance to the next element and return it, or `nil` if no next
  /// element exists.
  ///
  /// Note: subclasses must override this method.
  public func next() -> T? 
}

/// Every `GeneratorType` can also be a `SequenceType`.  Note that
/// traversing the sequence consumes the generator.
extension AnyGenerator : SequenceType {
  /// Returns `self`.
  public func generate() -> AnyGenerator 
}

/// Return a `GeneratorType` instance that wraps `base` but whose type
/// depends only on the type of `G.Element`.
///
/// Example:
///
///     func countStrings() -> AnyGenerator<String> {
///       let lazyStrings = lazy(0..<10).map { String($0) }
///
///       // This is a really complicated type of no interest to our
///       // clients.
///       let g: MapSequenceGenerator<RangeGenerator<Int>, String>
///         = lazyStrings.generate()
///       return anyGenerator(g)
///     }
public func anyGenerator<G: GeneratorType>(base: G) -> AnyGenerator<G.Element> 


/// Return a `GeneratorType` instance whose `next` method invokes
/// `nextImplementation` and returns the result.
///
/// Example:
///
///     var x = 7
///     let g = anyGenerator { x < 15 ? x++ : nil }
///     let a = Array(g) // [ 7, 8, 9, 10, 11, 12, 13, 14 ]
public func anyGenerator<T>(nextImplementation: ()->T?) -> AnyGenerator<T> 



//===--- Sequence ---------------------------------------------------------===//
//===----------------------------------------------------------------------===//



// FIXME: can't make this a protocol due to <rdar://20209031><commit_msg>Revert "Remove duplicated line"<commit_after>//===--- dump_api.swift ---------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
// RUN: %target-swift-ide-test -dump-api -source-filename %s > %t.swift
// RUN: diff -du %S/Inputs/dumped_api.swift %t.swift

//===--- Definitions needed only while experimental -----------------------===//
public struct _Distance {}
public struct _InitializeTo {}
extension _InitializeTo {  }
extension _ContiguousArrayBuffer {
}

//===----------------------------------------------------------------------===//



//===--- Generator --------------------------------------------------------===//
//===----------------------------------------------------------------------===//

public class _AnyGeneratorBase {}

/// An abstract `GeneratorType` base class over `T` elements.
///
/// Use this as a `Sequence`'s associated `Generator` type when you
/// don't want to expose details of the concrete generator, a subclass.
///
/// It is an error to create instances of `AnyGenerator` that are not
/// also instances of an `AnyGenerator` subclass.
///
/// See also:
///
///     struct AnySequence<S: SequenceType>
///     func anyGenerator<G: GeneratorType>(base: G) -> AnyGenerator<G.Element>
///     func anyGenerator<T>(nextImplementation: ()->T?) -> AnyGenerator<T>
public class AnyGenerator<T> : _AnyGeneratorBase, GeneratorType {
  /// Initialize the instance.  May only be called from a subclass
  /// initializer.
  override public init() 

  /// Advance to the next element and return it, or `nil` if no next
  /// element exists.
  ///
  /// Note: subclasses must override this method.
  public func next() -> T? 
}

/// Every `GeneratorType` can also be a `SequenceType`.  Note that
/// traversing the sequence consumes the generator.
extension AnyGenerator : SequenceType {
  /// Returns `self`.
  public func generate() -> AnyGenerator 
}

/// Return a `GeneratorType` instance that wraps `base` but whose type
/// depends only on the type of `G.Element`.
///
/// Example:
///
///     func countStrings() -> AnyGenerator<String> {
///       let lazyStrings = lazy(0..<10).map { String($0) }
///
///       // This is a really complicated type of no interest to our
///       // clients.
///       let g: MapSequenceGenerator<RangeGenerator<Int>, String>
///         = lazyStrings.generate()
///       return anyGenerator(g)
///     }
public func anyGenerator<G: GeneratorType>(base: G) -> AnyGenerator<G.Element> 


/// Return a `GeneratorType` instance whose `next` method invokes
/// `nextImplementation` and returns the result.
///
/// Example:
///
///     var x = 7
///     let g = anyGenerator { x < 15 ? x++ : nil }
///     let a = Array(g) // [ 7, 8, 9, 10, 11, 12, 13, 14 ]
public func anyGenerator<T>(nextImplementation: ()->T?) -> AnyGenerator<T> 



//===--- Sequence ---------------------------------------------------------===//
//===----------------------------------------------------------------------===//



// FIXME: can't make this a protocol due to <rdar://20209031>
// FIXME: can't make this a protocol due to <rdar://20209031>
{'fraction_non_alphanumeric': 0.27780971543546995, 'fraction_numerical': 0.012072434607645875, 'mean_word_length': 1.7397637795275591, 'pattern_counts': {'":': 0, '<': 36, '<?xml version=': 0, '>': 52, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4206742', 'n_tokens_mistral': 1876, 'n_tokens_neox': 1751, 'n_words': 623}