A library for working with Bible references.
Get a formatted String from a Reference.
Some example outputs:
It may be useful to have a unique, compact representation of a reference for storage, searching, sorting, etc.
An easy way to achieve this is to convert the start and end of the reference to an Int.
These integers can then be stored in a database, sorted, checked for intersections to do searches, etc.
The encoding process is as follows:
(1000000 * Book.toInt book) + (1000 * chapter) + verseThis results in an Int with the following structure
16001001
--===___
| | |
| | |
| | |--- Zero padded verse number
| |------ Zero padded chapter number
|-------- Book numberConvert a reference to an encoded representation.
(fromString "Gen 1:1 - Rev 5") |> Result.map encode)
== Ok {start = 1001001, end = 66005014}Attempt to convert an encoded value to a reference.
These functions may be useful if you want to build your own formatter, or something else.
Get the name of the book the reference starts with.
Get the name of the book the reference ends with.
Get the chapter the reference starts with.
Get the chapter the reference ends with.
Get the verse the reference starts with.
Get the verse the reference ends with.
An opaque type to represent a Bible reference.
Attempt to convert a
Stringinto aReference.The following formats should work: