≈ the.bay.news

How to refactor this code combining IO and Either?

Haskell Community
How to refactor this code combining IO and Either?
Hi all, I’ve been working on a side-project (a small utility for building DJ playlists) for a couple of months while re-learning a bit of Haskell. There’s a library of pure functions and a CLI (built with optparse-applicative) that does some sfuff using those functions. In the CLI code, I ended up with a bunch of function with this shape: handleMakePlaylist :: MakePlaylistOptions -> IO () handleMakePlaylist opts = do lib <- readLibFromFile_ opts.libraryPath case lib of Left e ...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.