2020-05-19 20:25:18 +03:00
|
|
|
public export
|
2020-12-11 14:58:26 +03:00
|
|
|
interface Do (0 m : Type) where
|
2021-03-09 20:23:05 +03:00
|
|
|
0 Next : m -> Type
|
2020-05-19 20:25:18 +03:00
|
|
|
bind : (x : m) -> Next x
|
|
|
|
|
|
|
|
-- Test that the implicits don't turn into as patterns on the LHS - they
|
|
|
|
-- shouldn't, because the elaborator hasn't got that far yet
|
|
|
|
foom : Int -> {a, b : Type} -> (a -> b) -> a -> b
|
|
|
|
foom = ?thurlingdrome
|
|
|
|
|
|
|
|
-- Similarly, for bind (we can't just implement it as >>= because of where
|
|
|
|
-- the implicits end up...)
|
|
|
|
public export
|
|
|
|
Monad m => Do (m a) where
|
|
|
|
Next x = {b : Type} -> (a -> m b) -> m b
|
|
|
|
bind = ?oops -- (>>=)
|