Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Documentation
An UCL object
UCLMap (Map Text UCL) | |
UCLArray [UCL] | |
UCLInt Int | |
UCLDouble Double | |
UCLText Text | |
UCLBool Bool | |
UCLTime DiffTime |
parseString :: String -> IO (Either String UCL) Source #
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.
parseByteString :: ByteString -> IO (Either String UCL) Source #
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 String
s 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.
parseFile :: FilePath -> IO (Either String UCL) Source #
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.