<commit_before>import Foundation
import Yaml
import KituraMarkdown

public struct Workshop {
  let title: String
  let authors: [String]
  let presenters: [String]
  let thanks: [Thanks]
  let recommendations: [Recommendation]
  let links: [URL]
  let tags: [String]
  let prerequisites: String
  let description: String

  struct Thanks: Equatable {
    let to: String
    let reason: String?
  }

  struct Recommendation: Equatable {
    let title: String
    let url: URL
  }

  enum WorkshopError : Error {
    case malformedMetadata
  }
}

// Satisfy equatability for Workshop.Recommendation
func ==(lhs: Workshop.Recommendation, rhs: Workshop.Recommendation) -> Bool { 
  return lhs.title == rhs.title && lhs.url == rhs.url
}
// ...and for Workshop.Thanks
func ==(lhs: Workshop.Thanks, rhs: Workshop.Thanks) -> Bool {
  return lhs.to == rhs.to && lhs.reason == rhs.reason
}

public extension Workshop {
  /**
    Parses the files that describe a workshop into a Workshop instance

    - returns:<commit_msg>Improve clarity of Equatable structs<commit_after>import Foundation
import Yaml
import KituraMarkdown

public struct Workshop {
  let title: String
  let authors: [String]
  let presenters: [String]
  let thanks: [Thanks]
  let recommendations: [Recommendation]
  let links: [URL]
  let tags: [String]
  let prerequisites: String
  let description: String

  struct Thanks: Equatable {
    let to: String
    let reason: String?

    static func ==(lhs: Workshop.Thanks, rhs: Workshop.Thanks) -> Bool {
      return lhs.to == rhs.to && lhs.reason == rhs.reason
    }
  }

  struct Recommendation: Equatable {
    let title: String
    let url: URL
    
    static func ==(lhs: Workshop.Recommendation, rhs: Workshop.Recommendation) -> Bool { 
      return lhs.title == rhs.title && lhs.url == rhs.url
    }
  }

  enum WorkshopError: Error {
    case malformedMetadata
  }
}

public extension Workshop {
  /**
    Parses the files that describe a workshop into a Workshop instance

    - returns:
{'fraction_non_alphanumeric': 0.09606769537083126, 'fraction_numerical': 0.0, 'mean_word_length': 3.30406852248394, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '956639', 'n_tokens_mistral': 646, 'n_tokens_neox': 596, 'n_words': 204}