• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

msakai / toysolver / 530

03 Dec 2024 03:40PM UTC coverage: 70.43% (+0.4%) from 70.001%
530

push

github

web-flow
Merge pull request #120 from msakai/feature/converter-to-json

Add ToJSON/FromJSON instances to converters

288 of 380 new or added lines in 14 files covered. (75.79%)

73 existing lines in 8 files now uncovered.

10218 of 14508 relevant lines covered (70.43%)

0.7 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

50.0
/src/ToySolver/Internal/JSON.hs
1
{-# OPTIONS_GHC -Wall #-}
2
{-# LANGUAGE OverloadedStrings #-}
3
module ToySolver.Internal.JSON where
4

5
import Control.Monad
6
import qualified Data.Aeson as J
7
import qualified Data.Aeson.Types as J
8
import Data.Aeson ((.:))
9

10
withTypedObject :: String -> (J.Object -> J.Parser a) -> J.Value -> J.Parser a
NEW
11
withTypedObject name k = J.withObject name $ \obj -> do
×
12
  t <- obj .: "type"
1✔
NEW
13
  unless (t == name) $ fail ("expected type " ++ show name ++ ", but found type " ++ show t)
×
14
  k obj
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc