1
0
forked from GitHub/gf-core

Merge pull request #196 from GrammaticalFramework/fix-code-generation

`import Control.Monad` when generating .hs with GADTs
This commit is contained in:
Inari Listenmaa
2025-08-13 14:02:53 +02:00
committed by GitHub

View File

@@ -51,7 +51,7 @@ grammar2haskell opts name gr = foldr (++++) [] $
derivingClause
| dataExt = "deriving (Show,Data)"
| otherwise = "deriving Show"
extraImports | gadt = ["import Control.Monad.Identity", "import Data.Monoid"]
extraImports | gadt = ["import Control.Monad.Identity", "import Control.Monad", "import Data.Monoid"]
| dataExt = ["import Data.Data"]
| otherwise = []
pgfImports | pgf2 = ["import PGF2 hiding (Tree)", "", "showCId :: CId -> String", "showCId = id"]