@@ -25,6 +25,7 @@ module Data.Aeson.Types.Internal
2525 -- * Core JSON types
2626 Value(..)
2727 , Encoding(..)
28+ , unsafeToEncoding
2829 , Series(..)
2930 , Array
3031 , emptyArray, isEmptyArray
@@ -343,6 +344,13 @@ newtype Encoding = Encoding {
343344 -- ^ Acquire the underlying bytestring builder.
344345 } deriving (Semigroup,Monoid)
345346
347+-- | Make Encoding from Builder.
348+--
349+-- Use with care! You have to make sure that the passed Builder
350+-- is a valid JSON Encoding!
351+unsafeToEncoding :: Builder -> Encoding
352+unsafeToEncoding = Encoding
353+
346354instance Show Encoding where
347355 show (Encoding e) = show (toLazyByteString e)
348356