module SMSAero.Utils where
import Control.Applicative
import Servant.API.Alternative
class DistributiveClient client client' where
distributeClient :: client -> client'
instance DistributiveClient (a -> b) (a -> b) where
distributeClient = id
instance (DistributiveClient (a -> b) b', DistributiveClient (a -> c) c') => DistributiveClient (a -> (b :<|> c)) (b' :<|> c') where
distributeClient client = distributeClient (left <$> client) :<|> distributeClient (right <$> client)
where
left (l :<|> _) = l
right (_ :<|> r) = r