diff options
Diffstat (limited to 'src/Language/Fiddle/Internal/Scopes.hs')
-rw-r--r-- | src/Language/Fiddle/Internal/Scopes.hs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Language/Fiddle/Internal/Scopes.hs b/src/Language/Fiddle/Internal/Scopes.hs index 02c9a5a..70cadee 100644 --- a/src/Language/Fiddle/Internal/Scopes.hs +++ b/src/Language/Fiddle/Internal/Scopes.hs @@ -2,10 +2,9 @@ module Language.Fiddle.Internal.Scopes where -import Control.Monad (forM) import Data.Aeson import Data.Aeson.Key -import Data.List (inits, intercalate) +import Data.List (inits) import Data.List.NonEmpty (NonEmpty (..), prependList) import Data.Map (Map) import qualified Data.Map as Map @@ -129,10 +128,10 @@ lookupScopeWithPath (ScopePath current others) key scope = Nothing -> [] instance (ToJSONKey k, ToJSON v, Ord k) => ToJSON (Scope k v) where - toJSON (Scope subScopes scopeValues) = + toJSON scope = object - [ fromString "subScopes" .= toJSON subScopes, - fromString "scopeValues" .= toJSON scopeValues + [ fromString "subScopes" .= toJSON (subScopes scope), + fromString "scopeValues" .= toJSON (scopeValues scope) ] instance (FromJSONKey k, FromJSON v, Ord k) => FromJSON (Scope k v) where |