things seem to mostly work I guess ???

This commit is contained in:
Jon Doe
2020-09-27 17:27:55 +02:00
committed by Maciej Bonin
parent 80455d20ec
commit 9fa180ff6f
5 changed files with 27 additions and 13 deletions

View File

@ -17,7 +17,7 @@ tooTeToSt a b = tup $ a ♯ "@" ♯ b
stripCommandPrefix
:: T.Text -> [T.Text] -> Either [Maybe T.Text] (Maybe T.Text)
stripCommandPrefix c = uniqueHit . filter (/= Nothing) . map (\cs -> T.stripPrefix cs (c " "))
stripCommandPrefix c = uniqueHit . filter (/= Nothing) . map (\cs -> T.stripPrefix (cs " ") (c " "))
where
uniqueHit cs = if (L.length cs == (1 :: Int)) then Right $ head cs else Left cs