Mapleft

intermediate6 of 8

Learn about mapleft in fp-ts readertaskeither

Code Editor

06-mapleft.exercise.ts

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

Test Results

Requirements

describe('ReaderTaskEither mapLeft', () => {
  const config: Config = {}

  it('transforms error value', async () => {
    const result = await convertErrorToMessage()(config)()
    expect(E.isLeft(result)).toBe(true)
    if (E.isLeft(result)) {
      expect(result.left).toBe('Error 404: Not Found')
    }
  })
})
🧪

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