Safe Haskell | Safe-Inferred |
---|---|

Language | Haskell98 |

- class Shortcutable s where
- shortcut_ :: (Functor s, Shortcutable s) => [s a] -> ([a] -> Bool) -> s [a]
- shortcut2 :: (Functor s, Monad s, Shortcutable s) => [s a] -> [s b] -> ([Maybe a] -> [Maybe b] -> Bool) -> s ([Maybe a], [Maybe b])
- shortcut2b :: (Functor s, Monad s, Shortcutable s) => [s a] -> s b -> ([Maybe a] -> Bool -> Bool) -> s ([Maybe a], Bool)
- fromLeft :: Either a b -> a
- fromRight :: Either a b -> b

# Documentation

class Shortcutable s where Source

class of things that can be run in parallel and can be shortcuted. The funtion in parameter is called everytime an intermediate result is known, as soon as it returns True the intermediate results are returned (discarding those not yet available). the order of the lists must be preserved

shortcut_ :: (Functor s, Shortcutable s) => [s a] -> ([a] -> Bool) -> s [a] Source

version without the maybes

shortcut2 :: (Functor s, Monad s, Shortcutable s) => [s a] -> [s b] -> ([Maybe a] -> [Maybe b] -> Bool) -> s ([Maybe a], [Maybe b]) Source

version with two different types of result

shortcut2b :: (Functor s, Monad s, Shortcutable s) => [s a] -> s b -> ([Maybe a] -> Bool -> Bool) -> s ([Maybe a], Bool) Source

version with a supplementary event which result is discarded