Created
November 2, 2018 15:24
-
-
Save adamczykm/18b6ab618a2aa330efee98a4df9ac267 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiGet | |
:: forall e m p | |
. MonadJsonHttp e m => MonadApiAccess m => WriteForeign { | p } => Lacks "login" p => Lacks "passwd" p | |
=> ApiRoute → { | p } → ExceptV e m Json | |
apiGet route params = do | |
{login, password, apiUrl} <- lift getApiAccess | |
let inter = insert (SProxy :: SProxy "passwd") password params | |
authP = insert (SProxy :: SProxy "login") login inter | |
get (apiUrl <> route) authP | |
get :: forall p. WriteForeign { | p } => String → { | p } → ExceptV e m Json | |
get = ?asd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment