Module

URI.Port

Package
purescript-uri
Repository
slamdata/purescript-uri

#Port Source

newtype Port

The port component of a host in a URI.

Instances

#toInt Source

toInt :: Port -> Int

Returns the port number as an integer.

#fromInt Source

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 Source

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 Source

parser :: Parser String Port

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

#print Source

print :: Port -> String

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