Composing Flows

beginner3 of 5

Learn about composing flows in fp-ts flow

Code Editor

03-composing-flows.exercise.ts

💻
Loading editor...
Preparing Monaco Editor with TypeScript support

Test Results

Requirements

describe('text processing flows', () => {
  it('normalizes text', () => {
    const result = normalizeText('  Hello WORLD  ')
    expect(result).toEqual('hello world')
  })

  it('counts words in text', () => {
    const result = countWordsInText('  Hello WORLD  ')
    expect(result).toEqual(2)
  })

  it('counts words in longer text', () => {
    const result = countWordsInText('  The Quick Brown FOX  ')
    expect(result).toEqual(4)
  })

  it('handles single word', () => {
    const result = countWordsInText('  Hello  ')
    expect(result).toEqual(1)
  })
})
🧪

Ready to Test?

Click "Run Tests" to see how your code performs

Pro Tips

💡 Stuck? Here's what to try:

  • • Read the comments in the code carefully
  • • Run tests frequently to get feedback
  • • Check the fp-ts documentation
  • • Use the solution if you need help

🚀 Learning Approach:

  • • Focus on understanding, not just solving
  • • Experiment with different approaches
  • • Think about real-world applications
  • • Build on previous exercises