@@ -392,17 +392,16 @@ scShowTerm sc opts t =
392
392
pure (showTermWithNames opts env t)
393
393
394
394
-- | Create a global variable with the given identifier (which may be "_") and type.
395
- scFreshEC :: SharedContext -> String -> a -> IO (ExtCns a )
396
- scFreshEC sc x tp = do
397
- i <- scFreshGlobalVar sc
398
- let x' = Text. pack x
399
- let uri = scFreshNameURI x' i
400
- let nmi = ImportedName uri [x',Text. pack (x <> " #" <> show i)]
401
- scRegisterName sc i nmi
402
- pure (EC i nmi tp)
395
+ scFreshEC :: SharedContext -> Text -> a -> IO (ExtCns a )
396
+ scFreshEC sc x tp =
397
+ do i <- scFreshGlobalVar sc
398
+ let uri = scFreshNameURI x i
399
+ let nmi = ImportedName uri [x, x <> " #" <> Text. pack (show i)]
400
+ scRegisterName sc i nmi
401
+ pure (EC i nmi tp)
403
402
404
403
-- | Create a global variable with the given identifier (which may be "_") and type.
405
- scFreshGlobal :: SharedContext -> String -> Term -> IO Term
404
+ scFreshGlobal :: SharedContext -> Text -> Term -> IO Term
406
405
scFreshGlobal sc x tp = scExtCns sc =<< scFreshEC sc x tp
407
406
408
407
-- | Returns shared term associated with ident.
@@ -1213,7 +1212,7 @@ scSort sc s = scFlatTermF sc (Sort s)
1213
1212
scNat :: SharedContext -> Natural -> IO Term
1214
1213
scNat sc n = scFlatTermF sc (NatLit n)
1215
1214
1216
- -- | Create a literal term (of saw-core type @String@) from a 'String '.
1215
+ -- | Create a literal term (of saw-core type @String@) from a 'Text '.
1217
1216
scString :: SharedContext -> Text -> IO Term
1218
1217
scString sc s = scFlatTermF sc (StringLit s)
1219
1218
@@ -1324,7 +1323,7 @@ scFunAll :: SharedContext
1324
1323
-> IO Term
1325
1324
scFunAll sc argTypes resultType = foldrM (scFun sc) resultType argTypes
1326
1325
1327
- -- | Create a lambda term from a parameter name (as a 'String '), parameter type
1326
+ -- | Create a lambda term from a parameter name (as a 'LocalName '), parameter type
1328
1327
-- (as a 'Term'), and a body. Regarding deBruijn indices, in the body of the
1329
1328
-- function, an index of 0 refers to the bound parameter.
1330
1329
scLambda :: SharedContext
@@ -1378,7 +1377,7 @@ scLocalVar sc i = scTermF sc (LocalVar i)
1378
1377
-- indices. If the body contains any ExtCns variables, they will be
1379
1378
-- abstracted over and reapplied to the resulting constant.
1380
1379
scConstant :: SharedContext
1381
- -> String -- ^ The name
1380
+ -> Text -- ^ The name
1382
1381
-> Term -- ^ The body
1383
1382
-> Term -- ^ The type
1384
1383
-> IO Term
@@ -2337,7 +2336,7 @@ scTreeSize = fst . go (0, Map.empty)
2337
2336
-- | `openTerm sc nm ty i body` replaces the loose deBruijn variable `i`
2338
2337
-- with a fresh external constant (with name `nm`, and type `ty`) in `body`.
2339
2338
scOpenTerm :: SharedContext
2340
- -> String
2339
+ -> Text
2341
2340
-> Term
2342
2341
-> DeBruijnIndex
2343
2342
-> Term
0 commit comments