mirror of
https://github.com/edwinb/Idris2-boot.git
synced 2025-01-07 05:36:30 +03:00
e9a3167e2f
Small change needed to fix one - assume given implicits which are of the form x@_ arise from types. It's a bit of a hack but I don't think there's any need for anything more complicated.
17 lines
509 B
Idris
17 lines
509 B
Idris
public export
|
|
interface Do (m : Type) where
|
|
Next : m -> Type
|
|
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 -- (>>=)
|