module SMSAero.Utils where
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 (aleft <$> client) :<|> distributeClient (aright <$> client)
where
aleft (l :<|> _) = l
aright (_ :<|> r) = r