From f5435dba388862dc486dc2ea52d5ad67a35007e2 Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Sun, 9 Jan 2022 08:00:05 +0100 Subject: [PATCH] restore the rigt order for terms --- src/compiler/GF/Compile/GeneratePMCFG.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/GF/Compile/GeneratePMCFG.hs b/src/compiler/GF/Compile/GeneratePMCFG.hs index a34f4d86e..33f478b2f 100644 --- a/src/compiler/GF/Compile/GeneratePMCFG.hs +++ b/src/compiler/GF/Compile/GeneratePMCFG.hs @@ -26,7 +26,7 @@ import Control.Monad import Control.Monad.State import qualified Data.Map.Strict as Map import qualified Data.Sequence as Seq -import Data.List(mapAccumL,sortOn) +import Data.List(mapAccumL,sortOn,sortBy) import Data.Maybe(fromMaybe,isNothing) generatePMCFG :: Options -> FilePath -> SourceGrammar -> SourceModule -> Check SourceModule @@ -260,7 +260,7 @@ combine cnt' ((r,pv):rs) ((r',pv'):rs') = EQ -> (r*cnt'+r',pv ) : combine cnt' rs ((r',pv'):rs') GT -> ( r',pv') : combine cnt' ((r,pv):rs) rs' -order = sortOn fst +order = sortBy (\(r1,_) (r2,_) -> compare r2 r1) mapAccumM f a [] = return (a,[]) mapAccumM f a (x:xs) = do (a, y) <- f a x