• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

haskell-github/github: The github API for Haskell

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

haskell-github/github

开源软件地址:

https://github.com/haskell-github/github

开源编程语言:

Haskell 100.0%

开源软件介绍:

GitHub

Haskell-CI Hackage

The GitHub API v3 for Haskell.

Some functions are missing; these are functions where the GitHub API did not work as expected. The full GitHub API is in beta and constantly improving.

Installation

In your project's cabal file:

Build-depends:       github

Or from the command line:

cabal v1-install github

Example Usage

See the samples in the samples/ directory.

Note: some samples might be outdated.

Documentation

For details see the reference documentation on Hackage.

Each module lines up with the hierarchy of documentation from the GitHub API.

Request functions (ending with R) construct a data type which can be executed in IO by executeRequest functions. They are all listed in the root GitHub module.

IO functions produce an IO (Either Error a), where a is the actual thing you want. You must call the function using IO goodness, then dispatch on the possible error message. Here's an example from the samples:

Many function have samples under samples/ directory.

{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}

import Prelude.Compat

import Data.Text         (Text, pack)
import Data.Text.IO as T (putStrLn)
import Data.Monoid       ((<>))

import GitHub (github')
import qualified GitHub

main :: IO ()
main = do
    possibleUsers <- github' GitHub.usersFollowingR "phadej"
    T.putStrLn $ either (("Error: " <>) . pack . show)
                        (foldMap ((<> "\n") . formatUser))
                        possibleUsers

formatUser :: GitHub.SimpleUser -> Text
formatUser = GitHub.untagName . GitHub.simpleUserLogin

Contributions

Please see CONTRIBUTING.md for details on how you can help.

Copyright

Copyright 2011-2012 Mike Burns. Copyright 2013-2015 John Wiegley. Copyright 2016-2019 Oleg Grenrus.

Available under the BSD 3-clause license.

Alternative

Library github-rest also provides an interface to the GitHub API. It compares itself to github here: https://github.com/LeapYear/github-rest#comparison-to-other-libraries




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap