[{"name":"Bible","comment":" A library for working with Bible references.\n\n\n# Parsing\n\n@docs fromString\n\n\n# Formatting\n\n@docs format\n\n\n# Encoding\n\nIt may be useful to have a unique, compact representation of a reference for storage, searching, sorting, etc.\n\nAn easy way to achieve this is to convert the start and end of the reference to an `Int`.\nThese integers can then be stored in a database, sorted, checked for intersections to do searches, etc.\n\nThe encoding process is as follows:\n\n    (1000000 * Book.toInt book) + (1000 * chapter) + verse\n\nThis results in an `Int` with the following structure\n\n    16001001\n    --===___\n     | |  |\n     | |  |\n     | |  |--- Zero padded verse number\n     | |------ Zero padded chapter number\n     |-------- Book number\n\n@docs encode, decode\n\n\n# Lower Level Parts\n\nThese functions may be useful if you want to build your own formatter, or something else.\n[`Bible.Book`](Bible-Book) has the names, numbers and sizes of the books.\n\n@docs toStartBook, toEndBook\n@docs toStartBookString, toEndBookString, toStartChapter, toEndChapter, toStartVerse, toEndVerse\n\n\n# Types\n\n@docs Reference\n\n","unions":[{"name":"Reference","comment":" An opaque type to represent a Bible reference.\n","args":[],"cases":[]}],"aliases":[],"values":[{"name":"decode","comment":" Attempt to convert an encoded value to a reference.\n\nFails if either value is outside Genesis 1:1 to Revelation 22:21, or the\nreference isn't valid.\n\n","type":"{ start : Basics.Int, end : Basics.Int } -> Result.Result String.String Bible.Reference"},{"name":"encode","comment":" Convert a reference to an encoded representation.\n\n    (fromString \"Gen 1:1 - Rev 5\") |> Result.map encode)\n        == Ok {start = 1001001, end = 66005014}\n\n","type":"Bible.Reference -> { start : Basics.Int, end : Basics.Int }"},{"name":"format","comment":" Get a formatted `String` from a `Reference`.\n\nSome example outputs:\n\n  - Genesis 1:1\n  - Genesis 1:1-11\n  - Genesis 1:1 - 12:2\n  - Genesis 1:1 - Exodus 2:4\n\n","type":"Bible.Reference -> String.String"},{"name":"fromString","comment":" Attempt to convert a `String` into a `Reference`.\n\nThe following formats should work:\n\n  - Genesis 1\n  - Genesis 1:1\n  - Genesis 1:1-20\n  - Genesis 1:20-2:24\n  - Genesis 1-5\n  - Genesis 1 - Exodus 5\n  - Genesis 1:1 - Exodus 5:20\n  - Genesis 1:1 - Exodus 5\n  - Genesis 1 - Exodus 5:20\n\nBook names can be written in full or abbreviated, in any case, with or without\na trailing dot: `Psalm 23`, `Psalms 23`, `Ps. 23`, `1 Cor 13`, `I Cor 13`,\n`First Corinthians 13`, `Jhn 3:16`. Any whitespace works between the parts, and\n`-`, `–` and `—` all work as dashes.\n\nText after the reference is ignored, so `John 3:16 (ESV)` is John 3:16.\n\n    (fromString \"Ps. 23\" |> Result.map format)\n        == Ok \"Psalm 23:1-6\"\n\n    (fromString \"Gen 0\" |> Result.map format)\n        == Err \"Chapter numbers start at 1\"\n\n","type":"String.String -> Result.Result String.String Bible.Reference"},{"name":"toEndBook","comment":" Get the book the reference ends with.\n","type":"Bible.Reference -> Bible.Book.Book"},{"name":"toEndBookString","comment":" Get the name of the book the reference ends with.\n","type":"Bible.Reference -> String.String"},{"name":"toEndChapter","comment":" Get the chapter the reference ends with.\n","type":"Bible.Reference -> Basics.Int"},{"name":"toEndVerse","comment":" Get the verse the reference ends with.\n","type":"Bible.Reference -> Basics.Int"},{"name":"toStartBook","comment":" Get the book the reference starts with.\n","type":"Bible.Reference -> Bible.Book.Book"},{"name":"toStartBookString","comment":" Get the name of the book the reference starts with.\n","type":"Bible.Reference -> String.String"},{"name":"toStartChapter","comment":" Get the chapter the reference starts with.\n","type":"Bible.Reference -> Basics.Int"},{"name":"toStartVerse","comment":" Get the verse the reference starts with.\n","type":"Bible.Reference -> Basics.Int"}],"binops":[]},{"name":"Bible.Book","comment":" The 66 books of the Bible, in order, with their names, sizes and the\nspellings the parser accepts.\n\n    Bible.fromString \"Ps 23\"\n        |> Result.map (Bible.toStartBook >> title)\n        == Ok \"Psalms\"\n\n@docs Book\n\n\n# Listing books\n\n@docs all, fromInt, toInt\n\n\n# Names\n\n@docs name, title\n\n\n# Size\n\n@docs numChapters, numVerses\n\n\n# Parsing\n\n@docs aliases\n\n","unions":[],"aliases":[{"name":"Book","comment":" A book of the Bible. Get one from [`all`](#all), [`fromInt`](#fromInt) or\n[`Bible.toStartBook`](Bible#toStartBook).\n","args":[],"type":"Internal.Book.Book"}],"values":[{"name":"aliases","comment":" The lowercase spellings [`Bible.fromString`](Bible#fromString) accepts for\nthe book. Matching ignores case, a trailing `.` and extra whitespace.\n\n    Maybe.map aliases (fromInt 1) == Just [ \"genesis\", \"gen\" ]\n\n","type":"Bible.Book.Book -> List.List String.String"},{"name":"all","comment":" Every book, from Genesis to Revelation.\n","type":"List.List Bible.Book.Book"},{"name":"fromInt","comment":" The book with this number, counting Genesis as 1 and Revelation as 66.\n\n    Maybe.map name (fromInt 19) == Just \"Psalm\"\n\n    fromInt 67 == Nothing\n\n","type":"Basics.Int -> Maybe.Maybe Bible.Book.Book"},{"name":"name","comment":" The name used in a reference, as [`Bible.format`](Bible#format) writes it:\n\"Genesis\", \"1 Samuel\", \"Psalm\".\n","type":"Bible.Book.Book -> String.String"},{"name":"numChapters","comment":" How many chapters the book has.\n\n    Maybe.map numChapters (fromInt 19) == Just 150\n\n","type":"Bible.Book.Book -> Basics.Int"},{"name":"numVerses","comment":" How many verses a chapter of the book has, or 0 if the book has no such\nchapter.\n\n    Maybe.map (\\psalms -> numVerses psalms 119) (fromInt 19) == Just 176\n\n","type":"Bible.Book.Book -> Basics.Int -> Basics.Int"},{"name":"title","comment":" The name used for the book as a whole, such as in a heading. This is the\nsame as [`name`](#name) except for Psalms: `name` gives \"Psalm\" (as in\n\"Psalm 23\") and `title` gives \"Psalms\".\n","type":"Bible.Book.Book -> String.String"},{"name":"toInt","comment":" The book's number, from 1 (Genesis) to 66 (Revelation). This is the book\npart of [`Bible.encode`](Bible#encode).\n","type":"Bible.Book.Book -> Basics.Int"}],"binops":[]}]