add types to metas, find example that needs postpone

This commit is contained in:
2024-09-17 22:11:23 -07:00
parent 699a4bd575
commit 4f7b78f056
6 changed files with 65 additions and 31 deletions

View File

@@ -39,3 +39,19 @@ MaybeMonad = MkMonad {Maybe} (\ {A} ma amb =>
bind : {m : U -> U} -> {x : Monad m} -> {a b : U} -> (m a) -> (a -> m b) -> m b
bind {m} {MkMonad bind'} = bind'
ptype Int
-- For now, we may try to solve this at creation time, but it's possible postpone is needed
/-
So I think we need to solve meta 7 first, and then if we're lucky, it's var 0 and we're
good to go.
failed to unify ( Maybe ( ?m:9 x:0 ) )
with ( ( ?m:4 x:0 ) ( ?m:7 x:0 ) )
non-variable in pattern (%meta 7 [< (%var 0 [< ])])
-/
foo : Int -> Maybe Int
foo x = bind {_} {_} (Just x) (\ x => Just x)