From ca667318cfba207865eab82eef3c8289a7ed2d5a Mon Sep 17 00:00:00 2001 From: bjorn Date: Mon, 18 Aug 2008 20:20:32 +0000 Subject: [PATCH] Sort languages in fastcgi /languages output. --- src/server/MainFastCGI.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/MainFastCGI.hs b/src/server/MainFastCGI.hs index 5987f1e6d..88178b017 100644 --- a/src/server/MainFastCGI.hs +++ b/src/server/MainFastCGI.hs @@ -12,6 +12,7 @@ import Control.Exception import Control.Monad import Data.Dynamic import Data.Maybe +import Data.List grammarFile :: FilePath @@ -92,7 +93,7 @@ linearize' pgf mto tree = Just to -> [(to,PGF.linearize pgf to tree)] listLanguages :: PGF -> [(PGF.Language,JSObject JSValue)] -listLanguages pgf = [(l,toJSObject (info l)) | l <- PGF.languages pgf] +listLanguages pgf = [(l,toJSObject (info l)) | l <- sort (PGF.languages pgf)] where info l = [("languageCode", showJSON (fromMaybe "" (PGF.languageCode pgf l))), ("canParse", showJSON (PGF.canParse pgf l))]