From 391b301881bee7de9580f2c6d819144161e6a51d Mon Sep 17 00:00:00 2001 From: hallgren Date: Tue, 21 Oct 2014 19:20:31 +0000 Subject: ModuleName and Ident are now distinct types This makes the documentation clearer, and can potentially catch more programming mistakes. --- src/compiler/GF/Infra/Ident.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/compiler/GF/Infra/Ident.hs') diff --git a/src/compiler/GF/Infra/Ident.hs b/src/compiler/GF/Infra/Ident.hs index 71e86fb37..7d0bed804 100644 --- a/src/compiler/GF/Infra/Ident.hs +++ b/src/compiler/GF/Infra/Ident.hs @@ -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 = -- cgit v1.2.3