Why does importing Control.Applicative allow this bad code to type check?

前端 未结 2 1495
滥情空心
滥情空心 2020-12-19 01:43

I\'m helping a friend learn Haskell and he recently created code like this, which type checks and produces a CPU-burning loop at runtime. I\'m completely baffled by this.

2条回答
  •  一个人的身影
    2020-12-19 02:15

    Control.Applicative imports Control.Monad.Instances, and therefore re-exports the instances from Control.Monad.Instances. This includes Functor and Monad instances for ((->) r).

提交回复
热议问题