Revision b74ebe44 src/Ganeti/BasicTypes.hs
b/src/Ganeti/BasicTypes.hs | ||
---|---|---|
23 | 23 |
|
24 | 24 |
module Ganeti.BasicTypes |
25 | 25 |
( GenericResult(..) |
26 |
, genericResult |
|
26 | 27 |
, Result |
27 | 28 |
, ResultT(..) |
28 | 29 |
, resultT |
... | ... | |
53 | 54 |
| Ok b |
54 | 55 |
deriving (Show, Eq) |
55 | 56 |
|
57 |
-- | Sum type structure of GenericResult. |
|
58 |
genericResult :: (a -> c) -> (b -> c) -> GenericResult a b -> c |
|
59 |
genericResult f _ (Bad a) = f a |
|
60 |
genericResult _ g (Ok b) = g b |
|
61 |
|
|
56 | 62 |
-- | Type alias for a string Result. |
57 | 63 |
type Result = GenericResult String |
58 | 64 |
|
Also available in: Unified diff