GrammaticalFramework/gf-core

Add flag for making Haskell export PGF2 compatible

johnjcamilleri opened this issue · 1 comments

(This is mostly a TODO for my future self).

Currently gf --make --output-format=haskell produces something starting with this:

{-# OPTIONS_GHC -fglasgow-exts #-}
{-# LANGUAGE GADTs #-}
module AbstractName where

import Control.Monad.Identity
import Data.Monoid
import PGF hiding (Tree)

I want to make two additions.

  1. A --haskell=pgf2 flag which instead produces this preamble:
import Control.Monad.Identity
import PGF2 hiding (Tree)

showCId :: CId -> String
showCId = id
  1. A --haskell=module:A.B.C which produces this module declaration:
module A.B.C where

and names the file itself C.hs

A --haskell=module:A.B.C which produces this module declaration:
module A.B.C where
and names the file itself C.hs

Turns out this is already available via the --name=A.B.C flag (although the resulting file is name A.B.C.hs, but I can live with that).