mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-05 01:02:51 -06:00
ModuleName and Ident are now distinct types
This makes the documentation clearer, and can potentially catch more programming mistakes.
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
module GF.Infra.Ident (-- ** Identifiers
|
||||
ModuleName(..), moduleNameS,
|
||||
Ident, ident2utf8, showIdent, prefixIdent,
|
||||
identS, identC, identV, identA, identAV, identW,
|
||||
argIdent, isArgIdent, getArgIndex,
|
||||
@@ -34,6 +35,15 @@ import PGF.Internal(Binary(..))
|
||||
import GF.Text.Pretty
|
||||
|
||||
|
||||
-- | Module names
|
||||
newtype ModuleName = MN Ident deriving (Eq,Ord)
|
||||
|
||||
moduleNameS = MN . identS
|
||||
|
||||
instance Show ModuleName where showsPrec d (MN m) = showsPrec d m
|
||||
instance Pretty ModuleName where pp (MN m) = pp m
|
||||
|
||||
|
||||
-- | the constructors labelled /INTERNAL/ are
|
||||
-- internal representation never returned by the parser
|
||||
data Ident =
|
||||
|
||||
Reference in New Issue
Block a user