| 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
| Eq Identity Source # | |
| Ord Identity Source # | |
Defined in ROC.ID | |
| Show Identity Source # | |
| Generic Identity Source # | |
| type Rep Identity Source # | |
Defined in ROC.ID type Rep Identity = D1 (MetaData "Identity" "ROC.ID" "roc-id-0.1.0.0-EBt7nY1QCMq7lYvcqKJOx6" False) (C1 (MetaCons "Identity" PrefixI True) (S1 (MetaSel (Just "identityGender") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Gender) :*: (S1 (MetaSel (Just "identityLocation") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Location) :*: S1 (MetaSel (Just "identitySerial") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Serial)))) | |
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
| Eq ParseError Source # | |
Defined in ROC.ID | |
| Show ParseError Source # | |
Defined in ROC.ID Methods showsPrec :: Int -> ParseError -> ShowS # show :: ParseError -> String # showList :: [ParseError] -> ShowS # | |
randomIdentity :: MonadRandom m => m Identity Source #
Generate a random Identity.