Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- getWithAuth :: FromJSON a => String -> Endpoint -> AccessToken -> IO (Maybe a)
- getWithAuthAndOptions :: FromJSON a => Options -> String -> Endpoint -> AccessToken -> IO (Maybe a)
- postWithAuth :: (ToJSON body, FromJSON res) => String -> body -> Endpoint -> AccessToken -> IO (Maybe res)
- defaults :: Options
- header :: HeaderName -> Lens' Options [ByteString]
- param :: Text -> Lens' Options [Text]
- fromString :: IsString a => String -> a
- (.~) :: ASetter s t a b -> b -> s -> t
- (&) :: a -> (a -> b) -> b
- (</>) :: FilePath -> FilePath -> FilePath
- data Options
- newtype Endpoint = Endpoint String
- newtype AccessToken = AccessToken {}
Documentation
getWithAuth :: FromJSON a => String -> Endpoint -> AccessToken -> IO (Maybe a) Source #
getWithAuthAndOptions :: FromJSON a => Options -> String -> Endpoint -> AccessToken -> IO (Maybe a) Source #
postWithAuth :: (ToJSON body, FromJSON res) => String -> body -> Endpoint -> AccessToken -> IO (Maybe res) Source #
header :: HeaderName -> Lens' Options [ByteString] #
fromString :: IsString a => String -> a #
(</>) :: FilePath -> FilePath -> FilePath infixr 5 #
Combine two paths with a path separator.
If the second path starts with a path separator or a drive letter, then it returns the second.
The intention is that readFile (dir
will access the same file as
</>
file)setCurrentDirectory dir; readFile file
.
Posix: "/directory" </> "file.ext" == "/directory/file.ext" Windows: "/directory" </> "file.ext" == "/directory\\file.ext" "directory" </> "/file.ext" == "/file.ext" Valid x => (takeDirectory x </> takeFileName x) `equalFilePath` x
Combined:
Posix: "/" </> "test" == "/test" Posix: "home" </> "bob" == "home/bob" Posix: "x:" </> "foo" == "x:/foo" Windows: "C:\\foo" </> "bar" == "C:\\foo\\bar" Windows: "home" </> "bob" == "home\\bob"
Not combined:
Posix: "home" </> "/bob" == "/bob" Windows: "home" </> "C:\\bob" == "C:\\bob"
Not combined (tricky):
On Windows, if a filepath starts with a single slash, it is relative to the
root of the current drive. In [1], this is (confusingly) referred to as an
absolute path.
The current behavior of </>
is to never combine these forms.
Windows: "home" </> "/bob" == "/bob" Windows: "home" </> "\\bob" == "\\bob" Windows: "C:\\home" </> "\\bob" == "\\bob"
On Windows, from [1]: "If a file name begins with only a disk designator
but not the backslash after the colon, it is interpreted as a relative path
to the current directory on the drive with the specified letter."
The current behavior of </>
is to never combine these forms.
Windows: "D:\\foo" </> "C:bar" == "C:bar" Windows: "C:\\foo" </> "C:bar" == "C:bar"
newtype AccessToken #
Instances
FromJSON AccessToken | |
Defined in Network.OAuth.OAuth2.Internal parseJSON :: Value -> Parser AccessToken parseJSONList :: Value -> Parser [AccessToken] | |
ToJSON AccessToken | |
Defined in Network.OAuth.OAuth2.Internal toJSON :: AccessToken -> Value toEncoding :: AccessToken -> Encoding toJSONList :: [AccessToken] -> Value toEncodingList :: [AccessToken] -> Encoding | |
Show AccessToken | |
Defined in Network.OAuth.OAuth2.Internal showsPrec :: Int -> AccessToken -> ShowS # show :: AccessToken -> String # showList :: [AccessToken] -> ShowS # | |
Binary AccessToken | |
Defined in Network.OAuth.OAuth2.Internal | |
Eq AccessToken | |
Defined in Network.OAuth.OAuth2.Internal (==) :: AccessToken -> AccessToken -> Bool # (/=) :: AccessToken -> AccessToken -> Bool # |