diff options
Diffstat (limited to 'app/Prompt.hs')
-rw-r--r-- | app/Prompt.hs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/Prompt.hs b/app/Prompt.hs index 0548c80..4a9b725 100644 --- a/app/Prompt.hs +++ b/app/Prompt.hs @@ -34,6 +34,8 @@ help h (Choice c _ q as) = Choice c (Just h) q as help h (String c _ q as) = String c (Just h) q as -- TODO add `compact` +-- +-- @topic prompt compact :: Prompt a -> Prompt a compact (Choice _ h' q as) = Choice True h' q as compact (String _ h' q as) = String True h' q as @@ -49,6 +51,8 @@ instance Promptable String where prompt :: (Eq a, Promptable a) => Prompt a -> IO a prompt p@(Choice c h' q as) = do -- TODO add `help` + -- + -- @topic prompt let p' = String c Nothing q (map toString (N.toList as)) a' <- fromString <$> prompt p' if isNothing a' || not (a' `elem` (map Just (N.toList as))) |