7
Domanda semplice.Come importare il costruttore PortNumber specifico
Questo compila:
module Example where
import Network
port :: PortID
port = PortNumber 3001
E questo non lo fa:
module Example where
import Network (PortID, PortNumber)
port :: PortID
port = PortNumber 3001
GHC dice:
Example.hs:6:8: Not in scope: data constructor `PortNumber'
Perché?
È possibile importare tutti i costruttori di un tipo di dati con ad es. 'Importa rete (PortID (..))'. – dflemstr