From 5d98b03204e98259d8219c615199c796c286bb55 Mon Sep 17 00:00:00 2001 From: Joe Crayne Date: Wed, 27 Mar 2019 16:00:47 -0400 Subject: Switch to using Unique symbols to simplify namespace hygiene. --- Unique.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Unique.hs') diff --git a/Unique.hs b/Unique.hs index d0d3eb1..1594b4a 100644 --- a/Unique.hs +++ b/Unique.hs @@ -1,8 +1,10 @@ module Unique ( UniqueFactory , freshUniques + , genUnique , Unique , uniqueSymbol + , uniquePattern , substituteUnique , multipleOccurances ) where @@ -25,6 +27,9 @@ genUnique (UniqueFactory c) = (Unique c, UniqueFactory (succ c)) uniqueSymbol :: Unique -> Exp () uniqueSymbol (Unique i) = Var () (UnQual () (Ident () (showSym i))) +uniquePattern :: Unique -> Pat () +uniquePattern (Unique i) = PVar () (Ident () (showSym i)) + showSym :: Integer -> String showSym i = " u" ++ show i -- cgit v1.2.3