io-choice-0.0.6: Choice for IO and lifted IO

Safe HaskellNone
LanguageHaskell98

Control.Exception.IOChoice.TH

Description

This package provides a function to generate a choice operator in IO monad by specifying exceptions to be caught.

Synopsis

Documentation

newIOChoice :: [Name] -> ExpQ Source

A function to generate a choice operator in IO monad. IOException is automatically added to specified exceptions. So, goNext can be used with the new operator.

{-# LANGUAGE TemplateHaskell #-}
import Control.Exception
import Control.Exception.IOChoice.TH

(||>>) :: IO a -> IO a -> IO a
(||>>) = $(newIOChoice [''ErrorCall, ''ArithException])