Basic

beginner1 of 4

Learn about basic in fp-ts semigroup

Code Editor

01-basic.exercise.ts

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

Test Results

Requirements

describe('Semigroup basics', () => {
  it('combines strings with space', () => {
    const result = combineStrings('Hello', 'World')
    expect(result).toBe('Hello World')
  })

  it('sums numbers using SemigroupSum', () => {
    const result = combineNumbers([1, 2, 3, 4, 5])
    expect(result).toBe(15)
  })

  it('handles single number', () => {
    const result = combineNumbers([42])
    expect(result).toBe(42)
  })
})
🧪

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