Safe Haskell | None |
---|---|
Language | Haskell2010 |
ROC.ID
Synopsis
- data Identity = Identity {}
- identityChecksum :: Identity -> Digit
- parseIdentity :: Text -> Either ParseError Identity
- data ParseError
- randomIdentity :: MonadRandom m => m Identity
Documentation
Represents a valid 10-digit ROC national identification number
(中華民國身份證號碼) of the form A123456789
.
By construction, invalid values are not representable by this type.
An identification number encodes a person's Gender
, the Location
in
which they first registered for an identification card, and a unique Serial
number.
Constructors
Identity | |
Fields
|
Instances
parseIdentity :: Text -> Either ParseError Identity Source #
data ParseError Source #
An error produced when parsing an Identity
with the parseIdentity
function.
Constructors
InvalidLength | The input was either too short or too long. |
InvalidGender | The gender portion of the input was invalid. |
InvalidLocation | The location portion of the input included non-alphabetic characters. |
InvalidSerial | The serial number portion of the input included non-numeric characters. |
InvalidChecksum | The computed checksum did not match the checksum portion of the input. |
Instances
Show ParseError Source # | |
Defined in ROC.ID Methods showsPrec :: Int -> ParseError -> ShowS # show :: ParseError -> String # showList :: [ParseError] -> ShowS # | |
Eq ParseError Source # | |
Defined in ROC.ID |
randomIdentity :: MonadRandom m => m Identity Source #
Generate a random Identity
.