1module Data.NonEmptyList
10import Control.Monad (liftM2)
11import Data.Binary (Binary, get, put)
12import qualified Data.List as List
23singleton :: a -> List a
28toList :: List a -> [a]
37instance Functor List where
38 fmap func (List x xs) = List (func x) (map func xs)
41instance Traversable List where
42 traverse func (List x xs) = List <$> func x <*> traverse func xs
45instance Foldable List where
46 foldr step state (List x xs) = step x (foldr step state xs)
47 foldl step state (List x xs) = foldl step (step state x) xs
48 foldl1 step (List x xs) = foldl step x xs
55sortBy :: (Ord b) => (a -> b) -> List a -> List a
56sortBy toRank (List x xs) =
59 compare (toRank a) (toRank b)
61 case List.sortBy comparison xs of
66 case comparison x y of
69 GT -> List y (List.insertBy comparison x ys)
76instance (Binary a) => Binary (List a) where
77 put (List x xs) = put x >> put xs
78 get = liftM2 List get get
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