Paste server written in Haskell. Fork of Hpaste, fully freedom and privacy respecting and generally improved. At the time of writing there's an instance at <http://paste.rel4tion.org>.

[[ 🗃 ^aoqmo toothpaste ]] :: [📥 Inbox] [📤 Outbox] [🐤 Followers] [🤝 Collaborators] [🛠 Commits]

Clone

HTTPS: git clone https://vervis.peers.community/repos/aoqmo

SSH: git clone USERNAME@vervis.peers.community:aoqmo

Branches

Tags

hpaste :: src / Data / Either /

Extra.hs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
{-# OPTIONS -Wall #-}
{-# LANGUAGE OverloadedStrings #-}

module Data.Either.Extra where

-- | When a value is Right, do something with it, monadically.
whenRight :: Monad m => Either a b -> (b -> m c) -> m ()
whenRight (Right x) m = m x >> return ()
whenRight _         _ = return ()

-- | When a value is Left, do something with it, monadically.
whenLeft :: Monad m => Either a b -> (a -> m c) -> m ()
whenLeft (Left x) m = m x >> return ()
whenLeft _         _ = return ()
[See repo JSON]