10 import Control.Arrow.ArrowList
13 parseYesOrNo :: ArrowChoice a => a String Bool
15 = proc str -> do case str of
16 "yes" -> returnA -< True
17 "no" -> returnA -< False
18 _ -> returnA -< error ("Expected yes or no: " ++ str)
21 maybeA :: (ArrowList a, ArrowChoice a) => a b c -> a b (Maybe c)
25 [] -> returnA -< Nothing
26 (x:_) -> returnA -< Just x
29 defaultTo :: ArrowChoice a => b -> a (Maybe b) b
32 Nothing -> returnA -< def
33 Just x -> returnA -< x
36 deleteIfEmpty :: (ArrowList a, ArrowChoice a) => a String String
38 = proc str -> do case str of