diff options
author | tv <tv@krebsco.de> | 2019-01-27 03:23:17 +0100 |
---|---|---|
committer | tv <tv@krebsco.de> | 2019-01-27 03:27:29 +0100 |
commit | e9ca12a945b1d1c068e9c31050e264cb20690db4 (patch) | |
tree | 6f12a1ede100424ebbd24f97f46bf9c31243d672 /src/Reaktor/Parser.hs | |
parent | aaddda85c74540d1dab452dcdddf425927983ea9 (diff) |
Reaktor: add data Commandv0.2.0
Diffstat (limited to 'src/Reaktor/Parser.hs')
-rw-r--r-- | src/Reaktor/Parser.hs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Reaktor/Parser.hs b/src/Reaktor/Parser.hs index f226ad5..6fbcce9 100644 --- a/src/Reaktor/Parser.hs +++ b/src/Reaktor/Parser.hs @@ -1,11 +1,13 @@ {-# LANGUAGE OverloadedStrings #-} module Reaktor.Parser where -import Prelude.Extended import Control.Applicative import Data.Attoparsec.Text import qualified Data.Char +import Data.String.Conversions (convertString) import qualified Data.Text.Extended as T +import Prelude.Extended +import Reaktor.IRC import Reaktor.Internal @@ -13,8 +15,9 @@ prefix :: Parser Text prefix = T.pack <$> many (satisfy Data.Char.isAlphaNum <|> satisfy (flip elem (":.-@/!~[]\\`_^{|}" :: String))) -command :: Parser Text -command = T.pack <$> many1 (satisfy Data.Char.isAlphaNum) +command :: Parser Command +command = + convertString . T.pack <$> many1 (satisfy Data.Char.isAlphaNum) nospcrlfcl :: Parser Char nospcrlfcl = |