XTypeOperators extension doesn't work as pragma

后端 未结 3 745
清酒与你
清酒与你 2021-02-19 08:10

I\'m using GHCi 7.0.3 with the following program that implements type-level list:

{-# LANGUAGE TypeOperators #-}

data True
data False

-- List
data Nil
data Con         


        
3条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-19 08:35

    The LANGUAGE pragma works for the source file, it is not propagated to the ghci-prompt. Since it is possible to have conflicting pragmas in multiple source files of a project, source pragmas cannot by default propagate to the ghci-prompt. It would be possible to have the pragmas from *modules effective at the prompt, I'm not sure, but I think it is pondered to implement that, anyway, so far, it's not implemented, so you need to set the extensions for ghci explicitly.

提交回复
热议问题