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
Here's my example code (abstract syntax is enough):
abstract Mini= {
cat
CN ;
[CN]{2} ;
fun
dog :CN ;
rabbit :CN ;
ListCN2CN:ListCN->CN ; -- This fails
myConjCN :ListCN->CN ; -- This succeeds
}
I have my own custom functions from lists to non-list categories, and if I name them like ListX2Y (no matter if X and Y are same or different), then the Compos instance in the generated Haskell code for that function is wrong. Here's the code, generated with gf -make -f haskell --haskell=gadt Mini.gf:
instanceComposTreewhere
compos r a f t =case t of-- This is the same as the Haskell convenience constructor GListCN, but has a different type.-- So the line below is a type error.GListCN2CN x1 -> r GListCN2CN`a`foldr (a . a (r (:)) . f) (r []) x1
-- This is correct, and how the previous line should be.GmyConjCN x1 -> r GmyConjCN`a` f x1
-- This is also correct, type signature of GListCN is [GCN] -> GListCNGListCN x1 -> r GListCN`a`foldr (a . a (r (:)) . f) (r []) x1
_ -> r t
So it seems that the Haskell code generator is just checking for a prefix, not the full name of the function.
The text was updated successfully, but these errors were encountered:
Here's my example code (abstract syntax is enough):
I have my own custom functions from lists to non-list categories, and if I name them like
ListX2Y
(no matter if X and Y are same or different), then theCompos
instance in the generated Haskell code for that function is wrong. Here's the code, generated withgf -make -f haskell --haskell=gadt Mini.gf
:So it seems that the Haskell code generator is just checking for a prefix, not the full name of the function.
The text was updated successfully, but these errors were encountered: