1module Bloodhound.Import
12import Control.Applicative as X (Alternative(..), optional)
13import Control.Exception as X (Exception)
14import Control.Monad as X ( MonadPlus(..)
18import Control.Monad.Fix as X (MonadFix)
19import Control.Monad.IO.Class as X (MonadIO(..))
20import Control.Monad.Catch as X ( MonadCatch
24import Control.Monad.Except as X (MonadError)
25import Control.Monad.Reader as X ( MonadReader (..)
29import Control.Monad.State as X (MonadState)
30import Control.Monad.Writer as X (MonadWriter)
32import Data.Aeson.Types as X ( Pair
39import Data.Bifunctor as X (first)
40import Data.Char as X (isNumber)
41import Data.Hashable as X (Hashable)
42import Data.List as X ( foldl'
46import Data.List.NonEmpty as X ( NonEmpty (..)
49import Data.Maybe as X ( catMaybes
54import Data.Scientific as X (Scientific)
55import Data.Semigroup as X (Semigroup(..))
56import Data.Text as X (Text)
57import Data.Time.Calendar as X ( Day(..)
60import Data.Time.Clock as X ( NominalDiffTime
63import Data.Time.Clock.POSIX as X
65import qualified Data.ByteString.Lazy as BL
66import qualified Data.Text as T
67import qualified Data.Traversable as DT
68import qualified Data.Vector as V
69import qualified Network.HTTP.Types.Method as NHTM
71type LByteString = BL.ByteString
73type Method = NHTM.Method
75readMay :: Read a => String -> Maybe a
76readMay s = case reads s of
80parseReadText :: Read a => Text -> Parser a
81parseReadText = maybe mzero return . readMay . T.unpack
83showText :: Show a => a -> Text
84showText = T.pack . show
86omitNulls :: [(Text, Value)] -> Value
87omitNulls = object . filter notNull where
88 notNull (_, Null) = False
89 notNull (_, Array a) = (not . V.null) a
92parseNEJSON :: (FromJSON a) => [Value] -> Parser (NonEmpty a)
93parseNEJSON [] = fail "Expected non-empty list"
94parseNEJSON (x:xs) = DT.mapM parseJSON (x :| xs)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list