1module Yoga.Helpers where
4import Data.Array (head, tail, (:))
5import Data.Maybe (Maybe(..), fromMaybe)
7fromMaybeFlipped ∷ ∀ a. Maybe a -> a -> a
8fromMaybeFlipped = flip fromMaybe
10infixr 5 fromMaybeFlipped as ?||
12ifJustTrue ∷ ∀ m. Monoid m => Maybe Boolean -> m -> m
13ifJustTrue option value = if option == Just true then value else mempty
15ifJustFalse ∷ ∀ m. Monoid m => Maybe Boolean -> m -> m
16ifJustFalse option value = if option == Just false then value else mempty
18intersperse ∷ ∀ a. a -> Array a -> Array a
19intersperse sep xs = case head xs, tail xs ?|| [] of
21 Just x, xs' -> x : prependToAll sep xs'
23prependToAll ∷ ∀ a. a -> Array a -> Array a
24prependToAll sep xs = case head xs, tail xs ?|| [] of
26 Just x, xs' -> sep : x : prependToAll sep 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