Module

URI.Port

#Port

newtype Port

The port component of a host in a URI.

Instances

#toInt

toInt :: Port -> Int

Returns the port number as an integer.

#fromInt

fromInt :: Int -> Maybe Port

Attempts to create a port from the passed integer. If the value falls outside of the range 0-65535 (inclusive) Nothing will be returned.

#unsafeFromInt

unsafeFromInt :: Int -> Port

Constructs a port from an integer directly: if the value is not an acceptable port number a runtime error will be thrown.

This is intended as a convenience when describing Ports statically in PureScript code, in all other cases fromInt should be preferred.

#parser

parser :: Parser String Port

A parser for the port component of a host in a URI. Expects values with a ':' prefix.

#print

print :: Port -> String

A printer for the port component of a host in a URI. Will print the value with a ':' prefix.

Modules