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
modulefoo.Mainwhereimport foo.Lens (Lens)
dataUser=User{_name::String}where
user :: LensUserUserStringStringuserfthis= (\name'->this.{_name=name'}) <$> f this._name
derive ShowUsermain::IO()
main =dolet me =User"foo"-- prints:-- User "Mr. foo"
println =<<User.user (pure. ("Mr. "++)) me
If both of the two modules are compiled at once, it works. However, if foo.Lens is compiled, and then foo.Main is compiled in another run, a kind error occurs:
$ java -jar fregec.jar -make foo.Lens
$ java -jar fregec.jar -make foo.Main
...
E ./foo/Main.fr:1: kind error, type variable `f` has kind *, expected was ? -> *
E ./foo/Main.fr:8: Kind error in unification of
t7684 :: * -> * with
f :: *
E ./foo/Main.fr:8: type error in expression
f this._name
type is : f String
expected: t1 String
...
(Presence of -make is irrelevant but put anyway to illustrate a common use case.)
As a workaround, the type annotation can be expanded by hand:
user::Functorf=> (String->fString) ->User->fUser
The text was updated successfully, but these errors were encountered:
The kinds of type variables in type aliases are correctly infered on full compilation but not on incremental one.
For example:
If both of the two modules are compiled at once, it works. However, if
foo.Lens
is compiled, and thenfoo.Main
is compiled in another run, a kind error occurs:(Presence of
-make
is irrelevant but put anyway to illustrate a common use case.)As a workaround, the type annotation can be expanded by hand:
The text was updated successfully, but these errors were encountered: