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
This snippet is taken from idris-free (https://github.com/idris-hackers/idris-free) which does not compile currently. This issue is about the error messages the compilation produces, not about the fact that Free does not compile:
dataFree: (f : Type -> Type) -> (a : Type) ->TypewherePure: a -> Free f a
Bind: f (Free f a) -> Free f a
instanceFunctor f => Functor (Free f) wheremap f (Pure x) =Pure (f x)
map f (Bind x) = assert_total (Bind (map (map f) x))
The first error message one gets is :
Prelude.Functor.Control.Monad.Free.Free f implementation of Prelude.Functor.Functor,
method map is possibly not total due to: Control.Monad.Free.Bind
Inspecting the docs of map gives the standard map function of the Functor interface which declares map to be total. This left me puzzled, because I was not able to get the totality state of this map implementation.
I then inspected the docs for Free
Data type Control.Monad.Free.Free : (f : Type -> Type) -> (a : Type) -> Type
Constructors:
Pure : a -> Free f a
Bind : f (Free f a) -> Free f a
(nothing unusual here) and finally Bind. The docs for Bind say:
Control.Monad.Free.Suspend : f (Free f a) -> Free f a
The function is not strictly positive
I tried to find out what "strictly positive" means. Some Adga and Coq resources later (which I am not fluent with), there seems to be a problem that Free occurs on the left hand side of the constructor arrow. Again I am puzzled - why does
(::) : a -> List a -> List a
work as a constructor for List then?
As a user of Idris, I would like that
Idris reports that map is not total because Bind is not strictly positive
Idris explains a bit better what exactly being strictly positive entitles
as a bonus: that Idris provides error messages which link to an error message wiki page on Github, giving more detailed information about the nature of the error.
The text was updated successfully, but these errors were encountered:
This snippet is taken from idris-free (https://github.com/idris-hackers/idris-free) which does not compile currently. This issue is about the error messages the compilation produces, not about the fact that Free does not compile:
The first error message one gets is :
Inspecting the docs of map gives the standard map function of the Functor interface which declares map to be total. This left me puzzled, because I was not able to get the totality state of this map implementation.
I then inspected the docs for Free
(nothing unusual here) and finally Bind. The docs for Bind say:
I tried to find out what "strictly positive" means. Some Adga and Coq resources later (which I am not fluent with), there seems to be a problem that Free occurs on the left hand side of the constructor arrow. Again I am puzzled - why does
work as a constructor for List then?
As a user of Idris, I would like that
The text was updated successfully, but these errors were encountered: