Last active
May 18, 2017 16:45
-
-
Save schell/38565574641fe994aab3faabf350020e to your computer and use it in GitHub Desktop.
varying in idris
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
record VaryingT (input : Type) (m : Type -> Type) (output : Type) where | |
constructor VT | |
runVarT : input -> m (output, Inf $ VaryingT input m output) | |
Monad m => Functor (VaryingT a m) where | |
map f v = assert_total $ VT $ \ x => do | |
(b, v2) <- runVarT v x | |
pure (f b, map f v2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Melvar (irc.freenode.net #idris): The problem is that as you define VT, m could be contravariant or invariant, meaning VT is not strictly positive and thus counts as nontotal.