You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using unbind2Plus on two different term types results in an error when printing the terms out, see an example below.
Using it on two terms of the same type doesn't cause errors, as far as I can see.
Example
{-# LANGUAGE DeriveAnyClass, DeriveGeneric #-}
importqualifiedUnbound.Generics.LocallyNamelessasUnboundimportGHC.Generics (Generic)
importControl.DeepSeq (NFData, force)
typeLName=Unbound.NameLTermdataLTerm=--| variables `x`LVarLName
| --| abstraction `\x. a`LLam (Unbound.BindLNameLTerm)
| --| application `a b`LAppLTermLTermderiving (Show, Generic, Unbound.Alpha, NFData)
typeRName=Unbound.NameRTermdataRTerm=--| variables `x`RVarRName
| --| abstraction `\x. a`RLam (Unbound.BindRNameRTerm)
| --| application `a b`RAppRTermRTermderiving (Show, Generic, Unbound.Alpha, NFData)
lterm::LTerm
lterm =let name = (Unbound.s2n "left")
var =LVar name
inLLam (Unbound.bind name var)
rterm::RTerm
rterm =let name = (Unbound.s2n "right")
var =RVar name
inRLam (Unbound.bind name var)
test::IO (LTerm, RTerm)
test =Unbound.runFreshMT $dolet (LLam lbind) = lterm
let (RLam rbind) = rterm
(lv, lb, rv, rb) <-Unbound.unbind2Plus lbind rbind
return (lb, rb)
main::IO()
main =do
(l,r) <- test
-- this doesn't cause errorslet dl = force l
let dr = force r
-- this doesputStrLn$show$ dl
putStrLn$show$ dr
-- that's itputStrLn"done"
Error
The error I'm getting while printing the right subterm is
LocallyNameless.open: inconsistent sorts
CallStack (from HasCallStack):
error, called at src/Unbound/Generics/LocallyNameless/Alpha.hs:717:20 in unbound-generics-0.4.2-B2j2SNQtM51IWCI7gQ83CW:Unbound.Generics.LocallyNameless.Alpha
Version
this is using GHC 9.02, but also works on at least 9.2.2
unbound-generics version is the current revision a2a5580
using unbind2Plus on two different term types results in an error when printing the terms out, see an example below.
Using it on two terms of the same type doesn't cause errors, as far as I can see.
Example
Error
The error I'm getting while printing the right subterm is
Version
this is using GHC 9.02, but also works on at least 9.2.2
unbound-generics version is the current revision a2a5580
How to build the example
I have this example in a reproducible build. Here is a gist with all relevant files.
The text was updated successfully, but these errors were encountered: