Simple question.
This compiles:
module Example where
import Network
port :: PortID
port = PortNumber 3001
And this does not:
module Example where
import Network (PortID, PortNumber)
port :: PortID
port = PortNumber 3001
GHC says:
Example.hs:6:8: Not in scope: data constructor `PortNumber'
Why?
It has to be
as
PortNumberseems to be a constructor ofPortID. The other import simply imports all ofNetworkand hencePortNumberis found.