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

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

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

php - Get uncommon values from two or more arrays -