How to control export of records to Haskell?

With the following module example:

module Exp ( initial, myval ) where
data State = State { i :: Int }
initial = State { i = 123 }
myval st = i st

After loading the module in GHCI, I see that the names Stateand iwere also exported. I can get their types and use them. How to limit export to export only initial(black box) and myval?

+5
source share
1 answer

State i , ghci, . , ghci, :l Exp resp ghci Exp. .

+11

All Articles