diff --git a/src/compiler/api/GF/Compile/GeneratePMCFG.hs b/src/compiler/api/GF/Compile/GeneratePMCFG.hs index 7ce0377f6..8bfe3ff6d 100644 --- a/src/compiler/api/GF/Compile/GeneratePMCFG.hs +++ b/src/compiler/api/GF/Compile/GeneratePMCFG.hs @@ -22,6 +22,7 @@ import Control.Monad (foldM,zipWithM,liftM,liftM2,forM,MonadPlus(..)) import Control.Monad.Fix import Data.Maybe import Data.List(mapAccumL,sortBy,intersperse) +import Data.Containers.ListUtils(nubOrd) import Prelude hiding ((<>)) @@ -73,7 +74,7 @@ pmcfgForm g t ctxt ty = do let (ms,s',t',arg_params) = apply 0 Map.empty unit ctxt t [] let v = eval g [] s' t' [] (ms,_,_,fn) <- breakDown g ms unit 0 [] v ty (return []) empty - runGenM g ms [] $ do + fmap nubOrd $ runGenM g ms [] $ do (r,rs,v,res_params) <- fn arg_params <- mapM params2int arg_params res_params <- params2int res_params diff --git a/src/runtime/haskell/PGF2/Transactions.hsc b/src/runtime/haskell/PGF2/Transactions.hsc index d3a197a3b..67f9e03d4 100644 --- a/src/runtime/haskell/PGF2/Transactions.hsc +++ b/src/runtime/haskell/PGF2/Transactions.hsc @@ -231,7 +231,6 @@ setConcreteFlag name value = Transaction $ \c_db _ c_revision c_exn -> type Token = String -type SeqId = Int type LIndex = Int type LVar = Int data LParam = LParam {-# UNPACK #-} !LIndex [(LIndex,LVar)] @@ -253,14 +252,11 @@ data Symbol type Quantifiers = [(LVar,Int)] data Rule = Rule Quantifiers LParam [LParam] LParam [Symbol] - deriving (Eq,Show) + deriving (Eq,Ord,Show) data PArg = PArg [(LIndex,LIndex)] {-# UNPACK #-} !LParam deriving (Eq,Show) -data Production = Production [(LVar,LIndex)] [PArg] LParam [SeqId] - deriving (Eq,Show) - createLincat :: Cat -> [String] -> [Rule] -> [Rule] -> Transaction Concr () createLincat name fields lindefs linrefs = Transaction $ \c_db c_abstr c_revision c_exn -> let n_fields = length fields