diff --git a/JSON-Combinator.cabal b/JSON-Combinator.cabal
--- a/JSON-Combinator.cabal
+++ b/JSON-Combinator.cabal
@@ -1,12 +1,20 @@
 Name:               JSON-Combinator
-Version:            0.0.2
+Version:            0.1.0
 License:            BSD3
 License-File:       LICENSE
 Author:             Tony Morris <ʇǝu˙sıɹɹoɯʇ@ןןǝʞsɐɥ>
 Maintainer:         Tony Morris
-Synopsis:           A combinator library on top of Text.JSONb
+Synopsis:           A combinator library on top of a generalised JSON type
 Category:           Combinator
-Description:        A combinator library on top of Text.JSONb 
+Description:
+  A combinator library on top of a generalised JSON type. The highest-level module is
+  @Text.JSON.Combinator@ and it is expected that no other module need to be explicitly imported.
+  .
+  Instances for the combinators are provided for two libraries available on hackage:
+  .
+    * json (@Text.JSON@)
+    .
+    * JSONb (@Text.JSONb@)
 Cabal-version:      >= 1.2
 Build-Type:         Simple
 
@@ -14,19 +22,20 @@
   Description:      Choose the new, split-up base package.
 
 Library
-  Build-Depends:    base < 5 && >= 4,
-                    JSONb,
-                    bytestring,
-                    bytestring-trie,
-                    HUnit,
-                    QuickCheck,
-                    test-framework,
-                    test-framework-hunit,
-                    test-framework-quickcheck2
+  Build-Depends:
+                    base < 5 && >= 4
+                    , JSONb
+                    , json
+                    , bytestring
+                    , bytestring-trie
 
   GHC-Options:      -Wall
-                    -fno-warn-orphans
-                    -fno-warn-type-defaults
-                    -fno-warn-name-shadowing
 
