haskell - How to import specific PortNumber constructor -


simple question.

this compiles:

module example import network port :: portid port = portnumber 3001 

and not:

module example import network (portid, portnumber) port :: portid port = portnumber 3001 

ghc says:

example.hs:6:8: not in scope: data constructor `portnumber' 

why?

it has be

import network (portid(portnumber)) 

as portnumber seems constructor of portid. other import imports of network , hence portnumber found.


Comments

Popular posts from this blog

JQuery Autocomplete without using label, value, id -

c++ - Accessing inactive union member and undefined behavior? -

JAVA - what is the difference between void and boolean methods? -