chuchu- Behaviour Driven Development like Cucumber for Haskell

Portabilitynon-portable (GADTs)
MaintainerMarco Túlio Pimenta Gontijo <>
Safe HaskellSafe-Infered






type Chuchu m = ChuchuM m ()Source

The most command use case where the return value of the Monad is ignored.

data ChuchuM m a whereSource

The Monad on which the step rules are constructed. Given, When, Then, And and But are interpreted in the same way by the program. All of them receive a parser and an action to run if the parser finishes correctly.


Given :: Parser a -> (a -> m ()) -> ChuchuM m () 
When :: Parser a -> (a -> m ()) -> ChuchuM m () 
Then :: Parser a -> (a -> m ()) -> ChuchuM m () 
And :: Parser a -> (a -> m ()) -> ChuchuM m () 
But :: Parser a -> (a -> m ()) -> ChuchuM m () 


runChuchu :: ChuchuM m a -> Parser (m ())Source

Converts the Monad into a single Parser that executes the specified action if the parser is executed correctly. It includes an eof on the parser of each step to avoid it from accepting prefixes of the desired rule.