Copyright | (c) 2015, GetShopTV |
---|---|
License | BSD3 |
Maintainer | nickolay@getshoptv.com |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
This module defines
class
to help distribute functions over alternatives (DistributiveClient
).:<|>
- class DistributiveClient client client' where
- distributeClient :: client -> client'
Documentation
class DistributiveClient client client' where Source
Distribute a client looking like
a -> (b:<|>
...:<|>
c)
into
(a -> b):<|>
...:<|>
(a -> c)
This is useful to bring authentication credentials to individual client endpoint queries.
distributeClient :: client -> client' Source
(DistributiveClient (a -> b) b', DistributiveClient (a -> c) c') => DistributiveClient (a -> (:<|>) b c) ((:<|>) b' c') | Distribute function over alternative. |
DistributiveClient (a -> b) (a -> b) | Base case. |