From cc0559227771f9ca63492022897e0091649f8615 Mon Sep 17 00:00:00 2001 From: Flavio Corpa Date: Thu, 18 Jul 2024 11:43:57 +0200 Subject: [PATCH] small doc improvements --- src/PersonalNumber/Danish.elm | 6 +++++- src/PersonalNumber/Finnish.elm | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/PersonalNumber/Danish.elm b/src/PersonalNumber/Danish.elm index b5b529d..dda008d 100644 --- a/src/PersonalNumber/Danish.elm +++ b/src/PersonalNumber/Danish.elm @@ -43,6 +43,8 @@ type PersonalNumber = PersonalNumber String +{-| If the parsing fails an error of this type is returned. +-} type ValidationError = InvalidLength | InvalidDate @@ -137,7 +139,7 @@ display = toString -{-| Males have odd and females have even individual number +{-| Males have an odd serial number -} isMale : PersonalNumber -> Bool isMale (PersonalNumber str) = @@ -152,6 +154,8 @@ isMale (PersonalNumber str) = modBy 2 serialPart == 1 +{-| Females have an even serial number +-} isFemale : PersonalNumber -> Bool isFemale = not << isMale diff --git a/src/PersonalNumber/Finnish.elm b/src/PersonalNumber/Finnish.elm index 89e80e1..5719dc3 100644 --- a/src/PersonalNumber/Finnish.elm +++ b/src/PersonalNumber/Finnish.elm @@ -123,7 +123,7 @@ validateChecksum str = Err InvalidChecksum -{-| Males have odd and females have even individual number +{-| Males have an odd serial number -} isMale : PersonalNumber -> Bool isMale (PersonalNumber str) = @@ -138,6 +138,8 @@ isMale (PersonalNumber str) = modBy 2 serialPart == 1 +{-| Females have an even serial number +-} isFemale : PersonalNumber -> Bool isFemale = not << isMale