File: ListLanguages.hs

package info (click to toggle)
haskell-github 0.4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 452 kB
  • sloc: haskell: 2,286; makefile: 2
file content (14 lines) | stat: -rw-r--r-- 441 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module ListLanguages where

import qualified Github.Repos as Github
import Data.List

main = do
  possibleLanguages <- Github.languagesFor "mike-burns" "ohlaunch"
  case possibleLanguages of
       (Left error) -> putStrLn $ "Error: " ++ (show error)
       (Right languages) ->
         putStrLn $ intercalate "\n" $ map formatLanguage languages

formatLanguage (Github.Language name characterCount) =
  name ++ "\t" ++ show characterCount