Safe Haskell | Trustworthy |
---|---|
Language | Haskell2010 |
Microformats 2 types for Haskell.
Notes:
- We don't duplicate sub-properties in parent types. E.g. h-adr has both p-geo and p-latitude, p-longitude, p-altitude. Adr only has a Geo.
- Lazy Text is used for storing texts, because it's the format used in Scotty, Hastache and other popular web libraries.
- Lists are used everywhere, because all properties might be multivalued, even though it doesn't always make sense.
Use
headMay
from the safe package! - SomethingReference sum types are used for, well, references. The spec always makes embedded microformats optional, so these types include Text options.
- data GeoReference
- data AdrReference
- data LocationReference
- data CardReference
- data EntryReference
- data ContentReference
- data Geo = Geo {
- geoLatitude :: [Double]
- geoLongitude :: [Double]
- geoAltitude :: [Double]
- data Adr = Adr {
- adrStreetAddress :: [Text]
- adrExtendedAddress :: [Text]
- adrPostOfficeBox :: [Text]
- adrLocality :: [Text]
- adrRegion :: [Text]
- adrPostalCode :: [Text]
- adrCountryName :: [Text]
- adrLabel :: [Text]
- adrGeo :: [GeoReference]
- data Card = Card {
- cardName :: [Text]
- cardHonorificPrefix :: [Text]
- cardGivenName :: [Text]
- cardAdditionalName :: [Text]
- cardFamilyName :: [Text]
- cardSortString :: [Text]
- cardHonorificSuffix :: [Text]
- cardNickname :: [Text]
- cardEmail :: [Text]
- cardLogo :: [Text]
- cardPhoto :: [Text]
- cardUrl :: [Text]
- cardUid :: [Text]
- cardCategory :: [Text]
- cardAdr :: [AdrReference]
- cardTel :: [Text]
- cardNote :: [Text]
- cardBday :: [UTCTime]
- cardKey :: [Text]
- cardOrg :: [CardReference]
- cardJobTitle :: [Text]
- cardRole :: [Text]
- cardImpp :: [Text]
- cardSex :: [Text]
- cardGenderIdentity :: [Text]
- cardAnniversary :: [UTCTime]
- data Cite = Cite {
- citeName :: [Text]
- citePublished :: [UTCTime]
- citeAuthor :: [CardReference]
- citeUrl :: [Text]
- citeUid :: [Text]
- citePublication :: [Text]
- citeAccessed :: [UTCTime]
- citeContent :: [ContentReference]
- data Entry = Entry {
- entryName :: [Text]
- entrySummary :: [Text]
- entryContent :: [ContentReference]
- entryPublished :: [UTCTime]
- entryUpdated :: [UTCTime]
- entryAuthor :: [CardReference]
- entryCategory :: [Text]
- entryUrl :: [Text]
- entryUid :: [Text]
- entryLocation :: [LocationReference]
- entryComments :: [EntryReference]
- entrySyndication :: [Text]
- entryInReplyTo :: [EntryReference]
- entryLikeOf :: [EntryReference]
- entryRepostOf :: [EntryReference]
- citeOfEntry :: Entry -> Cite
Documentation
data GeoReference Source
A Geo reference.
data AdrReference Source
An Adr reference.
data LocationReference Source
A location (CardAdrGeo) reference.
data CardReference Source
A Card reference.
data EntryReference Source
An Entry/Cite reference.
data ContentReference Source
A content reference.
A Geo type, based on h-geo http://microformats.org/wiki/h-geo
Geo | |
|
An Adr type, based on h-adr http://microformats.org/wiki/h-adr
Adr | |
|
A Card type, based on h-card http://microformats.org/wiki/h-card
Card | |
|
A Cite type, based on h-cite http://microformats.org/wiki/h-cite
Cite | |
|
An Entry type, based on h-entry http://microformats.org/wiki/h-entry with popular extensions.
Entry | |
|
citeOfEntry :: Entry -> Cite Source