-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Datatype and parser for the Universal Configuration Language (UCL) using libucl -- -- The Universal Configuration Language (UCL) is a configuration language -- inspired by nginx configuration files and compatible with JSON. For a -- complete description of the language, see the libucl readme. -- -- This library contains a datatype representing UCL objects, and a -- parser. It is based on the C library libucl, which is needed to -- build this package. @package ucl @version 0.2.0.0 module Data.UCL -- | An UCL object data UCL UCLMap :: Map Text UCL -> UCL UCLArray :: [UCL] -> UCL UCLInt :: Int -> UCL UCLDouble :: Double -> UCL UCLText :: Text -> UCL UCLBool :: Bool -> UCL UCLTime :: DiffTime -> UCL -- | Parse a String into a UCL, resolving includes, macros, -- variables... -- --
-- >>> parseString "{a: [1,2], 🌅: 3min, a: [4]}"
-- Right (UCLMap (fromList
-- [ ("a" , UCLArray [UCLInt 1, UCLInt 2, UCLInt 4])
-- , ("\127749", UCLTime 180s )
-- ]))
--
--
-- This function is not safe to call on untrusted input:
-- configurations can read files, make http requests, do "billion laughs"
-- attacks, and possibly crash the parser.
parseString :: String -> IO (Either String UCL)
-- | Parse a ByteString into a UCL, resolving includes,
-- macros, variables... Note that unicode does not get converted when
-- using fromString. Prefer parseString when working on
-- Strings or literals.
--
--
-- >>> parseByteString $ fromString "{a: [1,2], b: 3min, a: [4]}"
-- Right (UCLMap (fromList
-- [ ("a", UCLArray [UCLInt 1, UCLInt 2, UCLInt 4])
-- , ("b", UCLTime 180s )
-- ]))
--
--
-- This function is not safe to call on untrusted input:
-- configurations can read files, make http requests, do "billion laughs"
-- attacks, and possibly crash the parser.
parseByteString :: ByteString -> IO (Either String UCL)
-- | Parse the contents of a file into a UCL, resolving includes,
-- macros, variables...
--
-- This function is not safe to call on untrusted input:
-- configurations can read files, make http requests, do "billion laughs"
-- attacks, and possibly crash the parser.
parseFile :: FilePath -> IO (Either String UCL)
instance GHC.Classes.Ord Data.UCL.UCL
instance GHC.Classes.Eq Data.UCL.UCL
instance GHC.Show.Show Data.UCL.UCL