DYEZ6CABMQQZD5GZR2DPR7NTHQH3GVT2ZI5ALX2YMEDWPS3YRNKQC result <- liftIO $ withFile filename ReadMode(ByteString.hGetContents >=> return . fromJson @Index . ByteString.fromStrict)case result ofNothing -> lift $ throwE "Unable to parse JSON into AlBhed.Index"Just x -> return x
liftIO $ withFile filename ReadMode(ByteStringLazy.hGetContents >=> printContent)
printContent :: (MonadFail m) => ByteString -> m IndexprintContent = maybe (fail "Could not parse JSON into AlBhed.Index.Index") pure . fromJson @Index