Copyright | (c) plaimi 2014 |
---|---|

License | GPL-3 |

Maintainer | plailude@plaimi.net |

Safe Haskell | None |

Language | Haskell2010 |

- both :: Arrow a => a b c -> a (b, b) (c, c)
- erretreat :: (MonadError e m, MonadError e n) => m a -> m (n a)
- retreat :: (Monad m, Monad n) => m a -> m (n a)
- (.:) :: (c -> d) -> (a -> b -> c) -> a -> b -> d
- (.:.) :: (d -> e) -> (a -> b -> c -> d) -> a -> b -> c -> e
- vbs :: (Stringable a, Stringable b) => a -> b
- vbsl :: (Stringable a, Stringable b) => a -> b
- vstr :: (Stringable a, Stringable b) => a -> b
- vtxt :: (Stringable a, Stringable b) => a -> b
- vtxtl :: (Stringable a, Stringable b) => a -> b
- showL8 :: Show a => a -> ByteString
- newtype Hour a = MkHour Int
- newtype Minute a = MkMinute Int
- newtype Second a = MkSecond Int
- newtype Year a = MkYear Integer
- newtype Month a = MkMonth Int
- newtype Day a = MkDay Int
- class TimeUnit t where
- asSeconds :: Hour h -> Minute m -> Second s -> Second t
- fromGregorian :: Year y -> Month mo -> Day d -> Day

# Documentation

both :: Arrow a => a b c -> a (b, b) (c, c)

Send both components of the input through the argument arrow.

erretreat :: (MonadError e m, MonadError e n) => m a -> m (n a)

`retreat`

the value a of a `MonadError`

m further into the `MonadError`

burrito by injecting it into yet another `MonadError`

n, giving us m (n a).
If there's an error, it is rethrown inside n.

(.:) :: (c -> d) -> (a -> b -> c) -> a -> b -> d

Compose two functions where the second function takes two values and delivers its result as a single value to the first function.

This is equivalent to: (f .: g) x y = f (g x y).

(.:.) :: (d -> e) -> (a -> b -> c -> d) -> a -> b -> c -> e

Compose two functions where the second function takes three values and delivers its result as a single value to the first function.

This is equivalent to: (f .:. g) x y z = f (g x y z).

vbs :: (Stringable a, Stringable b) => a -> b

Convert from a `Stringable`

a to a `Stringable`

b via `ByteString`

.

vbsl :: (Stringable a, Stringable b) => a -> b

Convert from a `Stringable`

a to a `Stringable`

b via `ByteString`

.

vstr :: (Stringable a, Stringable b) => a -> b

Convert from a `Stringable`

a to a `Stringable`

b via `String`

.

vtxt :: (Stringable a, Stringable b) => a -> b

Convert from a `Stringable`

a to a `Stringable`

b via `Text`

.

vtxtl :: (Stringable a, Stringable b) => a -> b

Convert from a `Stringable`

a to a `Stringable`

b via `Text`

.

showL8 :: Show a => a -> ByteString

`showL8`

converts a showable value to a `ByteString`

using `show`

.

class TimeUnit t where

`TimeUnit`

s are units of time with a value that's an instance of `Num`

.
The class is used to get type safety of time units, and a function for
getting "out" the value (analogues to `fromJust`

for `Maybe`

) for every
type of `Num`

, for free.