-  Exposed-Modules:  Text.JSONb.Combinator
+  Exposed-Modules:  Text.JSON.Combinator
+                    , Text.JSON.JSONLike
+                    , Text.JSON.JSONField
+                    , Text.JSON.JSONPrepend
+                    , Text.JSON.JSONParse
+                    , Text.JSON.JSONPrint
+                    , Text.JSON.Interact
+                    , Text.JSON.InteractFile
diff --git a/Text/JSON/Combinator.hs b/Text/JSON/Combinator.hs
new file mode 100644
--- /dev/null
+++ b/Text/JSON/Combinator.hs
@@ -0,0 +1,731 @@
+-- | Combinators for JSON data types.
+module Text.JSON.Combinator
+(
+  -- * Transformers
+  jnot
+, withNumber
+, withString
+, withArray
+, withObject
+, withObjectFields
+  -- * Constructors
+, jzero
+, jemptystring
+, jemptyarray
+, jemptyobject
+, jsinglearray
+, jsingleobject
+  -- * Accessors
+, getBool
+, getNumber
+, getString
+, getArray
+, getObject
+  -- * Decisions
+, isBool
+, isTrue
+, isFalse
+, isNumber
+, isString
+, isArray
+, isObject
+  -- * Accessors with default
+, numberOr
+, stringOr
+, arrayOr
+, objectOr
+, fieldsOr
+, valuesOr
+, numberOrZero
+, stringOrEmpty
+, arrayOrEmpty
+, objectOrEmpty
+, objectFieldsOrEmpty
+, objectValuesOrEmpty
+  -- * Combinators
+, usingNumber
+, usingString
+, usingArray
+, usingObject
+, usingObjectFields
+, usingObjectValues
+  -- * Object field accessors
+, hasField
+, (-?)
+, (-|)
+, fieldOr
+, fieldOrNull
+, fieldOrTrue
+, fieldOrFalse
+, fieldOrZero
+, fieldOrEmptyString
+, fieldOrEmptyArray
+, fieldOrEmptyObject
+, hasField'
+, (-??)
+, field'
+, (-||)
+, field'Or
+, field'OrNull
+, field'OrTrue
+, field'OrFalse
+, field'OrZero
+, field'OrEmptyString
+, field'OrEmptyArray
+, field'OrEmptyObject
+  -- * Stdin/stdout interaction
+, interactJSON
+, interactJSON'
+, withJSON
+  -- * File I/O
+, interactJSONFile
+, interactJSONFile'
+, withJSONFile
+  -- * Modules containing additional combinators
+, module Text.JSON.JSONLike
+, module Text.JSON.JSONField
+, module Text.JSON.JSONParse
+, module Text.JSON.JSONPrepend
+, module Text.JSON.JSONPrint
+) where
+
+import Text.JSON.JSONLike
+import Text.JSON.JSONField
+import Text.JSON.JSONParse
+import Text.JSON.JSONPrepend
+import Text.JSON.JSONPrint
+import Text.JSON.Interact
+import Text.JSON.InteractFile
+import Control.Applicative
+import Data.Maybe
+import Data.Monoid
+import qualified Data.Foldable as F
+
+-- | Returns whether or not a JSON is a boolean with the value true.
+isTrue ::
+  JSONLike j s a o f =>
+  j -- ^ The JSON value.
+  -> Bool
+isTrue =
+  foldJSON False True False (const False) (const False) (const False) (const False)
+
+-- | Returns whether or not a JSON is a boolean with the value false.
+isFalse ::
+  JSONLike j s a o f =>
+  j -- ^ The JSON value.
+  -> Bool
+isFalse =
+  foldJSON False False True (const False) (const False) (const False) (const False)
+
+-- | Returns whether or not a JSON is a boolean value.
+isBool ::
+  JSONLike j s a o f =>
+  j -- ^ The JSON value.
+  -> Bool
+isBool =
+  liftA2 (||) isTrue isFalse
+
+-- | Returns whether or not a JSON is a number value.
+isNumber ::
+  JSONLike j s a o f =>
+  j -- ^ The JSON value.
+  -> Bool
+isNumber =
+  foldJSON False False False (const True) (const False) (const False) (const False)
+
+-- | Returns whether or not a JSON is a string value.
+isString ::
+  JSONLike j s a o f =>
+  j -- ^ The JSON value.
+  -> Bool
+isString =
+  foldJSON False False False (const False) (const True) (const False) (const False)
+
+-- | Returns whether or not a JSON is an array value.
+isArray ::
+  JSONLike j s a o f =>
+  j -- ^ The JSON value.
+  -> Bool
+isArray =
+  foldJSON False False False (const False) (const False) (const True) (const False)
+
+-- | Returns whether or not a JSON is an object value.
+isObject ::
+  JSONLike j s a o f =>
+  j -- ^ The JSON value.
+  -> Bool
+isObject =
+  foldJSON False False False (const False) (const False) (const False) (const True)
+
+-- | Inverts the JSON value if it is a boolean.
+jnot ::
+  JSONLike j s a o f =>
+  j -- ^ The JSON value.
+  -> j
+jnot j =
+  if isTrue j
+    then jfalse
+    else
+      if isFalse j
+        then
+          jtrue
+        else
+          j
+
+-- | Runs the given function if the JSON value is a number.
+withNumber ::
+  JSONLike j s a o f =>
+  (Rational -> Rational)
+  -> j -- ^ The JSON value.
+  -> j
+withNumber f j =
+  foldJSON j j j (jnumber . f) (const j) (const j) (const j) j
+
+-- | Runs the given function if the JSON value is a string.
+withString ::
+  JSONLike j s a o f =>
+  (s -> s)
+  -> j -- ^ The JSON value.
+  -> j
+withString f j =
+  foldJSON j j j (const j) (jstring . f) (const j) (const j) j
+
+-- | Runs the given function if the JSON value is an array.
+withArray ::
+  JSONLike j s a o f =>
+  (a j -> a j)
+  -> j -- ^ The JSON value.
+  -> j
+withArray f j =
+  foldJSON j j j (const j) (const j) (jarray . f) (const j) j
+
+-- | Runs the given function if the JSON value is an object.
+withObject ::
+  JSONLike j s a o f =>
+  (o j -> o j)
+  -> j -- ^ The JSON value.
+  -> j
+withObject f j =
+  foldJSON j j j (const j) (const j) (const j) (jobject . f) j
+
+-- | Runs the given function on the fields if the JSON value is an object.
+withObjectFields ::
+  (Functor o, JSONLike j s a o f) =>
+  (j -> j)
+  -> j -- ^ The JSON value.
+  -> j
+withObjectFields f =
+  withObject (fmap f)
+
+-- | Returns the potential boolean value of a JSON value.
+getBool ::
+  JSONLike j s a o f =>
+  j -- ^ The JSON value.
+  -> Maybe Bool
+getBool =
+  foldJSON Nothing (Just True) (Just False) (const Nothing) (const Nothing) (const Nothing) (const Nothing)
+
+-- | Returns the potential number value of a JSON value.
+getNumber ::
+  JSONLike j s a o f =>
+  j -- ^ The JSON value.
+  -> Maybe Rational
+getNumber =
+  foldJSON Nothing Nothing Nothing Just (const Nothing) (const Nothing) (const Nothing)
+
+-- | Returns the potential string value of a JSON value.
+getString ::
+  JSONLike j s a o f =>
+  j -- ^ The JSON value.
+  -> Maybe s
+getString =
+  foldJSON Nothing Nothing Nothing (const Nothing) Just (const Nothing) (const Nothing)
+
+-- | Returns the potential array value of a JSON value.
+getArray ::
+  JSONLike j s a o f =>
+  j -- ^ The JSON value.
+  -> Maybe (a j)
+getArray =
+  foldJSON Nothing Nothing Nothing (const Nothing) (const Nothing) Just (const Nothing)
+
+-- | Returns the potential object value of a JSON value.
+getObject ::
+  JSONLike j s a o f =>
+  j -- ^ The JSON value.
+  -> Maybe (o j)
+getObject =
+  foldJSON Nothing Nothing Nothing (const Nothing) (const Nothing) (const Nothing) Just
+
+-- | Returns a number value from a JSON value or if it is not a number, returns the given default.
+numberOr ::
+  JSONLike j s a o f =>
+  Rational
+  -> j -- ^ The JSON value.
+  -> Rational
+numberOr x =
+  fromMaybe x . getNumber
+
+-- | Returns a string value from a JSON value or if it is not a string, returns the given default.
+stringOr ::
+  JSONLike j s a o f =>
+  s
+  -> j -- ^ The JSON value.
+  -> s
+stringOr x =
+  fromMaybe x . getString
+
+-- | Returns a rational value from a JSON value or if it is not a rational, returns the given default.
+arrayOr ::
+  JSONLike j s a o f =>
+  a j
+  -> j -- ^ The JSON value.
+  -> a j
+arrayOr x =
+  fromMaybe x . getArray
+
+-- | Returns an object value from a JSON value or if it is not an object, returns the given default.
+objectOr ::
+  JSONLike j s a o f =>
+  o j
+  -> j -- ^ The JSON value.
+  -> o j
+objectOr x =
+  fromMaybe x . getObject
+
+-- | Returns an object's fields from a JSON value or if it is not an object, returns the given default.
+fieldsOr ::
+  JSONField j f =>
+  [f]
+  -> j -- ^ The JSON value.
+  -> [f]
+fieldsOr x =
+  fromMaybe x . fields
+
+-- | Returns an object's values from a JSON value or if it is not an object, returns the given default.
+valuesOr ::
+  JSONField j f =>
+  [j]
+  -> j -- ^ The JSON value.
+  -> [j]
+valuesOr x =
+  fromMaybe x . values
+
+-- | Runs a function on the number of a JSON value or if it is not a number, returns the given default.
+usingNumber ::
+  JSONLike j s a o f =>
+  x
+  -> (Rational -> x)
+  -> j -- ^ The JSON value.
+  -> x
+usingNumber a f =
+  maybe a f . getNumber
+
+-- | Runs a function on the string of a JSON value or if it is not a string, returns the given default.
+usingString ::
+  JSONLike j s a o f =>
+  x
+  -> (s -> x)
+  -> j -- ^ The JSON value.
+  -> x
+usingString a f =
+  maybe a f . getString
+
+-- | Runs a function on the array of a JSON value or if it is not an array, returns the given default.
+usingArray ::
+  JSONLike j s a o f =>
+  x
+  -> (a j -> x)
+  -> j -- ^ The JSON value.
+  -> x
+usingArray a f =
+  maybe a f . getArray
+
+-- | Runs a function on the object of a JSON value or if it is not an object, returns the given default.
+usingObject ::
+  JSONLike j s a o f =>
+  x
+  -> (o j -> x)
+  -> j -- ^ The JSON value.
+  -> x
+usingObject a f =
+  maybe a f . getObject
+
+-- | Runs a function on the fields of an object of a JSON value or if it is not an object, returns the given default.
+usingObjectFields ::
+  JSONField j f =>
+  a
+  -> ([f] -> a)
+  -> j -- ^ The JSON value.
+  -> a
+usingObjectFields a f =
+  maybe a f . fields
+
+-- | Runs a function on the values of an object of a JSON value or if it is not an object, returns the given default.
+usingObjectValues ::
+  JSONField j f =>
+  a
+  -> ([j] -> a)
+  -> j -- ^ The JSON value.
+  -> a
+usingObjectValues a f =
+  maybe a f . values
+
+-- | The JSON value zero.
+jzero ::
+  JSONLike j s a o f =>
+  j
+jzero =
+  jnumber 0
+
+-- | The JSON value empty string.
+jemptystring ::
+  (Monoid s, JSONLike j s a o f) =>
+  j
+jemptystring =
+  jstring mempty
+
+-- | The JSON value empty array.
+jemptyarray ::
+  (Monoid (a j), JSONLike j s a o f) =>
+  j
+jemptyarray =
+  jarray mempty
+
+-- | The JSON value empty object.
+jemptyobject ::
+  (Monoid (o j), JSONLike j s a o f) =>
+  j
+jemptyobject =
+  jobject mempty
+
+-- | Puts a single value into a JSON array.
+jsinglearray ::
+  (Applicative a, JSONLike j s a o f) =>
+  j
+  -> j
+jsinglearray =
+  jarray . pure
+
+-- | Puts a single value into a JSON object.
+jsingleobject ::
+  (Applicative o, JSONLike j s a o f) =>
+  j
+  -> j
+jsingleobject =
+  jobject . pure
+
+-- | Returns the possible value associated with the given field if this is an object. An alias for 'field'.
+(-|) ::
+  JSONField j s =>
+  s
+  -> j -- ^ The JSON value.
+  -> Maybe j
+(-|) =
+  field
+
+-- | Returns a number value from a JSON value or if it is not a number, returns zero.
+numberOrZero ::
+  JSONLike j s a o f =>
+  j -- ^ The JSON value.
+  -> Rational
+numberOrZero =
+  numberOr 0
+
+-- | Returns a string value from a JSON value or if it is not a string, returns an empty string.
+stringOrEmpty ::
+  (JSONLike j s a o f, Monoid s) =>
+  j -- ^ The JSON value.
+  -> s
+stringOrEmpty =
+  stringOr mempty
+
+-- | Returns an array value from a JSON value or if it is not an array, returns an empty array.
+arrayOrEmpty ::
+  (JSONLike j s a o f, Monoid (a j)) =>
+  j -- ^ The JSON value.
+  -> a j
+arrayOrEmpty =
+  arrayOr mempty
+
+-- | Returns an object value from a JSON value or if it is not an object, returns an empty object.
+objectOrEmpty ::
+  (JSONLike j s a o f, Monoid (o j)) =>
+  j -- ^ The JSON value.
+  -> o j
+objectOrEmpty =
+  objectOr mempty
+
+-- | Returns an object's fields from a JSON value or if it is not an object, returns no fields.
+objectFieldsOrEmpty ::
+  (JSONField j f, Monoid (o j)) =>
+  j -- ^ The JSON value.
+  -> [f]
+objectFieldsOrEmpty =
+  fieldsOr []
+
+-- | Returns an object's values from a JSON value or if it is not an object, returns no values.
+objectValuesOrEmpty ::
+  (JSONField j f, Monoid (o j)) =>
+  j -- ^ The JSON value.
+  -> [j]
+objectValuesOrEmpty =
+  valuesOr []
+
+-- | Whether or not a JSON value is an object with the given field.
+hasField ::
+  JSONField j f =>
+  f
+  -> j -- ^ The JSON value.
+  -> Bool
+hasField s =
+  isJust . field s
+
+-- | Whether or not a JSON value is an object with the given field. An alias for 'hasField'.
+(-?) ::
+  JSONField j f =>
+  f
+  -> j -- ^ The JSON value.
+  -> Bool
+(-?) =
+  hasField
+
+-- | Returns the value associated with the given field or if this is not an object or has no associated value, return the given default.
+fieldOr ::
+  JSONField j f =>
+  f
+  -> j -- ^ The default.
+  -> j -- ^ The JSON value.
+  -> j
+fieldOr s =
+  flip fromMaybe . field s
+
+-- | Returns the value associated with the given field or if this is not an object or has no associated value, return a JSON null.
+fieldOrNull ::
+  (JSONLike j s a o f, JSONField j f) =>
+  f
+  -> j -- ^ The JSON value.
+  -> j
+fieldOrNull s j =
+  fieldOr s j jnull
+
+-- | Returns the value associated with the given field or if this is not an object or has no associated value, return a JSON true.
+fieldOrTrue ::
+  (JSONLike j s a o f, JSONField j f) =>
+  f
+  -> j -- ^ The JSON value.
+  -> j
+fieldOrTrue s j =
+  fieldOr s j jtrue
+
+-- | Returns the value associated with the given field or if this is not an object or has no associated value, return a JSON false.
+fieldOrFalse ::
+  (JSONLike j s a o f, JSONField j f) =>
+  f
+  -> j -- ^ The JSON value.
+  -> j
+fieldOrFalse s j =
+  fieldOr s j jfalse
+
+-- | Returns the value associated with the given field or if this is not an object or has no associated value, return a JSON zero.
+fieldOrZero ::
+  (JSONLike j s a o f, JSONField j f) =>
+  f
+  -> j -- ^ The JSON value.
+  -> j
+fieldOrZero s j =
+  fieldOr s j jzero
+
+-- | Returns the value associated with the given field or if this is not an object or has no associated value, return a JSON string that is empty.
+fieldOrEmptyString ::
+  (JSONLike j s a o f, JSONField j f, Monoid s) =>
+  f
+  -> j -- ^ The JSON value.
+  -> j
+fieldOrEmptyString s j =
+  fieldOr s j jemptystring
+
+-- | Returns the value associated with the given field or if this is not an object or has no associated value, return a JSON array that is empty.
+fieldOrEmptyArray ::
+  (JSONLike j s a o f, JSONField j f, Monoid (a j)) =>
+  f
+  -> j -- ^ The JSON value.
+  -> j
+fieldOrEmptyArray s j =
+  fieldOr s j jemptyarray
+
+-- | Returns the value associated with the given field or if this is not an object or has no associated value, return a JSON object that is empty.
+fieldOrEmptyObject ::
+  (JSONLike j s a o f, JSONField j f, Monoid (o j)) =>
+  f
+  -> j -- ^ The JSON value.
+  -> j
+fieldOrEmptyObject s j =
+  fieldOr s j jemptyobject
+
+-- | Traverses down JSON objects with the association fields and returns the potential value.
+field' ::
+  (JSONField j f, F.Foldable t) =>
+  t f
+  -> j -- ^ The JSON value.
+  -> Maybe j
+field' =
+  flip (F.foldrM field)
+
+-- | Traverses down JSON objects with the association fields and returns the potential value. An alias for 'field''.
+(-||) ::
+  (JSONField j f, F.Foldable t) =>
+  t f
+  -> j -- ^ The JSON value.
+  -> Maybe j
+(-||) =
+  field'
+
+-- | Traverses down JSON objects with the association fields and returns true if the association graph exists.
+hasField' ::
+  (JSONField j f, F.Foldable t) =>
+  t f
+  -> j -- ^ The JSON value.
+  -> Bool
+hasField' s =
+  isJust . field' s
+
+-- | Traverses down JSON objects with the association fields and returns true if the association graph exists. An alias for 'hasField''.
+(-??) ::
+  (JSONField j f, F.Foldable t) =>
+  t f
+  -> j -- ^ The JSON value.
+  -> Bool
+(-??) =
+  hasField'
+
+-- | Traverses down JSON objects with the association fields and returns the potential value or the given default.
+field'Or ::
+  (JSONField j f, F.Foldable t) =>
+  j -- ^ The default.
+  -> t f
+  -> j -- ^ The JSON value.
+  -> j
+field'Or d s =
+  fromMaybe d . field' s
+
+-- | Traverses down JSON objects with the association fields and returns the potential value or a JSON null.
+field'OrNull ::
+  (JSONLike j s a o f, JSONField j f, F.Foldable t) =>
+  t f
+  -> j -- ^ The JSON value.
+  -> j
+field'OrNull =
+  field'Or jnull
+
+-- | Traverses down JSON objects with the association fields and returns the potential value or a JSON true.
+field'OrTrue ::
+  (JSONLike j s a o f, JSONField j f, F.Foldable t) =>
+  t f
+  -> j -- ^ The JSON value.
+  -> j
+field'OrTrue =
+  field'Or jtrue
+
+-- | Traverses down JSON objects with the association fields and returns the potential value or a JSON false.
+field'OrFalse ::
+  (JSONLike j s a o f, JSONField j f, F.Foldable t) =>
+  t f
+  -> j -- ^ The JSON value.
+  -> j
+field'OrFalse =
+  field'Or jfalse
+
+-- | Traverses down JSON objects with the association fields and returns the potential value or a JSON zero.
+field'OrZero ::
+  (JSONLike j s a o f, JSONField j f, F.Foldable t) =>
+  t f
+  -> j -- ^ The JSON value.
+  -> j
+field'OrZero =
+  field'Or jzero
+
+-- | Traverses down JSON objects with the association fields and returns the potential value or a JSON empty string.
+field'OrEmptyString ::
+  (JSONLike j s a o f, JSONField j f, F.Foldable t, Monoid s) =>
+  t f
+  -> j -- ^ The JSON value.
+  -> j
+field'OrEmptyString =
+  field'Or jemptystring
+
+-- | Traverses down JSON objects with the association fields and returns the potential value or a JSON empty array.
+field'OrEmptyArray ::
+  (JSONLike j s a o f, JSONField j f, F.Foldable t, Monoid (a j)) =>
+  t f
+  -> j -- ^ The JSON value.
+  -> j
+field'OrEmptyArray =
+  field'Or jemptyarray
+
+-- | Traverses down JSON objects with the association fields and returns the potential value or a JSON empty object.
+field'OrEmptyObject ::
+  (JSONLike j s a o f, JSONField j f, F.Foldable t, Monoid (o j)) =>
+  t f
+  -> j -- ^ The JSON value.
+  -> j
+field'OrEmptyObject =
+  field'Or jemptyobject
+
+-- | Interacts by parsing the standard input for JSON, passing the result to the given function, then printing the result to standard output.
+interactJSON ::
+  (JSONPrint j' s, JSONParse j s e, Interact s) =>
+  (Either e j -> j')
+  -> IO ()
+interactJSON f =
+  interact' (printJSON . f . parseJSON "stdin")
+
+-- | Interacts by parsing the standard input for JSON, passing a failed result with a string error message to the given function, or a successful result to the given function, then printing the result to standard output.
+interactJSON' ::
+  (JSONPrint j' s, JSONParse j s e, Interact s) =>
+  (e -> j')
+  -> (j -> j')
+  -> IO ()
+interactJSON' l =
+  interactJSON . either l
+
+-- | Interacts by parsing the standard input for JSON, executing the given function for a failed result with a string error message, or printing a successful result to the given function and passing the result to standard output.
+withJSON ::
+ (Interact p, Interact s, JSONPrint j' s, JSONParse j p e) =>
+  (e -> IO ())
+  -> (j -> j')
+  -> IO ()
+withJSON f g =
+  getContents' >>= either f (putStr' . printJSON . g) . parseJSON "stdin"
+
+-- | Interacts by parsing the given file for JSON, passing the result to the given function, then writing the result to the given file.
+interactJSONFile ::
+  (InteractFile p, InteractFile s, JSONPrint j' s, JSONParse j p e) =>
+  (Either e j -> j')
+  -> FilePath
+  -> FilePath
+  -> IO ()
+interactJSONFile f i o =
+  readFile' i >>= writeFile' o . (printJSON . f) . parseJSON ""
+
+-- | Interacts by parsing the given file for JSON, passing a failed result with a string error message to the given function, or a successful result to the given function, then writing the result to the given file.
+interactJSONFile' ::
+  (InteractFile p, InteractFile s, JSONPrint j' s, JSONParse j p e) =>
+  (e -> j')
+  -> (j -> j')
+  -> FilePath
+  -> FilePath
+  -> IO ()
+interactJSONFile' l =
+  interactJSONFile . either l
+
+-- | Interacts by parsing the given file for JSON, executing the given function for a failed result with a string error message, or printing a successful result to the given function and writing the result to the given file.
+withJSONFile ::
+  (InteractFile p, InteractFile s, JSONPrint j' s, JSONParse j p e) =>
+  (e -> IO ())
+  -> (j -> j')
+  -> FilePath
+  -> FilePath
+  -> IO ()
+withJSONFile f g i o =
+  readFile' i >>= either f (writeFile' o . printJSON . g) . parseJSON i
diff --git a/Text/JSON/Interact.hs b/Text/JSON/Interact.hs
new file mode 100644
--- /dev/null
+++ b/Text/JSON/Interact.hs
@@ -0,0 +1,35 @@
+{-# LANGUAGE FlexibleInstances #-}
+
+-- | A generalisation on functions to interact with standard input and standard output.
+module Text.JSON.Interact
+(
+  Interact(..)
+) where
+
+import Data.ByteString
+import qualified Data.ByteString as S
+
+class Interact z where
+  getContents' ::
+    IO z
+  putStr' ::
+    z -> IO ()
+
+  interact' ::
+    (z -> z)
+    -> IO ()
+  interact' t =
+    putStr' . t =<< getContents'
+
+instance Interact [Char] where
+  getContents' =
+    Prelude.getContents
+  putStr' =
+    Prelude.putStr
+
+instance Interact ByteString where
+  getContents' =
+    S.getContents
+  putStr' =
+    S.putStr
+
diff --git a/Text/JSON/InteractFile.hs b/Text/JSON/InteractFile.hs
new file mode 100644
--- /dev/null
+++ b/Text/JSON/InteractFile.hs
@@ -0,0 +1,32 @@
+{-# LANGUAGE FlexibleInstances #-}
+
+-- | A generalisation on functions to read and write files.
+module Text.JSON.InteractFile
+(
+  InteractFile(..)
+) where
+
+import Data.ByteString
+import qualified Data.ByteString as S
+
+class InteractFile z where
+  readFile' ::
+    FilePath
+    -> IO z
+  writeFile' ::
+    FilePath
+    -> z
+    -> IO ()
+
+instance InteractFile [Char] where
+  readFile' =
+    Prelude.readFile
+  writeFile' =
+    Prelude.writeFile
+
+instance InteractFile ByteString where
+  readFile' =
+    S.readFile
+  writeFile' =
+    S.writeFile
+
diff --git a/Text/JSON/JSONField.hs b/Text/JSON/JSONField.hs
new file mode 100644
--- /dev/null
+++ b/Text/JSON/JSONField.hs
@@ -0,0 +1,54 @@
+{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, FunctionalDependencies #-}
+
+-- | The base functions for accessing JSON object fields.
+module Text.JSON.JSONField
+(
+  JSONField(..)
+) where
+
+import Data.ByteString
+import qualified Data.Trie as T
+import Text.JSONb
+import qualified Text.JSON as J
+import Text.JSON.Types
+
+class JSONField j f | j -> f where
+  field ::
+    f
+    -> j
+    -> Maybe j
+  fields ::
+    j
+    -> Maybe [f]
+  -- | Returns the potential object field values of a JSON value.
+  values ::
+    j
+    -> Maybe [j]
+
+instance JSONField JSON ByteString where
+  field f (Object o) =
+    T.lookup f o
+  field _ _ =
+    Nothing
+  fields (Object o) =
+    Just (T.keys o)
+  fields _ =
+    Nothing
+  values (Object o) =
+    Just . fmap snd . T.toList $ o
+  values _ =
+    Nothing
+
+instance JSONField J.JSValue [Char] where
+  field f (J.JSObject (JSONObject o)) =
+    lookup f o
+  field _ _ =
+    Nothing
+  fields (J.JSObject (JSONObject o)) =
+    Just (fmap fst o)
+  fields _ =
+    Nothing
+  values (J.JSObject (JSONObject o)) =
+    Just (fmap snd o)
+  values _ =
+    Nothing
diff --git a/Text/JSON/JSONLike.hs b/Text/JSON/JSONLike.hs
new file mode 100644
--- /dev/null
+++ b/Text/JSON/JSONLike.hs
@@ -0,0 +1,108 @@
+{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, FunctionalDependencies #-}
+
+-- | The generalisation of a JSON object.
+module Text.JSON.JSONLike
+(
+  JSONLike(..)
+) where
+
+import Data.ByteString
+import qualified Data.Trie as T
+import Text.JSONb
+import qualified Text.JSON as J
+import Text.JSON.Types
+
+-- | The generalisation of a JSON object.
+class JSONLike j s a o f | j -> s, j -> a, j -> o, o -> f where
+  -- | Deconstructs a JSON object.
+  foldJSON ::
+    x -- ^ If a JSON null value.
+    -> x -- ^ If a JSON true value.
+    -> x -- ^ If a JSON false value.
+    -> (Rational -> x) -- ^ If a JSON number value.
+    -> (s -> x) -- ^ If a JSON string value.
+    -> (a j -> x) -- ^ If a JSON array value.
+    -> (o j -> x) -- ^ If a JSON object value.
+    -> j
+    -> x
+  -- | Constructs a JSON null value.
+  jnull ::
+    j
+  -- | Constructs a JSON true value.
+  jtrue ::
+    j
+  -- | Constructs a JSON false value.
+  jfalse ::
+    j
+  -- | Constructs a JSON number value from the given rational.
+  jnumber ::
+    Rational
+    -> j
+  -- | Constructs a JSON string value from the given string.
+  jstring ::
+    s
+    -> j
+  -- | Constructs a JSON array value from the given array.
+  jarray ::
+    a j
+    -> j
+  -- | Constructs a JSON object value from the given object.
+  jobject ::
+    o j
+    -> j
+
+instance JSONLike JSON ByteString [] T.Trie ByteString where
+  foldJSON n _ _ _ _ _ _ Null =
+    n
+  foldJSON _ t f _ _ _ _ (Boolean b) =
+    if b then t else f
+  foldJSON _ _ _ r _ _ _ (Number r') =
+    r r'
+  foldJSON _ _ _ _ s _ _ (String s') =
+    s s'
+  foldJSON _ _ _ _ _ a _ (Array a') =
+    a a'
+  foldJSON _ _ _ _ _ _ o (Object o') =
+    o o'
+  jnull =
+    Null
+  jtrue =
+    Boolean True
+  jfalse =
+    Boolean False
+  jnumber =
+    Number
+  jstring =
+    String
+  jarray =
+    Array
+  jobject =
+    Object
+
+instance JSONLike J.JSValue [Char] [] J.JSObject [Char] where
+  foldJSON n _ _ _ _ _ _ J.JSNull =
+    n
+  foldJSON _ t f _ _ _ _ (J.JSBool b) =
+    if b then t else f
+  foldJSON _ _ _ r _ _ _ (J.JSRational _ r') =
+    r r'
+  foldJSON _ _ _ _ s _ _ (J.JSString (JSONString s')) =
+    s s'
+  foldJSON _ _ _ _ _ a _ (J.JSArray a') =
+    a a'
+  foldJSON _ _ _ _ _ _ o (J.JSObject o') =
+    o o'
+  jnull =
+    J.JSNull
+  jtrue =
+    J.JSBool True
+  jfalse =
+    J.JSBool False
+  jnumber =
+    J.JSRational False
+  jstring =
+    J.JSString . JSONString
+  jarray =
+    J.JSArray
+  jobject =
+    J.JSObject
diff --git a/Text/JSON/JSONParse.hs b/Text/JSON/JSONParse.hs
new file mode 100644
--- /dev/null
+++ b/Text/JSON/JSONParse.hs
@@ -0,0 +1,38 @@
+{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, FunctionalDependencies #-}
+
+-- | Parsing JSON object values.
+module Text.JSON.JSONParse
+(
+  JSONParse(..)
+, parseJSON'
+) where
+
+import Data.ByteString
+import Text.JSONb
+import qualified Text.JSON as J
+import Text.JSON.Parsec
+
+-- | Parsing JSON object values.
+class JSONParse j p e | j -> p, j -> e where
+  -- | Parses a value into either an error or a JSON object.
+  parseJSON ::
+    String -- ^ Source name.
+    -> p -- ^ The value to parse.
+    -> Either e j -- ^ Either error or a JSON object.
+
+instance JSONParse JSON ByteString [Char] where
+  parseJSON =
+    const decode
+
+instance JSONParse J.JSValue [Char] ParseError where
+  parseJSON =
+    parse p_jvalue
+
+-- | Parse a value with an empty source name.
+parseJSON' ::
+  JSONParse j p e =>
+  p -- ^ The value to parse.
+  -> Either e j -- ^ Either error or a JSON object.
+parseJSON' =
+  parseJSON []
+
diff --git a/Text/JSON/JSONPrepend.hs b/Text/JSON/JSONPrepend.hs
new file mode 100644
--- /dev/null
+++ b/Text/JSON/JSONPrepend.hs
@@ -0,0 +1,38 @@
+{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, FunctionalDependencies #-}
+
+-- | Prepending values to existing JSON association values.
+module Text.JSON.JSONPrepend
+(
+  JSONPrepend(..)
+) where
+
+import Data.ByteString
+import qualified Data.Trie as T
+import Text.JSONb
+import qualified Text.JSON as J
+import Text.JSON.Types
+
+-- | Prepending values to existing JSON association values.
+class JSONPrepend j s | j -> s where
+  -- | Prepends the given association if the JSON is an object.
+  (->:) ::
+    (s, j) -- ^ The value to prepend if the JSON value is an object.
+    -> j -- ^ The JSON value to prepend to.
+    -> j
+  -- | Prepends the given value if the JSON is an array.
+  (-->>:) ::
+    j -- ^ The value to prepend if the JSON value is an array..
+    -> j -- ^ The JSON value to prepend to.
+    -> j
+
+instance JSONPrepend JSON ByteString where
+  (k, v) ->: Object x = Object (T.insert k v x)
+  _      ->: x        = x
+  k -->>: Array x = Array (k : x)
+  _ -->>: x       = x
+
+instance JSONPrepend J.JSValue [Char] where
+  k ->: (J.JSObject (JSONObject x)) = (J.JSObject (JSONObject (k:x)))
+  _ ->: x        = x
+  k -->>: J.JSArray x = J.JSArray (k : x)
+  _ -->>: x       = x
diff --git a/Text/JSON/JSONPrint.hs b/Text/JSON/JSONPrint.hs
new file mode 100644
--- /dev/null
+++ b/Text/JSON/JSONPrint.hs
@@ -0,0 +1,28 @@
+{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, FunctionalDependencies #-}
+
+-- | Pretty-printing JSON values.
+module Text.JSON.JSONPrint
+(
+  JSONPrint(..)
+) where
+
+import Data.ByteString
+import Text.JSONb
+import qualified Text.JSON as J
+import Text.JSON.Pretty
+
+-- | Pretty-printing JSON values.
+class JSONPrint j s | j -> s where
+  -- | Print the given JSON value to a pretty-printed value.
+  printJSON ::
+    j -- ^ The JSON value.
+    -> s -- ^ The pretty-printed result.
+
+instance JSONPrint JSON ByteString where
+  printJSON =
+    encode Compact
+
+instance JSONPrint J.JSValue [Char] where
+  printJSON =
+    render . pp_value
+
diff --git a/Text/JSONb/Combinator.hs b/Text/JSONb/Combinator.hs
deleted file mode 100644
--- a/Text/JSONb/Combinator.hs
+++ /dev/null
@@ -1,639 +0,0 @@
--- | Combinators for Text.JSONb data types. <http://hackage.haskell.org/package/JSONb>
-module Text.JSONb.Combinator where
-
-
-import Data.Maybe
-import Control.Arrow
-import Text.JSONb
-import Data.ByteString
-import qualified Data.ByteString as S
-import Data.Trie
-import qualified Data.Trie as T
-import qualified Data.Foldable as F
-
--- | The type of JSON arrays.
-type JArray = [JSON]
-
--- | The type of JSON objects.
-type JObject = Trie JSON
-
--- | Inverts the JSON value if it is a boolean.
-jNot ::
-  JSON
-  -> JSON
-jNot (Boolean x) = Boolean (not x)
-jNot j           = j
-
--- | Runs the given function if the JSON value is a number.
-withNumber ::
-  (Rational -> Rational)
-  -> JSON
-  -> JSON
-withNumber f (Number r) = Number (f r)
-withNumber _ j          = j
-
--- | Runs the given function if the JSON value is a string.
-withString ::
-  (ByteString -> ByteString)
-  -> JSON
-  -> JSON
-withString f (String x) = String (f x)
-withString _ j          = j
-
--- | Runs the given function if the JSON value is an array.
-withArray ::
-  (JArray -> JArray)
-  -> JSON
-  -> JSON
-withArray f (Array x) = Array (f x)
-withArray _ j          = j
-
--- | Runs the given function if the JSON value is an object.
-withObject ::
-  (JObject -> JObject)
-  -> JSON
-  -> JSON
-withObject f (Object x) = Object (f x)
-withObject _ j          = j
-
--- | Runs the given function on the fields if the JSON value is an object.
-withObjectFields ::
-  (ByteString -> ByteString)
-  -> JSON
-  -> JSON
-withObjectFields f =
-  withObject (fromList . fmap (first f) . toList)
-
--- | Runs the given function on the field values if the JSON value is an object.
-withObjectValues ::
-  (JSON -> JSON)
-  -> JSON
-  -> JSON
-withObjectValues f =
-  withObject (fromList . fmap (second f) . toList)
-
--- | Prepends the given association if the JSON is an object.
-(->:) ::
-  (ByteString, JSON)
-  -> JSON
-  -> JSON
-(k, v) ->: Object x = Object (insert k v x)
-_      ->: x        = x
-
--- | Prepends the given value if the JSON is an array.
-(-->>:) ::
-  JSON
-  -> JSON
-  -> JSON
-k -->>: Array x = Array (k : x)
-_ -->>: x       = x
-
--- | A JSON number with the value zero.
-jZero ::
-  JSON
-jZero =
-  Number 0
-
--- | A JSON string with a value of empty.
-jEmptyString ::
-  JSON
-jEmptyString =
-  String S.empty
-
--- | A JSON array with a value of empty.
-jEmptyArray ::
-  JSON
-jEmptyArray =
-  Array []
-
--- | A JSON object with a value of empty.
-jEmptyObject ::
-  JSON
-jEmptyObject =
-  Object T.empty
-
--- | A JSON boolean with a value of true.
-jTrue ::
-  JSON
-jTrue =
-  Boolean True
-
--- | A JSON boolean with a value of false.
-jFalse ::
-  JSON
-jFalse =
-  Boolean False
-
--- | Returns a JSON array value with the given single value.
-jSingleArray ::
-  JSON
-  -> JSON
-jSingleArray x =
-  Array [x]
-
--- | Returns a JSON object value with the given single association value.
-jSingleObject ::
-  ByteString
-  -> JSON
-  -> JSON
-jSingleObject k v =
-  Object (T.singleton k v)
-
--- | Returns the potential boolean value of a JSON value.
-getBool ::
-  JSON
-  -> Maybe Bool
-getBool (Boolean x) = Just x
-getBool _           = Nothing
-
--- | Returns the potential number value of a JSON value.
-getNumber ::
-  JSON
-  -> Maybe Rational
-getNumber (Number x) = Just x
-getNumber _          = Nothing
-
--- | Returns the potential string value of a JSON value.
-getString ::
-  JSON
-  -> Maybe ByteString
-getString (String x) = Just x
-getString _          = Nothing
-
--- | Returns the potential array value of a JSON value.
-getArray ::
-  JSON
-  -> Maybe [JSON]
-getArray (Array x) = Just x
-getArray _         = Nothing
-
--- | Returns the potential object value of a JSON value.
-getObject ::
-  JSON
-  -> Maybe (Trie JSON)
-getObject (Object x) = Just x
-getObject _          = Nothing
-
--- | Returns the potential object fields of a JSON value.
-getObjectFields ::
-  JSON
-  -> Maybe [ByteString]
-getObjectFields =
-  fmap keys . getObject
-
--- | Returns the potential object field values of a JSON value.
-getObjectValues ::
-  JSON
-  -> Maybe [JSON]
-getObjectValues =
-  fmap (fmap snd . toList) . getObject
-
--- | Returns whether or not a JSON is a boolean value.
-isBool ::
-  JSON
-  -> Bool
-isBool =
-  isJust . getBool
-
--- | Returns whether or not a JSON is a boolean with the value true.
-isTrue ::
-  JSON
-  -> Bool
-isTrue =
-  F.or . getBool
-
--- | Returns whether or not a JSON is a boolean with the value false.
-isFalse ::
-  JSON
-  -> Bool
-isFalse =
-  not . F.and . getBool
-
--- | Returns whether or not a JSON is a number value.
-isNumber ::
-  JSON
-  -> Bool
-isNumber =
-  isJust . getNumber
-
--- | Returns whether or not a JSON is a string value.
-isString ::
-  JSON
-  -> Bool
-isString =
-  isJust . getString
-
--- | Returns whether or not a JSON is an array value.
-isArray ::
-  JSON
-  -> Bool
-isArray =
-  isJust . getArray
-
--- | Returns whether or not a JSON is an object value.
-isObject ::
-  JSON
-  -> Bool
-isObject =
-  isJust . getObject
-
--- | Returns a number value from a JSON value or if it is not a number, returns the given default.
-numberOr ::
-  Rational
-  -> JSON
-  -> Rational
-numberOr x =
-  fromMaybe x . getNumber
-
--- | Returns a string value from a JSON value or if it is not a string, returns the given default.
-stringOr ::
-  ByteString
-  -> JSON
-  -> ByteString
-stringOr x =
-  fromMaybe x . getString
-
--- | Returns a rational value from a JSON value or if it is not a rational, returns the given default.
-arrayOr ::
-  JArray
-  -> JSON
-  -> JArray
-arrayOr x =
-  fromMaybe x . getArray
-
--- | Returns an object value from a JSON value or if it is not an object, returns the given default.
-objectOr ::
-  Trie JSON
-  -> JSON
-  -> Trie JSON
-objectOr x =
-  fromMaybe x . getObject
-
--- | Returns an object's fields from a JSON value or if it is not an object, returns the given default.
-objectFieldsOr ::
-  [ByteString]
-  -> JSON
-  -> [ByteString]
-objectFieldsOr x =
-  fromMaybe x . getObjectFields
-
--- | Returns an object's values from a JSON value or if it is not an object, returns the given default.
-objectValuesOr ::
-  [JSON]
-  -> JSON
-  -> [JSON]
-objectValuesOr x =
-  fromMaybe x . getObjectValues
-
--- | Returns a number value from a JSON value or if it is not a number, returns zero.
-numberOrZero ::
-  JSON
-  -> Rational
-numberOrZero =
-  numberOr 0
-
--- | Returns a string value from a JSON value or if it is not a string, returns an empty string.
-stringOrEmpty ::
-  JSON
-  -> ByteString
-stringOrEmpty =
-  stringOr S.empty
-
--- | Returns an array value from a JSON value or if it is not an array, returns an empty array.
-arrayOrEmpty ::
-  JSON
-  -> JArray
-arrayOrEmpty =
-  arrayOr []
-
--- | Returns an object value from a JSON value or if it is not an object, returns an empty object.
-objectOrEmpty ::
-  JSON
-  -> Trie JSON
-objectOrEmpty =
-  objectOr T.empty
-
--- | Returns an object's fields from a JSON value or if it is not an object, returns no fields.
-objectFieldsOrEmpty ::
-  JSON
-  -> [ByteString]
-objectFieldsOrEmpty =
-  objectFieldsOr []
-
--- | Returns an object's values from a JSON value or if it is not an object, returns no values.
-objectValuesOrEmpty ::
-  JSON
-  -> [JSON]
-objectValuesOrEmpty =
-  objectValuesOr []
-
--- | Runs a function on the number of a JSON value or if it is not a number, returns the given default.
-usingNumber ::
-  a
-  -> (Rational -> a)
-  -> JSON
-  -> a
-usingNumber a f =
-  maybe a f . getNumber
-
--- | Runs a function on the string of a JSON value or if it is not a string, returns the given default.
-usingString ::
-  a
-  -> (ByteString -> a)
-  -> JSON
-  -> a
-usingString a f =
-  maybe a f . getString
-
--- | Runs a function on the array of a JSON value or if it is not an array, returns the given default.
-usingArray ::
-  a
-  -> ([JSON] -> a)
-  -> JSON
-  -> a
-usingArray a f =
-  maybe a f . getArray
-
--- | Runs a function on the object of a JSON value or if it is not an object, returns the given default.
-usingObject ::
-  a
-  -> (Trie JSON -> a)
-  -> JSON
-  -> a
-usingObject a f =
-  maybe a f . getObject
-
--- | Runs a function on the fields of an object of a JSON value or if it is not an object, returns the given default.
-usingObjectFields ::
-  a
-  -> ([ByteString] -> a)
-  -> JSON
-  -> a
-usingObjectFields a f =
-  maybe a f . getObjectFields
-
--- | Runs a function on the values of an object of a JSON value or if it is not an object, returns the given default.
-usingObjectValues ::
-  a
-  -> ([JSON] -> a)
-  -> JSON
-  -> a
-usingObjectValues a f =
-  maybe a f . getObjectValues
-
--- | Whether or not a JSON value is an object with the given field.
-hasField ::
-  ByteString
-  -> JSON
-  -> Bool
-hasField s =
-  isJust . field s
-
--- | Whether or not a JSON value is an object with the given field. An alias for 'hasField'.
-(-?) ::
-  ByteString
-  -> JSON
-  -> Bool
-(-?) =
-  hasField
-
--- | Returns the possible value associated with the given field if this is an object.
-field ::
-  ByteString
-  -> JSON
-  -> Maybe JSON
-field s j =
-  getObject j >>= T.lookup s
-
--- | Returns the possible value associated with the given field if this is an object. An alias for 'field'.
-(-|) ::
-  ByteString
-  -> JSON
-  -> Maybe JSON
-(-|) =
-  field
-
--- | Returns the value associated with the given field or if this is not an object or has no associated value, return the given default.
-fieldOr ::
-  ByteString
-  -> JSON
-  -> JSON
-  -> JSON
-fieldOr s =
-  flip fromMaybe . field s
-
--- | Returns the value associated with the given field or if this is not an object or has no associated value, return a JSON null.
-fieldOrNull ::
-  ByteString
-  -> JSON
-  -> JSON
-fieldOrNull s j =
-  fieldOr s j Null
-
--- | Returns the value associated with the given field or if this is not an object or has no associated value, return a JSON true.
-fieldOrTrue ::
-  ByteString
-  -> JSON
-  -> JSON
-fieldOrTrue s j =
-  fieldOr s j jTrue
-
--- | Returns the value associated with the given field or if this is not an object or has no associated value, return a JSON false.
-fieldOrFalse ::
-  ByteString
-  -> JSON
-  -> JSON
-fieldOrFalse s j =
-  fieldOr s j jFalse
-
--- | Returns the value associated with the given field or if this is not an object or has no associated value, return a JSON zero.
-fieldOrZero ::
-  ByteString
-  -> JSON
-  -> JSON
-fieldOrZero s j =
-  fieldOr s j jZero
-
--- | Returns the value associated with the given field or if this is not an object or has no associated value, return a JSON string that is empty.
-fieldOrEmptyString ::
-  ByteString
-  -> JSON
-  -> JSON
-fieldOrEmptyString s j =
-  fieldOr s j jEmptyString
-
--- | Returns the value associated with the given field or if this is not an object or has no associated value, return a JSON array that is empty.
-fieldOrEmptyArray ::
-  ByteString
-  -> JSON
-  -> JSON
-fieldOrEmptyArray s j =
-  fieldOr s j jEmptyArray
-
--- | Returns the value associated with the given field or if this is not an object or has no associated value, return a JSON object that is empty.
-fieldOrEmptyObject ::
-  ByteString
-  -> JSON
-  -> JSON
-fieldOrEmptyObject s j =
-  fieldOr s j jEmptyObject
-
--- | Traverses down JSON objects with the association fields and returns true if the association graph exists.
-hasField' ::
-  F.Foldable t =>
-  t ByteString
-  -> JSON
-  -> Bool
-hasField' s =
-  isJust . field' s
-
--- | Traverses down JSON objects with the association fields and returns true if the association graph exists. An alias for 'hasField''.
-(-??) ::
-  F.Foldable t =>
-  t ByteString
-  -> JSON
-  -> Bool
-(-??) =
-  hasField'
-
--- | Traverses down JSON objects with the association fields and returns the potential value.
-field' ::
-  F.Foldable t =>
-  t ByteString
-  -> JSON
-  -> Maybe JSON
-field' =
-  flip (F.foldrM field)
-
--- | Traverses down JSON objects with the association fields and returns the potential value. An alias for 'field''.
-(-||) ::
-  F.Foldable t =>
-  t ByteString
-  -> JSON
-  -> Maybe JSON
-(-||) =
-  field'
-
--- | Traverses down JSON objects with the association fields and returns the potential value or the given default.
-field'Or ::
-  F.Foldable t =>
-  JSON
-  -> t ByteString
-  -> JSON
-  -> JSON
-field'Or d s =
-  fromMaybe d . field' s
-
--- | Traverses down JSON objects with the association fields and returns the potential value or a JSON null.
-field'OrNull ::
-  F.Foldable t =>
-  t ByteString
-  -> JSON
-  -> JSON
-field'OrNull =
-  field'Or Null
-
--- | Traverses down JSON objects with the association fields and returns the potential value or a JSON true.
-field'OrTrue ::
-  F.Foldable t =>
-  t ByteString
-  -> JSON
-  -> JSON
-field'OrTrue =
-  field'Or jTrue
-
--- | Traverses down JSON objects with the association fields and returns the potential value or a JSON false.
-field'OrFalse ::
-  F.Foldable t =>
-  t ByteString
-  -> JSON
-  -> JSON
-field'OrFalse =
-  field'Or jFalse
-
--- | Traverses down JSON objects with the association fields and returns the potential value or a JSON zero.
-field'OrZero ::
-  F.Foldable t =>
-  t ByteString
-  -> JSON
-  -> JSON
-field'OrZero =
-  field'Or jZero
-
--- | Traverses down JSON objects with the association fields and returns the potential value or a JSON empty string.
-field'OrEmptyString ::
-  F.Foldable t =>
-  t ByteString
-  -> JSON
-  -> JSON
-field'OrEmptyString =
-  field'Or jEmptyString
-
--- | Traverses down JSON objects with the association fields and returns the potential value or a JSON empty array.
-field'OrEmptyArray ::
-  F.Foldable t =>
-  t ByteString
-  -> JSON
-  -> JSON
-field'OrEmptyArray =
-  field'Or jEmptyArray
-
--- | Traverses down JSON objects with the association fields and returns the potential value or a JSON empty object.
-field'OrEmptyObject ::
-  F.Foldable t =>
-  t ByteString
-  -> JSON
-  -> JSON
-field'OrEmptyObject =
-  field'Or jEmptyObject
-
--- | Interacts by parsing the standard input for JSON, passing the result to the given function, then printing the result to standard output.
-interactJSON ::
-  (Either String JSON -> JSON)
-  -> IO ()
-interactJSON f =
-  S.interact (encode Compact . f . decode)
-
--- | Interacts by parsing the standard input for JSON, passing a failed result with a string error message to the given function, or a successful result to the given function, then printing the result to standard output.
-interactJSON' ::
-  (String -> JSON)
-  -> (JSON -> JSON)
-  -> IO ()
-interactJSON' l = interactJSON . either l
-
--- | Interacts by parsing the standard input for JSON, executing the given function for a failed result with a string error message, or printing a successful result to the given function and passing the result to standard output.
-withJSON ::
-  (String -> IO ())
-  -> (JSON -> JSON)
-  -> IO ()
-withJSON f g =
-  S.getContents >>= either f (S.putStr . encode Compact . g) . decode
-
--- | Interacts by parsing the given file for JSON, passing the result to the given function, then writing the result to the given file.
-interactJSONFile ::
-  (Either String JSON -> JSON)
-  -> FilePath
-  -> FilePath
-  -> IO ()
-interactJSONFile f i o =
-  S.readFile i >>= S.writeFile o . (encode Compact . f) . decode
-
--- | Interacts by parsing the given file for JSON, passing a failed result with a string error message to the given function, or a successful result to the given function, then writing the result to the given file.
-interactJSONFile' ::
-  (String -> JSON)
-  -> (JSON -> JSON)
-  -> FilePath
-  -> FilePath
-  -> IO ()
-interactJSONFile' l =
-  interactJSONFile . either l
-
--- | Interacts by parsing the given file for JSON, executing the given function for a failed result with a string error message, or printing a successful result to the given function and writing the result to the given file.
-withJSONFile ::
-  (String -> IO ())
-  -> (JSON -> JSON)
-  -> FilePath
-  -> FilePath
-  -> IO ()
-withJSONFile f g i o =
-  S.readFile i >>= either f (S.writeFile o . encode Compact . g) . decode
