Skip to content

Instantly share code, notes, and snippets.

@adamczykm
Created November 2, 2018 15:24
Show Gist options
  • Save adamczykm/18b6ab618a2aa330efee98a4df9ac267 to your computer and use it in GitHub Desktop.
Save adamczykm/18b6ab618a2aa330efee98a4df9ac267 to your computer and use it in GitHub Desktop.
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