<commit_before>const fs = require('fs')

const Task = require('data.task')
const { List, Map } = require('immutable-ext')


const httpGet = (path, params) =>

  // mocking 'result' as result of get
  Task.of(`${path} result`)

Map({
  home: '/',
  about: '/about-us',
  blog: '/blog'
})
.traverse(
  Task.of,
  route => httpGet(route, {})
)
.fork( console.error, console.log )



Map({
  home: ['/', '/home'],
  about: ['/about-us']
})
.traverse(
  Task.of,

  // routes are arrays,
  // wrap into List and traverse
  routes => List(routes).traverse(
    Task.of, route => httpGet(route, {})
  )
)
.fork( console.error, console.log )

<commit_msg>Structure async: Update comments<commit_after>const fs = require('fs')

const Task = require('data.task')
const { List, Map } = require('immutable-ext')


const httpGet = (path, params) =>

  // mocking return result of get
  // immeditate task returning the string
  Task.of(`${path} result`)


// Map of routes
Map({
  home: '/',
  about: '/about-us',
  blog: '/blog'
})
.traverse(
  Task.of,
  route => httpGet(route, {})
)
.fork( console.error, console.log )


// Map of route arrays
Map({
  home: ['/', '/home'],
  about: ['/about-us']
})
.traverse(
  Task.of,

  // now routes are arrays,
  // wrap them into List and traverse
  routes => List(routes).traverse(
    Task.of, route => httpGet(route, {})
  )
)
.fork( console.error, console.log )


{'fraction_non_alphanumeric': 0.19228020014295927, 'fraction_numerical': 0.0, 'mean_word_length': 3.191616766467066, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '1758764', 'n_tokens_mistral': 511, 'n_tokens_neox': 501, 'n_words': 132}