1module Main where
2
3import Prelude
4import Effect
5import Effect.Console
6
7class Monad m <= MonadAsk r m | m -> r where
8  ask :: m r
9
10instance monadAskFun :: MonadAsk r ((->) r) where
11  ask = identity
12
13-- This should generate a warning with the correct inferred type.
14test :: forall m. MonadAsk _ m  => m Int
15test = do
16  x <- ask
17  pure (x + 1)
18
19main :: Effect Unit
20main = do
21  log "Done"
22