gdritter repos config-ini / ff8c232
Added Alternative instance as well Getty Ritter 8 years ago
1 changed file(s) with 3 addition(s) and 2 deletion(s). Collapse all Expand all
3131 , flag
3232 ) where
3333
34 import Control.Applicative (Alternative(..))
3435 import Control.Monad.Trans.Except
3536 import qualified Data.HashMap.Strict as HM
3637 import Data.Ini.Config.Raw
5152 -- | An 'IniParser' value represents a computation for parsing entire
5253 -- INI-format files.
5354 newtype IniParser a = IniParser (StParser Ini a)
54 deriving (Functor, Applicative, Monad)
55 deriving (Functor, Applicative, Alternative, Monad)
5556
5657 -- | A 'SectionParser' value represents a computation for parsing a single
5758 -- section of an INI-format file.
5859 newtype SectionParser a = SectionParser (StParser IniSection a)
59 deriving (Functor, Applicative, Monad)
60 deriving (Functor, Applicative, Alternative, Monad)
6061
6162 -- | Parse a 'Text' value as an INI file and run an 'IniParser' over it
6263 parseIniFile :: Text -> IniParser a -> Either String a