1
0
forked from GitHub/gf-core

Added explicit implementation for 'readJSON' in the instance declaration for 'JSON PGF.Trie'

This commit is contained in:
Liyana
2020-11-10 17:19:18 +08:00
parent 8ca4baf470
commit 54e5fb6645

View File

@@ -1024,6 +1024,7 @@ instance JSON PGF.Trie where
showJSON (PGF.Ap f [[]]) = makeObj ["fun".=f] -- leaf
-- showJSON (PGF.Ap f [es]) = makeObj ["fun".=f,"children".=es] -- one alternative
showJSON (PGF.Ap f alts) = makeObj ["fun".=f,"alts".=alts]
readJSON = error "PGF.Trie.readJSON intentionally not defined"
instance JSON PGF.CId where
readJSON x = readJSON x >>= maybe (fail "Bad language.") return . PGF.readLanguage