import qualified Data.Map as Map
import Data.ByteString.Lazy.UTF8
import Data.Aeson
import qualified Data.Text as Text

-- | Formats a solution as an encoded Json string.
solutionToJson :: Solution -> String
solutionToJson (Solution list) = 
          (\xs -> toString $ encodePretty $ Map.fromList xs) 
          (map (\(x,y) -> (x, show y)) list)
