Should Unbound always be in the FreshM monad?

I am working on a project based on some existing code that uses unbound .

The code uses a unsafeUnbindbunch that causes me problems.

I tried using freshen, but I get the following error:

error "fresh encountered bound name! 
Please report this as a bug."

I am wondering:

  • Is the library intended to be used entirely in monad FreshM? Or their ways of doing things like a lambda application without being in Fresh?
  • What types of values ​​can I give freshento avoid the errors they list?
  • If I end up using unsafeUnbind, under what conditions is it safe to use?
+4
source share
1 answer

Is the library intended to be used fully in monad FreshM? Or their ways of doing things like a lambda application without being in Fresh?

In most situations, you will want to work in the monad Freshor LFresh.

What values ​​can I give freshento avoid the errors they list?

, , , , , freshen . Unbound : Name E , , E s, (p1, p2) [p] , p1 p2 p, . , , , . Embed t Rebind p1 p2 , , (p1,p2), , p1 p2 ( , p2 Embed ed , p1 ). , , Scheme let*, , , . ( . ).

, , Bind p t - , : Bind p t , p Bind p t t. , () - data Expr = Lam (Bind Var Expr) | App Expr Expr | V Var, type Var = Name Expr.

, freshen. freshen , Bind p t ( , ) - p, t , freshen.

`unsafeUnbind, ?

, , - , , . . , , , , , , unsafeUnbind, .

, .

PS: unbound-generics, Unbound, GHC.Generics RepLib.

+6

All Articles