forked from GitHub/gf-core
update PGFService to work after the extensions in the random generation API
This commit is contained in:
@@ -23,6 +23,7 @@ import Data.List (sortBy,intersperse,mapAccumL)
|
||||
import qualified Data.Map as Map
|
||||
import Data.Maybe
|
||||
import System.Directory
|
||||
import System.Random
|
||||
import System.FilePath
|
||||
import System.Process
|
||||
import System.Exit
|
||||
@@ -466,7 +467,9 @@ linearizeAndBind pgf mto t = [(la, binds s) | (la,s) <- linearize' pgf mto t]
|
||||
_ -> []
|
||||
|
||||
random' :: PGF -> Maybe PGF.Type -> IO [PGF.Tree]
|
||||
random' pgf mcat = PGF.generateRandom pgf (fromMaybe (PGF.startCat pgf) mcat)
|
||||
random' pgf mcat = do
|
||||
g <- newStdGen
|
||||
return $ PGF.generateRandom (PGF.RandSel g) pgf (fromMaybe (PGF.startCat pgf) mcat)
|
||||
|
||||
selectLanguage :: PGF -> Maybe (Accept Language) -> PGF.Language
|
||||
selectLanguage pgf macc = case acceptable of
|
||||
|
||||
@@ -21,7 +21,8 @@ executable pgf-server
|
||||
json >= 0.3.3,
|
||||
utf8-string >= 0.3.1.1,
|
||||
bytestring,
|
||||
pretty
|
||||
pretty,
|
||||
random
|
||||
if !os(windows)
|
||||
build-depends: unix
|
||||
main-is: PGFService.hs
|
||||
|
||||
Reference in New Issue
Block a user