diff --git a/404.html b/404.html index 68590fc..e40c974 100644 --- a/404.html +++ b/404.html @@ -7,7 +7,7 @@ - + diff --git a/assets/js/516c3461.0509fa32.js b/assets/js/516c3461.0509fa32.js deleted file mode 100644 index fd87424..0000000 --- a/assets/js/516c3461.0509fa32.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[266],{3523:(n,e,l)=>{l.r(e),l.d(e,{assets:()=>d,contentTitle:()=>s,default:()=>c,frontMatter:()=>o,metadata:()=>t,toc:()=>g});var a=l(5893),i=l(1151);const o={sidebar_position:2,id:"types",title:"Pre-defined Types"},s=void 0,t={id:"core/refined/types",title:"Pre-defined Types",description:"Import",source:"@site/../generated-docs/docs/core/refined/types.md",sourceDirName:"core/refined",slug:"/core/refined/types",permalink:"/docs/core/refined/types",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2,id:"types",title:"Pre-defined Types"},sidebar:"docsSidebar",previous:{title:"Refined",permalink:"/docs/core/refined/"},next:{title:"Custom Type",permalink:"/docs/core/refined/custom-type"}},d={},g=[{value:"Import",id:"import",level:2},{value:"Refined Int",id:"refined-int",level:2},{value:"NegInt: negative Int",id:"negint-negative-int",level:2},{value:"Compile-time Validation",id:"compile-time-validation",level:3},{value:"Runtime Validation",id:"runtime-validation",level:3},{value:"Comparison",id:"comparison",level:3},{value:"Get Value",id:"get-value",level:3},{value:"Min and Max Values",id:"min-and-max-values",level:3},{value:"NonNegInt: non-negative Int",id:"nonnegint-non-negative-int",level:2},{value:"Compile-time Validation",id:"compile-time-validation-1",level:3},{value:"Runtime Validation",id:"runtime-validation-1",level:3},{value:"Comparison",id:"comparison-1",level:3},{value:"Get Value",id:"get-value-1",level:3},{value:"Min and Max Values",id:"min-and-max-values-1",level:3},{value:"PosInt: positive Int",id:"posint-positive-int",level:2},{value:"Compile-time Validation",id:"compile-time-validation-2",level:3},{value:"Runtime Validation",id:"runtime-validation-2",level:3},{value:"Comparison",id:"comparison-2",level:3},{value:"Get Value",id:"get-value-2",level:3},{value:"Min and Max Values",id:"min-and-max-values-2",level:3},{value:"NonPosInt: non-positive Int",id:"nonposint-non-positive-int",level:2},{value:"Compile-time Validation",id:"compile-time-validation-3",level:3},{value:"Runtime Validation",id:"runtime-validation-3",level:3},{value:"Comparison",id:"comparison-3",level:3},{value:"Get Value",id:"get-value-3",level:3},{value:"Min and Max Values",id:"min-and-max-values-3",level:3},{value:"Refined Long",id:"refined-long",level:2},{value:"NegLong: negative Long",id:"neglong-negative-long",level:2},{value:"Compile-time Validation",id:"compile-time-validation-4",level:3},{value:"Runtime Validation",id:"runtime-validation-4",level:3},{value:"Comparison",id:"comparison-4",level:3},{value:"Get Value",id:"get-value-4",level:3},{value:"Min and Max Values",id:"min-and-max-values-4",level:3},{value:"NonNegLong: non-negative Long",id:"nonneglong-non-negative-long",level:2},{value:"Compile-time Validation",id:"compile-time-validation-5",level:3},{value:"Runtime Validation",id:"runtime-validation-5",level:3},{value:"Comparison",id:"comparison-5",level:3},{value:"Get Value",id:"get-value-5",level:3},{value:"Min and Max Values",id:"min-and-max-values-5",level:3},{value:"PosLong: positive Long",id:"poslong-positive-long",level:2},{value:"Compile-time Validation",id:"compile-time-validation-6",level:3},{value:"Runtime Validation",id:"runtime-validation-6",level:3},{value:"Comparison",id:"comparison-6",level:3},{value:"Get Value",id:"get-value-6",level:3},{value:"Min and Max Values",id:"min-and-max-values-6",level:3},{value:"NonPosLong: non-positive Long",id:"nonposlong-non-positive-long",level:2},{value:"Compile-time Validation",id:"compile-time-validation-7",level:3},{value:"Runtime Validation",id:"runtime-validation-7",level:3},{value:"Comparison",id:"comparison-7",level:3},{value:"Get Value",id:"get-value-7",level:3},{value:"Min and Max Values",id:"min-and-max-values-7",level:3},{value:"Refined Double",id:"refined-double",level:2},{value:"NegDouble: negative Double",id:"negdouble-negative-double",level:2},{value:"Compile-time Validation",id:"compile-time-validation-8",level:3},{value:"Runtime Validation",id:"runtime-validation-8",level:3},{value:"Comparison",id:"comparison-8",level:3},{value:"Get Value",id:"get-value-8",level:3},{value:"Min and Max Values",id:"min-and-max-values-8",level:3},{value:"NonNegDouble: non-negative Double",id:"nonnegdouble-non-negative-double",level:2},{value:"Compile-time Validation",id:"compile-time-validation-9",level:3},{value:"Runtime Validation",id:"runtime-validation-9",level:3},{value:"Comparison",id:"comparison-9",level:3},{value:"Get Value",id:"get-value-9",level:3},{value:"Min and Max Values",id:"min-and-max-values-9",level:3},{value:"PosDouble: positive Double",id:"posdouble-positive-double",level:2},{value:"Compile-time Validation",id:"compile-time-validation-10",level:3},{value:"Runtime Validation",id:"runtime-validation-10",level:3},{value:"Comparison",id:"comparison-10",level:3},{value:"Get Value",id:"get-value-10",level:3},{value:"Min and Max Values",id:"min-and-max-values-10",level:3},{value:"NonPosDouble: non-positive Double",id:"nonposdouble-non-positive-double",level:2},{value:"Compile-time Validation",id:"compile-time-validation-11",level:3},{value:"Runtime Validation",id:"runtime-validation-11",level:3},{value:"Comparison",id:"comparison-11",level:3},{value:"Get Value",id:"get-value-11",level:3},{value:"Min and Max Values",id:"min-and-max-values-11",level:3},{value:"Refined Float",id:"refined-float",level:2},{value:"NegFloat: negative Float",id:"negfloat-negative-float",level:2},{value:"Compile-time Validation",id:"compile-time-validation-12",level:3},{value:"Runtime Validation",id:"runtime-validation-12",level:3},{value:"Comparison",id:"comparison-12",level:3},{value:"Get Value",id:"get-value-12",level:3},{value:"Min and Max Values",id:"min-and-max-values-12",level:3},{value:"NonNegFloat: non-negative Float",id:"nonnegfloat-non-negative-float",level:2},{value:"Compile-time Validation",id:"compile-time-validation-13",level:3},{value:"Runtime Validation",id:"runtime-validation-13",level:3},{value:"Comparison",id:"comparison-13",level:3},{value:"Get Value",id:"get-value-13",level:3},{value:"Min and Max Values",id:"min-and-max-values-13",level:3},{value:"PosFloat: positive Float",id:"posfloat-positive-float",level:2},{value:"Compile-time Validation",id:"compile-time-validation-14",level:3},{value:"Runtime Validation",id:"runtime-validation-14",level:3},{value:"Comparison",id:"comparison-14",level:3},{value:"Get Value",id:"get-value-14",level:3},{value:"Min and Max Values",id:"min-and-max-values-14",level:3},{value:"NonPosFloat: non-positive Float",id:"nonposfloat-non-positive-float",level:2},{value:"Compile-time Validation",id:"compile-time-validation-15",level:3},{value:"Runtime Validation",id:"runtime-validation-15",level:3},{value:"Comparison",id:"comparison-15",level:3},{value:"Get Value",id:"get-value-15",level:3},{value:"Min and Max Values",id:"min-and-max-values-15",level:3},{value:"Refined BigInt",id:"refined-bigint",level:2},{value:"NegBigInt: negative BigInt",id:"negbigint-negative-bigint",level:2},{value:"Compile-time Validation",id:"compile-time-validation-16",level:3},{value:"Runtime Validation",id:"runtime-validation-16",level:3},{value:"Comparison",id:"comparison-16",level:3},{value:"Get Value",id:"get-value-16",level:3},{value:"NonNegBigInt: non-negative BigInt",id:"nonnegbigint-non-negative-bigint",level:2},{value:"Compile-time Validation",id:"compile-time-validation-17",level:3},{value:"Runtime Validation",id:"runtime-validation-17",level:3},{value:"Comparison",id:"comparison-17",level:3},{value:"Get Value",id:"get-value-17",level:3},{value:"PosBigInt: positive BigInt",id:"posbigint-positive-bigint",level:2},{value:"Compile-time Validation",id:"compile-time-validation-18",level:3},{value:"Runtime Validation",id:"runtime-validation-18",level:3},{value:"Comparison",id:"comparison-18",level:3},{value:"Get Value",id:"get-value-18",level:3},{value:"NonPosBigInt: non-positive BigInt",id:"nonposbigint-non-positive-bigint",level:2},{value:"Compile-time Validation",id:"compile-time-validation-19",level:3},{value:"Runtime Validation",id:"runtime-validation-19",level:3},{value:"Comparison",id:"comparison-19",level:3},{value:"Get Value",id:"get-value-19",level:3},{value:"Refined BigDecimal",id:"refined-bigdecimal",level:2},{value:"NegBigDecimal: negative BigDecimal",id:"negbigdecimal-negative-bigdecimal",level:2},{value:"Compile-time Validation",id:"compile-time-validation-20",level:3},{value:"Runtime Validation",id:"runtime-validation-20",level:3},{value:"Comparison",id:"comparison-20",level:3},{value:"Get Value",id:"get-value-20",level:3},{value:"NonNegBigDecimal: non-negative BigDecimal",id:"nonnegbigdecimal-non-negative-bigdecimal",level:2},{value:"Compile-time Validation",id:"compile-time-validation-21",level:3},{value:"Runtime Validation",id:"runtime-validation-21",level:3},{value:"Comparison",id:"comparison-21",level:3},{value:"Get Value",id:"get-value-21",level:3},{value:"PosBigDecimal: positive BigDecimal",id:"posbigdecimal-positive-bigdecimal",level:2},{value:"Compile-time Validation",id:"compile-time-validation-22",level:3},{value:"Runtime Validation",id:"runtime-validation-22",level:3},{value:"Comparison",id:"comparison-22",level:3},{value:"Get Value",id:"get-value-22",level:3},{value:"NonPosBigDecimal: non-positive BigDecimal",id:"nonposbigdecimal-non-positive-bigdecimal",level:2},{value:"Compile-time Validation",id:"compile-time-validation-23",level:3},{value:"Runtime Validation",id:"runtime-validation-23",level:3},{value:"Comparison",id:"comparison-23",level:3},{value:"Get Value",id:"get-value-23",level:3},{value:"Refined NonEmptyString",id:"refined-nonemptystring",level:2},{value:"Compile-time Validation",id:"compile-time-validation-24",level:3},{value:"Runtime Validation",id:"runtime-validation-24",level:3},{value:"Concatenation",id:"concatenation",level:3},{value:"Get Value",id:"get-value-24",level:3},{value:"Refined Uri",id:"refined-uri",level:2},{value:"Compile-time Validation",id:"compile-time-validation-25",level:3},{value:"Runtime Validation",id:"runtime-validation-25",level:3},{value:"Get Value",id:"get-value-25",level:3},{value:"Convert to java.net.URI",id:"convert-to-javaneturi",level:3}];function r(n){const e={code:"code",h2:"h2",h3:"h3",hr:"hr",pre:"pre",...(0,i.a)(),...n.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(e.h2,{id:"import",children:"Import"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"import refined4s.types.all.*\n"})}),"\n",(0,a.jsxs)(e.h2,{id:"refined-int",children:["Refined ",(0,a.jsx)(e.code,{children:"Int"})]}),"\n",(0,a.jsxs)(e.h2,{id:"negint-negative-int",children:[(0,a.jsx)(e.code,{children:"NegInt"}),": negative ",(0,a.jsx)(e.code,{children:"Int"})]}),"\n",(0,a.jsx)(e.h3,{id:"compile-time-validation",children:"Compile-time Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NegInt(-1)\n// res0: Type = -1\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NegInt(0)\n// error: \n// Invalid value: [0]. It must be a negative Int\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NegInt(1)\n// error: \n// Invalid value: [1]. It must be a negative Int\n"})}),"\n",(0,a.jsx)(e.h3,{id:"runtime-validation",children:"Runtime Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val validNegInt = -1 \n// validNegInt: Int = -1 \nNegInt.from(validNegInt)\n// res3: Either[String, Type] = Right(value = -1)\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'val invalidNegInt1 = 0 \n// invalidNegInt1: Int = 0 \nNegInt.from(invalidNegInt1)\n// res4: Either[String, Type] = Left(\n// value = "Invalid value: [0]. It must be a negative Int"\n// )\n\nval invalidNegInt2 = 1\n// invalidNegInt2: Int = 1\nNegInt.from(invalidNegInt2)\n// res5: Either[String, Type] = Left(\n// value = "Invalid value: [1]. It must be a negative Int"\n// )\n'})}),"\n",(0,a.jsx)(e.h3,{id:"comparison",children:"Comparison"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val negInt1 = NegInt(-1)\n// negInt1: Type = -1\nval negInt2 = NegInt(-2)\n// negInt2: Type = -2\n\nnegInt1 > negInt2\n// res6: Boolean = true\nnegInt1 >= negInt2\n// res7: Boolean = true\nnegInt1 == negInt2\n// res8: Boolean = false\nnegInt1 < negInt2\n// res9: Boolean = false\nnegInt1 <= negInt2\n// res10: Boolean = false\n"})}),"\n",(0,a.jsx)(e.h3,{id:"get-value",children:"Get Value"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val negInt123 = NegInt(-123)\n// negInt123: Type = -123\nval negInt999 = NegInt(-999)\n// negInt999: Type = -999\n\nnegInt123.value\n// res11: Int = -123\n\nnegInt999.value\n// res12: Int = -999\n"})}),"\n",(0,a.jsx)(e.h3,{id:"min-and-max-values",children:"Min and Max Values"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NegInt.MinValue\n// res13: Type = -2147483648\n\nNegInt.MaxValue\n// res14: Type = -1\n"})}),"\n",(0,a.jsx)(e.hr,{}),"\n",(0,a.jsxs)(e.h2,{id:"nonnegint-non-negative-int",children:[(0,a.jsx)(e.code,{children:"NonNegInt"}),": non-negative ",(0,a.jsx)(e.code,{children:"Int"})]}),"\n",(0,a.jsx)(e.h3,{id:"compile-time-validation-1",children:"Compile-time Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonNegInt(0)\n// res15: Type = 0\nNonNegInt(1)\n// res16: Type = 1\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonNegInt(-2)\n// error: \n// Invalid value: [-2]. It must be a non-negative Int\n"})}),"\n",(0,a.jsx)(e.h3,{id:"runtime-validation-1",children:"Runtime Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val validNonNegInt = 1 \n// validNonNegInt: Int = 1 \nNonNegInt.from(validNonNegInt)\n// res18: Either[String, Type] = Right(value = 1)\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'val invalidNonNegInt1 = -1\n// invalidNonNegInt1: Int = -1\nNonNegInt.from(invalidNonNegInt1)\n// res19: Either[String, Type] = Left(\n// value = "Invalid value: [-1]. It must be a non-negative Int"\n// )\n\nval invalidNonNegInt2 = -999\n// invalidNonNegInt2: Int = -999\nNonNegInt.from(invalidNonNegInt2)\n// res20: Either[String, Type] = Left(\n// value = "Invalid value: [-999]. It must be a non-negative Int"\n// )\n'})}),"\n",(0,a.jsx)(e.h3,{id:"comparison-1",children:"Comparison"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val nonNegInt1 = NonNegInt(0)\n// nonNegInt1: Type = 0\nval nonNegInt2 = NonNegInt(999)\n// nonNegInt2: Type = 999\n\nnonNegInt1 > nonNegInt2\n// res21: Boolean = false\nnonNegInt1 >= nonNegInt2\n// res22: Boolean = false\nnonNegInt1 == nonNegInt2\n// res23: Boolean = false\nnonNegInt1 < nonNegInt2\n// res24: Boolean = true\nnonNegInt1 <= nonNegInt2\n// res25: Boolean = true\n"})}),"\n",(0,a.jsx)(e.h3,{id:"get-value-1",children:"Get Value"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val nonNegInt123 = NonNegInt(0)\n// nonNegInt123: Type = 0\nval nonNegInt999 = NonNegInt(999)\n// nonNegInt999: Type = 999\n\nnonNegInt123.value\n// res26: Int = 0\n\nnonNegInt999.value\n// res27: Int = 999\n"})}),"\n",(0,a.jsx)(e.h3,{id:"min-and-max-values-1",children:"Min and Max Values"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonNegInt.MinValue\n// res28: Type = 0\n\nNonNegInt.MaxValue\n// res29: Type = 2147483647\n"})}),"\n",(0,a.jsx)(e.hr,{}),"\n",(0,a.jsxs)(e.h2,{id:"posint-positive-int",children:[(0,a.jsx)(e.code,{children:"PosInt"}),": positive ",(0,a.jsx)(e.code,{children:"Int"})]}),"\n",(0,a.jsx)(e.h3,{id:"compile-time-validation-2",children:"Compile-time Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"PosInt(1)\n// res30: Type = 1\nPosInt(999)\n// res31: Type = 999\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"PosInt(0)\n// error: \n// Invalid value: [0]. It must be a positive Int\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"PosInt(-2)\n// error: \n// Invalid value: [-2]. It must be a positive Int\n"})}),"\n",(0,a.jsx)(e.h3,{id:"runtime-validation-2",children:"Runtime Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val validPosInt = 1\n// validPosInt: Int = 1\nPosInt.from(validPosInt)\n// res34: Either[String, Type] = Right(value = 1)\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'val invalidPosInt1 = 0\n// invalidPosInt1: Int = 0\nPosInt.from(invalidPosInt1)\n// res35: Either[String, Type] = Left(\n// value = "Invalid value: [0]. It must be a positive Int"\n// )\n\nval invalidPosInt2 = -999\n// invalidPosInt2: Int = -999\nPosInt.from(invalidPosInt2)\n// res36: Either[String, Type] = Left(\n// value = "Invalid value: [-999]. It must be a positive Int"\n// )\n'})}),"\n",(0,a.jsx)(e.h3,{id:"comparison-2",children:"Comparison"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val posInt1 = PosInt(1)\n// posInt1: Type = 1\nval posInt2 = PosInt(999)\n// posInt2: Type = 999\n\nposInt1 > posInt2\n// res37: Boolean = false\nposInt1 >= posInt2\n// res38: Boolean = false\nposInt1 == posInt2\n// res39: Boolean = false\nposInt1 < posInt2\n// res40: Boolean = true\nposInt1 <= posInt2\n// res41: Boolean = true\n"})}),"\n",(0,a.jsx)(e.h3,{id:"get-value-2",children:"Get Value"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val posInt123 = PosInt(123)\n// posInt123: Type = 123\nval posInt999 = PosInt(999)\n// posInt999: Type = 999\n\nposInt123.value\n// res42: Int = 123\n\nposInt999.value\n// res43: Int = 999\n"})}),"\n",(0,a.jsx)(e.h3,{id:"min-and-max-values-2",children:"Min and Max Values"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"PosInt.MinValue\n// res44: Type = 1\n\nPosInt.MaxValue\n// res45: Type = 2147483647\n"})}),"\n",(0,a.jsx)(e.hr,{}),"\n",(0,a.jsxs)(e.h2,{id:"nonposint-non-positive-int",children:[(0,a.jsx)(e.code,{children:"NonPosInt"}),": non-positive ",(0,a.jsx)(e.code,{children:"Int"})]}),"\n",(0,a.jsx)(e.h3,{id:"compile-time-validation-3",children:"Compile-time Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonPosInt(0)\n// res46: Type = 0\nNonPosInt(-999)\n// res47: Type = -999\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonPosInt(1)\n// error: \n// Invalid value: [1]. It must be a non-positive Int\n"})}),"\n",(0,a.jsx)(e.h3,{id:"runtime-validation-3",children:"Runtime Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val validNonPosInt = 0\n// validNonPosInt: Int = 0\nNonPosInt.from(validNonPosInt)\n// res49: Either[String, Type] = Right(value = 0)\n\nval validNonPosInt2 = -999\n// validNonPosInt2: Int = -999\nNonPosInt.from(validNonPosInt2)\n// res50: Either[String, Type] = Right(value = -999)\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'val invalidNonPosInt1 = 1\n// invalidNonPosInt1: Int = 1\nNonPosInt.from(invalidNonPosInt1)\n// res51: Either[String, Type] = Left(\n// value = "Invalid value: [1]. It must be a non-positive Int"\n// )\n\nval invalidNonPosInt2 = 999\n// invalidNonPosInt2: Int = 999\nNonPosInt.from(invalidNonPosInt2)\n// res52: Either[String, Type] = Left(\n// value = "Invalid value: [999]. It must be a non-positive Int"\n// )\n'})}),"\n",(0,a.jsx)(e.h3,{id:"comparison-3",children:"Comparison"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val nonPosInt1 = NonPosInt(0)\n// nonPosInt1: Type = 0\nval nonPosInt2 = NonPosInt(-999)\n// nonPosInt2: Type = -999\n\nnonPosInt1 > nonPosInt2\n// res53: Boolean = true\nnonPosInt1 >= nonPosInt2\n// res54: Boolean = true\nnonPosInt1 == nonPosInt2\n// res55: Boolean = false\nnonPosInt1 < nonPosInt2\n// res56: Boolean = false\nnonPosInt1 <= nonPosInt2\n// res57: Boolean = false\n"})}),"\n",(0,a.jsx)(e.h3,{id:"get-value-3",children:"Get Value"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val nonPosInt0 = NonPosInt(0)\n// nonPosInt0: Type = 0\nval nonPosIntMinus999 = NonPosInt(-999)\n// nonPosIntMinus999: Type = -999\n\nnonPosInt0.value\n// res58: Int = 0\n\nnonPosIntMinus999.value\n// res59: Int = -999\n"})}),"\n",(0,a.jsx)(e.h3,{id:"min-and-max-values-3",children:"Min and Max Values"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonPosInt.MinValue\n// res60: Type = -2147483648\n\nNonPosInt.MaxValue\n// res61: Type = 0\n"})}),"\n",(0,a.jsx)(e.hr,{}),"\n",(0,a.jsxs)(e.h2,{id:"refined-long",children:["Refined ",(0,a.jsx)(e.code,{children:"Long"})]}),"\n",(0,a.jsxs)(e.h2,{id:"neglong-negative-long",children:[(0,a.jsx)(e.code,{children:"NegLong"}),": negative ",(0,a.jsx)(e.code,{children:"Long"})]}),"\n",(0,a.jsx)(e.h3,{id:"compile-time-validation-4",children:"Compile-time Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NegLong(-1L)\n// res62: Type = -1L\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NegLong(0L)\n// error: \n// Invalid value: [0L]. It must be a negative Long\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NegLong(1L)\n// error: \n// Invalid value: [1L]. It must be a negative Long\n"})}),"\n",(0,a.jsx)(e.h3,{id:"runtime-validation-4",children:"Runtime Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val validNegLong = -1L \n// validNegLong: Long = -1L \nNegLong.from(validNegLong)\n// res65: Either[String, Type] = Right(value = -1L)\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'val invalidNegLong1 = 0L \n// invalidNegLong1: Long = 0L \nNegLong.from(invalidNegLong1)\n// res66: Either[String, Type] = Left(\n// value = "Invalid value: [0]. It must be a negative Long"\n// )\n\nval invalidNegLong2 = 1L\n// invalidNegLong2: Long = 1L\nNegLong.from(invalidNegLong2)\n// res67: Either[String, Type] = Left(\n// value = "Invalid value: [1]. It must be a negative Long"\n// )\n'})}),"\n",(0,a.jsx)(e.h3,{id:"comparison-4",children:"Comparison"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val negLong1 = NegLong(-1L)\n// negLong1: Type = -1L\nval negLong2 = NegLong(-2L)\n// negLong2: Type = -2L\n\nnegLong1 > negLong2\n// res68: Boolean = true\nnegLong1 >= negLong2\n// res69: Boolean = true\nnegLong1 == negLong2\n// res70: Boolean = false\nnegLong1 < negLong2\n// res71: Boolean = false\nnegLong1 <= negLong2\n// res72: Boolean = false\n"})}),"\n",(0,a.jsx)(e.h3,{id:"get-value-4",children:"Get Value"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val negLong123 = NegLong(-123L)\n// negLong123: Type = -123L\nval negLong999 = NegLong(-999L)\n// negLong999: Type = -999L\n\nnegLong123.value\n// res73: Long = -123L\n\nnegLong999.value\n// res74: Long = -999L\n"})}),"\n",(0,a.jsx)(e.h3,{id:"min-and-max-values-4",children:"Min and Max Values"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NegLong.MinValue\n// res75: Type = -9223372036854775808L\n\nNegLong.MaxValue\n// res76: Type = -1L\n"})}),"\n",(0,a.jsx)(e.hr,{}),"\n",(0,a.jsxs)(e.h2,{id:"nonneglong-non-negative-long",children:[(0,a.jsx)(e.code,{children:"NonNegLong"}),": non-negative ",(0,a.jsx)(e.code,{children:"Long"})]}),"\n",(0,a.jsx)(e.h3,{id:"compile-time-validation-5",children:"Compile-time Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonNegLong(0L)\n// res77: Type = 0L\nNonNegLong(1L)\n// res78: Type = 1L\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonNegLong(-2L)\n// error: \n// Invalid value: [-2L]. It must be a non-negative Long\n"})}),"\n",(0,a.jsx)(e.h3,{id:"runtime-validation-5",children:"Runtime Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val validNonNegLong = 1L\n// validNonNegLong: Long = 1L\nNonNegLong.from(validNonNegLong)\n// res80: Either[String, Type] = Right(value = 1L)\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'val invalidNonNegLong1 = -1L\n// invalidNonNegLong1: Long = -1L\nNonNegLong.from(invalidNonNegLong1)\n// res81: Either[String, Type] = Left(\n// value = "Invalid value: [-1]. It must be a non-negative Long"\n// )\n\nval invalidNonNegLong2 = -999L\n// invalidNonNegLong2: Long = -999L\nNonNegLong.from(invalidNonNegLong2)\n// res82: Either[String, Type] = Left(\n// value = "Invalid value: [-999]. It must be a non-negative Long"\n// )\n'})}),"\n",(0,a.jsx)(e.h3,{id:"comparison-5",children:"Comparison"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val nonNegLong1 = NonNegLong(0L)\n// nonNegLong1: Type = 0L\nval nonNegLong2 = NonNegLong(999L)\n// nonNegLong2: Type = 999L\n\nnonNegLong1 > nonNegLong2\n// res83: Boolean = false\nnonNegLong1 >= nonNegLong2\n// res84: Boolean = false\nnonNegLong1 == nonNegLong2\n// res85: Boolean = false\nnonNegLong1 < nonNegLong2\n// res86: Boolean = true\nnonNegLong1 <= nonNegLong2\n// res87: Boolean = true\n"})}),"\n",(0,a.jsx)(e.h3,{id:"get-value-5",children:"Get Value"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val nonNegLong123 = NonNegLong(0L)\n// nonNegLong123: Type = 0L\nval nonNegLong999 = NonNegLong(999L)\n// nonNegLong999: Type = 999L\n\nnonNegLong123.value\n// res88: Long = 0L\n\nnonNegLong999.value\n// res89: Long = 999L\n"})}),"\n",(0,a.jsx)(e.h3,{id:"min-and-max-values-5",children:"Min and Max Values"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonNegLong.MinValue\n// res90: Type = 0L\n\nNonNegLong.MaxValue\n// res91: Type = 9223372036854775807L\n"})}),"\n",(0,a.jsx)(e.hr,{}),"\n",(0,a.jsxs)(e.h2,{id:"poslong-positive-long",children:[(0,a.jsx)(e.code,{children:"PosLong"}),": positive ",(0,a.jsx)(e.code,{children:"Long"})]}),"\n",(0,a.jsx)(e.h3,{id:"compile-time-validation-6",children:"Compile-time Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"PosLong(1L)\n// res92: Type = 1L\nPosLong(999L)\n// res93: Type = 999L\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"PosLong(0L)\n// error: \n// Invalid value: [0L]. It must be a positive Long\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"PosLong(-2L)\n// error: \n// Invalid value: [-2L]. It must be a positive Long\n"})}),"\n",(0,a.jsx)(e.h3,{id:"runtime-validation-6",children:"Runtime Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val validPosLong = 1L\n// validPosLong: Long = 1L\nPosLong.from(validPosLong)\n// res96: Either[String, Type] = Right(value = 1L)\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'val invalidPosLong1 = 0L\n// invalidPosLong1: Long = 0L\nPosLong.from(invalidPosLong1)\n// res97: Either[String, Type] = Left(\n// value = "Invalid value: [0]. It must be a positive Long"\n// )\n\nval invalidPosLong2 = -999L\n// invalidPosLong2: Long = -999L\nPosLong.from(invalidPosLong2)\n// res98: Either[String, Type] = Left(\n// value = "Invalid value: [-999]. It must be a positive Long"\n// )\n'})}),"\n",(0,a.jsx)(e.h3,{id:"comparison-6",children:"Comparison"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val posLong1 = PosLong(1L)\n// posLong1: Type = 1L\nval posLong2 = PosLong(999L)\n// posLong2: Type = 999L\n\nposLong1 > posLong2\n// res99: Boolean = false\nposLong1 >= posLong2\n// res100: Boolean = false\nposLong1 == posLong2\n// res101: Boolean = false\nposLong1 < posLong2\n// res102: Boolean = true\nposLong1 <= posLong2\n// res103: Boolean = true\n"})}),"\n",(0,a.jsx)(e.h3,{id:"get-value-6",children:"Get Value"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val posLong123 = PosLong(123L)\n// posLong123: Type = 123L\nval posLong999 = PosLong(999L)\n// posLong999: Type = 999L\n\nposLong123.value\n// res104: Long = 123L\n\nposLong999.value\n// res105: Long = 999L\n"})}),"\n",(0,a.jsx)(e.h3,{id:"min-and-max-values-6",children:"Min and Max Values"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"PosLong.MinValue\n// res106: Type = 1L\n\nPosLong.MaxValue\n// res107: Type = 9223372036854775807L\n"})}),"\n",(0,a.jsx)(e.hr,{}),"\n",(0,a.jsxs)(e.h2,{id:"nonposlong-non-positive-long",children:[(0,a.jsx)(e.code,{children:"NonPosLong"}),": non-positive ",(0,a.jsx)(e.code,{children:"Long"})]}),"\n",(0,a.jsx)(e.h3,{id:"compile-time-validation-7",children:"Compile-time Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonPosLong(0L)\n// res108: Type = 0L\nNonPosLong(-999L)\n// res109: Type = -999L\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonPosLong(1L)\n// error: \n// Invalid value: [1L]. It must be a non-positive Long\n"})}),"\n",(0,a.jsx)(e.h3,{id:"runtime-validation-7",children:"Runtime Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val validNonPosLong = 0L\n// validNonPosLong: Long = 0L\nNonPosLong.from(validNonPosLong)\n// res111: Either[String, Type] = Right(value = 0L)\n\nval validNonPosLong2 = -999L\n// validNonPosLong2: Long = -999L\nNonPosLong.from(validNonPosLong2)\n// res112: Either[String, Type] = Right(value = -999L)\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'val invalidNonPosLong1 = 1L\n// invalidNonPosLong1: Long = 1L\nNonPosLong.from(invalidNonPosLong1)\n// res113: Either[String, Type] = Left(\n// value = "Invalid value: [1]. It must be a non-positive Long"\n// )\n\nval invalidNonPosLong2 = 999L\n// invalidNonPosLong2: Long = 999L\nNonPosLong.from(invalidNonPosLong2)\n// res114: Either[String, Type] = Left(\n// value = "Invalid value: [999]. It must be a non-positive Long"\n// )\n'})}),"\n",(0,a.jsx)(e.h3,{id:"comparison-7",children:"Comparison"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val nonPosLong1 = NonPosLong(0L)\n// nonPosLong1: Type = 0L\nval nonPosLong2 = NonPosLong(-999L)\n// nonPosLong2: Type = -999L\n\nnonPosLong1 > nonPosLong2\n// res115: Boolean = true\nnonPosLong1 >= nonPosLong2\n// res116: Boolean = true\nnonPosLong1 == nonPosLong2\n// res117: Boolean = false\nnonPosLong1 < nonPosLong2\n// res118: Boolean = false\nnonPosLong1 <= nonPosLong2\n// res119: Boolean = false\n"})}),"\n",(0,a.jsx)(e.h3,{id:"get-value-7",children:"Get Value"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val nonPosLong0 = NonPosLong(0L)\n// nonPosLong0: Type = 0L\nval nonPosLongMinus999 = NonPosLong(-999L)\n// nonPosLongMinus999: Type = -999L\n\nnonPosLong0.value\n// res120: Long = 0L\n\nnonPosLongMinus999.value\n// res121: Long = -999L\n"})}),"\n",(0,a.jsx)(e.h3,{id:"min-and-max-values-7",children:"Min and Max Values"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonPosLong.MinValue\n// res122: Type = -9223372036854775808L\n\nNonPosLong.MaxValue\n// res123: Type = 0L\n"})}),"\n",(0,a.jsx)(e.hr,{}),"\n",(0,a.jsxs)(e.h2,{id:"refined-double",children:["Refined ",(0,a.jsx)(e.code,{children:"Double"})]}),"\n",(0,a.jsxs)(e.h2,{id:"negdouble-negative-double",children:[(0,a.jsx)(e.code,{children:"NegDouble"}),": negative ",(0,a.jsx)(e.code,{children:"Double"})]}),"\n",(0,a.jsx)(e.h3,{id:"compile-time-validation-8",children:"Compile-time Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NegDouble(-0.00001d)\n// res124: Type = -1.0E-5\nNegDouble(-999.999d)\n// res125: Type = -999.999\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NegDouble(0d)\n// error: \n// Invalid value: [0.0d]. It must be a negative Double\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NegDouble(999.999d)\n// error: \n// Invalid value: [999.999d]. It must be a negative Double\n"})}),"\n",(0,a.jsx)(e.h3,{id:"runtime-validation-8",children:"Runtime Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val validNegDouble = -0.00001d \n// validNegDouble: Double = -1.0E-5 \nNegDouble.from(validNegDouble)\n// res128: Either[String, Type] = Right(value = -1.0E-5)\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'val invalidNegDouble1 = 0d \n// invalidNegDouble1: Double = 0.0 \nNegDouble.from(invalidNegDouble1)\n// res129: Either[String, Type] = Left(\n// value = "Invalid value: [0.0]. It must be a negative Double"\n// )\n\nval invalidNegDouble2 = 999.999d\n// invalidNegDouble2: Double = 999.999\nNegDouble.from(invalidNegDouble2)\n// res130: Either[String, Type] = Left(\n// value = "Invalid value: [999.999]. It must be a negative Double"\n// )\n'})}),"\n",(0,a.jsx)(e.h3,{id:"comparison-8",children:"Comparison"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val negDouble1 = NegDouble(-0.1d)\n// negDouble1: Type = -0.1\nval negDouble2 = NegDouble(-0.2d)\n// negDouble2: Type = -0.2\n\nnegDouble1 > negDouble2\n// res131: Boolean = true\nnegDouble1 >= negDouble2\n// res132: Boolean = true\nnegDouble1 == negDouble2\n// res133: Boolean = false\nnegDouble1 < negDouble2\n// res134: Boolean = false\nnegDouble1 <= negDouble2\n// res135: Boolean = false\n"})}),"\n",(0,a.jsx)(e.h3,{id:"get-value-8",children:"Get Value"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val negDouble123 = NegDouble(-123.123d)\n// negDouble123: Type = -123.123\nval negDouble999 = NegDouble(-999.999d)\n// negDouble999: Type = -999.999\n\nnegDouble123.value\n// res136: Double = -123.123\n\nnegDouble999.value\n// res137: Double = -999.999\n"})}),"\n",(0,a.jsx)(e.h3,{id:"min-and-max-values-8",children:"Min and Max Values"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NegDouble.MinValue\n// res138: Type = -1.7976931348623157E308\n\nNegDouble.MaxValue\n// res139: Type = -4.9E-324\n"})}),"\n",(0,a.jsx)(e.hr,{}),"\n",(0,a.jsxs)(e.h2,{id:"nonnegdouble-non-negative-double",children:[(0,a.jsx)(e.code,{children:"NonNegDouble"}),": non-negative ",(0,a.jsx)(e.code,{children:"Double"})]}),"\n",(0,a.jsx)(e.h3,{id:"compile-time-validation-9",children:"Compile-time Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonNegDouble(0d)\n// res140: Type = 0.0\nNonNegDouble(999.999d)\n// res141: Type = 999.999\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonNegDouble(-0.00001d)\n// error: \n// Invalid value: [-1.0E-5d]. It must be a non-negative Double\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{children:"```scala mdoc:fail\nNonNegDouble(-999.999d)\n"})}),"\n",(0,a.jsx)(e.h3,{id:"runtime-validation-9",children:"Runtime Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val validNonNegDouble1 = 0d\n// validNonNegDouble1: Double = 0.0\nNonNegDouble.from(validNonNegDouble1)\n// res143: Either[String, Type] = Right(value = 0.0)\n\nval validNonNegDouble2 = 999.999d\n// validNonNegDouble2: Double = 999.999\nNonNegDouble.from(validNonNegDouble2)\n// res144: Either[String, Type] = Right(value = 999.999)\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'val invalidNonNegDouble1 = -0.00001d\n// invalidNonNegDouble1: Double = -1.0E-5\nNonNegDouble.from(invalidNonNegDouble1)\n// res145: Either[String, Type] = Left(\n// value = "Invalid value: [-1.0E-5]. It must be a non-negative Double"\n// )\n\nval invalidNonNegDouble2 = -999.999d\n// invalidNonNegDouble2: Double = -999.999\nNonNegDouble.from(invalidNonNegDouble2)\n// res146: Either[String, Type] = Left(\n// value = "Invalid value: [-999.999]. It must be a non-negative Double"\n// )\n'})}),"\n",(0,a.jsx)(e.h3,{id:"comparison-9",children:"Comparison"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val nonNegDouble1 = NonNegDouble(0d)\n// nonNegDouble1: Type = 0.0\nval nonNegDouble2 = NonNegDouble(0.999d)\n// nonNegDouble2: Type = 0.999\n\nnonNegDouble1 > nonNegDouble2\n// res147: Boolean = false\nnonNegDouble1 >= nonNegDouble2\n// res148: Boolean = false\nnonNegDouble1 == nonNegDouble2\n// res149: Boolean = false\nnonNegDouble1 < nonNegDouble2\n// res150: Boolean = true\nnonNegDouble1 <= nonNegDouble2\n// res151: Boolean = true\n"})}),"\n",(0,a.jsx)(e.h3,{id:"get-value-9",children:"Get Value"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val nonNegDouble123 = NonNegDouble(0d)\n// nonNegDouble123: Type = 0.0\nval nonNegDouble999 = NonNegDouble(999.999d)\n// nonNegDouble999: Type = 999.999\n\nnonNegDouble123.value\n// res152: Double = 0.0\n\nnonNegDouble999.value\n// res153: Double = 999.999\n"})}),"\n",(0,a.jsx)(e.h3,{id:"min-and-max-values-9",children:"Min and Max Values"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonNegDouble.MinValue\n// res154: Type = 0.0\n\nNonNegDouble.MaxValue\n// res155: Type = 1.7976931348623157E308\n"})}),"\n",(0,a.jsx)(e.hr,{}),"\n",(0,a.jsxs)(e.h2,{id:"posdouble-positive-double",children:[(0,a.jsx)(e.code,{children:"PosDouble"}),": positive ",(0,a.jsx)(e.code,{children:"Double"})]}),"\n",(0,a.jsx)(e.h3,{id:"compile-time-validation-10",children:"Compile-time Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"PosDouble(0.00001d)\n// res156: Type = 1.0E-5\nPosDouble(999.999d)\n// res157: Type = 999.999\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"PosDouble(0d)\n// error: \n// Invalid value: [0.0d]. It must be a positive Double\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"PosDouble(-999.999d)\n// error: \n// Invalid value: [-999.999d]. It must be a positive Double\n"})}),"\n",(0,a.jsx)(e.h3,{id:"runtime-validation-10",children:"Runtime Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val validPosDouble1 = 0.00001d\n// validPosDouble1: Double = 1.0E-5\nPosDouble.from(validPosDouble1)\n// res160: Either[String, Type] = Right(value = 1.0E-5)\n\nval validPosDouble2 = 999.999d\n// validPosDouble2: Double = 999.999\nPosDouble.from(validPosDouble2)\n// res161: Either[String, Type] = Right(value = 999.999)\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'val invalidPosDouble1 = 0d\n// invalidPosDouble1: Double = 0.0\nPosDouble.from(invalidPosDouble1)\n// res162: Either[String, Type] = Left(\n// value = "Invalid value: [0.0]. It must be a positive Double"\n// )\n\nval invalidPosDouble2 = -999.999d\n// invalidPosDouble2: Double = -999.999\nPosDouble.from(invalidPosDouble2)\n// res163: Either[String, Type] = Left(\n// value = "Invalid value: [-999.999]. It must be a positive Double"\n// )\n'})}),"\n",(0,a.jsx)(e.h3,{id:"comparison-10",children:"Comparison"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val posDouble1 = PosDouble(0.00001d)\n// posDouble1: Type = 1.0E-5\nval posDouble2 = PosDouble(0.999d)\n// posDouble2: Type = 0.999\n\nposDouble1 > posDouble2\n// res164: Boolean = false\nposDouble1 >= posDouble2\n// res165: Boolean = false\nposDouble1 == posDouble2\n// res166: Boolean = false\nposDouble1 < posDouble2\n// res167: Boolean = true\nposDouble1 <= posDouble2\n// res168: Boolean = true\n"})}),"\n",(0,a.jsx)(e.h3,{id:"get-value-10",children:"Get Value"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val posDouble123 = PosDouble(123.123d)\n// posDouble123: Type = 123.123\nval posDouble999 = PosDouble(999.999d)\n// posDouble999: Type = 999.999\n\nposDouble123.value\n// res169: Double = 123.123\n\nposDouble999.value\n// res170: Double = 999.999\n"})}),"\n",(0,a.jsx)(e.h3,{id:"min-and-max-values-10",children:"Min and Max Values"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"PosDouble.MinValue\n// res171: Type = 4.9E-324\n\nPosDouble.MaxValue\n// res172: Type = 1.7976931348623157E308\n"})}),"\n",(0,a.jsx)(e.hr,{}),"\n",(0,a.jsxs)(e.h2,{id:"nonposdouble-non-positive-double",children:[(0,a.jsx)(e.code,{children:"NonPosDouble"}),": non-positive ",(0,a.jsx)(e.code,{children:"Double"})]}),"\n",(0,a.jsx)(e.h3,{id:"compile-time-validation-11",children:"Compile-time Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonPosDouble(0d)\n// res173: Type = 0.0\nNonPosDouble(-999.999d)\n// res174: Type = -999.999\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonPosDouble(0.00001d)\n// error: \n// Invalid value: [1.0E-5d]. It must be a non-positive Double\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonPosDouble(999.999d)\n// error: \n// Invalid value: [999.999d]. It must be a non-positive Double\n"})}),"\n",(0,a.jsx)(e.h3,{id:"runtime-validation-11",children:"Runtime Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val validNonPosDouble = 0d\n// validNonPosDouble: Double = 0.0\nNonPosDouble.from(validNonPosDouble)\n// res177: Either[String, Type] = Right(value = 0.0)\n\nval validNonPosDouble2 = -999.999d\n// validNonPosDouble2: Double = -999.999\nNonPosDouble.from(validNonPosDouble2)\n// res178: Either[String, Type] = Right(value = -999.999)\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'val invalidNonPosDouble1 = 0.00001d\n// invalidNonPosDouble1: Double = 1.0E-5\nNonPosDouble.from(invalidNonPosDouble1)\n// res179: Either[String, Type] = Left(\n// value = "Invalid value: [1.0E-5]. It must be a non-positive Double"\n// )\n\nval invalidNonPosDouble2 = 999.999d\n// invalidNonPosDouble2: Double = 999.999\nNonPosDouble.from(invalidNonPosDouble2)\n// res180: Either[String, Type] = Left(\n// value = "Invalid value: [999.999]. It must be a non-positive Double"\n// )\n'})}),"\n",(0,a.jsx)(e.h3,{id:"comparison-11",children:"Comparison"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val nonPosDouble1 = NonPosDouble(0d)\n// nonPosDouble1: Type = 0.0\nval nonPosDouble2 = NonPosDouble(-0.999d)\n// nonPosDouble2: Type = -0.999\n\nnonPosDouble1 > nonPosDouble2\n// res181: Boolean = true\nnonPosDouble1 >= nonPosDouble2\n// res182: Boolean = true\nnonPosDouble1 == nonPosDouble2\n// res183: Boolean = false\nnonPosDouble1 < nonPosDouble2\n// res184: Boolean = false\nnonPosDouble1 <= nonPosDouble2\n// res185: Boolean = false\n"})}),"\n",(0,a.jsx)(e.h3,{id:"get-value-11",children:"Get Value"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val nonPosDouble0 = NonPosDouble(0d)\n// nonPosDouble0: Type = 0.0\nval nonPosDoubleMinus999 = NonPosDouble(-999.999d)\n// nonPosDoubleMinus999: Type = -999.999\n\nnonPosDouble0.value\n// res186: Double = 0.0\n\nnonPosDoubleMinus999.value\n// res187: Double = -999.999\n"})}),"\n",(0,a.jsx)(e.h3,{id:"min-and-max-values-11",children:"Min and Max Values"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonPosDouble.MinValue\n// res188: Type = -1.7976931348623157E308\n\nNonPosDouble.MaxValue\n// res189: Type = 0.0\n"})}),"\n",(0,a.jsx)(e.hr,{}),"\n",(0,a.jsxs)(e.h2,{id:"refined-float",children:["Refined ",(0,a.jsx)(e.code,{children:"Float"})]}),"\n",(0,a.jsxs)(e.h2,{id:"negfloat-negative-float",children:[(0,a.jsx)(e.code,{children:"NegFloat"}),": negative ",(0,a.jsx)(e.code,{children:"Float"})]}),"\n",(0,a.jsx)(e.h3,{id:"compile-time-validation-12",children:"Compile-time Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NegFloat(-0.00001f)\n// res190: Type = -1.0E-5F\nNegFloat(-999.999f)\n// res191: Type = -999.999F\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NegFloat(0f)\n// error: \n// Invalid value: [0.0f]. It must be a negative Float\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NegFloat(999.999f)\n// error: \n// Invalid value: [999.999f]. It must be a negative Float\n"})}),"\n",(0,a.jsx)(e.h3,{id:"runtime-validation-12",children:"Runtime Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val validNegFloat = -0.00001f \n// validNegFloat: Float = -1.0E-5F \nNegFloat.from(validNegFloat)\n// res194: Either[String, Type] = Right(value = -1.0E-5F)\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'val invalidNegFloat1 = 0f \n// invalidNegFloat1: Float = 0.0F \nNegFloat.from(invalidNegFloat1)\n// res195: Either[String, Type] = Left(\n// value = "Invalid value: [0.0]. It must be a negative Float"\n// )\n\nval invalidNegFloat2 = 999.999f\n// invalidNegFloat2: Float = 999.999F\nNegFloat.from(invalidNegFloat2)\n// res196: Either[String, Type] = Left(\n// value = "Invalid value: [999.999]. It must be a negative Float"\n// )\n'})}),"\n",(0,a.jsx)(e.h3,{id:"comparison-12",children:"Comparison"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val negFloat1 = NegFloat(-0.1f)\n// negFloat1: Type = -0.1F\nval negFloat2 = NegFloat(-0.2f)\n// negFloat2: Type = -0.2F\n\nnegFloat1 > negFloat2\n// res197: Boolean = true\nnegFloat1 >= negFloat2\n// res198: Boolean = true\nnegFloat1 == negFloat2\n// res199: Boolean = false\nnegFloat1 < negFloat2\n// res200: Boolean = false\nnegFloat1 <= negFloat2\n// res201: Boolean = false\n"})}),"\n",(0,a.jsx)(e.h3,{id:"get-value-12",children:"Get Value"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val negFloat123 = NegFloat(-123.123f)\n// negFloat123: Type = -123.123F\nval negFloat999 = NegFloat(-999.999f)\n// negFloat999: Type = -999.999F\n\nnegFloat123.value\n// res202: Float = -123.123F\n\nnegFloat999.value\n// res203: Float = -999.999F\n"})}),"\n",(0,a.jsx)(e.h3,{id:"min-and-max-values-12",children:"Min and Max Values"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NegFloat.MinValue\n// res204: Type = -3.4028235E38F\n\nNegFloat.MaxValue\n// res205: Type = -1.4E-45F\n"})}),"\n",(0,a.jsx)(e.hr,{}),"\n",(0,a.jsxs)(e.h2,{id:"nonnegfloat-non-negative-float",children:[(0,a.jsx)(e.code,{children:"NonNegFloat"}),": non-negative ",(0,a.jsx)(e.code,{children:"Float"})]}),"\n",(0,a.jsx)(e.h3,{id:"compile-time-validation-13",children:"Compile-time Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonNegFloat(0f)\n// res206: Type = 0.0F\nNonNegFloat(999.999f)\n// res207: Type = 999.999F\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonNegFloat(-0.00001f)\n// error: \n// Invalid value: [-1.0E-5f]. It must be a non-negative Float\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonNegFloat(-999.999f)\n// error: \n// Invalid value: [-999.999f]. It must be a non-negative Float\n"})}),"\n",(0,a.jsx)(e.h3,{id:"runtime-validation-13",children:"Runtime Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val validNonNegFloat1 = 0f\n// validNonNegFloat1: Float = 0.0F\nNonNegFloat.from(validNonNegFloat1)\n// res210: Either[String, Type] = Right(value = 0.0F)\n\nval validNonNegFloat2 = 999.999f\n// validNonNegFloat2: Float = 999.999F\nNonNegFloat.from(validNonNegFloat2)\n// res211: Either[String, Type] = Right(value = 999.999F)\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'val invalidNonNegFloat1 = -0.00001f\n// invalidNonNegFloat1: Float = -1.0E-5F\nNonNegFloat.from(invalidNonNegFloat1)\n// res212: Either[String, Type] = Left(\n// value = "Invalid value: [-1.0E-5]. It must be a non-negative Float"\n// )\n\nval invalidNonNegFloat2 = -999.999f\n// invalidNonNegFloat2: Float = -999.999F\nNonNegFloat.from(invalidNonNegFloat2)\n// res213: Either[String, Type] = Left(\n// value = "Invalid value: [-999.999]. It must be a non-negative Float"\n// )\n'})}),"\n",(0,a.jsx)(e.h3,{id:"comparison-13",children:"Comparison"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val nonNegFloat1 = NonNegFloat(0f)\n// nonNegFloat1: Type = 0.0F\nval nonNegFloat2 = NonNegFloat(0.999f)\n// nonNegFloat2: Type = 0.999F\n\nnonNegFloat1 > nonNegFloat2\n// res214: Boolean = false\nnonNegFloat1 >= nonNegFloat2\n// res215: Boolean = false\nnonNegFloat1 == nonNegFloat2\n// res216: Boolean = false\nnonNegFloat1 < nonNegFloat2\n// res217: Boolean = true\nnonNegFloat1 <= nonNegFloat2\n// res218: Boolean = true\n"})}),"\n",(0,a.jsx)(e.h3,{id:"get-value-13",children:"Get Value"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val nonNegFloat123 = NonNegFloat(0f)\n// nonNegFloat123: Type = 0.0F\nval nonNegFloat999 = NonNegFloat(999.999f)\n// nonNegFloat999: Type = 999.999F\n\nnonNegFloat123.value\n// res219: Float = 0.0F\n\nnonNegFloat999.value\n// res220: Float = 999.999F\n"})}),"\n",(0,a.jsx)(e.h3,{id:"min-and-max-values-13",children:"Min and Max Values"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonNegFloat.MinValue\n// res221: Type = 0.0F\n\nNonNegFloat.MaxValue\n// res222: Type = 3.4028235E38F\n"})}),"\n",(0,a.jsx)(e.hr,{}),"\n",(0,a.jsxs)(e.h2,{id:"posfloat-positive-float",children:[(0,a.jsx)(e.code,{children:"PosFloat"}),": positive ",(0,a.jsx)(e.code,{children:"Float"})]}),"\n",(0,a.jsx)(e.h3,{id:"compile-time-validation-14",children:"Compile-time Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"PosFloat(0.00001f)\n// res223: Type = 1.0E-5F\nPosFloat(999.999f)\n// res224: Type = 999.999F\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"PosFloat(0f)\n// error: \n// Invalid value: [0.0f]. It must be a positive Float\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"PosFloat(-999.999f)\n// error: \n// Invalid value: [-999.999f]. It must be a positive Float\n"})}),"\n",(0,a.jsx)(e.h3,{id:"runtime-validation-14",children:"Runtime Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val validPosFloat1 = 0.00001f\n// validPosFloat1: Float = 1.0E-5F\nPosFloat.from(validPosFloat1)\n// res227: Either[String, Type] = Right(value = 1.0E-5F)\n\nval validPosFloat2 = 999.999f\n// validPosFloat2: Float = 999.999F\nPosFloat.from(validPosFloat2)\n// res228: Either[String, Type] = Right(value = 999.999F)\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'val invalidPosFloat1 = 0f\n// invalidPosFloat1: Float = 0.0F\nPosFloat.from(invalidPosFloat1)\n// res229: Either[String, Type] = Left(\n// value = "Invalid value: [0.0]. It must be a positive Float"\n// )\n\nval invalidPosFloat2 = -999.999f\n// invalidPosFloat2: Float = -999.999F\nPosFloat.from(invalidPosFloat2)\n// res230: Either[String, Type] = Left(\n// value = "Invalid value: [-999.999]. It must be a positive Float"\n// )\n'})}),"\n",(0,a.jsx)(e.h3,{id:"comparison-14",children:"Comparison"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val posFloat1 = PosFloat(0.00001f)\n// posFloat1: Type = 1.0E-5F\nval posFloat2 = PosFloat(0.999f)\n// posFloat2: Type = 0.999F\n\nposFloat1 > posFloat2\n// res231: Boolean = false\nposFloat1 >= posFloat2\n// res232: Boolean = false\nposFloat1 == posFloat2\n// res233: Boolean = false\nposFloat1 < posFloat2\n// res234: Boolean = true\nposFloat1 <= posFloat2\n// res235: Boolean = true\n"})}),"\n",(0,a.jsx)(e.h3,{id:"get-value-14",children:"Get Value"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val posFloat123 = PosFloat(123.123f)\n// posFloat123: Type = 123.123F\nval posFloat999 = PosFloat(999.999f)\n// posFloat999: Type = 999.999F\n\nposFloat123.value\n// res236: Float = 123.123F\n\nposFloat999.value\n// res237: Float = 999.999F\n"})}),"\n",(0,a.jsx)(e.h3,{id:"min-and-max-values-14",children:"Min and Max Values"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"PosFloat.MinValue\n// res238: Type = 1.4E-45F\n\nPosFloat.MaxValue\n// res239: Type = 3.4028235E38F\n"})}),"\n",(0,a.jsx)(e.hr,{}),"\n",(0,a.jsxs)(e.h2,{id:"nonposfloat-non-positive-float",children:[(0,a.jsx)(e.code,{children:"NonPosFloat"}),": non-positive ",(0,a.jsx)(e.code,{children:"Float"})]}),"\n",(0,a.jsx)(e.h3,{id:"compile-time-validation-15",children:"Compile-time Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonPosFloat(0f)\n// res240: Type = 0.0F\nNonPosFloat(-999.999f)\n// res241: Type = -999.999F\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonPosFloat(0.00001f)\n// error: \n// Invalid value: [1.0E-5f]. It must be a non-positive Float\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonPosFloat(999.999f)\n// error: \n// Invalid value: [999.999f]. It must be a non-positive Float\n"})}),"\n",(0,a.jsx)(e.h3,{id:"runtime-validation-15",children:"Runtime Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val validNonPosFloat = 0f\n// validNonPosFloat: Float = 0.0F\nNonPosFloat.from(validNonPosFloat)\n// res244: Either[String, Type] = Right(value = 0.0F)\n\nval validNonPosFloat2 = -999.999f\n// validNonPosFloat2: Float = -999.999F\nNonPosFloat.from(validNonPosFloat2)\n// res245: Either[String, Type] = Right(value = -999.999F)\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'val invalidNonPosFloat1 = 0.00001f\n// invalidNonPosFloat1: Float = 1.0E-5F\nNonPosFloat.from(invalidNonPosFloat1)\n// res246: Either[String, Type] = Left(\n// value = "Invalid value: [1.0E-5]. It must be a non-positive Float"\n// )\n\nval invalidNonPosFloat2 = 999.999f\n// invalidNonPosFloat2: Float = 999.999F\nNonPosFloat.from(invalidNonPosFloat2)\n// res247: Either[String, Type] = Left(\n// value = "Invalid value: [999.999]. It must be a non-positive Float"\n// )\n'})}),"\n",(0,a.jsx)(e.h3,{id:"comparison-15",children:"Comparison"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val nonPosFloat1 = NonPosFloat(0f)\n// nonPosFloat1: Type = 0.0F\nval nonPosFloat2 = NonPosFloat(-0.999f)\n// nonPosFloat2: Type = -0.999F\n\nnonPosFloat1 > nonPosFloat2\n// res248: Boolean = true\nnonPosFloat1 >= nonPosFloat2\n// res249: Boolean = true\nnonPosFloat1 == nonPosFloat2\n// res250: Boolean = false\nnonPosFloat1 < nonPosFloat2\n// res251: Boolean = false\nnonPosFloat1 <= nonPosFloat2\n// res252: Boolean = false\n"})}),"\n",(0,a.jsx)(e.h3,{id:"get-value-15",children:"Get Value"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val nonPosFloat0 = NonPosFloat(0f)\n// nonPosFloat0: Type = 0.0F\nval nonPosFloatMinus999 = NonPosFloat(-999.999f)\n// nonPosFloatMinus999: Type = -999.999F\n\nnonPosFloat0.value\n// res253: Float = 0.0F\n\nnonPosFloatMinus999.value\n// res254: Float = -999.999F\n"})}),"\n",(0,a.jsx)(e.h3,{id:"min-and-max-values-15",children:"Min and Max Values"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonPosFloat.MinValue\n// res255: Type = -3.4028235E38F\n\nNonPosFloat.MaxValue\n// res256: Type = 0.0F\n"})}),"\n",(0,a.jsx)(e.hr,{}),"\n",(0,a.jsxs)(e.h2,{id:"refined-bigint",children:["Refined ",(0,a.jsx)(e.code,{children:"BigInt"})]}),"\n",(0,a.jsxs)(e.h2,{id:"negbigint-negative-bigint",children:[(0,a.jsx)(e.code,{children:"NegBigInt"}),": negative ",(0,a.jsx)(e.code,{children:"BigInt"})]}),"\n",(0,a.jsx)(e.h3,{id:"compile-time-validation-16",children:"Compile-time Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NegBigInt(-1)\n// res257: Type = -1\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NegBigInt(0)\n// error: \n// Invalid value: [BigInt.apply(0)]. It must be a negative BigInt\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NegBigInt(1)\n// error: \n// Invalid value: [BigInt.apply(1)]. It must be a negative BigInt\n"})}),"\n",(0,a.jsx)(e.h3,{id:"runtime-validation-16",children:"Runtime Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val validNegBigInt = -1 \n// validNegBigInt: Int = -1 \nNegBigInt.from(validNegBigInt)\n// res260: Either[String, Type] = Right(value = -1)\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'val invalidNegBigInt1 = 0 \n// invalidNegBigInt1: Int = 0 \nNegBigInt.from(invalidNegBigInt1)\n// res261: Either[String, Type] = Left(\n// value = "Invalid value: [0]. It must be a negative BigInt"\n// )\n\nval invalidNegBigInt2 = 1\n// invalidNegBigInt2: Int = 1\nNegBigInt.from(invalidNegBigInt2)\n// res262: Either[String, Type] = Left(\n// value = "Invalid value: [1]. It must be a negative BigInt"\n// )\n'})}),"\n",(0,a.jsx)(e.h3,{id:"comparison-16",children:"Comparison"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val negBigInt1 = NegBigInt(-1)\n// negBigInt1: Type = -1\nval negBigInt2 = NegBigInt(-2)\n// negBigInt2: Type = -2\n\nnegBigInt1 > negBigInt2\n// res263: Boolean = true\nnegBigInt1 >= negBigInt2\n// res264: Boolean = true\nnegBigInt1 == negBigInt2\n// res265: Boolean = false\nnegBigInt1 < negBigInt2\n// res266: Boolean = false\nnegBigInt1 <= negBigInt2\n// res267: Boolean = false\n"})}),"\n",(0,a.jsx)(e.h3,{id:"get-value-16",children:"Get Value"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val negBigInt123 = NegBigInt(-123)\n// negBigInt123: Type = -123\nval negBigInt999 = NegBigInt(-999)\n// negBigInt999: Type = -999\n\nnegBigInt123.value\n// res268: BigInt = -123\n\nnegBigInt999.value\n// res269: BigInt = -999\n"})}),"\n",(0,a.jsx)(e.hr,{}),"\n",(0,a.jsxs)(e.h2,{id:"nonnegbigint-non-negative-bigint",children:[(0,a.jsx)(e.code,{children:"NonNegBigInt"}),": non-negative ",(0,a.jsx)(e.code,{children:"BigInt"})]}),"\n",(0,a.jsx)(e.h3,{id:"compile-time-validation-17",children:"Compile-time Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonNegBigInt(0)\n// res270: Type = 0\nNonNegBigInt(1)\n// res271: Type = 1\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonNegBigInt(-2)\n// error: \n// Invalid value: [BigInt.apply(-2)]. It must be a non-negative BigInt\n"})}),"\n",(0,a.jsx)(e.h3,{id:"runtime-validation-17",children:"Runtime Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val validNonNegBigInt = 1 \n// validNonNegBigInt: Int = 1 \nNonNegBigInt.from(validNonNegBigInt)\n// res273: Either[String, Type] = Right(value = 1)\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'val invalidNonNegBigInt1 = -1\n// invalidNonNegBigInt1: Int = -1\nNonNegBigInt.from(invalidNonNegBigInt1)\n// res274: Either[String, Type] = Left(\n// value = "Invalid value: [-1]. It must be a non-negative BigInt"\n// )\n\nval invalidNonNegBigInt2 = -999\n// invalidNonNegBigInt2: Int = -999\nNonNegBigInt.from(invalidNonNegBigInt2)\n// res275: Either[String, Type] = Left(\n// value = "Invalid value: [-999]. It must be a non-negative BigInt"\n// )\n'})}),"\n",(0,a.jsx)(e.h3,{id:"comparison-17",children:"Comparison"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val nonNegBigInt1 = NonNegBigInt(0)\n// nonNegBigInt1: Type = 0\nval nonNegBigInt2 = NonNegBigInt(999)\n// nonNegBigInt2: Type = 999\n\nnonNegBigInt1 > nonNegBigInt2\n// res276: Boolean = false\nnonNegBigInt1 >= nonNegBigInt2\n// res277: Boolean = false\nnonNegBigInt1 == nonNegBigInt2\n// res278: Boolean = false\nnonNegBigInt1 < nonNegBigInt2\n// res279: Boolean = true\nnonNegBigInt1 <= nonNegBigInt2\n// res280: Boolean = true\n"})}),"\n",(0,a.jsx)(e.h3,{id:"get-value-17",children:"Get Value"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val nonNegBigInt123 = NonNegBigInt(0)\n// nonNegBigInt123: Type = 0\nval nonNegBigInt999 = NonNegBigInt(999)\n// nonNegBigInt999: Type = 999\n\nnonNegBigInt123.value\n// res281: BigInt = 0\n\nnonNegBigInt999.value\n// res282: BigInt = 999\n"})}),"\n",(0,a.jsx)(e.hr,{}),"\n",(0,a.jsxs)(e.h2,{id:"posbigint-positive-bigint",children:[(0,a.jsx)(e.code,{children:"PosBigInt"}),": positive ",(0,a.jsx)(e.code,{children:"BigInt"})]}),"\n",(0,a.jsx)(e.h3,{id:"compile-time-validation-18",children:"Compile-time Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"PosBigInt(1)\n// res283: Type = 1\nPosBigInt(999)\n// res284: Type = 999\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"PosBigInt(0)\n// error: \n// Invalid value: [BigInt.apply(0)]. It must be a positive BigInt\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"PosBigInt(-2)\n// error: \n// Invalid value: [BigInt.apply(-2)]. It must be a positive BigInt\n"})}),"\n",(0,a.jsx)(e.h3,{id:"runtime-validation-18",children:"Runtime Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val validPosBigInt = 1\n// validPosBigInt: Int = 1\nPosBigInt.from(validPosBigInt)\n// res287: Either[String, Type] = Right(value = 1)\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'val invalidPosBigInt1 = 0\n// invalidPosBigInt1: Int = 0\nPosBigInt.from(invalidPosBigInt1)\n// res288: Either[String, Type] = Left(\n// value = "Invalid value: [0]. It must be a positive BigInt"\n// )\n\nval invalidPosBigInt2 = -999\n// invalidPosBigInt2: Int = -999\nPosBigInt.from(invalidPosBigInt2)\n// res289: Either[String, Type] = Left(\n// value = "Invalid value: [-999]. It must be a positive BigInt"\n// )\n'})}),"\n",(0,a.jsx)(e.h3,{id:"comparison-18",children:"Comparison"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val posBigInt1 = PosBigInt(1)\n// posBigInt1: Type = 1\nval posBigInt2 = PosBigInt(999)\n// posBigInt2: Type = 999\n\nposBigInt1 > posBigInt2\n// res290: Boolean = false\nposBigInt1 >= posBigInt2\n// res291: Boolean = false\nposBigInt1 == posBigInt2\n// res292: Boolean = false\nposBigInt1 < posBigInt2\n// res293: Boolean = true\nposBigInt1 <= posBigInt2\n// res294: Boolean = true\n"})}),"\n",(0,a.jsx)(e.h3,{id:"get-value-18",children:"Get Value"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val posBigInt123 = PosBigInt(123)\n// posBigInt123: Type = 123\nval posBigInt999 = PosBigInt(999)\n// posBigInt999: Type = 999\n\nposBigInt123.value\n// res295: BigInt = 123\n\nposBigInt999.value\n// res296: BigInt = 999\n"})}),"\n",(0,a.jsx)(e.hr,{}),"\n",(0,a.jsxs)(e.h2,{id:"nonposbigint-non-positive-bigint",children:[(0,a.jsx)(e.code,{children:"NonPosBigInt"}),": non-positive ",(0,a.jsx)(e.code,{children:"BigInt"})]}),"\n",(0,a.jsx)(e.h3,{id:"compile-time-validation-19",children:"Compile-time Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonPosBigInt(0)\n// res297: Type = 0\nNonPosBigInt(-999)\n// res298: Type = -999\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonPosBigInt(1)\n// error: \n// Invalid value: [BigInt.apply(1)]. It must be a non-positive BigInt\n"})}),"\n",(0,a.jsx)(e.h3,{id:"runtime-validation-19",children:"Runtime Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val validNonPosBigInt = 0\n// validNonPosBigInt: Int = 0\nNonPosBigInt.from(validNonPosBigInt)\n// res300: Either[String, Type] = Right(value = 0)\n\nval validNonPosBigInt2 = -999\n// validNonPosBigInt2: Int = -999\nNonPosBigInt.from(validNonPosBigInt2)\n// res301: Either[String, Type] = Right(value = -999)\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'val invalidNonPosBigInt1 = 1\n// invalidNonPosBigInt1: Int = 1\nNonPosBigInt.from(invalidNonPosBigInt1)\n// res302: Either[String, Type] = Left(\n// value = "Invalid value: [1]. It must be a non-positive BigInt"\n// )\n\nval invalidNonPosBigInt2 = 999\n// invalidNonPosBigInt2: Int = 999\nNonPosBigInt.from(invalidNonPosBigInt2)\n// res303: Either[String, Type] = Left(\n// value = "Invalid value: [999]. It must be a non-positive BigInt"\n// )\n'})}),"\n",(0,a.jsx)(e.h3,{id:"comparison-19",children:"Comparison"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val nonPosBigInt1 = NonPosBigInt(0)\n// nonPosBigInt1: Type = 0\nval nonPosBigInt2 = NonPosBigInt(-999)\n// nonPosBigInt2: Type = -999\n\nnonPosBigInt1 > nonPosBigInt2\n// res304: Boolean = true\nnonPosBigInt1 >= nonPosBigInt2\n// res305: Boolean = true\nnonPosBigInt1 == nonPosBigInt2\n// res306: Boolean = false\nnonPosBigInt1 < nonPosBigInt2\n// res307: Boolean = false\nnonPosBigInt1 <= nonPosBigInt2\n// res308: Boolean = false\n"})}),"\n",(0,a.jsx)(e.h3,{id:"get-value-19",children:"Get Value"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val nonPosBigInt0 = NonPosBigInt(0)\n// nonPosBigInt0: Type = 0\nval nonPosBigIntMinus999 = NonPosBigInt(-999)\n// nonPosBigIntMinus999: Type = -999\n\nnonPosBigInt0.value\n// res309: BigInt = 0\n\nnonPosBigIntMinus999.value\n// res310: BigInt = -999\n"})}),"\n",(0,a.jsx)(e.hr,{}),"\n",(0,a.jsxs)(e.h2,{id:"refined-bigdecimal",children:["Refined ",(0,a.jsx)(e.code,{children:"BigDecimal"})]}),"\n",(0,a.jsxs)(e.h2,{id:"negbigdecimal-negative-bigdecimal",children:[(0,a.jsx)(e.code,{children:"NegBigDecimal"}),": negative ",(0,a.jsx)(e.code,{children:"BigDecimal"})]}),"\n",(0,a.jsx)(e.h3,{id:"compile-time-validation-20",children:"Compile-time Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NegBigDecimal(-0.00001d)\n// res311: Type = -0.000010\nNegBigDecimal(-999.999d)\n// res312: Type = -999.999\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NegBigDecimal(0d)\n// error: \n// Invalid value: [BigDecimal.apply(0.0d)]. It must be a negative BigDecimal\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NegBigDecimal(999.999d)\n// error: \n// Invalid value: [BigDecimal.apply(999.999d)]. It must be a negative BigDecimal\n"})}),"\n",(0,a.jsx)(e.h3,{id:"runtime-validation-20",children:"Runtime Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val validNegBigDecimal = -0.00001d \n// validNegBigDecimal: Double = -1.0E-5 \nNegBigDecimal.from(validNegBigDecimal)\n// res315: Either[String, Type] = Right(value = -0.000010)\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'val invalidNegBigDecimal1 = 0d \n// invalidNegBigDecimal1: Double = 0.0 \nNegBigDecimal.from(invalidNegBigDecimal1)\n// res316: Either[String, Type] = Left(\n// value = "Invalid value: [0.0]. It must be a negative BigDecimal"\n// )\n\nval invalidNegBigDecimal2 = 999.999d\n// invalidNegBigDecimal2: Double = 999.999\nNegBigDecimal.from(invalidNegBigDecimal2)\n// res317: Either[String, Type] = Left(\n// value = "Invalid value: [999.999]. It must be a negative BigDecimal"\n// )\n'})}),"\n",(0,a.jsx)(e.h3,{id:"comparison-20",children:"Comparison"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val negBigDecimal1 = NegBigDecimal(-0.1d)\n// negBigDecimal1: Type = -0.1\nval negBigDecimal2 = NegBigDecimal(-0.2d)\n// negBigDecimal2: Type = -0.2\n\nnegBigDecimal1 > negBigDecimal2\n// res318: Boolean = true\nnegBigDecimal1 >= negBigDecimal2\n// res319: Boolean = true\nnegBigDecimal1 == negBigDecimal2\n// res320: Boolean = false\nnegBigDecimal1 < negBigDecimal2\n// res321: Boolean = false\nnegBigDecimal1 <= negBigDecimal2\n// res322: Boolean = false\n"})}),"\n",(0,a.jsx)(e.h3,{id:"get-value-20",children:"Get Value"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val negBigDecimal123 = NegBigDecimal(-123.123d)\n// negBigDecimal123: Type = -123.123\nval negBigDecimal999 = NegBigDecimal(-999.999d)\n// negBigDecimal999: Type = -999.999\n\nnegBigDecimal123.value\n// res323: BigDecimal = -123.123\n\nnegBigDecimal999.value\n// res324: BigDecimal = -999.999\n"})}),"\n",(0,a.jsx)(e.hr,{}),"\n",(0,a.jsxs)(e.h2,{id:"nonnegbigdecimal-non-negative-bigdecimal",children:[(0,a.jsx)(e.code,{children:"NonNegBigDecimal"}),": non-negative ",(0,a.jsx)(e.code,{children:"BigDecimal"})]}),"\n",(0,a.jsx)(e.h3,{id:"compile-time-validation-21",children:"Compile-time Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonNegBigDecimal(0d)\n// res325: Type = 0.0\nNonNegBigDecimal(999.999d)\n// res326: Type = 999.999\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonNegBigDecimal(-0.00001d)\n// error: \n// Invalid value: [BigDecimal.apply(-1.0E-5d)]. It must be a non-negative BigDecimal\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{children:"```scala mdoc:fail\nNonNegBigDecimal(-999.999d)\n"})}),"\n",(0,a.jsx)(e.h3,{id:"runtime-validation-21",children:"Runtime Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val validNonNegBigDecimal1 = 0d\n// validNonNegBigDecimal1: Double = 0.0\nNonNegBigDecimal.from(validNonNegBigDecimal1)\n// res328: Either[String, Type] = Right(value = 0.0)\n\nval validNonNegBigDecimal2 = 999.999d\n// validNonNegBigDecimal2: Double = 999.999\nNonNegBigDecimal.from(validNonNegBigDecimal2)\n// res329: Either[String, Type] = Right(value = 999.999)\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'val invalidNonNegBigDecimal1 = -0.00001d\n// invalidNonNegBigDecimal1: Double = -1.0E-5\nNonNegBigDecimal.from(invalidNonNegBigDecimal1)\n// res330: Either[String, Type] = Left(\n// value = "Invalid value: [-0.000010]. It must be a non-negative BigDecimal"\n// )\n\nval invalidNonNegBigDecimal2 = -999.999d\n// invalidNonNegBigDecimal2: Double = -999.999\nNonNegBigDecimal.from(invalidNonNegBigDecimal2)\n// res331: Either[String, Type] = Left(\n// value = "Invalid value: [-999.999]. It must be a non-negative BigDecimal"\n// )\n'})}),"\n",(0,a.jsx)(e.h3,{id:"comparison-21",children:"Comparison"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val nonNegBigDecimal1 = NonNegBigDecimal(0d)\n// nonNegBigDecimal1: Type = 0.0\nval nonNegBigDecimal2 = NonNegBigDecimal(0.999d)\n// nonNegBigDecimal2: Type = 0.999\n\nnonNegBigDecimal1 > nonNegBigDecimal2\n// res332: Boolean = false\nnonNegBigDecimal1 >= nonNegBigDecimal2\n// res333: Boolean = false\nnonNegBigDecimal1 == nonNegBigDecimal2\n// res334: Boolean = false\nnonNegBigDecimal1 < nonNegBigDecimal2\n// res335: Boolean = true\nnonNegBigDecimal1 <= nonNegBigDecimal2\n// res336: Boolean = true\n"})}),"\n",(0,a.jsx)(e.h3,{id:"get-value-21",children:"Get Value"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val nonNegBigDecimal123 = NonNegBigDecimal(0d)\n// nonNegBigDecimal123: Type = 0.0\nval nonNegBigDecimal999 = NonNegBigDecimal(999.999d)\n// nonNegBigDecimal999: Type = 999.999\n\nnonNegBigDecimal123.value\n// res337: BigDecimal = 0.0\n\nnonNegBigDecimal999.value\n// res338: BigDecimal = 999.999\n"})}),"\n",(0,a.jsx)(e.hr,{}),"\n",(0,a.jsxs)(e.h2,{id:"posbigdecimal-positive-bigdecimal",children:[(0,a.jsx)(e.code,{children:"PosBigDecimal"}),": positive ",(0,a.jsx)(e.code,{children:"BigDecimal"})]}),"\n",(0,a.jsx)(e.h3,{id:"compile-time-validation-22",children:"Compile-time Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"PosBigDecimal(0.00001d)\n// res339: Type = 0.000010\nPosBigDecimal(999.999d)\n// res340: Type = 999.999\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"PosBigDecimal(0d)\n// error: \n// Invalid value: [BigDecimal.apply(0.0d)]. It must be a positive BigDecimal\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"PosBigDecimal(-999.999d)\n// error: \n// Invalid value: [BigDecimal.apply(-999.999d)]. It must be a positive BigDecimal\n"})}),"\n",(0,a.jsx)(e.h3,{id:"runtime-validation-22",children:"Runtime Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val validPosBigDecimal1 = 0.00001d\n// validPosBigDecimal1: Double = 1.0E-5\nPosBigDecimal.from(validPosBigDecimal1)\n// res343: Either[String, Type] = Right(value = 0.000010)\n\nval validPosBigDecimal2 = 999.999d\n// validPosBigDecimal2: Double = 999.999\nPosBigDecimal.from(validPosBigDecimal2)\n// res344: Either[String, Type] = Right(value = 999.999)\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'val invalidPosBigDecimal1 = 0d\n// invalidPosBigDecimal1: Double = 0.0\nPosBigDecimal.from(invalidPosBigDecimal1)\n// res345: Either[String, Type] = Left(\n// value = "Invalid value: [0.0]. It must be a positive BigDecimal"\n// )\n\nval invalidPosBigDecimal2 = -999.999d\n// invalidPosBigDecimal2: Double = -999.999\nPosBigDecimal.from(invalidPosBigDecimal2)\n// res346: Either[String, Type] = Left(\n// value = "Invalid value: [-999.999]. It must be a positive BigDecimal"\n// )\n'})}),"\n",(0,a.jsx)(e.h3,{id:"comparison-22",children:"Comparison"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val posBigDecimal1 = PosBigDecimal(0.00001d)\n// posBigDecimal1: Type = 0.000010\nval posBigDecimal2 = PosBigDecimal(0.999d)\n// posBigDecimal2: Type = 0.999\n\nposBigDecimal1 > posBigDecimal2\n// res347: Boolean = false\nposBigDecimal1 >= posBigDecimal2\n// res348: Boolean = false\nposBigDecimal1 == posBigDecimal2\n// res349: Boolean = false\nposBigDecimal1 < posBigDecimal2\n// res350: Boolean = true\nposBigDecimal1 <= posBigDecimal2\n// res351: Boolean = true\n"})}),"\n",(0,a.jsx)(e.h3,{id:"get-value-22",children:"Get Value"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val posBigDecimal123 = PosBigDecimal(123.123d)\n// posBigDecimal123: Type = 123.123\nval posBigDecimal999 = PosBigDecimal(999.999d)\n// posBigDecimal999: Type = 999.999\n\nposBigDecimal123.value\n// res352: BigDecimal = 123.123\n\nposBigDecimal999.value\n// res353: BigDecimal = 999.999\n"})}),"\n",(0,a.jsx)(e.hr,{}),"\n",(0,a.jsxs)(e.h2,{id:"nonposbigdecimal-non-positive-bigdecimal",children:[(0,a.jsx)(e.code,{children:"NonPosBigDecimal"}),": non-positive ",(0,a.jsx)(e.code,{children:"BigDecimal"})]}),"\n",(0,a.jsx)(e.h3,{id:"compile-time-validation-23",children:"Compile-time Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonPosBigDecimal(0d)\n// res354: Type = 0.0\nNonPosBigDecimal(-999.999d)\n// res355: Type = -999.999\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonPosBigDecimal(0.00001d)\n// error: \n// Invalid value: [BigDecimal.apply(1.0E-5d)]. It must be a non-positive BigDecimal\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"NonPosBigDecimal(999.999d)\n// error: \n// Invalid value: [BigDecimal.apply(999.999d)]. It must be a non-positive BigDecimal\n"})}),"\n",(0,a.jsx)(e.h3,{id:"runtime-validation-23",children:"Runtime Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val validNonPosBigDecimal = 0d\n// validNonPosBigDecimal: Double = 0.0\nNonPosBigDecimal.from(validNonPosBigDecimal)\n// res358: Either[String, Type] = Right(value = 0.0)\n\nval validNonPosBigDecimal2 = -999.999d\n// validNonPosBigDecimal2: Double = -999.999\nNonPosBigDecimal.from(validNonPosBigDecimal2)\n// res359: Either[String, Type] = Right(value = -999.999)\n"})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'val invalidNonPosBigDecimal1 = 0.00001d\n// invalidNonPosBigDecimal1: Double = 1.0E-5\nNonPosBigDecimal.from(invalidNonPosBigDecimal1)\n// res360: Either[String, Type] = Left(\n// value = "Invalid value: [0.000010]. It must be a non-positive BigDecimal"\n// )\n\nval invalidNonPosBigDecimal2 = 999.999d\n// invalidNonPosBigDecimal2: Double = 999.999\nNonPosBigDecimal.from(invalidNonPosBigDecimal2)\n// res361: Either[String, Type] = Left(\n// value = "Invalid value: [999.999]. It must be a non-positive BigDecimal"\n// )\n'})}),"\n",(0,a.jsx)(e.h3,{id:"comparison-23",children:"Comparison"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val nonPosBigDecimal1 = NonPosBigDecimal(0d)\n// nonPosBigDecimal1: Type = 0.0\nval nonPosBigDecimal2 = NonPosBigDecimal(-0.999d)\n// nonPosBigDecimal2: Type = -0.999\n\nnonPosBigDecimal1 > nonPosBigDecimal2\n// res362: Boolean = true\nnonPosBigDecimal1 >= nonPosBigDecimal2\n// res363: Boolean = true\nnonPosBigDecimal1 == nonPosBigDecimal2\n// res364: Boolean = false\nnonPosBigDecimal1 < nonPosBigDecimal2\n// res365: Boolean = false\nnonPosBigDecimal1 <= nonPosBigDecimal2\n// res366: Boolean = false\n"})}),"\n",(0,a.jsx)(e.h3,{id:"get-value-23",children:"Get Value"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"val nonPosBigDecimal0 = NonPosBigDecimal(0d)\n// nonPosBigDecimal0: Type = 0.0\nval nonPosBigDecimalMinus999 = NonPosBigDecimal(-999.999d)\n// nonPosBigDecimalMinus999: Type = -999.999\n\nnonPosBigDecimal0.value\n// res367: BigDecimal = 0.0\n\nnonPosBigDecimalMinus999.value\n// res368: BigDecimal = -999.999\n"})}),"\n",(0,a.jsx)(e.hr,{}),"\n",(0,a.jsxs)(e.h2,{id:"refined-nonemptystring",children:["Refined ",(0,a.jsx)(e.code,{children:"NonEmptyString"})]}),"\n",(0,a.jsx)(e.h3,{id:"compile-time-validation-24",children:"Compile-time Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'NonEmptyString("blah")\n// res369: Type = "blah"\nNonEmptyString("Lorem Ipsum is simply dummy text of the printing and typesetting industry.")\n// res370: Type = "Lorem Ipsum is simply dummy text of the printing and typesetting industry."\n'})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'NonEmptyString("")\n// error:\n// Invalid value: [""]. It must be a non-empty String\n'})}),"\n",(0,a.jsx)(e.h3,{id:"runtime-validation-24",children:"Runtime Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'val validNonEmptyString1 = "blah" \n// validNonEmptyString1: String = "blah" \nNonEmptyString.from(validNonEmptyString1)\n// res371: Either[String, Type] = Right(value = "blah")\n\nval validNonEmptyString2 = "Lorem Ipsum is simply dummy text of the printing and typesetting industry." \n// validNonEmptyString2: String = "Lorem Ipsum is simply dummy text of the printing and typesetting industry." \nNonEmptyString.from(validNonEmptyString2)\n// res372: Either[String, Type] = Right(\n// value = "Lorem Ipsum is simply dummy text of the printing and typesetting industry."\n// )\n'})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'val invalidNonEmptyString = "" \n// invalidNonEmptyString: String = "" \nNonEmptyString.from(invalidNonEmptyString)\n// res373: Either[String, Type] = Left(\n// value = "Invalid value: []. It must be a non-empty String"\n// )\n'})}),"\n",(0,a.jsx)(e.h3,{id:"concatenation",children:"Concatenation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'val nonEmptyString1 = NonEmptyString("Hello")\n// nonEmptyString1: Type = "Hello"\nval nonEmptyString2 = NonEmptyString(" World")\n// nonEmptyString2: Type = " World"\n\nnonEmptyString1 ++ nonEmptyString2\n// res374: Type = "Hello World"\n'})}),"\n",(0,a.jsx)(e.h3,{id:"get-value-24",children:"Get Value"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'val nonEmptyStringA = NonEmptyString("blah")\n// nonEmptyStringA: Type = "blah"\nval nonEmptyStringB = NonEmptyString("Lorem Ipsum is simply dummy text of the printing and typesetting industry.")\n// nonEmptyStringB: Type = "Lorem Ipsum is simply dummy text of the printing and typesetting industry."\n\nnonEmptyStringA.value\n// res375: String = "blah"\n\nnonEmptyStringB.value\n// res376: String = "Lorem Ipsum is simply dummy text of the printing and typesetting industry."\n'})}),"\n",(0,a.jsx)(e.hr,{}),"\n",(0,a.jsxs)(e.h2,{id:"refined-uri",children:["Refined ",(0,a.jsx)(e.code,{children:"Uri"})]}),"\n",(0,a.jsx)(e.h3,{id:"compile-time-validation-25",children:"Compile-time Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'Uri("https://www.google.com")\n// res377: Type = "https://www.google.com"\nUri("https://github.com/kevin-lee")\n// res378: Type = "https://github.com/kevin-lee"\n'})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'Uri("%^<>[]`{}")\n// error:\n// Invalid value: ["%^<>[]`{}"]. It must be a URI String\n'})}),"\n",(0,a.jsx)(e.h3,{id:"runtime-validation-25",children:"Runtime Validation"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'val validUri1 = "https://www.google.com" \n// validUri1: String = "https://www.google.com" \nUri.from(validUri1)\n// res379: Either[String, Type] = Right(value = "https://www.google.com")\n\nval validUri2 = "https://github.com/kevin-lee" \n// validUri2: String = "https://github.com/kevin-lee" \nUri.from(validUri2)\n// res380: Either[String, Type] = Right(value = "https://github.com/kevin-lee")\n'})}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'val invalidUri = "%^<>[]`{}" \n// invalidUri: String = "%^<>[]`{}" \nUri.from(invalidUri)\n// res381: Either[String, Type] = Left(\n// value = "Invalid value: [%^<>[]`{}]. It must be a URI String"\n// )\n'})}),"\n",(0,a.jsx)(e.h3,{id:"get-value-25",children:"Get Value"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:'val uriA = Uri("https://www.google.com")\n// uriA: Type = "https://www.google.com"\nval uriB = Uri("https://github.com/kevin-lee")\n// uriB: Type = "https://github.com/kevin-lee"\n\nuriA.value\n// res382: String = "https://www.google.com"\n\nuriB.value\n// res383: String = "https://github.com/kevin-lee"\n'})}),"\n",(0,a.jsxs)(e.h3,{id:"convert-to-javaneturi",children:["Convert to ",(0,a.jsx)(e.code,{children:"java.net.URI"})]}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-scala",children:"uriA.toURI\n// res384: URI = https://www.google.com\n\nuriB.toURI\n// res385: URI = https://github.com/kevin-lee\n"})})]})}function c(n={}){const{wrapper:e}={...(0,i.a)(),...n.components};return e?(0,a.jsx)(e,{...n,children:(0,a.jsx)(r,{...n})}):r(n)}},1151:(n,e,l)=>{l.d(e,{Z:()=>t,a:()=>s});var a=l(7294);const i={},o=a.createContext(i);function s(n){const e=a.useContext(o);return a.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function t(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(i):n.components||i:s(n.components),a.createElement(o.Provider,{value:e},n.children)}}}]); \ No newline at end of file diff --git a/assets/js/516c3461.14a62e7e.js b/assets/js/516c3461.14a62e7e.js new file mode 100644 index 0000000..f95fd17 --- /dev/null +++ b/assets/js/516c3461.14a62e7e.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[266],{3523:(n,e,o)=>{o.r(e),o.d(e,{assets:()=>l,contentTitle:()=>a,default:()=>m,frontMatter:()=>t,metadata:()=>r,toc:()=>g});var s=o(5893),i=o(1151);const t={sidebar_position:2,id:"types",title:"Pre-defined Types"},a=void 0,r={id:"core/refined/types",title:"Pre-defined Types",description:"Import",source:"@site/../generated-docs/docs/core/refined/types.md",sourceDirName:"core/refined",slug:"/core/refined/types",permalink:"/docs/core/refined/types",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2,id:"types",title:"Pre-defined Types"},sidebar:"docsSidebar",previous:{title:"Refined",permalink:"/docs/core/refined/"},next:{title:"Custom Type",permalink:"/docs/core/refined/custom-type"}},l={},g=[{value:"Import",id:"import",level:2},{value:"Refined Int",id:"refined-int",level:2},{value:"NegInt: negative Int",id:"negint-negative-int",level:2},{value:"Compile-time Validation",id:"compile-time-validation",level:3},{value:"Runtime Validation",id:"runtime-validation",level:3},{value:"Comparison",id:"comparison",level:3},{value:"Get Value",id:"get-value",level:3},{value:"Min and Max Values",id:"min-and-max-values",level:3},{value:"NonNegInt: non-negative Int",id:"nonnegint-non-negative-int",level:2},{value:"Compile-time Validation",id:"compile-time-validation-1",level:3},{value:"Runtime Validation",id:"runtime-validation-1",level:3},{value:"Comparison",id:"comparison-1",level:3},{value:"Get Value",id:"get-value-1",level:3},{value:"Min and Max Values",id:"min-and-max-values-1",level:3},{value:"PosInt: positive Int",id:"posint-positive-int",level:2},{value:"Compile-time Validation",id:"compile-time-validation-2",level:3},{value:"Runtime Validation",id:"runtime-validation-2",level:3},{value:"Comparison",id:"comparison-2",level:3},{value:"Get Value",id:"get-value-2",level:3},{value:"Min and Max Values",id:"min-and-max-values-2",level:3},{value:"NonPosInt: non-positive Int",id:"nonposint-non-positive-int",level:2},{value:"Compile-time Validation",id:"compile-time-validation-3",level:3},{value:"Runtime Validation",id:"runtime-validation-3",level:3},{value:"Comparison",id:"comparison-3",level:3},{value:"Get Value",id:"get-value-3",level:3},{value:"Min and Max Values",id:"min-and-max-values-3",level:3},{value:"Refined Long",id:"refined-long",level:2},{value:"NegLong: negative Long",id:"neglong-negative-long",level:2},{value:"Compile-time Validation",id:"compile-time-validation-4",level:3},{value:"Runtime Validation",id:"runtime-validation-4",level:3},{value:"Comparison",id:"comparison-4",level:3},{value:"Get Value",id:"get-value-4",level:3},{value:"Min and Max Values",id:"min-and-max-values-4",level:3},{value:"NonNegLong: non-negative Long",id:"nonneglong-non-negative-long",level:2},{value:"Compile-time Validation",id:"compile-time-validation-5",level:3},{value:"Runtime Validation",id:"runtime-validation-5",level:3},{value:"Comparison",id:"comparison-5",level:3},{value:"Get Value",id:"get-value-5",level:3},{value:"Min and Max Values",id:"min-and-max-values-5",level:3},{value:"PosLong: positive Long",id:"poslong-positive-long",level:2},{value:"Compile-time Validation",id:"compile-time-validation-6",level:3},{value:"Runtime Validation",id:"runtime-validation-6",level:3},{value:"Comparison",id:"comparison-6",level:3},{value:"Get Value",id:"get-value-6",level:3},{value:"Min and Max Values",id:"min-and-max-values-6",level:3},{value:"NonPosLong: non-positive Long",id:"nonposlong-non-positive-long",level:2},{value:"Compile-time Validation",id:"compile-time-validation-7",level:3},{value:"Runtime Validation",id:"runtime-validation-7",level:3},{value:"Comparison",id:"comparison-7",level:3},{value:"Get Value",id:"get-value-7",level:3},{value:"Min and Max Values",id:"min-and-max-values-7",level:3},{value:"Refined Double",id:"refined-double",level:2},{value:"NegDouble: negative Double",id:"negdouble-negative-double",level:2},{value:"Compile-time Validation",id:"compile-time-validation-8",level:3},{value:"Runtime Validation",id:"runtime-validation-8",level:3},{value:"Comparison",id:"comparison-8",level:3},{value:"Get Value",id:"get-value-8",level:3},{value:"Min and Max Values",id:"min-and-max-values-8",level:3},{value:"NonNegDouble: non-negative Double",id:"nonnegdouble-non-negative-double",level:2},{value:"Compile-time Validation",id:"compile-time-validation-9",level:3},{value:"Runtime Validation",id:"runtime-validation-9",level:3},{value:"Comparison",id:"comparison-9",level:3},{value:"Get Value",id:"get-value-9",level:3},{value:"Min and Max Values",id:"min-and-max-values-9",level:3},{value:"PosDouble: positive Double",id:"posdouble-positive-double",level:2},{value:"Compile-time Validation",id:"compile-time-validation-10",level:3},{value:"Runtime Validation",id:"runtime-validation-10",level:3},{value:"Comparison",id:"comparison-10",level:3},{value:"Get Value",id:"get-value-10",level:3},{value:"Min and Max Values",id:"min-and-max-values-10",level:3},{value:"NonPosDouble: non-positive Double",id:"nonposdouble-non-positive-double",level:2},{value:"Compile-time Validation",id:"compile-time-validation-11",level:3},{value:"Runtime Validation",id:"runtime-validation-11",level:3},{value:"Comparison",id:"comparison-11",level:3},{value:"Get Value",id:"get-value-11",level:3},{value:"Min and Max Values",id:"min-and-max-values-11",level:3},{value:"Refined Float",id:"refined-float",level:2},{value:"NegFloat: negative Float",id:"negfloat-negative-float",level:2},{value:"Compile-time Validation",id:"compile-time-validation-12",level:3},{value:"Runtime Validation",id:"runtime-validation-12",level:3},{value:"Comparison",id:"comparison-12",level:3},{value:"Get Value",id:"get-value-12",level:3},{value:"Min and Max Values",id:"min-and-max-values-12",level:3},{value:"NonNegFloat: non-negative Float",id:"nonnegfloat-non-negative-float",level:2},{value:"Compile-time Validation",id:"compile-time-validation-13",level:3},{value:"Runtime Validation",id:"runtime-validation-13",level:3},{value:"Comparison",id:"comparison-13",level:3},{value:"Get Value",id:"get-value-13",level:3},{value:"Min and Max Values",id:"min-and-max-values-13",level:3},{value:"PosFloat: positive Float",id:"posfloat-positive-float",level:2},{value:"Compile-time Validation",id:"compile-time-validation-14",level:3},{value:"Runtime Validation",id:"runtime-validation-14",level:3},{value:"Comparison",id:"comparison-14",level:3},{value:"Get Value",id:"get-value-14",level:3},{value:"Min and Max Values",id:"min-and-max-values-14",level:3},{value:"NonPosFloat: non-positive Float",id:"nonposfloat-non-positive-float",level:2},{value:"Compile-time Validation",id:"compile-time-validation-15",level:3},{value:"Runtime Validation",id:"runtime-validation-15",level:3},{value:"Comparison",id:"comparison-15",level:3},{value:"Get Value",id:"get-value-15",level:3},{value:"Min and Max Values",id:"min-and-max-values-15",level:3},{value:"Refined BigInt",id:"refined-bigint",level:2},{value:"NegBigInt: negative BigInt",id:"negbigint-negative-bigint",level:2},{value:"Compile-time Validation",id:"compile-time-validation-16",level:3},{value:"Runtime Validation",id:"runtime-validation-16",level:3},{value:"Comparison",id:"comparison-16",level:3},{value:"Get Value",id:"get-value-16",level:3},{value:"NonNegBigInt: non-negative BigInt",id:"nonnegbigint-non-negative-bigint",level:2},{value:"Compile-time Validation",id:"compile-time-validation-17",level:3},{value:"Runtime Validation",id:"runtime-validation-17",level:3},{value:"Comparison",id:"comparison-17",level:3},{value:"Get Value",id:"get-value-17",level:3},{value:"PosBigInt: positive BigInt",id:"posbigint-positive-bigint",level:2},{value:"Compile-time Validation",id:"compile-time-validation-18",level:3},{value:"Runtime Validation",id:"runtime-validation-18",level:3},{value:"Comparison",id:"comparison-18",level:3},{value:"Get Value",id:"get-value-18",level:3},{value:"NonPosBigInt: non-positive BigInt",id:"nonposbigint-non-positive-bigint",level:2},{value:"Compile-time Validation",id:"compile-time-validation-19",level:3},{value:"Runtime Validation",id:"runtime-validation-19",level:3},{value:"Comparison",id:"comparison-19",level:3},{value:"Get Value",id:"get-value-19",level:3},{value:"Refined BigDecimal",id:"refined-bigdecimal",level:2},{value:"NegBigDecimal: negative BigDecimal",id:"negbigdecimal-negative-bigdecimal",level:2},{value:"Compile-time Validation",id:"compile-time-validation-20",level:3},{value:"Runtime Validation",id:"runtime-validation-20",level:3},{value:"Comparison",id:"comparison-20",level:3},{value:"Get Value",id:"get-value-20",level:3},{value:"NonNegBigDecimal: non-negative BigDecimal",id:"nonnegbigdecimal-non-negative-bigdecimal",level:2},{value:"Compile-time Validation",id:"compile-time-validation-21",level:3},{value:"Runtime Validation",id:"runtime-validation-21",level:3},{value:"Comparison",id:"comparison-21",level:3},{value:"Get Value",id:"get-value-21",level:3},{value:"PosBigDecimal: positive BigDecimal",id:"posbigdecimal-positive-bigdecimal",level:2},{value:"Compile-time Validation",id:"compile-time-validation-22",level:3},{value:"Runtime Validation",id:"runtime-validation-22",level:3},{value:"Comparison",id:"comparison-22",level:3},{value:"Get Value",id:"get-value-22",level:3},{value:"NonPosBigDecimal: non-positive BigDecimal",id:"nonposbigdecimal-non-positive-bigdecimal",level:2},{value:"Compile-time Validation",id:"compile-time-validation-23",level:3},{value:"Runtime Validation",id:"runtime-validation-23",level:3},{value:"Comparison",id:"comparison-23",level:3},{value:"Get Value",id:"get-value-23",level:3},{value:"Refined NonEmptyString",id:"refined-nonemptystring",level:2},{value:"Compile-time Validation",id:"compile-time-validation-24",level:3},{value:"Runtime Validation",id:"runtime-validation-24",level:3},{value:"Concatenation",id:"concatenation",level:3},{value:"Get Value",id:"get-value-24",level:3},{value:"Refined Uri",id:"refined-uri",level:2},{value:"Compile-time Validation",id:"compile-time-validation-25",level:3},{value:"Runtime Validation",id:"runtime-validation-25",level:3},{value:"Get Value",id:"get-value-25",level:3},{value:"Convert to java.net.URI",id:"convert-to-javaneturi",level:3}];function p(n){const e={code:"code",h2:"h2",h3:"h3",hr:"hr",pre:"pre",...(0,i.a)(),...n.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(e.h2,{id:"import",children:"Import"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"import refined4s.types.all.*\n"})}),"\n",(0,s.jsxs)(e.h2,{id:"refined-int",children:["Refined ",(0,s.jsx)(e.code,{children:"Int"})]}),"\n",(0,s.jsxs)(e.h2,{id:"negint-negative-int",children:[(0,s.jsx)(e.code,{children:"NegInt"}),": negative ",(0,s.jsx)(e.code,{children:"Int"})]}),"\n",(0,s.jsx)(e.h3,{id:"compile-time-validation",children:"Compile-time Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NegInt(-1)\n// res0: Type = -1\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NegInt(0)\n// error: \n// Invalid value: [0]. It must be a negative Int\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NegInt(1)\n// error: \n// Invalid value: [1]. It must be a negative Int\n"})}),"\n",(0,s.jsx)(e.h3,{id:"runtime-validation",children:"Runtime Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val validNegInt = -1 \n// validNegInt: Int = -1 \nNegInt.from(validNegInt)\n// res3: Either[String, Type] = Right(value = -1)\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'val invalidNegInt1 = 0 \n// invalidNegInt1: Int = 0 \nNegInt.from(invalidNegInt1)\n// res4: Either[String, Type] = Left(\n// value = "Invalid value: [0]. It must be a negative Int"\n// )\n\nval invalidNegInt2 = 1\n// invalidNegInt2: Int = 1\nNegInt.from(invalidNegInt2)\n// res5: Either[String, Type] = Left(\n// value = "Invalid value: [1]. It must be a negative Int"\n// )\n'})}),"\n",(0,s.jsx)(e.h3,{id:"comparison",children:"Comparison"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val negInt1 = NegInt(-1)\n// negInt1: Type = -1\nval negInt2 = NegInt(-2)\n// negInt2: Type = -2\n\nnegInt1 > negInt2\n// res6: Boolean = true\nnegInt1 >= negInt2\n// res7: Boolean = true\nnegInt1 == negInt2\n// res8: Boolean = false\nnegInt1 < negInt2\n// res9: Boolean = false\nnegInt1 <= negInt2\n// res10: Boolean = false\n"})}),"\n",(0,s.jsx)(e.h3,{id:"get-value",children:"Get Value"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val negInt123 = NegInt(-123)\n// negInt123: Type = -123\nval negInt999 = NegInt(-999)\n// negInt999: Type = -999\n\nnegInt123.value\n// res11: Int = -123\n\nnegInt999.value\n// res12: Int = -999\n"})}),"\n",(0,s.jsx)(e.h3,{id:"min-and-max-values",children:"Min and Max Values"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NegInt.MinValue\n// res13: Type = -2147483648\n\nNegInt.MaxValue\n// res14: Type = -1\n"})}),"\n",(0,s.jsx)(e.hr,{}),"\n",(0,s.jsxs)(e.h2,{id:"nonnegint-non-negative-int",children:[(0,s.jsx)(e.code,{children:"NonNegInt"}),": non-negative ",(0,s.jsx)(e.code,{children:"Int"})]}),"\n",(0,s.jsx)(e.h3,{id:"compile-time-validation-1",children:"Compile-time Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonNegInt(0)\n// res15: Type = 0\nNonNegInt(1)\n// res16: Type = 1\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonNegInt(-2)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegFloat.from(validNonNegFloat2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosFloat.from(validPosFloat2)\n// ^\n"})}),"\n",(0,s.jsx)(e.h3,{id:"runtime-validation-1",children:"Runtime Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val validNonNegInt = 1 \n// validNonNegInt: Int = 1 \nNonNegInt.from(validNonNegInt)\n// res18: Either[String, Type] = Right(value = 1)\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'val invalidNonNegInt1 = -1\n// invalidNonNegInt1: Int = -1\nNonNegInt.from(invalidNonNegInt1)\n// res19: Either[String, Type] = Left(\n// value = "Invalid value: [-1]. It must be a non-negative Int"\n// )\n\nval invalidNonNegInt2 = -999\n// invalidNonNegInt2: Int = -999\nNonNegInt.from(invalidNonNegInt2)\n// res20: Either[String, Type] = Left(\n// value = "Invalid value: [-999]. It must be a non-negative Int"\n// )\n'})}),"\n",(0,s.jsx)(e.h3,{id:"comparison-1",children:"Comparison"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val nonNegInt1 = NonNegInt(0)\n// nonNegInt1: Type = 0\nval nonNegInt2 = NonNegInt(999)\n// nonNegInt2: Type = 999\n\nnonNegInt1 > nonNegInt2\n// res21: Boolean = false\nnonNegInt1 >= nonNegInt2\n// res22: Boolean = false\nnonNegInt1 == nonNegInt2\n// res23: Boolean = false\nnonNegInt1 < nonNegInt2\n// res24: Boolean = true\nnonNegInt1 <= nonNegInt2\n// res25: Boolean = true\n"})}),"\n",(0,s.jsx)(e.h3,{id:"get-value-1",children:"Get Value"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val nonNegInt123 = NonNegInt(0)\n// nonNegInt123: Type = 0\nval nonNegInt999 = NonNegInt(999)\n// nonNegInt999: Type = 999\n\nnonNegInt123.value\n// res26: Int = 0\n\nnonNegInt999.value\n// res27: Int = 999\n"})}),"\n",(0,s.jsx)(e.h3,{id:"min-and-max-values-1",children:"Min and Max Values"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonNegInt.MinValue\n// res28: Type = 0\n\nNonNegInt.MaxValue\n// res29: Type = 2147483647\n"})}),"\n",(0,s.jsx)(e.hr,{}),"\n",(0,s.jsxs)(e.h2,{id:"posint-positive-int",children:[(0,s.jsx)(e.code,{children:"PosInt"}),": positive ",(0,s.jsx)(e.code,{children:"Int"})]}),"\n",(0,s.jsx)(e.h3,{id:"compile-time-validation-2",children:"Compile-time Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"PosInt(1)\n// res30: Type = 1\nPosInt(999)\n// res31: Type = 999\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"PosInt(0)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegFloat.from(validNonNegFloat2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosFloat.from(validPosFloat2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString2)\n// ^\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"PosInt(-2)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegFloat.from(validNonNegFloat2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosFloat.from(validPosFloat2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString2)\n// ^\n"})}),"\n",(0,s.jsx)(e.h3,{id:"runtime-validation-2",children:"Runtime Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val validPosInt = 1\n// validPosInt: Int = 1\nPosInt.from(validPosInt)\n// res34: Either[String, Type] = Right(value = 1)\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'val invalidPosInt1 = 0\n// invalidPosInt1: Int = 0\nPosInt.from(invalidPosInt1)\n// res35: Either[String, Type] = Left(\n// value = "Invalid value: [0]. It must be a positive Int"\n// )\n\nval invalidPosInt2 = -999\n// invalidPosInt2: Int = -999\nPosInt.from(invalidPosInt2)\n// res36: Either[String, Type] = Left(\n// value = "Invalid value: [-999]. It must be a positive Int"\n// )\n'})}),"\n",(0,s.jsx)(e.h3,{id:"comparison-2",children:"Comparison"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val posInt1 = PosInt(1)\n// posInt1: Type = 1\nval posInt2 = PosInt(999)\n// posInt2: Type = 999\n\nposInt1 > posInt2\n// res37: Boolean = false\nposInt1 >= posInt2\n// res38: Boolean = false\nposInt1 == posInt2\n// res39: Boolean = false\nposInt1 < posInt2\n// res40: Boolean = true\nposInt1 <= posInt2\n// res41: Boolean = true\n"})}),"\n",(0,s.jsx)(e.h3,{id:"get-value-2",children:"Get Value"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val posInt123 = PosInt(123)\n// posInt123: Type = 123\nval posInt999 = PosInt(999)\n// posInt999: Type = 999\n\nposInt123.value\n// res42: Int = 123\n\nposInt999.value\n// res43: Int = 999\n"})}),"\n",(0,s.jsx)(e.h3,{id:"min-and-max-values-2",children:"Min and Max Values"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"PosInt.MinValue\n// res44: Type = 1\n\nPosInt.MaxValue\n// res45: Type = 2147483647\n"})}),"\n",(0,s.jsx)(e.hr,{}),"\n",(0,s.jsxs)(e.h2,{id:"nonposint-non-positive-int",children:[(0,s.jsx)(e.code,{children:"NonPosInt"}),": non-positive ",(0,s.jsx)(e.code,{children:"Int"})]}),"\n",(0,s.jsx)(e.h3,{id:"compile-time-validation-3",children:"Compile-time Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonPosInt(0)\n// res46: Type = 0\nNonPosInt(-999)\n// res47: Type = -999\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonPosInt(1)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// negDouble123.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.from(validNonNegDouble2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// nonPosFloat0.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigInt.from(validNegBigInt)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString2)\n// ^\n"})}),"\n",(0,s.jsx)(e.h3,{id:"runtime-validation-3",children:"Runtime Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val validNonPosInt = 0\n// validNonPosInt: Int = 0\nNonPosInt.from(validNonPosInt)\n// res49: Either[String, Type] = Right(value = 0)\n\nval validNonPosInt2 = -999\n// validNonPosInt2: Int = -999\nNonPosInt.from(validNonPosInt2)\n// res50: Either[String, Type] = Right(value = -999)\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'val invalidNonPosInt1 = 1\n// invalidNonPosInt1: Int = 1\nNonPosInt.from(invalidNonPosInt1)\n// res51: Either[String, Type] = Left(\n// value = "Invalid value: [1]. It must be a non-positive Int"\n// )\n\nval invalidNonPosInt2 = 999\n// invalidNonPosInt2: Int = 999\nNonPosInt.from(invalidNonPosInt2)\n// res52: Either[String, Type] = Left(\n// value = "Invalid value: [999]. It must be a non-positive Int"\n// )\n'})}),"\n",(0,s.jsx)(e.h3,{id:"comparison-3",children:"Comparison"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val nonPosInt1 = NonPosInt(0)\n// nonPosInt1: Type = 0\nval nonPosInt2 = NonPosInt(-999)\n// nonPosInt2: Type = -999\n\nnonPosInt1 > nonPosInt2\n// res53: Boolean = true\nnonPosInt1 >= nonPosInt2\n// res54: Boolean = true\nnonPosInt1 == nonPosInt2\n// res55: Boolean = false\nnonPosInt1 < nonPosInt2\n// res56: Boolean = false\nnonPosInt1 <= nonPosInt2\n// res57: Boolean = false\n"})}),"\n",(0,s.jsx)(e.h3,{id:"get-value-3",children:"Get Value"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val nonPosInt0 = NonPosInt(0)\n// nonPosInt0: Type = 0\nval nonPosIntMinus999 = NonPosInt(-999)\n// nonPosIntMinus999: Type = -999\n\nnonPosInt0.value\n// res58: Int = 0\n\nnonPosIntMinus999.value\n// res59: Int = -999\n"})}),"\n",(0,s.jsx)(e.h3,{id:"min-and-max-values-3",children:"Min and Max Values"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonPosInt.MinValue\n// res60: Type = -2147483648\n\nNonPosInt.MaxValue\n// res61: Type = 0\n"})}),"\n",(0,s.jsx)(e.hr,{}),"\n",(0,s.jsxs)(e.h2,{id:"refined-long",children:["Refined ",(0,s.jsx)(e.code,{children:"Long"})]}),"\n",(0,s.jsxs)(e.h2,{id:"neglong-negative-long",children:[(0,s.jsx)(e.code,{children:"NegLong"}),": negative ",(0,s.jsx)(e.code,{children:"Long"})]}),"\n",(0,s.jsx)(e.h3,{id:"compile-time-validation-4",children:"Compile-time Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NegLong(-1L)\n// res62: Type = -1L\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NegLong(0L)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.from(validNonPosLong2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// nonPosLong0.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// negFloat123.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegFloat.from(validNonNegFloat1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// nonNegBigInt123.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosBigInt.from(invalidPosBigInt1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString2)\n// ^\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NegLong(1L)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.from(validNonPosLong2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// nonPosLong0.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// negFloat123.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegFloat.from(validNonNegFloat1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// nonNegBigInt123.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosBigInt.from(invalidPosBigInt1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString2)\n// ^\n"})}),"\n",(0,s.jsx)(e.h3,{id:"runtime-validation-4",children:"Runtime Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val validNegLong = -1L \n// validNegLong: Long = -1L \nNegLong.from(validNegLong)\n// res65: Either[String, Type] = Right(value = -1L)\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'val invalidNegLong1 = 0L \n// invalidNegLong1: Long = 0L \nNegLong.from(invalidNegLong1)\n// res66: Either[String, Type] = Left(\n// value = "Invalid value: [0]. It must be a negative Long"\n// )\n\nval invalidNegLong2 = 1L\n// invalidNegLong2: Long = 1L\nNegLong.from(invalidNegLong2)\n// res67: Either[String, Type] = Left(\n// value = "Invalid value: [1]. It must be a negative Long"\n// )\n'})}),"\n",(0,s.jsx)(e.h3,{id:"comparison-4",children:"Comparison"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val negLong1 = NegLong(-1L)\n// negLong1: Type = -1L\nval negLong2 = NegLong(-2L)\n// negLong2: Type = -2L\n\nnegLong1 > negLong2\n// res68: Boolean = true\nnegLong1 >= negLong2\n// res69: Boolean = true\nnegLong1 == negLong2\n// res70: Boolean = false\nnegLong1 < negLong2\n// res71: Boolean = false\nnegLong1 <= negLong2\n// res72: Boolean = false\n"})}),"\n",(0,s.jsx)(e.h3,{id:"get-value-4",children:"Get Value"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val negLong123 = NegLong(-123L)\n// negLong123: Type = -123L\nval negLong999 = NegLong(-999L)\n// negLong999: Type = -999L\n\nnegLong123.value\n// res73: Long = -123L\n\nnegLong999.value\n// res74: Long = -999L\n"})}),"\n",(0,s.jsx)(e.h3,{id:"min-and-max-values-4",children:"Min and Max Values"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NegLong.MinValue\n// res75: Type = -9223372036854775808L\n\nNegLong.MaxValue\n// res76: Type = -1L\n"})}),"\n",(0,s.jsx)(e.hr,{}),"\n",(0,s.jsxs)(e.h2,{id:"nonneglong-non-negative-long",children:[(0,s.jsx)(e.code,{children:"NonNegLong"}),": non-negative ",(0,s.jsx)(e.code,{children:"Long"})]}),"\n",(0,s.jsx)(e.h3,{id:"compile-time-validation-5",children:"Compile-time Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonNegLong(0L)\n// res77: Type = 0L\nNonNegLong(1L)\n// res78: Type = 1L\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonNegLong(-2L)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// negLong123.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.from(invalidNonNegLong1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// nonNegDouble123.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.from(validPosDouble1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// posFloat123.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosFloat.from(validNonPosFloat)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigDecimal.from(validNegBigDecimal)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigDecimal.from(invalidNegBigDecimal1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(invalidNonEmptyString)\n// ^\n"})}),"\n",(0,s.jsx)(e.h3,{id:"runtime-validation-5",children:"Runtime Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val validNonNegLong = 1L\n// validNonNegLong: Long = 1L\nNonNegLong.from(validNonNegLong)\n// res80: Either[String, Type] = Right(value = 1L)\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'val invalidNonNegLong1 = -1L\n// invalidNonNegLong1: Long = -1L\nNonNegLong.from(invalidNonNegLong1)\n// res81: Either[String, Type] = Left(\n// value = "Invalid value: [-1]. It must be a non-negative Long"\n// )\n\nval invalidNonNegLong2 = -999L\n// invalidNonNegLong2: Long = -999L\nNonNegLong.from(invalidNonNegLong2)\n// res82: Either[String, Type] = Left(\n// value = "Invalid value: [-999]. It must be a non-negative Long"\n// )\n'})}),"\n",(0,s.jsx)(e.h3,{id:"comparison-5",children:"Comparison"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val nonNegLong1 = NonNegLong(0L)\n// nonNegLong1: Type = 0L\nval nonNegLong2 = NonNegLong(999L)\n// nonNegLong2: Type = 999L\n\nnonNegLong1 > nonNegLong2\n// res83: Boolean = false\nnonNegLong1 >= nonNegLong2\n// res84: Boolean = false\nnonNegLong1 == nonNegLong2\n// res85: Boolean = false\nnonNegLong1 < nonNegLong2\n// res86: Boolean = true\nnonNegLong1 <= nonNegLong2\n// res87: Boolean = true\n"})}),"\n",(0,s.jsx)(e.h3,{id:"get-value-5",children:"Get Value"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val nonNegLong123 = NonNegLong(0L)\n// nonNegLong123: Type = 0L\nval nonNegLong999 = NonNegLong(999L)\n// nonNegLong999: Type = 999L\n\nnonNegLong123.value\n// res88: Long = 0L\n\nnonNegLong999.value\n// res89: Long = 999L\n"})}),"\n",(0,s.jsx)(e.h3,{id:"min-and-max-values-5",children:"Min and Max Values"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonNegLong.MinValue\n// res90: Type = 0L\n\nNonNegLong.MaxValue\n// res91: Type = 9223372036854775807L\n"})}),"\n",(0,s.jsx)(e.hr,{}),"\n",(0,s.jsxs)(e.h2,{id:"poslong-positive-long",children:[(0,s.jsx)(e.code,{children:"PosLong"}),": positive ",(0,s.jsx)(e.code,{children:"Long"})]}),"\n",(0,s.jsx)(e.h3,{id:"compile-time-validation-6",children:"Compile-time Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"PosLong(1L)\n// res92: Type = 1L\nPosLong(999L)\n// res93: Type = 999L\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"PosLong(0L)\n// error: \n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// error: \n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// nonNegLong123.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.from(invalidPosLong1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// posDouble123.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.from(validNonPosDouble)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// nonPosFloat0.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigInt.from(validNegBigInt)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigDecimal.from(validNegBigDecimal)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigDecimal.from(invalidNegBigDecimal1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(invalidNonEmptyString)\n// ^\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"PosLong(-2L)\n// error: \n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// error: \n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// nonNegLong123.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.from(invalidPosLong1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// posDouble123.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.from(validNonPosDouble)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// nonPosFloat0.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigInt.from(validNegBigInt)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigDecimal.from(validNegBigDecimal)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigDecimal.from(invalidNegBigDecimal1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(invalidNonEmptyString)\n// ^\n"})}),"\n",(0,s.jsx)(e.h3,{id:"runtime-validation-6",children:"Runtime Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val validPosLong = 1L\n// validPosLong: Long = 1L\nPosLong.from(validPosLong)\n// res96: Either[String, Type] = Right(value = 1L)\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'val invalidPosLong1 = 0L\n// invalidPosLong1: Long = 0L\nPosLong.from(invalidPosLong1)\n// res97: Either[String, Type] = Left(\n// value = "Invalid value: [0]. It must be a positive Long"\n// )\n\nval invalidPosLong2 = -999L\n// invalidPosLong2: Long = -999L\nPosLong.from(invalidPosLong2)\n// res98: Either[String, Type] = Left(\n// value = "Invalid value: [-999]. It must be a positive Long"\n// )\n'})}),"\n",(0,s.jsx)(e.h3,{id:"comparison-6",children:"Comparison"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val posLong1 = PosLong(1L)\n// posLong1: Type = 1L\nval posLong2 = PosLong(999L)\n// posLong2: Type = 999L\n\nposLong1 > posLong2\n// res99: Boolean = false\nposLong1 >= posLong2\n// res100: Boolean = false\nposLong1 == posLong2\n// res101: Boolean = false\nposLong1 < posLong2\n// res102: Boolean = true\nposLong1 <= posLong2\n// res103: Boolean = true\n"})}),"\n",(0,s.jsx)(e.h3,{id:"get-value-6",children:"Get Value"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val posLong123 = PosLong(123L)\n// posLong123: Type = 123L\nval posLong999 = PosLong(999L)\n// posLong999: Type = 999L\n\nposLong123.value\n// res104: Long = 123L\n\nposLong999.value\n// res105: Long = 999L\n"})}),"\n",(0,s.jsx)(e.h3,{id:"min-and-max-values-6",children:"Min and Max Values"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"PosLong.MinValue\n// res106: Type = 1L\n\nPosLong.MaxValue\n// res107: Type = 9223372036854775807L\n"})}),"\n",(0,s.jsx)(e.hr,{}),"\n",(0,s.jsxs)(e.h2,{id:"nonposlong-non-positive-long",children:[(0,s.jsx)(e.code,{children:"NonPosLong"}),": non-positive ",(0,s.jsx)(e.code,{children:"Long"})]}),"\n",(0,s.jsx)(e.h3,{id:"compile-time-validation-7",children:"Compile-time Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonPosLong(0L)\n// res108: Type = 0L\nNonPosLong(-999L)\n// res109: Type = -999L\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonPosLong(1L)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.from(invalidPosInt1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.from(invalidPosInt2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// posLong123.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.from(validNonPosLong)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// nonPosDouble0.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.from(validNegFloat)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigInt.from(invalidNegBigInt1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigInt.from(invalidNegBigInt2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigDecimal.from(invalidNegBigDecimal1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigDecimal.from(invalidNegBigDecimal2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(invalidNonEmptyString)\n// ^\n"})}),"\n",(0,s.jsx)(e.h3,{id:"runtime-validation-7",children:"Runtime Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val validNonPosLong = 0L\n// validNonPosLong: Long = 0L\nNonPosLong.from(validNonPosLong)\n// res111: Either[String, Type] = Right(value = 0L)\n\nval validNonPosLong2 = -999L\n// validNonPosLong2: Long = -999L\nNonPosLong.from(validNonPosLong2)\n// res112: Either[String, Type] = Right(value = -999L)\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'val invalidNonPosLong1 = 1L\n// invalidNonPosLong1: Long = 1L\nNonPosLong.from(invalidNonPosLong1)\n// res113: Either[String, Type] = Left(\n// value = "Invalid value: [1]. It must be a non-positive Long"\n// )\n\nval invalidNonPosLong2 = 999L\n// invalidNonPosLong2: Long = 999L\nNonPosLong.from(invalidNonPosLong2)\n// res114: Either[String, Type] = Left(\n// value = "Invalid value: [999]. It must be a non-positive Long"\n// )\n'})}),"\n",(0,s.jsx)(e.h3,{id:"comparison-7",children:"Comparison"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val nonPosLong1 = NonPosLong(0L)\n// nonPosLong1: Type = 0L\nval nonPosLong2 = NonPosLong(-999L)\n// nonPosLong2: Type = -999L\n\nnonPosLong1 > nonPosLong2\n// res115: Boolean = true\nnonPosLong1 >= nonPosLong2\n// res116: Boolean = true\nnonPosLong1 == nonPosLong2\n// res117: Boolean = false\nnonPosLong1 < nonPosLong2\n// res118: Boolean = false\nnonPosLong1 <= nonPosLong2\n// res119: Boolean = false\n"})}),"\n",(0,s.jsx)(e.h3,{id:"get-value-7",children:"Get Value"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val nonPosLong0 = NonPosLong(0L)\n// nonPosLong0: Type = 0L\nval nonPosLongMinus999 = NonPosLong(-999L)\n// nonPosLongMinus999: Type = -999L\n\nnonPosLong0.value\n// res120: Long = 0L\n\nnonPosLongMinus999.value\n// res121: Long = -999L\n"})}),"\n",(0,s.jsx)(e.h3,{id:"min-and-max-values-7",children:"Min and Max Values"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonPosLong.MinValue\n// res122: Type = -9223372036854775808L\n\nNonPosLong.MaxValue\n// res123: Type = 0L\n"})}),"\n",(0,s.jsx)(e.hr,{}),"\n",(0,s.jsxs)(e.h2,{id:"refined-double",children:["Refined ",(0,s.jsx)(e.code,{children:"Double"})]}),"\n",(0,s.jsxs)(e.h2,{id:"negdouble-negative-double",children:[(0,s.jsx)(e.code,{children:"NegDouble"}),": negative ",(0,s.jsx)(e.code,{children:"Double"})]}),"\n",(0,s.jsx)(e.h3,{id:"compile-time-validation-8",children:"Compile-time Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NegDouble(-0.00001d)\n// res124: Type = -1.0E-5\nNegDouble(-999.999d)\n// res125: Type = -999.999\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NegDouble(0d)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.from(validNonPosInt)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.from(invalidNonPosInt1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// nonPosLong0.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.from(validNegDouble)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.from(invalidNegFloat1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.from(invalidNegFloat2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigInt.from(invalidNegBigInt1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigInt.from(invalidNegBigInt2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigDecimal.from(invalidNegBigDecimal1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigDecimal.from(invalidNegBigDecimal2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(invalidNonEmptyString)\n// ^\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NegDouble(999.999d)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.from(validNonPosInt)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.from(invalidNonPosInt1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// nonPosLong0.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.from(validNegDouble)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.from(invalidNegFloat1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.from(invalidNegFloat2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigInt.from(invalidNegBigInt1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigInt.from(invalidNegBigInt2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigDecimal.from(invalidNegBigDecimal1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigDecimal.from(invalidNegBigDecimal2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(invalidNonEmptyString)\n// ^\n"})}),"\n",(0,s.jsx)(e.h3,{id:"runtime-validation-8",children:"Runtime Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val validNegDouble = -0.00001d \n// validNegDouble: Double = -1.0E-5 \nNegDouble.from(validNegDouble)\n// res128: Either[String, Type] = Right(value = -1.0E-5)\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'val invalidNegDouble1 = 0d \n// invalidNegDouble1: Double = 0.0 \nNegDouble.from(invalidNegDouble1)\n// res129: Either[String, Type] = Left(\n// value = "Invalid value: [0.0]. It must be a negative Double"\n// )\n\nval invalidNegDouble2 = 999.999d\n// invalidNegDouble2: Double = 999.999\nNegDouble.from(invalidNegDouble2)\n// res130: Either[String, Type] = Left(\n// value = "Invalid value: [999.999]. It must be a negative Double"\n// )\n'})}),"\n",(0,s.jsx)(e.h3,{id:"comparison-8",children:"Comparison"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val negDouble1 = NegDouble(-0.1d)\n// negDouble1: Type = -0.1\nval negDouble2 = NegDouble(-0.2d)\n// negDouble2: Type = -0.2\n\nnegDouble1 > negDouble2\n// res131: Boolean = true\nnegDouble1 >= negDouble2\n// res132: Boolean = true\nnegDouble1 == negDouble2\n// res133: Boolean = false\nnegDouble1 < negDouble2\n// res134: Boolean = false\nnegDouble1 <= negDouble2\n// res135: Boolean = false\n"})}),"\n",(0,s.jsx)(e.h3,{id:"get-value-8",children:"Get Value"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val negDouble123 = NegDouble(-123.123d)\n// negDouble123: Type = -123.123\nval negDouble999 = NegDouble(-999.999d)\n// negDouble999: Type = -999.999\n\nnegDouble123.value\n// res136: Double = -123.123\n\nnegDouble999.value\n// res137: Double = -999.999\n"})}),"\n",(0,s.jsx)(e.h3,{id:"min-and-max-values-8",children:"Min and Max Values"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NegDouble.MinValue\n// res138: Type = -1.7976931348623157E308\n\nNegDouble.MaxValue\n// res139: Type = -4.9E-324\n"})}),"\n",(0,s.jsx)(e.hr,{}),"\n",(0,s.jsxs)(e.h2,{id:"nonnegdouble-non-negative-double",children:[(0,s.jsx)(e.code,{children:"NonNegDouble"}),": non-negative ",(0,s.jsx)(e.code,{children:"Double"})]}),"\n",(0,s.jsx)(e.h3,{id:"compile-time-validation-9",children:"Compile-time Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonNegDouble(0d)\n// res140: Type = 0.0\nNonNegDouble(999.999d)\n// res141: Type = 999.999\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonNegDouble(-0.00001d)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error: \n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// error: \n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// nonNegDouble123.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.from(validPosDouble1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// posFloat123.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosFloat.from(validNonPosFloat)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigDecimal.from(validNegBigDecimal)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigDecimal.from(invalidNegBigDecimal1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(invalidNonEmptyString)\n// ^\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{children:"```scala mdoc:fail\nNonNegDouble(-999.999d)\n"})}),"\n",(0,s.jsx)(e.h3,{id:"runtime-validation-9",children:"Runtime Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val validNonNegDouble1 = 0d\n// validNonNegDouble1: Double = 0.0\nNonNegDouble.from(validNonNegDouble1)\n// res143: Either[String, Type] = Right(value = 0.0)\n\nval validNonNegDouble2 = 999.999d\n// validNonNegDouble2: Double = 999.999\nNonNegDouble.from(validNonNegDouble2)\n// res144: Either[String, Type] = Right(value = 999.999)\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'val invalidNonNegDouble1 = -0.00001d\n// invalidNonNegDouble1: Double = -1.0E-5\nNonNegDouble.from(invalidNonNegDouble1)\n// res145: Either[String, Type] = Left(\n// value = "Invalid value: [-1.0E-5]. It must be a non-negative Double"\n// )\n\nval invalidNonNegDouble2 = -999.999d\n// invalidNonNegDouble2: Double = -999.999\nNonNegDouble.from(invalidNonNegDouble2)\n// res146: Either[String, Type] = Left(\n// value = "Invalid value: [-999.999]. It must be a non-negative Double"\n// )\n'})}),"\n",(0,s.jsx)(e.h3,{id:"comparison-9",children:"Comparison"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val nonNegDouble1 = NonNegDouble(0d)\n// nonNegDouble1: Type = 0.0\nval nonNegDouble2 = NonNegDouble(0.999d)\n// nonNegDouble2: Type = 0.999\n\nnonNegDouble1 > nonNegDouble2\n// res147: Boolean = false\nnonNegDouble1 >= nonNegDouble2\n// res148: Boolean = false\nnonNegDouble1 == nonNegDouble2\n// res149: Boolean = false\nnonNegDouble1 < nonNegDouble2\n// res150: Boolean = true\nnonNegDouble1 <= nonNegDouble2\n// res151: Boolean = true\n"})}),"\n",(0,s.jsx)(e.h3,{id:"get-value-9",children:"Get Value"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val nonNegDouble123 = NonNegDouble(0d)\n// nonNegDouble123: Type = 0.0\nval nonNegDouble999 = NonNegDouble(999.999d)\n// nonNegDouble999: Type = 999.999\n\nnonNegDouble123.value\n// res152: Double = 0.0\n\nnonNegDouble999.value\n// res153: Double = 999.999\n"})}),"\n",(0,s.jsx)(e.h3,{id:"min-and-max-values-9",children:"Min and Max Values"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonNegDouble.MinValue\n// res154: Type = 0.0\n\nNonNegDouble.MaxValue\n// res155: Type = 1.7976931348623157E308\n"})}),"\n",(0,s.jsx)(e.hr,{}),"\n",(0,s.jsxs)(e.h2,{id:"posdouble-positive-double",children:[(0,s.jsx)(e.code,{children:"PosDouble"}),": positive ",(0,s.jsx)(e.code,{children:"Double"})]}),"\n",(0,s.jsx)(e.h3,{id:"compile-time-validation-10",children:"Compile-time Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"PosDouble(0.00001d)\n// res156: Type = 1.0E-5\nPosDouble(999.999d)\n// res157: Type = 999.999\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"PosDouble(0d)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.from(invalidPosLong1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.from(invalidPosLong2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// nonNegDouble123.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.from(validPosDouble1)\n// ^\n// error: \n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// error: \n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosBigInt.from(validNonPosBigInt)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosBigInt.from(invalidNonPosBigInt1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(invalidNonEmptyString)\n// ^\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"PosDouble(-999.999d)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.from(invalidPosLong1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.from(invalidPosLong2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// nonNegDouble123.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.from(validPosDouble1)\n// ^\n// error: \n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// error: \n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosBigInt.from(validNonPosBigInt)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosBigInt.from(invalidNonPosBigInt1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(invalidNonEmptyString)\n// ^\n"})}),"\n",(0,s.jsx)(e.h3,{id:"runtime-validation-10",children:"Runtime Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val validPosDouble1 = 0.00001d\n// validPosDouble1: Double = 1.0E-5\nPosDouble.from(validPosDouble1)\n// res160: Either[String, Type] = Right(value = 1.0E-5)\n\nval validPosDouble2 = 999.999d\n// validPosDouble2: Double = 999.999\nPosDouble.from(validPosDouble2)\n// res161: Either[String, Type] = Right(value = 999.999)\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'val invalidPosDouble1 = 0d\n// invalidPosDouble1: Double = 0.0\nPosDouble.from(invalidPosDouble1)\n// res162: Either[String, Type] = Left(\n// value = "Invalid value: [0.0]. It must be a positive Double"\n// )\n\nval invalidPosDouble2 = -999.999d\n// invalidPosDouble2: Double = -999.999\nPosDouble.from(invalidPosDouble2)\n// res163: Either[String, Type] = Left(\n// value = "Invalid value: [-999.999]. It must be a positive Double"\n// )\n'})}),"\n",(0,s.jsx)(e.h3,{id:"comparison-10",children:"Comparison"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val posDouble1 = PosDouble(0.00001d)\n// posDouble1: Type = 1.0E-5\nval posDouble2 = PosDouble(0.999d)\n// posDouble2: Type = 0.999\n\nposDouble1 > posDouble2\n// res164: Boolean = false\nposDouble1 >= posDouble2\n// res165: Boolean = false\nposDouble1 == posDouble2\n// res166: Boolean = false\nposDouble1 < posDouble2\n// res167: Boolean = true\nposDouble1 <= posDouble2\n// res168: Boolean = true\n"})}),"\n",(0,s.jsx)(e.h3,{id:"get-value-10",children:"Get Value"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val posDouble123 = PosDouble(123.123d)\n// posDouble123: Type = 123.123\nval posDouble999 = PosDouble(999.999d)\n// posDouble999: Type = 999.999\n\nposDouble123.value\n// res169: Double = 123.123\n\nposDouble999.value\n// res170: Double = 999.999\n"})}),"\n",(0,s.jsx)(e.h3,{id:"min-and-max-values-10",children:"Min and Max Values"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"PosDouble.MinValue\n// res171: Type = 4.9E-324\n\nPosDouble.MaxValue\n// res172: Type = 1.7976931348623157E308\n"})}),"\n",(0,s.jsx)(e.hr,{}),"\n",(0,s.jsxs)(e.h2,{id:"nonposdouble-non-positive-double",children:[(0,s.jsx)(e.code,{children:"NonPosDouble"}),": non-positive ",(0,s.jsx)(e.code,{children:"Double"})]}),"\n",(0,s.jsx)(e.h3,{id:"compile-time-validation-11",children:"Compile-time Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonPosDouble(0d)\n// res173: Type = 0.0\nNonPosDouble(-999.999d)\n// res174: Type = -999.999\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonPosDouble(0.00001d)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.from(validNonPosLong)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.from(invalidNonPosLong1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// nonPosDouble0.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.from(validNegFloat)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigInt.from(invalidNegBigInt1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigInt.from(invalidNegBigInt2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigDecimal.from(invalidNegBigDecimal1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigDecimal.from(invalidNegBigDecimal2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(invalidNonEmptyString)\n// ^\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonPosDouble(999.999d)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.from(validNonPosLong)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.from(invalidNonPosLong1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// nonPosDouble0.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.from(validNegFloat)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigInt.from(invalidNegBigInt1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigInt.from(invalidNegBigInt2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigDecimal.from(invalidNegBigDecimal1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigDecimal.from(invalidNegBigDecimal2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(invalidNonEmptyString)\n// ^\n"})}),"\n",(0,s.jsx)(e.h3,{id:"runtime-validation-11",children:"Runtime Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val validNonPosDouble = 0d\n// validNonPosDouble: Double = 0.0\nNonPosDouble.from(validNonPosDouble)\n// res177: Either[String, Type] = Right(value = 0.0)\n\nval validNonPosDouble2 = -999.999d\n// validNonPosDouble2: Double = -999.999\nNonPosDouble.from(validNonPosDouble2)\n// res178: Either[String, Type] = Right(value = -999.999)\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'val invalidNonPosDouble1 = 0.00001d\n// invalidNonPosDouble1: Double = 1.0E-5\nNonPosDouble.from(invalidNonPosDouble1)\n// res179: Either[String, Type] = Left(\n// value = "Invalid value: [1.0E-5]. It must be a non-positive Double"\n// )\n\nval invalidNonPosDouble2 = 999.999d\n// invalidNonPosDouble2: Double = 999.999\nNonPosDouble.from(invalidNonPosDouble2)\n// res180: Either[String, Type] = Left(\n// value = "Invalid value: [999.999]. It must be a non-positive Double"\n// )\n'})}),"\n",(0,s.jsx)(e.h3,{id:"comparison-11",children:"Comparison"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val nonPosDouble1 = NonPosDouble(0d)\n// nonPosDouble1: Type = 0.0\nval nonPosDouble2 = NonPosDouble(-0.999d)\n// nonPosDouble2: Type = -0.999\n\nnonPosDouble1 > nonPosDouble2\n// res181: Boolean = true\nnonPosDouble1 >= nonPosDouble2\n// res182: Boolean = true\nnonPosDouble1 == nonPosDouble2\n// res183: Boolean = false\nnonPosDouble1 < nonPosDouble2\n// res184: Boolean = false\nnonPosDouble1 <= nonPosDouble2\n// res185: Boolean = false\n"})}),"\n",(0,s.jsx)(e.h3,{id:"get-value-11",children:"Get Value"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val nonPosDouble0 = NonPosDouble(0d)\n// nonPosDouble0: Type = 0.0\nval nonPosDoubleMinus999 = NonPosDouble(-999.999d)\n// nonPosDoubleMinus999: Type = -999.999\n\nnonPosDouble0.value\n// res186: Double = 0.0\n\nnonPosDoubleMinus999.value\n// res187: Double = -999.999\n"})}),"\n",(0,s.jsx)(e.h3,{id:"min-and-max-values-11",children:"Min and Max Values"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonPosDouble.MinValue\n// res188: Type = -1.7976931348623157E308\n\nNonPosDouble.MaxValue\n// res189: Type = 0.0\n"})}),"\n",(0,s.jsx)(e.hr,{}),"\n",(0,s.jsxs)(e.h2,{id:"refined-float",children:["Refined ",(0,s.jsx)(e.code,{children:"Float"})]}),"\n",(0,s.jsxs)(e.h2,{id:"negfloat-negative-float",children:[(0,s.jsx)(e.code,{children:"NegFloat"}),": negative ",(0,s.jsx)(e.code,{children:"Float"})]}),"\n",(0,s.jsx)(e.h3,{id:"compile-time-validation-12",children:"Compile-time Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NegFloat(-0.00001f)\n// res190: Type = -1.0E-5F\nNegFloat(-999.999f)\n// res191: Type = -999.999F\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NegFloat(0f)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.from(validNonNegDouble1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.from(invalidNonNegDouble1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// nonNegFloat123.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosFloat.from(validPosFloat1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosBigInt.from(validNonPosBigInt)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosBigInt.from(invalidNonPosBigInt1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString2)\n// ^\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NegFloat(999.999f)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.from(validNonNegDouble1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.from(invalidNonNegDouble1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// nonNegFloat123.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosFloat.from(validPosFloat1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosBigInt.from(validNonPosBigInt)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosBigInt.from(invalidNonPosBigInt1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString2)\n// ^\n"})}),"\n",(0,s.jsx)(e.h3,{id:"runtime-validation-12",children:"Runtime Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val validNegFloat = -0.00001f \n// validNegFloat: Float = -1.0E-5F \nNegFloat.from(validNegFloat)\n// res194: Either[String, Type] = Right(value = -1.0E-5F)\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'val invalidNegFloat1 = 0f \n// invalidNegFloat1: Float = 0.0F \nNegFloat.from(invalidNegFloat1)\n// res195: Either[String, Type] = Left(\n// value = "Invalid value: [0.0]. It must be a negative Float"\n// )\n\nval invalidNegFloat2 = 999.999f\n// invalidNegFloat2: Float = 999.999F\nNegFloat.from(invalidNegFloat2)\n// res196: Either[String, Type] = Left(\n// value = "Invalid value: [999.999]. It must be a negative Float"\n// )\n'})}),"\n",(0,s.jsx)(e.h3,{id:"comparison-12",children:"Comparison"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val negFloat1 = NegFloat(-0.1f)\n// negFloat1: Type = -0.1F\nval negFloat2 = NegFloat(-0.2f)\n// negFloat2: Type = -0.2F\n\nnegFloat1 > negFloat2\n// res197: Boolean = true\nnegFloat1 >= negFloat2\n// res198: Boolean = true\nnegFloat1 == negFloat2\n// res199: Boolean = false\nnegFloat1 < negFloat2\n// res200: Boolean = false\nnegFloat1 <= negFloat2\n// res201: Boolean = false\n"})}),"\n",(0,s.jsx)(e.h3,{id:"get-value-12",children:"Get Value"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val negFloat123 = NegFloat(-123.123f)\n// negFloat123: Type = -123.123F\nval negFloat999 = NegFloat(-999.999f)\n// negFloat999: Type = -999.999F\n\nnegFloat123.value\n// res202: Float = -123.123F\n\nnegFloat999.value\n// res203: Float = -999.999F\n"})}),"\n",(0,s.jsx)(e.h3,{id:"min-and-max-values-12",children:"Min and Max Values"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NegFloat.MinValue\n// res204: Type = -3.4028235E38F\n\nNegFloat.MaxValue\n// res205: Type = -1.4E-45F\n"})}),"\n",(0,s.jsx)(e.hr,{}),"\n",(0,s.jsxs)(e.h2,{id:"nonnegfloat-non-negative-float",children:[(0,s.jsx)(e.code,{children:"NonNegFloat"}),": non-negative ",(0,s.jsx)(e.code,{children:"Float"})]}),"\n",(0,s.jsx)(e.h3,{id:"compile-time-validation-13",children:"Compile-time Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonNegFloat(0f)\n// res206: Type = 0.0F\nNonNegFloat(999.999f)\n// res207: Type = 999.999F\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonNegFloat(-0.00001f)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.from(validPosDouble1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.from(invalidPosDouble1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// posFloat123.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosFloat.from(validNonPosFloat)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigDecimal.from(validNegBigDecimal)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigDecimal.from(invalidNegBigDecimal1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(invalidNonEmptyString)\n// ^\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonNegFloat(-999.999f)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.from(validPosDouble1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.from(invalidPosDouble1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// posFloat123.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosFloat.from(validNonPosFloat)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigDecimal.from(validNegBigDecimal)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigDecimal.from(invalidNegBigDecimal1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(invalidNonEmptyString)\n// ^\n"})}),"\n",(0,s.jsx)(e.h3,{id:"runtime-validation-13",children:"Runtime Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val validNonNegFloat1 = 0f\n// validNonNegFloat1: Float = 0.0F\nNonNegFloat.from(validNonNegFloat1)\n// res210: Either[String, Type] = Right(value = 0.0F)\n\nval validNonNegFloat2 = 999.999f\n// validNonNegFloat2: Float = 999.999F\nNonNegFloat.from(validNonNegFloat2)\n// res211: Either[String, Type] = Right(value = 999.999F)\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'val invalidNonNegFloat1 = -0.00001f\n// invalidNonNegFloat1: Float = -1.0E-5F\nNonNegFloat.from(invalidNonNegFloat1)\n// res212: Either[String, Type] = Left(\n// value = "Invalid value: [-1.0E-5]. It must be a non-negative Float"\n// )\n\nval invalidNonNegFloat2 = -999.999f\n// invalidNonNegFloat2: Float = -999.999F\nNonNegFloat.from(invalidNonNegFloat2)\n// res213: Either[String, Type] = Left(\n// value = "Invalid value: [-999.999]. It must be a non-negative Float"\n// )\n'})}),"\n",(0,s.jsx)(e.h3,{id:"comparison-13",children:"Comparison"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val nonNegFloat1 = NonNegFloat(0f)\n// nonNegFloat1: Type = 0.0F\nval nonNegFloat2 = NonNegFloat(0.999f)\n// nonNegFloat2: Type = 0.999F\n\nnonNegFloat1 > nonNegFloat2\n// res214: Boolean = false\nnonNegFloat1 >= nonNegFloat2\n// res215: Boolean = false\nnonNegFloat1 == nonNegFloat2\n// res216: Boolean = false\nnonNegFloat1 < nonNegFloat2\n// res217: Boolean = true\nnonNegFloat1 <= nonNegFloat2\n// res218: Boolean = true\n"})}),"\n",(0,s.jsx)(e.h3,{id:"get-value-13",children:"Get Value"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val nonNegFloat123 = NonNegFloat(0f)\n// nonNegFloat123: Type = 0.0F\nval nonNegFloat999 = NonNegFloat(999.999f)\n// nonNegFloat999: Type = 999.999F\n\nnonNegFloat123.value\n// res219: Float = 0.0F\n\nnonNegFloat999.value\n// res220: Float = 999.999F\n"})}),"\n",(0,s.jsx)(e.h3,{id:"min-and-max-values-13",children:"Min and Max Values"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonNegFloat.MinValue\n// res221: Type = 0.0F\n\nNonNegFloat.MaxValue\n// res222: Type = 3.4028235E38F\n"})}),"\n",(0,s.jsx)(e.hr,{}),"\n",(0,s.jsxs)(e.h2,{id:"posfloat-positive-float",children:[(0,s.jsx)(e.code,{children:"PosFloat"}),": positive ",(0,s.jsx)(e.code,{children:"Float"})]}),"\n",(0,s.jsx)(e.h3,{id:"compile-time-validation-14",children:"Compile-time Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"PosFloat(0.00001f)\n// res223: Type = 1.0E-5F\nPosFloat(999.999f)\n// res224: Type = 999.999F\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"PosFloat(0f)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.from(validNonPosDouble)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.from(invalidNonPosDouble1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// nonPosFloat0.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigInt.from(validNegBigInt)\n// ^\n// error: \n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// nonPosBigInt0.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(invalidNonEmptyString)\n// ^\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"PosFloat(-999.999f)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.from(validNonPosDouble)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.from(invalidNonPosDouble1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// nonPosFloat0.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigInt.from(validNegBigInt)\n// ^\n// error: \n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// nonPosBigInt0.value\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(invalidNonEmptyString)\n// ^\n"})}),"\n",(0,s.jsx)(e.h3,{id:"runtime-validation-14",children:"Runtime Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val validPosFloat1 = 0.00001f\n// validPosFloat1: Float = 1.0E-5F\nPosFloat.from(validPosFloat1)\n// res227: Either[String, Type] = Right(value = 1.0E-5F)\n\nval validPosFloat2 = 999.999f\n// validPosFloat2: Float = 999.999F\nPosFloat.from(validPosFloat2)\n// res228: Either[String, Type] = Right(value = 999.999F)\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'val invalidPosFloat1 = 0f\n// invalidPosFloat1: Float = 0.0F\nPosFloat.from(invalidPosFloat1)\n// res229: Either[String, Type] = Left(\n// value = "Invalid value: [0.0]. It must be a positive Float"\n// )\n\nval invalidPosFloat2 = -999.999f\n// invalidPosFloat2: Float = -999.999F\nPosFloat.from(invalidPosFloat2)\n// res230: Either[String, Type] = Left(\n// value = "Invalid value: [-999.999]. It must be a positive Float"\n// )\n'})}),"\n",(0,s.jsx)(e.h3,{id:"comparison-14",children:"Comparison"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val posFloat1 = PosFloat(0.00001f)\n// posFloat1: Type = 1.0E-5F\nval posFloat2 = PosFloat(0.999f)\n// posFloat2: Type = 0.999F\n\nposFloat1 > posFloat2\n// res231: Boolean = false\nposFloat1 >= posFloat2\n// res232: Boolean = false\nposFloat1 == posFloat2\n// res233: Boolean = false\nposFloat1 < posFloat2\n// res234: Boolean = true\nposFloat1 <= posFloat2\n// res235: Boolean = true\n"})}),"\n",(0,s.jsx)(e.h3,{id:"get-value-14",children:"Get Value"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val posFloat123 = PosFloat(123.123f)\n// posFloat123: Type = 123.123F\nval posFloat999 = PosFloat(999.999f)\n// posFloat999: Type = 999.999F\n\nposFloat123.value\n// res236: Float = 123.123F\n\nposFloat999.value\n// res237: Float = 999.999F\n"})}),"\n",(0,s.jsx)(e.h3,{id:"min-and-max-values-14",children:"Min and Max Values"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"PosFloat.MinValue\n// res238: Type = 1.4E-45F\n\nPosFloat.MaxValue\n// res239: Type = 3.4028235E38F\n"})}),"\n",(0,s.jsx)(e.hr,{}),"\n",(0,s.jsxs)(e.h2,{id:"nonposfloat-non-positive-float",children:[(0,s.jsx)(e.code,{children:"NonPosFloat"}),": non-positive ",(0,s.jsx)(e.code,{children:"Float"})]}),"\n",(0,s.jsx)(e.h3,{id:"compile-time-validation-15",children:"Compile-time Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonPosFloat(0f)\n// res240: Type = 0.0F\nNonPosFloat(-999.999f)\n// res241: Type = -999.999F\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonPosFloat(0.00001f)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegFloat.from(validNonNegFloat1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegFloat.from(invalidNonNegFloat1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosBigInt.from(validNonPosBigInt)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosBigInt.from(invalidNonPosBigInt1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(invalidNonEmptyString)\n// ^\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonPosFloat(999.999f)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegFloat.from(validNonNegFloat1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegFloat.from(invalidNonNegFloat1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosBigInt.from(validNonPosBigInt)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosBigInt.from(invalidNonPosBigInt1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString2)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(invalidNonEmptyString)\n// ^\n"})}),"\n",(0,s.jsx)(e.h3,{id:"runtime-validation-15",children:"Runtime Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val validNonPosFloat = 0f\n// validNonPosFloat: Float = 0.0F\nNonPosFloat.from(validNonPosFloat)\n// res244: Either[String, Type] = Right(value = 0.0F)\n\nval validNonPosFloat2 = -999.999f\n// validNonPosFloat2: Float = -999.999F\nNonPosFloat.from(validNonPosFloat2)\n// res245: Either[String, Type] = Right(value = -999.999F)\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'val invalidNonPosFloat1 = 0.00001f\n// invalidNonPosFloat1: Float = 1.0E-5F\nNonPosFloat.from(invalidNonPosFloat1)\n// res246: Either[String, Type] = Left(\n// value = "Invalid value: [1.0E-5]. It must be a non-positive Float"\n// )\n\nval invalidNonPosFloat2 = 999.999f\n// invalidNonPosFloat2: Float = 999.999F\nNonPosFloat.from(invalidNonPosFloat2)\n// res247: Either[String, Type] = Left(\n// value = "Invalid value: [999.999]. It must be a non-positive Float"\n// )\n'})}),"\n",(0,s.jsx)(e.h3,{id:"comparison-15",children:"Comparison"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val nonPosFloat1 = NonPosFloat(0f)\n// nonPosFloat1: Type = 0.0F\nval nonPosFloat2 = NonPosFloat(-0.999f)\n// nonPosFloat2: Type = -0.999F\n\nnonPosFloat1 > nonPosFloat2\n// res248: Boolean = true\nnonPosFloat1 >= nonPosFloat2\n// res249: Boolean = true\nnonPosFloat1 == nonPosFloat2\n// res250: Boolean = false\nnonPosFloat1 < nonPosFloat2\n// res251: Boolean = false\nnonPosFloat1 <= nonPosFloat2\n// res252: Boolean = false\n"})}),"\n",(0,s.jsx)(e.h3,{id:"get-value-15",children:"Get Value"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val nonPosFloat0 = NonPosFloat(0f)\n// nonPosFloat0: Type = 0.0F\nval nonPosFloatMinus999 = NonPosFloat(-999.999f)\n// nonPosFloatMinus999: Type = -999.999F\n\nnonPosFloat0.value\n// res253: Float = 0.0F\n\nnonPosFloatMinus999.value\n// res254: Float = -999.999F\n"})}),"\n",(0,s.jsx)(e.h3,{id:"min-and-max-values-15",children:"Min and Max Values"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonPosFloat.MinValue\n// res255: Type = -3.4028235E38F\n\nNonPosFloat.MaxValue\n// res256: Type = 0.0F\n"})}),"\n",(0,s.jsx)(e.hr,{}),"\n",(0,s.jsxs)(e.h2,{id:"refined-bigint",children:["Refined ",(0,s.jsx)(e.code,{children:"BigInt"})]}),"\n",(0,s.jsxs)(e.h2,{id:"negbigint-negative-bigint",children:[(0,s.jsx)(e.code,{children:"NegBigInt"}),": negative ",(0,s.jsx)(e.code,{children:"BigInt"})]}),"\n",(0,s.jsx)(e.h3,{id:"compile-time-validation-16",children:"Compile-time Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NegBigInt(-1)\n// res257: Type = -1\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NegBigInt(0)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.MinValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosFloat.from(validPosFloat1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosFloat.from(invalidPosFloat1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosBigInt.from(validNonPosBigInt)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosBigInt.from(invalidNonPosBigInt1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString2)\n// ^\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NegBigInt(1)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.MinValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosFloat.from(validPosFloat1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosFloat.from(invalidPosFloat1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosBigInt.from(validNonPosBigInt)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosBigInt.from(invalidNonPosBigInt1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonEmptyString.from(validNonEmptyString2)\n// ^\n"})}),"\n",(0,s.jsx)(e.h3,{id:"runtime-validation-16",children:"Runtime Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val validNegBigInt = -1 \n// validNegBigInt: Int = -1 \nNegBigInt.from(validNegBigInt)\n// res260: Either[String, Type] = Right(value = -1)\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'val invalidNegBigInt1 = 0 \n// invalidNegBigInt1: Int = 0 \nNegBigInt.from(invalidNegBigInt1)\n// res261: Either[String, Type] = Left(\n// value = "Invalid value: [0]. It must be a negative BigInt"\n// )\n\nval invalidNegBigInt2 = 1\n// invalidNegBigInt2: Int = 1\nNegBigInt.from(invalidNegBigInt2)\n// res262: Either[String, Type] = Left(\n// value = "Invalid value: [1]. It must be a negative BigInt"\n// )\n'})}),"\n",(0,s.jsx)(e.h3,{id:"comparison-16",children:"Comparison"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val negBigInt1 = NegBigInt(-1)\n// negBigInt1: Type = -1\nval negBigInt2 = NegBigInt(-2)\n// negBigInt2: Type = -2\n\nnegBigInt1 > negBigInt2\n// res263: Boolean = true\nnegBigInt1 >= negBigInt2\n// res264: Boolean = true\nnegBigInt1 == negBigInt2\n// res265: Boolean = false\nnegBigInt1 < negBigInt2\n// res266: Boolean = false\nnegBigInt1 <= negBigInt2\n// res267: Boolean = false\n"})}),"\n",(0,s.jsx)(e.h3,{id:"get-value-16",children:"Get Value"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val negBigInt123 = NegBigInt(-123)\n// negBigInt123: Type = -123\nval negBigInt999 = NegBigInt(-999)\n// negBigInt999: Type = -999\n\nnegBigInt123.value\n// res268: BigInt = -123\n\nnegBigInt999.value\n// res269: BigInt = -999\n"})}),"\n",(0,s.jsx)(e.hr,{}),"\n",(0,s.jsxs)(e.h2,{id:"nonnegbigint-non-negative-bigint",children:[(0,s.jsx)(e.code,{children:"NonNegBigInt"}),": non-negative ",(0,s.jsx)(e.code,{children:"BigInt"})]}),"\n",(0,s.jsx)(e.h3,{id:"compile-time-validation-17",children:"Compile-time Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonNegBigInt(0)\n// res270: Type = 0\nNonNegBigInt(1)\n// res271: Type = 1\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonNegBigInt(-2)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.MinValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegFloat.MinValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosFloat.from(validNonPosFloat)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosFloat.from(invalidNonPosFloat1)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigDecimal.from(validNegBigDecimal)\n// ^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigDecimal.from(invalidNegBigDecimal1)\n// ^\n"})}),"\n",(0,s.jsx)(e.h3,{id:"runtime-validation-17",children:"Runtime Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val validNonNegBigInt = 1 \n// validNonNegBigInt: Int = 1 \nNonNegBigInt.from(validNonNegBigInt)\n// res273: Either[String, Type] = Right(value = 1)\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'val invalidNonNegBigInt1 = -1\n// invalidNonNegBigInt1: Int = -1\nNonNegBigInt.from(invalidNonNegBigInt1)\n// res274: Either[String, Type] = Left(\n// value = "Invalid value: [-1]. It must be a non-negative BigInt"\n// )\n\nval invalidNonNegBigInt2 = -999\n// invalidNonNegBigInt2: Int = -999\nNonNegBigInt.from(invalidNonNegBigInt2)\n// res275: Either[String, Type] = Left(\n// value = "Invalid value: [-999]. It must be a non-negative BigInt"\n// )\n'})}),"\n",(0,s.jsx)(e.h3,{id:"comparison-17",children:"Comparison"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val nonNegBigInt1 = NonNegBigInt(0)\n// nonNegBigInt1: Type = 0\nval nonNegBigInt2 = NonNegBigInt(999)\n// nonNegBigInt2: Type = 999\n\nnonNegBigInt1 > nonNegBigInt2\n// res276: Boolean = false\nnonNegBigInt1 >= nonNegBigInt2\n// res277: Boolean = false\nnonNegBigInt1 == nonNegBigInt2\n// res278: Boolean = false\nnonNegBigInt1 < nonNegBigInt2\n// res279: Boolean = true\nnonNegBigInt1 <= nonNegBigInt2\n// res280: Boolean = true\n"})}),"\n",(0,s.jsx)(e.h3,{id:"get-value-17",children:"Get Value"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val nonNegBigInt123 = NonNegBigInt(0)\n// nonNegBigInt123: Type = 0\nval nonNegBigInt999 = NonNegBigInt(999)\n// nonNegBigInt999: Type = 999\n\nnonNegBigInt123.value\n// res281: BigInt = 0\n\nnonNegBigInt999.value\n// res282: BigInt = 999\n"})}),"\n",(0,s.jsx)(e.hr,{}),"\n",(0,s.jsxs)(e.h2,{id:"posbigint-positive-bigint",children:[(0,s.jsx)(e.code,{children:"PosBigInt"}),": positive ",(0,s.jsx)(e.code,{children:"BigInt"})]}),"\n",(0,s.jsx)(e.h3,{id:"compile-time-validation-18",children:"Compile-time Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"PosBigInt(1)\n// res283: Type = 1\nPosBigInt(999)\n// res284: Type = 999\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"PosBigInt(0)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.MinValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegFloat.MinValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosFloat.MinValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosFloat.MinValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigInt.from(validNegBigInt)\n// ^\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"PosBigInt(-2)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.MinValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegFloat.MinValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosFloat.MinValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosFloat.MinValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegBigInt.from(validNegBigInt)\n// ^\n"})}),"\n",(0,s.jsx)(e.h3,{id:"runtime-validation-18",children:"Runtime Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val validPosBigInt = 1\n// validPosBigInt: Int = 1\nPosBigInt.from(validPosBigInt)\n// res287: Either[String, Type] = Right(value = 1)\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'val invalidPosBigInt1 = 0\n// invalidPosBigInt1: Int = 0\nPosBigInt.from(invalidPosBigInt1)\n// res288: Either[String, Type] = Left(\n// value = "Invalid value: [0]. It must be a positive BigInt"\n// )\n\nval invalidPosBigInt2 = -999\n// invalidPosBigInt2: Int = -999\nPosBigInt.from(invalidPosBigInt2)\n// res289: Either[String, Type] = Left(\n// value = "Invalid value: [-999]. It must be a positive BigInt"\n// )\n'})}),"\n",(0,s.jsx)(e.h3,{id:"comparison-18",children:"Comparison"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val posBigInt1 = PosBigInt(1)\n// posBigInt1: Type = 1\nval posBigInt2 = PosBigInt(999)\n// posBigInt2: Type = 999\n\nposBigInt1 > posBigInt2\n// res290: Boolean = false\nposBigInt1 >= posBigInt2\n// res291: Boolean = false\nposBigInt1 == posBigInt2\n// res292: Boolean = false\nposBigInt1 < posBigInt2\n// res293: Boolean = true\nposBigInt1 <= posBigInt2\n// res294: Boolean = true\n"})}),"\n",(0,s.jsx)(e.h3,{id:"get-value-18",children:"Get Value"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val posBigInt123 = PosBigInt(123)\n// posBigInt123: Type = 123\nval posBigInt999 = PosBigInt(999)\n// posBigInt999: Type = 999\n\nposBigInt123.value\n// res295: BigInt = 123\n\nposBigInt999.value\n// res296: BigInt = 999\n"})}),"\n",(0,s.jsx)(e.hr,{}),"\n",(0,s.jsxs)(e.h2,{id:"nonposbigint-non-positive-bigint",children:[(0,s.jsx)(e.code,{children:"NonPosBigInt"}),": non-positive ",(0,s.jsx)(e.code,{children:"BigInt"})]}),"\n",(0,s.jsx)(e.h3,{id:"compile-time-validation-19",children:"Compile-time Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonPosBigInt(0)\n// res297: Type = 0\nNonPosBigInt(-999)\n// res298: Type = -999\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonPosBigInt(1)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.MinValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegFloat.MinValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosFloat.MinValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosFloat.MinValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^\n"})}),"\n",(0,s.jsx)(e.h3,{id:"runtime-validation-19",children:"Runtime Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val validNonPosBigInt = 0\n// validNonPosBigInt: Int = 0\nNonPosBigInt.from(validNonPosBigInt)\n// res300: Either[String, Type] = Right(value = 0)\n\nval validNonPosBigInt2 = -999\n// validNonPosBigInt2: Int = -999\nNonPosBigInt.from(validNonPosBigInt2)\n// res301: Either[String, Type] = Right(value = -999)\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'val invalidNonPosBigInt1 = 1\n// invalidNonPosBigInt1: Int = 1\nNonPosBigInt.from(invalidNonPosBigInt1)\n// res302: Either[String, Type] = Left(\n// value = "Invalid value: [1]. It must be a non-positive BigInt"\n// )\n\nval invalidNonPosBigInt2 = 999\n// invalidNonPosBigInt2: Int = 999\nNonPosBigInt.from(invalidNonPosBigInt2)\n// res303: Either[String, Type] = Left(\n// value = "Invalid value: [999]. It must be a non-positive BigInt"\n// )\n'})}),"\n",(0,s.jsx)(e.h3,{id:"comparison-19",children:"Comparison"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val nonPosBigInt1 = NonPosBigInt(0)\n// nonPosBigInt1: Type = 0\nval nonPosBigInt2 = NonPosBigInt(-999)\n// nonPosBigInt2: Type = -999\n\nnonPosBigInt1 > nonPosBigInt2\n// res304: Boolean = true\nnonPosBigInt1 >= nonPosBigInt2\n// res305: Boolean = true\nnonPosBigInt1 == nonPosBigInt2\n// res306: Boolean = false\nnonPosBigInt1 < nonPosBigInt2\n// res307: Boolean = false\nnonPosBigInt1 <= nonPosBigInt2\n// res308: Boolean = false\n"})}),"\n",(0,s.jsx)(e.h3,{id:"get-value-19",children:"Get Value"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val nonPosBigInt0 = NonPosBigInt(0)\n// nonPosBigInt0: Type = 0\nval nonPosBigIntMinus999 = NonPosBigInt(-999)\n// nonPosBigIntMinus999: Type = -999\n\nnonPosBigInt0.value\n// res309: BigInt = 0\n\nnonPosBigIntMinus999.value\n// res310: BigInt = -999\n"})}),"\n",(0,s.jsx)(e.hr,{}),"\n",(0,s.jsxs)(e.h2,{id:"refined-bigdecimal",children:["Refined ",(0,s.jsx)(e.code,{children:"BigDecimal"})]}),"\n",(0,s.jsxs)(e.h2,{id:"negbigdecimal-negative-bigdecimal",children:[(0,s.jsx)(e.code,{children:"NegBigDecimal"}),": negative ",(0,s.jsx)(e.code,{children:"BigDecimal"})]}),"\n",(0,s.jsx)(e.h3,{id:"compile-time-validation-20",children:"Compile-time Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NegBigDecimal(-0.00001d)\n// res311: Type = -0.000010\nNegBigDecimal(-999.999d)\n// res312: Type = -999.999\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NegBigDecimal(0d)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.MinValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegFloat.MinValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosFloat.MinValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosFloat.MinValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NegBigDecimal(999.999d)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.MinValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegFloat.MinValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosFloat.MinValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosFloat.MinValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^\n"})}),"\n",(0,s.jsx)(e.h3,{id:"runtime-validation-20",children:"Runtime Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val validNegBigDecimal = -0.00001d \n// validNegBigDecimal: Double = -1.0E-5 \nNegBigDecimal.from(validNegBigDecimal)\n// res315: Either[String, Type] = Right(value = -0.000010)\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'val invalidNegBigDecimal1 = 0d \n// invalidNegBigDecimal1: Double = 0.0 \nNegBigDecimal.from(invalidNegBigDecimal1)\n// res316: Either[String, Type] = Left(\n// value = "Invalid value: [0.0]. It must be a negative BigDecimal"\n// )\n\nval invalidNegBigDecimal2 = 999.999d\n// invalidNegBigDecimal2: Double = 999.999\nNegBigDecimal.from(invalidNegBigDecimal2)\n// res317: Either[String, Type] = Left(\n// value = "Invalid value: [999.999]. It must be a negative BigDecimal"\n// )\n'})}),"\n",(0,s.jsx)(e.h3,{id:"comparison-20",children:"Comparison"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val negBigDecimal1 = NegBigDecimal(-0.1d)\n// negBigDecimal1: Type = -0.1\nval negBigDecimal2 = NegBigDecimal(-0.2d)\n// negBigDecimal2: Type = -0.2\n\nnegBigDecimal1 > negBigDecimal2\n// res318: Boolean = true\nnegBigDecimal1 >= negBigDecimal2\n// res319: Boolean = true\nnegBigDecimal1 == negBigDecimal2\n// res320: Boolean = false\nnegBigDecimal1 < negBigDecimal2\n// res321: Boolean = false\nnegBigDecimal1 <= negBigDecimal2\n// res322: Boolean = false\n"})}),"\n",(0,s.jsx)(e.h3,{id:"get-value-20",children:"Get Value"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val negBigDecimal123 = NegBigDecimal(-123.123d)\n// negBigDecimal123: Type = -123.123\nval negBigDecimal999 = NegBigDecimal(-999.999d)\n// negBigDecimal999: Type = -999.999\n\nnegBigDecimal123.value\n// res323: BigDecimal = -123.123\n\nnegBigDecimal999.value\n// res324: BigDecimal = -999.999\n"})}),"\n",(0,s.jsx)(e.hr,{}),"\n",(0,s.jsxs)(e.h2,{id:"nonnegbigdecimal-non-negative-bigdecimal",children:[(0,s.jsx)(e.code,{children:"NonNegBigDecimal"}),": non-negative ",(0,s.jsx)(e.code,{children:"BigDecimal"})]}),"\n",(0,s.jsx)(e.h3,{id:"compile-time-validation-21",children:"Compile-time Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonNegBigDecimal(0d)\n// res325: Type = 0.0\nNonNegBigDecimal(999.999d)\n// res326: Type = 999.999\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonNegBigDecimal(-0.00001d)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.MinValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegFloat.MinValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosFloat.MinValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosFloat.MinValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{children:"```scala mdoc:fail\nNonNegBigDecimal(-999.999d)\n"})}),"\n",(0,s.jsx)(e.h3,{id:"runtime-validation-21",children:"Runtime Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val validNonNegBigDecimal1 = 0d\n// validNonNegBigDecimal1: Double = 0.0\nNonNegBigDecimal.from(validNonNegBigDecimal1)\n// res328: Either[String, Type] = Right(value = 0.0)\n\nval validNonNegBigDecimal2 = 999.999d\n// validNonNegBigDecimal2: Double = 999.999\nNonNegBigDecimal.from(validNonNegBigDecimal2)\n// res329: Either[String, Type] = Right(value = 999.999)\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'val invalidNonNegBigDecimal1 = -0.00001d\n// invalidNonNegBigDecimal1: Double = -1.0E-5\nNonNegBigDecimal.from(invalidNonNegBigDecimal1)\n// res330: Either[String, Type] = Left(\n// value = "Invalid value: [-0.000010]. It must be a non-negative BigDecimal"\n// )\n\nval invalidNonNegBigDecimal2 = -999.999d\n// invalidNonNegBigDecimal2: Double = -999.999\nNonNegBigDecimal.from(invalidNonNegBigDecimal2)\n// res331: Either[String, Type] = Left(\n// value = "Invalid value: [-999.999]. It must be a non-negative BigDecimal"\n// )\n'})}),"\n",(0,s.jsx)(e.h3,{id:"comparison-21",children:"Comparison"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val nonNegBigDecimal1 = NonNegBigDecimal(0d)\n// nonNegBigDecimal1: Type = 0.0\nval nonNegBigDecimal2 = NonNegBigDecimal(0.999d)\n// nonNegBigDecimal2: Type = 0.999\n\nnonNegBigDecimal1 > nonNegBigDecimal2\n// res332: Boolean = false\nnonNegBigDecimal1 >= nonNegBigDecimal2\n// res333: Boolean = false\nnonNegBigDecimal1 == nonNegBigDecimal2\n// res334: Boolean = false\nnonNegBigDecimal1 < nonNegBigDecimal2\n// res335: Boolean = true\nnonNegBigDecimal1 <= nonNegBigDecimal2\n// res336: Boolean = true\n"})}),"\n",(0,s.jsx)(e.h3,{id:"get-value-21",children:"Get Value"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val nonNegBigDecimal123 = NonNegBigDecimal(0d)\n// nonNegBigDecimal123: Type = 0.0\nval nonNegBigDecimal999 = NonNegBigDecimal(999.999d)\n// nonNegBigDecimal999: Type = 999.999\n\nnonNegBigDecimal123.value\n// res337: BigDecimal = 0.0\n\nnonNegBigDecimal999.value\n// res338: BigDecimal = 999.999\n"})}),"\n",(0,s.jsx)(e.hr,{}),"\n",(0,s.jsxs)(e.h2,{id:"posbigdecimal-positive-bigdecimal",children:[(0,s.jsx)(e.code,{children:"PosBigDecimal"}),": positive ",(0,s.jsx)(e.code,{children:"BigDecimal"})]}),"\n",(0,s.jsx)(e.h3,{id:"compile-time-validation-22",children:"Compile-time Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"PosBigDecimal(0.00001d)\n// res339: Type = 0.000010\nPosBigDecimal(999.999d)\n// res340: Type = 999.999\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"PosBigDecimal(0d)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.MinValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegFloat.MinValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosFloat.MinValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosFloat.MinValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"PosBigDecimal(-999.999d)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.MinValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegFloat.MinValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosFloat.MinValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosFloat.MinValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^\n"})}),"\n",(0,s.jsx)(e.h3,{id:"runtime-validation-22",children:"Runtime Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val validPosBigDecimal1 = 0.00001d\n// validPosBigDecimal1: Double = 1.0E-5\nPosBigDecimal.from(validPosBigDecimal1)\n// res343: Either[String, Type] = Right(value = 0.000010)\n\nval validPosBigDecimal2 = 999.999d\n// validPosBigDecimal2: Double = 999.999\nPosBigDecimal.from(validPosBigDecimal2)\n// res344: Either[String, Type] = Right(value = 999.999)\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'val invalidPosBigDecimal1 = 0d\n// invalidPosBigDecimal1: Double = 0.0\nPosBigDecimal.from(invalidPosBigDecimal1)\n// res345: Either[String, Type] = Left(\n// value = "Invalid value: [0.0]. It must be a positive BigDecimal"\n// )\n\nval invalidPosBigDecimal2 = -999.999d\n// invalidPosBigDecimal2: Double = -999.999\nPosBigDecimal.from(invalidPosBigDecimal2)\n// res346: Either[String, Type] = Left(\n// value = "Invalid value: [-999.999]. It must be a positive BigDecimal"\n// )\n'})}),"\n",(0,s.jsx)(e.h3,{id:"comparison-22",children:"Comparison"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val posBigDecimal1 = PosBigDecimal(0.00001d)\n// posBigDecimal1: Type = 0.000010\nval posBigDecimal2 = PosBigDecimal(0.999d)\n// posBigDecimal2: Type = 0.999\n\nposBigDecimal1 > posBigDecimal2\n// res347: Boolean = false\nposBigDecimal1 >= posBigDecimal2\n// res348: Boolean = false\nposBigDecimal1 == posBigDecimal2\n// res349: Boolean = false\nposBigDecimal1 < posBigDecimal2\n// res350: Boolean = true\nposBigDecimal1 <= posBigDecimal2\n// res351: Boolean = true\n"})}),"\n",(0,s.jsx)(e.h3,{id:"get-value-22",children:"Get Value"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val posBigDecimal123 = PosBigDecimal(123.123d)\n// posBigDecimal123: Type = 123.123\nval posBigDecimal999 = PosBigDecimal(999.999d)\n// posBigDecimal999: Type = 999.999\n\nposBigDecimal123.value\n// res352: BigDecimal = 123.123\n\nposBigDecimal999.value\n// res353: BigDecimal = 999.999\n"})}),"\n",(0,s.jsx)(e.hr,{}),"\n",(0,s.jsxs)(e.h2,{id:"nonposbigdecimal-non-positive-bigdecimal",children:[(0,s.jsx)(e.code,{children:"NonPosBigDecimal"}),": non-positive ",(0,s.jsx)(e.code,{children:"BigDecimal"})]}),"\n",(0,s.jsx)(e.h3,{id:"compile-time-validation-23",children:"Compile-time Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonPosBigDecimal(0d)\n// res354: Type = 0.0\nNonPosBigDecimal(-999.999d)\n// res355: Type = -999.999\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonPosBigDecimal(0.00001d)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.MinValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegFloat.MinValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosFloat.MinValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosFloat.MinValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"NonPosBigDecimal(999.999d)\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MinValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosInt.MaxValue\n// ^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosInt.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MinValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosLong.MaxValue\n// ^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MinValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosLong.MaxValue\n// ^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.MinValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosDouble.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.MinValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NegFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegFloat.MinValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonNegFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosFloat.MinValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// PosFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosFloat.MinValue\n// ^^^^^^^^^^^^^^^^^^^^\n// error:\n// A pure expression does nothing in statement position; you may be omitting necessary parentheses\n// NonPosFloat.MaxValue\n// ^^^^^^^^^^^^^^^^^^^^\n"})}),"\n",(0,s.jsx)(e.h3,{id:"runtime-validation-23",children:"Runtime Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val validNonPosBigDecimal = 0d\n// validNonPosBigDecimal: Double = 0.0\nNonPosBigDecimal.from(validNonPosBigDecimal)\n// res358: Either[String, Type] = Right(value = 0.0)\n\nval validNonPosBigDecimal2 = -999.999d\n// validNonPosBigDecimal2: Double = -999.999\nNonPosBigDecimal.from(validNonPosBigDecimal2)\n// res359: Either[String, Type] = Right(value = -999.999)\n"})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'val invalidNonPosBigDecimal1 = 0.00001d\n// invalidNonPosBigDecimal1: Double = 1.0E-5\nNonPosBigDecimal.from(invalidNonPosBigDecimal1)\n// res360: Either[String, Type] = Left(\n// value = "Invalid value: [0.000010]. It must be a non-positive BigDecimal"\n// )\n\nval invalidNonPosBigDecimal2 = 999.999d\n// invalidNonPosBigDecimal2: Double = 999.999\nNonPosBigDecimal.from(invalidNonPosBigDecimal2)\n// res361: Either[String, Type] = Left(\n// value = "Invalid value: [999.999]. It must be a non-positive BigDecimal"\n// )\n'})}),"\n",(0,s.jsx)(e.h3,{id:"comparison-23",children:"Comparison"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val nonPosBigDecimal1 = NonPosBigDecimal(0d)\n// nonPosBigDecimal1: Type = 0.0\nval nonPosBigDecimal2 = NonPosBigDecimal(-0.999d)\n// nonPosBigDecimal2: Type = -0.999\n\nnonPosBigDecimal1 > nonPosBigDecimal2\n// res362: Boolean = true\nnonPosBigDecimal1 >= nonPosBigDecimal2\n// res363: Boolean = true\nnonPosBigDecimal1 == nonPosBigDecimal2\n// res364: Boolean = false\nnonPosBigDecimal1 < nonPosBigDecimal2\n// res365: Boolean = false\nnonPosBigDecimal1 <= nonPosBigDecimal2\n// res366: Boolean = false\n"})}),"\n",(0,s.jsx)(e.h3,{id:"get-value-23",children:"Get Value"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"val nonPosBigDecimal0 = NonPosBigDecimal(0d)\n// nonPosBigDecimal0: Type = 0.0\nval nonPosBigDecimalMinus999 = NonPosBigDecimal(-999.999d)\n// nonPosBigDecimalMinus999: Type = -999.999\n\nnonPosBigDecimal0.value\n// res367: BigDecimal = 0.0\n\nnonPosBigDecimalMinus999.value\n// res368: BigDecimal = -999.999\n"})}),"\n",(0,s.jsx)(e.hr,{}),"\n",(0,s.jsxs)(e.h2,{id:"refined-nonemptystring",children:["Refined ",(0,s.jsx)(e.code,{children:"NonEmptyString"})]}),"\n",(0,s.jsx)(e.h3,{id:"compile-time-validation-24",children:"Compile-time Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'NonEmptyString("blah")\n// res369: Type = "blah"\nNonEmptyString("Lorem Ipsum is simply dummy text of the printing and typesetting industry.")\n// res370: Type = "Lorem Ipsum is simply dummy text of the printing and typesetting industry."\n'})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'NonEmptyString("")\n// error:\n// Invalid value: [""]. It must be a non-empty String\n'})}),"\n",(0,s.jsx)(e.h3,{id:"runtime-validation-24",children:"Runtime Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'val validNonEmptyString1 = "blah" \n// validNonEmptyString1: String = "blah" \nNonEmptyString.from(validNonEmptyString1)\n// res371: Either[String, Type] = Right(value = "blah")\n\nval validNonEmptyString2 = "Lorem Ipsum is simply dummy text of the printing and typesetting industry." \n// validNonEmptyString2: String = "Lorem Ipsum is simply dummy text of the printing and typesetting industry." \nNonEmptyString.from(validNonEmptyString2)\n// res372: Either[String, Type] = Right(\n// value = "Lorem Ipsum is simply dummy text of the printing and typesetting industry."\n// )\n'})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'val invalidNonEmptyString = "" \n// invalidNonEmptyString: String = "" \nNonEmptyString.from(invalidNonEmptyString)\n// res373: Either[String, Type] = Left(\n// value = "Invalid value: []. It must be a non-empty String"\n// )\n'})}),"\n",(0,s.jsx)(e.h3,{id:"concatenation",children:"Concatenation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'val nonEmptyString1 = NonEmptyString("Hello")\n// nonEmptyString1: Type = "Hello"\nval nonEmptyString2 = NonEmptyString(" World")\n// nonEmptyString2: Type = " World"\n\nnonEmptyString1 ++ nonEmptyString2\n// res374: Type = "Hello World"\n'})}),"\n",(0,s.jsx)(e.h3,{id:"get-value-24",children:"Get Value"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'val nonEmptyStringA = NonEmptyString("blah")\n// nonEmptyStringA: Type = "blah"\nval nonEmptyStringB = NonEmptyString("Lorem Ipsum is simply dummy text of the printing and typesetting industry.")\n// nonEmptyStringB: Type = "Lorem Ipsum is simply dummy text of the printing and typesetting industry."\n\nnonEmptyStringA.value\n// res375: String = "blah"\n\nnonEmptyStringB.value\n// res376: String = "Lorem Ipsum is simply dummy text of the printing and typesetting industry."\n'})}),"\n",(0,s.jsx)(e.hr,{}),"\n",(0,s.jsxs)(e.h2,{id:"refined-uri",children:["Refined ",(0,s.jsx)(e.code,{children:"Uri"})]}),"\n",(0,s.jsx)(e.h3,{id:"compile-time-validation-25",children:"Compile-time Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'Uri("https://www.google.com")\n// res377: Type = "https://www.google.com"\nUri("https://github.com/kevin-lee")\n// res378: Type = "https://github.com/kevin-lee"\n'})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'Uri("%^<>[]`{}")\n// error:\n// Invalid value: ["%^<>[]`{}"]. It must be a URI String\n'})}),"\n",(0,s.jsx)(e.h3,{id:"runtime-validation-25",children:"Runtime Validation"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'val validUri1 = "https://www.google.com" \n// validUri1: String = "https://www.google.com" \nUri.from(validUri1)\n// res379: Either[String, Type] = Right(value = "https://www.google.com")\n\nval validUri2 = "https://github.com/kevin-lee" \n// validUri2: String = "https://github.com/kevin-lee" \nUri.from(validUri2)\n// res380: Either[String, Type] = Right(value = "https://github.com/kevin-lee")\n'})}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'val invalidUri = "%^<>[]`{}" \n// invalidUri: String = "%^<>[]`{}" \nUri.from(invalidUri)\n// res381: Either[String, Type] = Left(\n// value = "Invalid value: [%^<>[]`{}]. It must be a URI String"\n// )\n'})}),"\n",(0,s.jsx)(e.h3,{id:"get-value-25",children:"Get Value"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:'val uriA = Uri("https://www.google.com")\n// uriA: Type = "https://www.google.com"\nval uriB = Uri("https://github.com/kevin-lee")\n// uriB: Type = "https://github.com/kevin-lee"\n\nuriA.value\n// res382: String = "https://www.google.com"\n\nuriB.value\n// res383: String = "https://github.com/kevin-lee"\n'})}),"\n",(0,s.jsxs)(e.h3,{id:"convert-to-javaneturi",children:["Convert to ",(0,s.jsx)(e.code,{children:"java.net.URI"})]}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-scala",children:"uriA.toURI\n// res384: URI = https://www.google.com\n\nuriB.toURI\n// res385: URI = https://github.com/kevin-lee\n"})})]})}function m(n={}){const{wrapper:e}={...(0,i.a)(),...n.components};return e?(0,s.jsx)(e,{...n,children:(0,s.jsx)(p,{...n})}):p(n)}},1151:(n,e,o)=>{o.d(e,{Z:()=>r,a:()=>a});var s=o(7294);const i={},t=s.createContext(i);function a(n){const e=s.useContext(t);return s.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function r(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(i):n.components||i:a(n.components),s.createElement(t.Provider,{value:e},n.children)}}}]); \ No newline at end of file diff --git a/assets/js/7fb136ad.c4976abe.js b/assets/js/7fb136ad.a838a3e6.js similarity index 89% rename from assets/js/7fb136ad.c4976abe.js rename to assets/js/7fb136ad.a838a3e6.js index d93f2b1..c873202 100644 --- a/assets/js/7fb136ad.c4976abe.js +++ b/assets/js/7fb136ad.a838a3e6.js @@ -1 +1 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[631],{696:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>_,contentTitle:()=>V,default:()=>M,frontMatter:()=>S,metadata:()=>E,toc:()=>A});var i=s(5893),l=s(1151),r=s(7294),a=s(512),d=s(2466),t=s(6550),c=s(469),o=s(1980),u=s(7392),h=s(12);function f(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function b(e){const{values:n,children:s}=e;return(0,r.useMemo)((()=>{const e=n??function(e){return f(e).map((e=>{let{props:{value:n,label:s,attributes:i,default:l}}=e;return{value:n,label:s,attributes:i,default:l}}))}(s);return function(e){const n=(0,u.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,s])}function p(e){let{value:n,tabValues:s}=e;return s.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:s}=e;const i=(0,t.k6)(),l=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,o._X)(l),(0,r.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(i.location.search);n.set(l,e),i.replace({...i.location,search:n.toString()})}),[l,i])]}function v(e){const{defaultValue:n,queryString:s=!1,groupId:i}=e,l=b(e),[a,d]=(0,r.useState)((()=>function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const i=s.find((e=>e.default))??s[0];if(!i)throw new Error("Unexpected error: 0 tabValues");return i.value}({defaultValue:n,tabValues:l}))),[t,o]=x({queryString:s,groupId:i}),[u,f]=function(e){let{groupId:n}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(n),[i,l]=(0,h.Nk)(s);return[i,(0,r.useCallback)((e=>{s&&l.set(e)}),[s,l])]}({groupId:i}),v=(()=>{const e=t??u;return p({value:e,tabValues:l})?e:null})();(0,c.Z)((()=>{v&&d(v)}),[v]);return{selectedValue:a,selectValue:(0,r.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);d(e),o(e),f(e)}),[o,f,l]),tabValues:l}}var g=s(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function m(e){let{className:n,block:s,selectedValue:l,selectValue:r,tabValues:t}=e;const c=[],{blockElementScrollPositionUntilNextRender:o}=(0,d.o5)(),u=e=>{const n=e.currentTarget,s=c.indexOf(n),i=t[s].value;i!==l&&(o(n),r(i))},h=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const s=c.indexOf(e.currentTarget)+1;n=c[s]??c[0];break}case"ArrowLeft":{const s=c.indexOf(e.currentTarget)-1;n=c[s]??c[c.length-1];break}}n?.focus()};return(0,i.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.Z)("tabs",{"tabs--block":s},n),children:t.map((e=>{let{value:n,label:s,attributes:r}=e;return(0,i.jsx)("li",{role:"tab",tabIndex:l===n?0:-1,"aria-selected":l===n,ref:e=>c.push(e),onKeyDown:h,onClick:u,...r,className:(0,a.Z)("tabs__item",j.tabItem,r?.className,{"tabs__item--active":l===n}),children:s??n},n)}))})}function k(e){let{lazy:n,children:s,selectedValue:l}=e;const a=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){const e=a.find((e=>e.props.value===l));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,i.jsx)("div",{className:"margin-top--md",children:a.map(((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==l})))})}function y(e){const n=v(e);return(0,i.jsxs)("div",{className:(0,a.Z)("tabs-container",j.tabList),children:[(0,i.jsx)(m,{...e,...n}),(0,i.jsx)(k,{...e,...n})]})}function N(e){const n=(0,g.Z)();return(0,i.jsx)(y,{...e,children:f(e.children)},String(n))}const w={tabItem:"tabItem_Ymn6"};function I(e){let{children:n,hidden:s,className:l}=e;return(0,i.jsx)("div",{role:"tabpanel",className:(0,a.Z)(w.tabItem,l),hidden:s,children:n})}const S={sidebar_position:1,id:"intro",title:"Refined4s",slug:"/"},V="Refined4s",E={id:"intro",title:"Refined4s",description:"Build Status",source:"@site/../generated-docs/docs/intro.md",sourceDirName:".",slug:"/",permalink:"/docs/",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1,id:"intro",title:"Refined4s",slug:"/"},sidebar:"docsSidebar",next:{title:"core module",permalink:"/docs/core/"}},_={},A=[{value:"Getting Started",id:"getting-started",level:2},{value:"refined4s-core",id:"refined4s-core",level:3},{value:"refined4s-cats",id:"refined4s-cats",level:3},{value:"refined4s-circe",id:"refined4s-circe",level:3},{value:"refined4s-pureconfig",id:"refined4s-pureconfig",level:3},{value:"refined4s-doobie-ce2",id:"refined4s-doobie-ce2",level:3},{value:"refined4s-doobie-ce3",id:"refined4s-doobie-ce3",level:3},{value:"refined4s-extras-render",id:"refined4s-extras-render",level:3},{value:"All refined4s modules",id:"all-refined4s-modules",level:3},{value:"Why refined4s?",id:"why-refined4s",level:2}];function D(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",img:"img",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,l.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"refined4s",children:"Refined4s"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.a,{href:"https://github.com/kevin-lee/refined4s/actions?workflow=Build-All",children:(0,i.jsx)(n.img,{src:"https://github.com/kevin-lee/refined4s/workflows/Build-All/badge.svg",alt:"Build Status"})}),"\n",(0,i.jsx)(n.a,{href:"https://github.com/kevin-lee/refined4s/actions?workflow=Release",children:(0,i.jsx)(n.img,{src:"https://github.com/kevin-lee/refined4s/workflows/Release/badge.svg",alt:"Release Status"})}),"\n",(0,i.jsx)(n.a,{href:"https://index.scala-lang.org/kevin-lee/refined4s",children:(0,i.jsx)(n.img,{src:"https://index.scala-lang.org/kevin-lee/refined4s/latest.svg",alt:"Latest version"})})]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Refined4s Logo",src:s(6420).Z+"",width:"320",height:"320"})}),"\n",(0,i.jsx)(n.p,{children:"Newtypes and Refinement types for Scala 3"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{style:{textAlign:"right"},children:"Project"}),(0,i.jsx)(n.th,{children:"Maven Central"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{style:{textAlign:"right"},children:"refined4s-core"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.a,{href:"https://search.maven.org/artifact/io.kevinlee/refined4s-core_3",children:(0,i.jsx)(n.img,{src:"https://maven-badges.herokuapp.com/maven-central/io.kevinlee/refined4s-core_3/badge.svg",alt:"Maven Central"})})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{style:{textAlign:"right"},children:"refined4s-cats"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.a,{href:"https://search.maven.org/artifact/io.kevinlee/refined4s-cats_3",children:(0,i.jsx)(n.img,{src:"https://maven-badges.herokuapp.com/maven-central/io.kevinlee/refined4s-cats_3/badge.svg",alt:"Maven Central"})})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{style:{textAlign:"right"},children:"refined4s-circe"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.a,{href:"https://search.maven.org/artifact/io.kevinlee/refined4s-circe_3",children:(0,i.jsx)(n.img,{src:"https://maven-badges.herokuapp.com/maven-central/io.kevinlee/refined4s-circe_3/badge.svg",alt:"Maven Central"})})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{style:{textAlign:"right"},children:"refined4s-pureconfig"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.a,{href:"https://search.maven.org/artifact/io.kevinlee/refined4s-pureconfig_3",children:(0,i.jsx)(n.img,{src:"https://maven-badges.herokuapp.com/maven-central/io.kevinlee/refined4s-pureconfig_3/badge.svg",alt:"Maven Central"})})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{style:{textAlign:"right"},children:"refined4s-doobie-ce2"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.a,{href:"https://search.maven.org/artifact/io.kevinlee/refined4s-doobie-ce2_3",children:(0,i.jsx)(n.img,{src:"https://maven-badges.herokuapp.com/maven-central/io.kevinlee/refined4s-doobie-ce2_3/badge.svg",alt:"Maven Central"})})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{style:{textAlign:"right"},children:"refined4s-doobie-ce3"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.a,{href:"https://search.maven.org/artifact/io.kevinlee/refined4s-doobie-ce3_3",children:(0,i.jsx)(n.img,{src:"https://maven-badges.herokuapp.com/maven-central/io.kevinlee/refined4s-doobie-ce3_3/badge.svg",alt:"Maven Central"})})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{style:{textAlign:"right"},children:"refined4s-extras-render"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.a,{href:"https://search.maven.org/artifact/io.kevinlee/refined4s-extras-render_3",children:(0,i.jsx)(n.img,{src:"https://maven-badges.herokuapp.com/maven-central/io.kevinlee/refined4s-extras-render_3/badge.svg",alt:"Maven Central"})})})]})]})]}),"\n",(0,i.jsx)(n.h2,{id:"getting-started",children:"Getting Started"}),"\n",(0,i.jsxs)(n.p,{children:["To get ",(0,i.jsx)(n.code,{children:"refined4s"})," for your project,"]}),"\n",(0,i.jsx)(n.h3,{id:"refined4s-core",children:"refined4s-core"}),"\n",(0,i.jsxs)(N,{groupId:"refined4s",defaultValue:"refined4s-sbt",values:[{label:"sbt",value:"refined4s-sbt"},{label:"sbt (with libraryDependencies)",value:"refined4s-sbt-lib"},{label:"scala-cli",value:"refined4s-scala-cli"}],children:[(0,i.jsxs)(I,{value:"refined4s-sbt",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'"io.kevinlee" %% "refined4s-core" % "0.11.0"\n'})})]}),(0,i.jsxs)(I,{value:"refined4s-sbt-lib",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'libraryDependencies += "io.kevinlee" %% "refined4s-core" % "0.11.0"\n'})})]}),(0,i.jsx)(I,{value:"refined4s-scala-cli",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'//> using dep "io.kevinlee::refined4s-core:0.11.0"\n'})})})]}),"\n",(0,i.jsx)(n.h3,{id:"refined4s-cats",children:"refined4s-cats"}),"\n",(0,i.jsxs)(N,{groupId:"refined4s",defaultValue:"refined4s-sbt",values:[{label:"sbt",value:"refined4s-sbt"},{label:"sbt (with libraryDependencies)",value:"refined4s-sbt-lib"},{label:"scala-cli",value:"refined4s-scala-cli"}],children:[(0,i.jsxs)(I,{value:"refined4s-sbt",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'"io.kevinlee" %% "refined4s-cats" % "0.11.0"\n'})})]}),(0,i.jsxs)(I,{value:"refined4s-sbt-lib",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'libraryDependencies += "io.kevinlee" %% "refined4s-cats" % "0.11.0"\n'})})]}),(0,i.jsx)(I,{value:"refined4s-scala-cli",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'//> using dep "io.kevinlee::refined4s-cats:0.11.0"\n'})})})]}),"\n",(0,i.jsx)(n.h3,{id:"refined4s-circe",children:"refined4s-circe"}),"\n",(0,i.jsxs)(N,{groupId:"refined4s",defaultValue:"refined4s-sbt",values:[{label:"sbt",value:"refined4s-sbt"},{label:"sbt (with libraryDependencies)",value:"refined4s-sbt-lib"},{label:"scala-cli",value:"refined4s-scala-cli"}],children:[(0,i.jsxs)(I,{value:"refined4s-sbt",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'"io.kevinlee" %% "refined4s-circe" % "0.11.0"\n'})})]}),(0,i.jsxs)(I,{value:"refined4s-sbt-lib",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'libraryDependencies += "io.kevinlee" %% "refined4s-circe" % "0.11.0"\n'})})]}),(0,i.jsx)(I,{value:"refined4s-scala-cli",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'//> using dep "io.kevinlee::refined4s-circe:0.11.0"\n'})})})]}),"\n",(0,i.jsx)(n.h3,{id:"refined4s-pureconfig",children:"refined4s-pureconfig"}),"\n",(0,i.jsxs)(N,{groupId:"refined4s",defaultValue:"refined4s-sbt",values:[{label:"sbt",value:"refined4s-sbt"},{label:"sbt (with libraryDependencies)",value:"refined4s-sbt-lib"},{label:"scala-cli",value:"refined4s-scala-cli"}],children:[(0,i.jsxs)(I,{value:"refined4s-sbt",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'"io.kevinlee" %% "refined4s-pureconfig" % "0.11.0"\n'})})]}),(0,i.jsxs)(I,{value:"refined4s-sbt-lib",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'libraryDependencies += "io.kevinlee" %% "refined4s-pureconfig" % "0.11.0"\n'})})]}),(0,i.jsx)(I,{value:"refined4s-scala-cli",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'//> using dep "io.kevinlee::refined4s-pureconfig:0.11.0"\n'})})})]}),"\n",(0,i.jsx)(n.h3,{id:"refined4s-doobie-ce2",children:"refined4s-doobie-ce2"}),"\n",(0,i.jsxs)(N,{groupId:"refined4s",defaultValue:"refined4s-sbt",values:[{label:"sbt",value:"refined4s-sbt"},{label:"sbt (with libraryDependencies)",value:"refined4s-sbt-lib"},{label:"scala-cli",value:"refined4s-scala-cli"}],children:[(0,i.jsxs)(I,{value:"refined4s-sbt",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'"io.kevinlee" %% "refined4s-doobie-ce2" % "0.11.0"\n'})})]}),(0,i.jsxs)(I,{value:"refined4s-sbt-lib",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'libraryDependencies += "io.kevinlee" %% "refined4s-doobie-ce2" % "0.11.0"\n'})})]}),(0,i.jsx)(I,{value:"refined4s-scala-cli",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'//> using dep "io.kevinlee::refined4s-doobie-ce2:0.11.0"\n'})})})]}),"\n",(0,i.jsx)(n.h3,{id:"refined4s-doobie-ce3",children:"refined4s-doobie-ce3"}),"\n",(0,i.jsxs)(N,{groupId:"refined4s",defaultValue:"refined4s-sbt",values:[{label:"sbt",value:"refined4s-sbt"},{label:"sbt (with libraryDependencies)",value:"refined4s-sbt-lib"},{label:"scala-cli",value:"refined4s-scala-cli"}],children:[(0,i.jsxs)(I,{value:"refined4s-sbt",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'"io.kevinlee" %% "refined4s-doobie-ce3" % "0.11.0"\n'})})]}),(0,i.jsxs)(I,{value:"refined4s-sbt-lib",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'libraryDependencies += "io.kevinlee" %% "refined4s-doobie-ce3" % "0.11.0"\n'})})]}),(0,i.jsx)(I,{value:"refined4s-scala-cli",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'//> using dep "io.kevinlee::refined4s-doobie-ce3:0.11.0"\n'})})})]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h3,{id:"refined4s-extras-render",children:"refined4s-extras-render"}),"\n",(0,i.jsxs)(N,{groupId:"refined4s",defaultValue:"refined4s-sbt",values:[{label:"sbt",value:"refined4s-sbt"},{label:"sbt (with libraryDependencies)",value:"refined4s-sbt-lib"},{label:"scala-cli",value:"refined4s-scala-cli"}],children:[(0,i.jsxs)(I,{value:"refined4s-sbt",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'"io.kevinlee" %% "refined4s-extras-render" % "0.11.0"\n'})})]}),(0,i.jsxs)(I,{value:"refined4s-sbt-lib",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'libraryDependencies += "io.kevinlee" %% "refined4s-extras-render" % "0.11.0"\n'})})]}),(0,i.jsx)(I,{value:"refined4s-scala-cli",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'//> using dep "io.kevinlee::refined4s-extras-render:0.11.0"\n'})})})]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h3,{id:"all-refined4s-modules",children:"All refined4s modules"}),"\n",(0,i.jsxs)(N,{groupId:"refined4s",defaultValue:"refined4s-sbt",values:[{label:"sbt",value:"refined4s-sbt"},{label:"sbt (with libraryDependencies)",value:"refined4s-sbt-lib"},{label:"scala-cli",value:"refined4s-scala-cli"}],children:[(0,i.jsxs)(I,{value:"refined4s-sbt",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'"io.kevinlee" %% "refined4s-core" % "0.11.0",\n"io.kevinlee" %% "refined4s-cats" % "0.11.0",\n"io.kevinlee" %% "refined4s-circe" % "0.11.0",\n"io.kevinlee" %% "refined4s-pureconfig" % "0.11.0",\n"io.kevinlee" %% "refined4s-doobie-ce2" % "0.11.0", // Use either refined4s-doobie-ce2\n"io.kevinlee" %% "refined4s-doobie-ce3" % "0.11.0", // OR refined4s-doobie-ce3\n"io.kevinlee" %% "refined4s-extras-render" % "0.11.0",\n'})})]}),(0,i.jsxs)(I,{value:"refined4s-sbt-lib",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'libraryDependencies ++= Seq(\n "io.kevinlee" %% "refined4s-core" % "0.11.0",\n "io.kevinlee" %% "refined4s-cats" % "0.11.0",\n "io.kevinlee" %% "refined4s-circe" % "0.11.0",\n "io.kevinlee" %% "refined4s-pureconfig" % "0.11.0",\n "io.kevinlee" %% "refined4s-doobie-ce2" % "0.11.0", // Use either refined4s-doobie-ce2\n "io.kevinlee" %% "refined4s-doobie-ce3" % "0.11.0", // OR refined4s-doobie-ce3\n "io.kevinlee" %% "refined4s-extras-render" % "0.11.0",\n)\n'})})]}),(0,i.jsx)(I,{value:"refined4s-scala-cli",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'//> using dep "io.kevinlee::refined4s-core:0.11.0"\n//> using dep "io.kevinlee::refined4s-cats:0.11.0"\n//> using dep "io.kevinlee::refined4s-circe:0.11.0"\n//> using dep "io.kevinlee::refined4s-pureconfig:0.11.0"\n//> using dep "io.kevinlee::refined4s-doobie-ce2:0.11.0" // Use either refined4s-doobie-ce2\n//> using dep "io.kevinlee::refined4s-doobie-ce3:0.11.0" // OR refined4s-doobie-ce3\n//> using dep "io.kevinlee::refined4s-extras-render:0.11.0"\n'})})})]}),"\n",(0,i.jsxs)(n.h2,{id:"why-refined4s",children:["Why ",(0,i.jsx)(n.code,{children:"refined4s"}),"?"]}),"\n",(0,i.jsx)(n.p,{children:"Given the following methods"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'def hello(name: String): Unit = println(s"Hello $name")\ndef sendEmail(email: String): Unit = {\n println(s"Sending email to [email address: $email]")\n // ... send email\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:"You can easily mess up method parameters like this."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'val name = "Kevin"\n// name: String = "Kevin"\nval email = "blah@blah.blah"\n// email: String = "blah@blah.blah"\n\nhello(email)\n// Hello blah@blah.blah\nsendEmail(name)\n// Sending email to [email address: Kevin]\n'})}),"\n",(0,i.jsxs)(n.p,{children:["If you use ",(0,i.jsx)(n.code,{children:"refined4s"}),", you don't need to worry about that anymore."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'import refined4s.*\n\ntype Name = Name.Type\n\nobject Name extends Newtype[String]\n\ntype Email = Email.Type\n\nobject Email extends Newtype[String]\n\ndef hello(name: Name): Unit = println(s"Hello ${name.value}")\ndef sendEmail(email: Email): Unit = {\n println(s"Sending email to [email address: ${email.value}]")\n // ... send email\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:"You can easily mess up method parameters like this."}),"\n",(0,i.jsx)(n.p,{children:"If you pass the right types, it works."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'val name = Name("Kevin")\n// name: Type = "Kevin"\nval email = Email("blah@blah.blah")\n// email: Type = "blah@blah.blah"\n\nhello(name)\n// Hello Kevin\nsendEmail(email)\n// Sending email to [email address: blah@blah.blah]\n'})}),"\n",(0,i.jsx)(n.p,{children:"If you don't, it does not compile."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:"hello(email)\nsendEmail(name)\n// error:\n// Found: (repl.MdocSession.MdocApp1.email : repl.MdocSession.MdocApp1.Email.Type)\n// Required: repl.MdocSession.MdocApp1.Name\n// hello(email)\n// ^^^^^\n// error:\n// Found: (repl.MdocSession.MdocApp1.name : repl.MdocSession.MdocApp1.Name.Type)\n// Required: repl.MdocSession.MdocApp1.Email\n// sendEmail(name)\n// ^^^^\n// error: \n// Line is indented too far to the left, or a `}` is missing\n// error: \n// Line is indented too far to the left, or a `}` is missing\n// error: \n// Line is indented too far to the left, or a `}` is missing\n"})})]})}function M(e={}){const{wrapper:n}={...(0,l.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(D,{...e})}):D(e)}},6420:(e,n,s)=>{s.d(n,{Z:()=>i});const i=s.p+"assets/images/refined4s-320x320-2483b0bb373fca5ed168465ebe10e97e.png"},1151:(e,n,s)=>{s.d(n,{Z:()=>d,a:()=>a});var i=s(7294);const l={},r=i.createContext(l);function a(e){const n=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:a(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[631],{696:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>_,contentTitle:()=>V,default:()=>M,frontMatter:()=>S,metadata:()=>E,toc:()=>A});var i=s(5893),l=s(1151),r=s(7294),a=s(512),d=s(2466),t=s(6550),c=s(469),o=s(1980),u=s(7392),h=s(12);function f(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function b(e){const{values:n,children:s}=e;return(0,r.useMemo)((()=>{const e=n??function(e){return f(e).map((e=>{let{props:{value:n,label:s,attributes:i,default:l}}=e;return{value:n,label:s,attributes:i,default:l}}))}(s);return function(e){const n=(0,u.l)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,s])}function p(e){let{value:n,tabValues:s}=e;return s.some((e=>e.value===n))}function x(e){let{queryString:n=!1,groupId:s}=e;const i=(0,t.k6)(),l=function(e){let{queryString:n=!1,groupId:s}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:n,groupId:s});return[(0,o._X)(l),(0,r.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(i.location.search);n.set(l,e),i.replace({...i.location,search:n.toString()})}),[l,i])]}function v(e){const{defaultValue:n,queryString:s=!1,groupId:i}=e,l=b(e),[a,d]=(0,r.useState)((()=>function(e){let{defaultValue:n,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!p({value:n,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const i=s.find((e=>e.default))??s[0];if(!i)throw new Error("Unexpected error: 0 tabValues");return i.value}({defaultValue:n,tabValues:l}))),[t,o]=x({queryString:s,groupId:i}),[u,f]=function(e){let{groupId:n}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(n),[i,l]=(0,h.Nk)(s);return[i,(0,r.useCallback)((e=>{s&&l.set(e)}),[s,l])]}({groupId:i}),v=(()=>{const e=t??u;return p({value:e,tabValues:l})?e:null})();(0,c.Z)((()=>{v&&d(v)}),[v]);return{selectedValue:a,selectValue:(0,r.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);d(e),o(e),f(e)}),[o,f,l]),tabValues:l}}var g=s(2389);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function m(e){let{className:n,block:s,selectedValue:l,selectValue:r,tabValues:t}=e;const c=[],{blockElementScrollPositionUntilNextRender:o}=(0,d.o5)(),u=e=>{const n=e.currentTarget,s=c.indexOf(n),i=t[s].value;i!==l&&(o(n),r(i))},h=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const s=c.indexOf(e.currentTarget)+1;n=c[s]??c[0];break}case"ArrowLeft":{const s=c.indexOf(e.currentTarget)-1;n=c[s]??c[c.length-1];break}}n?.focus()};return(0,i.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.Z)("tabs",{"tabs--block":s},n),children:t.map((e=>{let{value:n,label:s,attributes:r}=e;return(0,i.jsx)("li",{role:"tab",tabIndex:l===n?0:-1,"aria-selected":l===n,ref:e=>c.push(e),onKeyDown:h,onClick:u,...r,className:(0,a.Z)("tabs__item",j.tabItem,r?.className,{"tabs__item--active":l===n}),children:s??n},n)}))})}function k(e){let{lazy:n,children:s,selectedValue:l}=e;const a=(Array.isArray(s)?s:[s]).filter(Boolean);if(n){const e=a.find((e=>e.props.value===l));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,i.jsx)("div",{className:"margin-top--md",children:a.map(((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==l})))})}function y(e){const n=v(e);return(0,i.jsxs)("div",{className:(0,a.Z)("tabs-container",j.tabList),children:[(0,i.jsx)(m,{...e,...n}),(0,i.jsx)(k,{...e,...n})]})}function N(e){const n=(0,g.Z)();return(0,i.jsx)(y,{...e,children:f(e.children)},String(n))}const w={tabItem:"tabItem_Ymn6"};function I(e){let{children:n,hidden:s,className:l}=e;return(0,i.jsx)("div",{role:"tabpanel",className:(0,a.Z)(w.tabItem,l),hidden:s,children:n})}const S={sidebar_position:1,id:"intro",title:"Refined4s",slug:"/"},V="Refined4s",E={id:"intro",title:"Refined4s",description:"Build Status",source:"@site/../generated-docs/docs/intro.md",sourceDirName:".",slug:"/",permalink:"/docs/",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1,id:"intro",title:"Refined4s",slug:"/"},sidebar:"docsSidebar",next:{title:"core module",permalink:"/docs/core/"}},_={},A=[{value:"Getting Started",id:"getting-started",level:2},{value:"refined4s-core",id:"refined4s-core",level:3},{value:"refined4s-cats",id:"refined4s-cats",level:3},{value:"refined4s-circe",id:"refined4s-circe",level:3},{value:"refined4s-pureconfig",id:"refined4s-pureconfig",level:3},{value:"refined4s-doobie-ce2",id:"refined4s-doobie-ce2",level:3},{value:"refined4s-doobie-ce3",id:"refined4s-doobie-ce3",level:3},{value:"refined4s-extras-render",id:"refined4s-extras-render",level:3},{value:"All refined4s modules",id:"all-refined4s-modules",level:3},{value:"Why refined4s?",id:"why-refined4s",level:2}];function D(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",img:"img",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,l.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"refined4s",children:"Refined4s"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.a,{href:"https://github.com/kevin-lee/refined4s/actions?workflow=Build-All",children:(0,i.jsx)(n.img,{src:"https://github.com/kevin-lee/refined4s/workflows/Build-All/badge.svg",alt:"Build Status"})}),"\n",(0,i.jsx)(n.a,{href:"https://github.com/kevin-lee/refined4s/actions?workflow=Release",children:(0,i.jsx)(n.img,{src:"https://github.com/kevin-lee/refined4s/workflows/Release/badge.svg",alt:"Release Status"})}),"\n",(0,i.jsx)(n.a,{href:"https://index.scala-lang.org/kevin-lee/refined4s",children:(0,i.jsx)(n.img,{src:"https://index.scala-lang.org/kevin-lee/refined4s/latest.svg",alt:"Latest version"})})]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Refined4s Logo",src:s(6420).Z+"",width:"320",height:"320"})}),"\n",(0,i.jsx)(n.p,{children:"Newtypes and Refinement types for Scala 3"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{style:{textAlign:"right"},children:"Project"}),(0,i.jsx)(n.th,{children:"Maven Central"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{style:{textAlign:"right"},children:"refined4s-core"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.a,{href:"https://search.maven.org/artifact/io.kevinlee/refined4s-core_3",children:(0,i.jsx)(n.img,{src:"https://maven-badges.herokuapp.com/maven-central/io.kevinlee/refined4s-core_3/badge.svg",alt:"Maven Central"})})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{style:{textAlign:"right"},children:"refined4s-cats"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.a,{href:"https://search.maven.org/artifact/io.kevinlee/refined4s-cats_3",children:(0,i.jsx)(n.img,{src:"https://maven-badges.herokuapp.com/maven-central/io.kevinlee/refined4s-cats_3/badge.svg",alt:"Maven Central"})})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{style:{textAlign:"right"},children:"refined4s-circe"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.a,{href:"https://search.maven.org/artifact/io.kevinlee/refined4s-circe_3",children:(0,i.jsx)(n.img,{src:"https://maven-badges.herokuapp.com/maven-central/io.kevinlee/refined4s-circe_3/badge.svg",alt:"Maven Central"})})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{style:{textAlign:"right"},children:"refined4s-pureconfig"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.a,{href:"https://search.maven.org/artifact/io.kevinlee/refined4s-pureconfig_3",children:(0,i.jsx)(n.img,{src:"https://maven-badges.herokuapp.com/maven-central/io.kevinlee/refined4s-pureconfig_3/badge.svg",alt:"Maven Central"})})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{style:{textAlign:"right"},children:"refined4s-doobie-ce2"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.a,{href:"https://search.maven.org/artifact/io.kevinlee/refined4s-doobie-ce2_3",children:(0,i.jsx)(n.img,{src:"https://maven-badges.herokuapp.com/maven-central/io.kevinlee/refined4s-doobie-ce2_3/badge.svg",alt:"Maven Central"})})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{style:{textAlign:"right"},children:"refined4s-doobie-ce3"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.a,{href:"https://search.maven.org/artifact/io.kevinlee/refined4s-doobie-ce3_3",children:(0,i.jsx)(n.img,{src:"https://maven-badges.herokuapp.com/maven-central/io.kevinlee/refined4s-doobie-ce3_3/badge.svg",alt:"Maven Central"})})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{style:{textAlign:"right"},children:"refined4s-extras-render"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.a,{href:"https://search.maven.org/artifact/io.kevinlee/refined4s-extras-render_3",children:(0,i.jsx)(n.img,{src:"https://maven-badges.herokuapp.com/maven-central/io.kevinlee/refined4s-extras-render_3/badge.svg",alt:"Maven Central"})})})]})]})]}),"\n",(0,i.jsx)(n.h2,{id:"getting-started",children:"Getting Started"}),"\n",(0,i.jsxs)(n.p,{children:["To get ",(0,i.jsx)(n.code,{children:"refined4s"})," for your project,"]}),"\n",(0,i.jsx)(n.h3,{id:"refined4s-core",children:"refined4s-core"}),"\n",(0,i.jsxs)(N,{groupId:"refined4s",defaultValue:"refined4s-sbt",values:[{label:"sbt",value:"refined4s-sbt"},{label:"sbt (with libraryDependencies)",value:"refined4s-sbt-lib"},{label:"scala-cli",value:"refined4s-scala-cli"}],children:[(0,i.jsxs)(I,{value:"refined4s-sbt",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'"io.kevinlee" %% "refined4s-core" % "0.13.0"\n'})})]}),(0,i.jsxs)(I,{value:"refined4s-sbt-lib",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'libraryDependencies += "io.kevinlee" %% "refined4s-core" % "0.13.0"\n'})})]}),(0,i.jsx)(I,{value:"refined4s-scala-cli",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'//> using dep "io.kevinlee::refined4s-core:0.13.0"\n'})})})]}),"\n",(0,i.jsx)(n.h3,{id:"refined4s-cats",children:"refined4s-cats"}),"\n",(0,i.jsxs)(N,{groupId:"refined4s",defaultValue:"refined4s-sbt",values:[{label:"sbt",value:"refined4s-sbt"},{label:"sbt (with libraryDependencies)",value:"refined4s-sbt-lib"},{label:"scala-cli",value:"refined4s-scala-cli"}],children:[(0,i.jsxs)(I,{value:"refined4s-sbt",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'"io.kevinlee" %% "refined4s-cats" % "0.13.0"\n'})})]}),(0,i.jsxs)(I,{value:"refined4s-sbt-lib",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'libraryDependencies += "io.kevinlee" %% "refined4s-cats" % "0.13.0"\n'})})]}),(0,i.jsx)(I,{value:"refined4s-scala-cli",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'//> using dep "io.kevinlee::refined4s-cats:0.13.0"\n'})})})]}),"\n",(0,i.jsx)(n.h3,{id:"refined4s-circe",children:"refined4s-circe"}),"\n",(0,i.jsxs)(N,{groupId:"refined4s",defaultValue:"refined4s-sbt",values:[{label:"sbt",value:"refined4s-sbt"},{label:"sbt (with libraryDependencies)",value:"refined4s-sbt-lib"},{label:"scala-cli",value:"refined4s-scala-cli"}],children:[(0,i.jsxs)(I,{value:"refined4s-sbt",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'"io.kevinlee" %% "refined4s-circe" % "0.13.0"\n'})})]}),(0,i.jsxs)(I,{value:"refined4s-sbt-lib",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'libraryDependencies += "io.kevinlee" %% "refined4s-circe" % "0.13.0"\n'})})]}),(0,i.jsx)(I,{value:"refined4s-scala-cli",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'//> using dep "io.kevinlee::refined4s-circe:0.13.0"\n'})})})]}),"\n",(0,i.jsx)(n.h3,{id:"refined4s-pureconfig",children:"refined4s-pureconfig"}),"\n",(0,i.jsxs)(N,{groupId:"refined4s",defaultValue:"refined4s-sbt",values:[{label:"sbt",value:"refined4s-sbt"},{label:"sbt (with libraryDependencies)",value:"refined4s-sbt-lib"},{label:"scala-cli",value:"refined4s-scala-cli"}],children:[(0,i.jsxs)(I,{value:"refined4s-sbt",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'"io.kevinlee" %% "refined4s-pureconfig" % "0.13.0"\n'})})]}),(0,i.jsxs)(I,{value:"refined4s-sbt-lib",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'libraryDependencies += "io.kevinlee" %% "refined4s-pureconfig" % "0.13.0"\n'})})]}),(0,i.jsx)(I,{value:"refined4s-scala-cli",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'//> using dep "io.kevinlee::refined4s-pureconfig:0.13.0"\n'})})})]}),"\n",(0,i.jsx)(n.h3,{id:"refined4s-doobie-ce2",children:"refined4s-doobie-ce2"}),"\n",(0,i.jsxs)(N,{groupId:"refined4s",defaultValue:"refined4s-sbt",values:[{label:"sbt",value:"refined4s-sbt"},{label:"sbt (with libraryDependencies)",value:"refined4s-sbt-lib"},{label:"scala-cli",value:"refined4s-scala-cli"}],children:[(0,i.jsxs)(I,{value:"refined4s-sbt",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'"io.kevinlee" %% "refined4s-doobie-ce2" % "0.13.0"\n'})})]}),(0,i.jsxs)(I,{value:"refined4s-sbt-lib",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'libraryDependencies += "io.kevinlee" %% "refined4s-doobie-ce2" % "0.13.0"\n'})})]}),(0,i.jsx)(I,{value:"refined4s-scala-cli",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'//> using dep "io.kevinlee::refined4s-doobie-ce2:0.13.0"\n'})})})]}),"\n",(0,i.jsx)(n.h3,{id:"refined4s-doobie-ce3",children:"refined4s-doobie-ce3"}),"\n",(0,i.jsxs)(N,{groupId:"refined4s",defaultValue:"refined4s-sbt",values:[{label:"sbt",value:"refined4s-sbt"},{label:"sbt (with libraryDependencies)",value:"refined4s-sbt-lib"},{label:"scala-cli",value:"refined4s-scala-cli"}],children:[(0,i.jsxs)(I,{value:"refined4s-sbt",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'"io.kevinlee" %% "refined4s-doobie-ce3" % "0.13.0"\n'})})]}),(0,i.jsxs)(I,{value:"refined4s-sbt-lib",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'libraryDependencies += "io.kevinlee" %% "refined4s-doobie-ce3" % "0.13.0"\n'})})]}),(0,i.jsx)(I,{value:"refined4s-scala-cli",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'//> using dep "io.kevinlee::refined4s-doobie-ce3:0.13.0"\n'})})})]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h3,{id:"refined4s-extras-render",children:"refined4s-extras-render"}),"\n",(0,i.jsxs)(N,{groupId:"refined4s",defaultValue:"refined4s-sbt",values:[{label:"sbt",value:"refined4s-sbt"},{label:"sbt (with libraryDependencies)",value:"refined4s-sbt-lib"},{label:"scala-cli",value:"refined4s-scala-cli"}],children:[(0,i.jsxs)(I,{value:"refined4s-sbt",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'"io.kevinlee" %% "refined4s-extras-render" % "0.13.0"\n'})})]}),(0,i.jsxs)(I,{value:"refined4s-sbt-lib",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'libraryDependencies += "io.kevinlee" %% "refined4s-extras-render" % "0.13.0"\n'})})]}),(0,i.jsx)(I,{value:"refined4s-scala-cli",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'//> using dep "io.kevinlee::refined4s-extras-render:0.13.0"\n'})})})]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h3,{id:"all-refined4s-modules",children:"All refined4s modules"}),"\n",(0,i.jsxs)(N,{groupId:"refined4s",defaultValue:"refined4s-sbt",values:[{label:"sbt",value:"refined4s-sbt"},{label:"sbt (with libraryDependencies)",value:"refined4s-sbt-lib"},{label:"scala-cli",value:"refined4s-scala-cli"}],children:[(0,i.jsxs)(I,{value:"refined4s-sbt",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'"io.kevinlee" %% "refined4s-core" % "0.13.0",\n"io.kevinlee" %% "refined4s-cats" % "0.13.0",\n"io.kevinlee" %% "refined4s-circe" % "0.13.0",\n"io.kevinlee" %% "refined4s-pureconfig" % "0.13.0",\n"io.kevinlee" %% "refined4s-doobie-ce2" % "0.13.0", // Use either refined4s-doobie-ce2\n"io.kevinlee" %% "refined4s-doobie-ce3" % "0.13.0", // OR refined4s-doobie-ce3\n"io.kevinlee" %% "refined4s-extras-render" % "0.13.0",\n'})})]}),(0,i.jsxs)(I,{value:"refined4s-sbt-lib",children:[(0,i.jsxs)(n.p,{children:["In ",(0,i.jsx)(n.code,{children:"build.sbt"}),","]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'libraryDependencies ++= Seq(\n "io.kevinlee" %% "refined4s-core" % "0.13.0",\n "io.kevinlee" %% "refined4s-cats" % "0.13.0",\n "io.kevinlee" %% "refined4s-circe" % "0.13.0",\n "io.kevinlee" %% "refined4s-pureconfig" % "0.13.0",\n "io.kevinlee" %% "refined4s-doobie-ce2" % "0.13.0", // Use either refined4s-doobie-ce2\n "io.kevinlee" %% "refined4s-doobie-ce3" % "0.13.0", // OR refined4s-doobie-ce3\n "io.kevinlee" %% "refined4s-extras-render" % "0.13.0",\n)\n'})})]}),(0,i.jsx)(I,{value:"refined4s-scala-cli",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'//> using dep "io.kevinlee::refined4s-core:0.13.0"\n//> using dep "io.kevinlee::refined4s-cats:0.13.0"\n//> using dep "io.kevinlee::refined4s-circe:0.13.0"\n//> using dep "io.kevinlee::refined4s-pureconfig:0.13.0"\n//> using dep "io.kevinlee::refined4s-doobie-ce2:0.13.0" // Use either refined4s-doobie-ce2\n//> using dep "io.kevinlee::refined4s-doobie-ce3:0.13.0" // OR refined4s-doobie-ce3\n//> using dep "io.kevinlee::refined4s-extras-render:0.13.0"\n'})})})]}),"\n",(0,i.jsxs)(n.h2,{id:"why-refined4s",children:["Why ",(0,i.jsx)(n.code,{children:"refined4s"}),"?"]}),"\n",(0,i.jsx)(n.p,{children:"Given the following methods"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'def hello(name: String): Unit = println(s"Hello $name")\ndef sendEmail(email: String): Unit = {\n println(s"Sending email to [email address: $email]")\n // ... send email\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:"You can easily mess up method parameters like this."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'val name = "Kevin"\n// name: String = "Kevin"\nval email = "blah@blah.blah"\n// email: String = "blah@blah.blah"\n\nhello(email)\n// Hello blah@blah.blah\nsendEmail(name)\n// Sending email to [email address: Kevin]\n'})}),"\n",(0,i.jsxs)(n.p,{children:["If you use ",(0,i.jsx)(n.code,{children:"refined4s"}),", you don't need to worry about that anymore."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'import refined4s.*\n\ntype Name = Name.Type\n\nobject Name extends Newtype[String]\n\ntype Email = Email.Type\n\nobject Email extends Newtype[String]\n\ndef hello(name: Name): Unit = println(s"Hello ${name.value}")\ndef sendEmail(email: Email): Unit = {\n println(s"Sending email to [email address: ${email.value}]")\n // ... send email\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:"You can easily mess up method parameters like this."}),"\n",(0,i.jsx)(n.p,{children:"If you pass the right types, it works."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:'val name = Name("Kevin")\n// name: Type = "Kevin"\nval email = Email("blah@blah.blah")\n// email: Type = "blah@blah.blah"\n\nhello(name)\n// Hello Kevin\nsendEmail(email)\n// Sending email to [email address: blah@blah.blah]\n'})}),"\n",(0,i.jsx)(n.p,{children:"If you don't, it does not compile."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-scala",children:"hello(email)\nsendEmail(name)\n// error:\n// Found: (repl.MdocSession.MdocApp1.email : repl.MdocSession.MdocApp1.Email.Type)\n// Required: repl.MdocSession.MdocApp1.Name\n// hello(email)\n// ^^^^^\n// error:\n// Found: (repl.MdocSession.MdocApp1.name : repl.MdocSession.MdocApp1.Name.Type)\n// Required: repl.MdocSession.MdocApp1.Email\n// sendEmail(name)\n// ^^^^\n// error: \n// Line is indented too far to the left, or a `}` is missing\n// error: \n// Line is indented too far to the left, or a `}` is missing\n// error: \n// Line is indented too far to the left, or a `}` is missing\n"})})]})}function M(e={}){const{wrapper:n}={...(0,l.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(D,{...e})}):D(e)}},6420:(e,n,s)=>{s.d(n,{Z:()=>i});const i=s.p+"assets/images/refined4s-320x320-2483b0bb373fca5ed168465ebe10e97e.png"},1151:(e,n,s)=>{s.d(n,{Z:()=>d,a:()=>a});var i=s(7294);const l={},r=i.createContext(l);function a(e){const n=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:a(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.2a23867f.js b/assets/js/runtime~main.05fb36f7.js similarity index 95% rename from assets/js/runtime~main.2a23867f.js rename to assets/js/runtime~main.05fb36f7.js index dcae3a6..c4a6b05 100644 --- a/assets/js/runtime~main.2a23867f.js +++ b/assets/js/runtime~main.05fb36f7.js @@ -1 +1 @@ -(()=>{"use strict";var e,t,r,a,o,n={},c={};function f(e){var t=c[e];if(void 0!==t)return t.exports;var r=c[e]={exports:{}};return n[e].call(r.exports,r,r.exports,f),r.exports}f.m=n,e=[],f.O=(t,r,a,o)=>{if(!r){var n=1/0;for(b=0;b=o)&&Object.keys(f.O).every((e=>f.O[e](r[d])))?r.splice(d--,1):(c=!1,o0&&e[b-1][2]>o;b--)e[b]=e[b-1];e[b]=[r,a,o]},f.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return f.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,f.t=function(e,a){if(1&a&&(e=this(e)),8&a)return e;if("object"==typeof e&&e){if(4&a&&e.__esModule)return e;if(16&a&&"function"==typeof e.then)return e}var o=Object.create(null);f.r(o);var n={};t=t||[null,r({}),r([]),r(r)];for(var c=2&a&&e;"object"==typeof c&&!~t.indexOf(c);c=r(c))Object.getOwnPropertyNames(c).forEach((t=>n[t]=()=>e[t]));return n.default=()=>e,f.d(o,n),o},f.d=(e,t)=>{for(var r in t)f.o(t,r)&&!f.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},f.f={},f.e=e=>Promise.all(Object.keys(f.f).reduce(((t,r)=>(f.f[r](e,t),t)),[])),f.u=e=>"assets/js/"+({53:"935f2afb",80:"d8c8fd71",85:"1f391b9e",87:"4d986000",111:"21face6d",237:"1df93b7f",266:"516c3461",368:"a94703ab",414:"393be207",518:"a7bd4aaa",584:"328c9882",609:"54c4a91f",610:"bae7b540",631:"7fb136ad",661:"5e95c892",692:"4bedc385",705:"0e6b1cbc",778:"c6e51ddd",854:"89c2e708",873:"4c9ef651",918:"17896441"}[e]||e)+"."+{53:"69af065a",80:"a1b46bdf",85:"ae5469f9",87:"b26b1acd",111:"7a609d00",237:"62583bdc",266:"0509fa32",368:"a4893501",414:"18e91144",518:"d63a5bf6",584:"7318a849",609:"7c6a3bbd",610:"944af2d1",631:"c4976abe",661:"3a245908",674:"afc6632e",692:"9613d7d6",705:"04c57618",772:"3e3b906c",778:"fda6080a",854:"ea3857a3",873:"8f0e92b3",918:"a2541306"}[e]+".js",f.miniCssF=e=>{},f.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),f.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a={},o="website:",f.l=(e,t,r,n)=>{if(a[e])a[e].push(t);else{var c,d;if(void 0!==r)for(var i=document.getElementsByTagName("script"),b=0;b{c.onerror=c.onload=null,clearTimeout(s);var o=a[e];if(delete a[e],c.parentNode&&c.parentNode.removeChild(c),o&&o.forEach((e=>e(r))),t)return t(r)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=l.bind(null,c.onerror),c.onload=l.bind(null,c.onload),d&&document.head.appendChild(c)}},f.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.p="/",f.gca=function(e){return e={17896441:"918","935f2afb":"53",d8c8fd71:"80","1f391b9e":"85","4d986000":"87","21face6d":"111","1df93b7f":"237","516c3461":"266",a94703ab:"368","393be207":"414",a7bd4aaa:"518","328c9882":"584","54c4a91f":"609",bae7b540:"610","7fb136ad":"631","5e95c892":"661","4bedc385":"692","0e6b1cbc":"705",c6e51ddd:"778","89c2e708":"854","4c9ef651":"873"}[e]||e,f.p+f.u(e)},(()=>{var e={303:0,532:0};f.f.j=(t,r)=>{var a=f.o(e,t)?e[t]:void 0;if(0!==a)if(a)r.push(a[2]);else if(/^(303|532)$/.test(t))e[t]=0;else{var o=new Promise(((r,o)=>a=e[t]=[r,o]));r.push(a[2]=o);var n=f.p+f.u(t),c=new Error;f.l(n,(r=>{if(f.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var o=r&&("load"===r.type?"missing":r.type),n=r&&r.target&&r.target.src;c.message="Loading chunk "+t+" failed.\n("+o+": "+n+")",c.name="ChunkLoadError",c.type=o,c.request=n,a[1](c)}}),"chunk-"+t,t)}},f.O.j=t=>0===e[t];var t=(t,r)=>{var a,o,n=r[0],c=r[1],d=r[2],i=0;if(n.some((t=>0!==e[t]))){for(a in c)f.o(c,a)&&(f.m[a]=c[a]);if(d)var b=d(f)}for(t&&t(r);i{"use strict";var e,t,r,a,o,n={},c={};function f(e){var t=c[e];if(void 0!==t)return t.exports;var r=c[e]={exports:{}};return n[e].call(r.exports,r,r.exports,f),r.exports}f.m=n,e=[],f.O=(t,r,a,o)=>{if(!r){var n=1/0;for(b=0;b=o)&&Object.keys(f.O).every((e=>f.O[e](r[d])))?r.splice(d--,1):(c=!1,o0&&e[b-1][2]>o;b--)e[b]=e[b-1];e[b]=[r,a,o]},f.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return f.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,f.t=function(e,a){if(1&a&&(e=this(e)),8&a)return e;if("object"==typeof e&&e){if(4&a&&e.__esModule)return e;if(16&a&&"function"==typeof e.then)return e}var o=Object.create(null);f.r(o);var n={};t=t||[null,r({}),r([]),r(r)];for(var c=2&a&&e;"object"==typeof c&&!~t.indexOf(c);c=r(c))Object.getOwnPropertyNames(c).forEach((t=>n[t]=()=>e[t]));return n.default=()=>e,f.d(o,n),o},f.d=(e,t)=>{for(var r in t)f.o(t,r)&&!f.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},f.f={},f.e=e=>Promise.all(Object.keys(f.f).reduce(((t,r)=>(f.f[r](e,t),t)),[])),f.u=e=>"assets/js/"+({53:"935f2afb",80:"d8c8fd71",85:"1f391b9e",87:"4d986000",111:"21face6d",237:"1df93b7f",266:"516c3461",368:"a94703ab",414:"393be207",518:"a7bd4aaa",584:"328c9882",609:"54c4a91f",610:"bae7b540",631:"7fb136ad",661:"5e95c892",692:"4bedc385",705:"0e6b1cbc",778:"c6e51ddd",854:"89c2e708",873:"4c9ef651",918:"17896441"}[e]||e)+"."+{53:"69af065a",80:"a1b46bdf",85:"ae5469f9",87:"b26b1acd",111:"7a609d00",237:"62583bdc",266:"14a62e7e",368:"a4893501",414:"18e91144",518:"d63a5bf6",584:"7318a849",609:"7c6a3bbd",610:"944af2d1",631:"a838a3e6",661:"3a245908",674:"afc6632e",692:"9613d7d6",705:"04c57618",772:"3e3b906c",778:"fda6080a",854:"ea3857a3",873:"8f0e92b3",918:"a2541306"}[e]+".js",f.miniCssF=e=>{},f.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),f.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a={},o="website:",f.l=(e,t,r,n)=>{if(a[e])a[e].push(t);else{var c,d;if(void 0!==r)for(var i=document.getElementsByTagName("script"),b=0;b{c.onerror=c.onload=null,clearTimeout(s);var o=a[e];if(delete a[e],c.parentNode&&c.parentNode.removeChild(c),o&&o.forEach((e=>e(r))),t)return t(r)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=l.bind(null,c.onerror),c.onload=l.bind(null,c.onload),d&&document.head.appendChild(c)}},f.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.p="/",f.gca=function(e){return e={17896441:"918","935f2afb":"53",d8c8fd71:"80","1f391b9e":"85","4d986000":"87","21face6d":"111","1df93b7f":"237","516c3461":"266",a94703ab:"368","393be207":"414",a7bd4aaa:"518","328c9882":"584","54c4a91f":"609",bae7b540:"610","7fb136ad":"631","5e95c892":"661","4bedc385":"692","0e6b1cbc":"705",c6e51ddd:"778","89c2e708":"854","4c9ef651":"873"}[e]||e,f.p+f.u(e)},(()=>{var e={303:0,532:0};f.f.j=(t,r)=>{var a=f.o(e,t)?e[t]:void 0;if(0!==a)if(a)r.push(a[2]);else if(/^(303|532)$/.test(t))e[t]=0;else{var o=new Promise(((r,o)=>a=e[t]=[r,o]));r.push(a[2]=o);var n=f.p+f.u(t),c=new Error;f.l(n,(r=>{if(f.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var o=r&&("load"===r.type?"missing":r.type),n=r&&r.target&&r.target.src;c.message="Loading chunk "+t+" failed.\n("+o+": "+n+")",c.name="ChunkLoadError",c.type=o,c.request=n,a[1](c)}}),"chunk-"+t,t)}},f.O.j=t=>0===e[t];var t=(t,r)=>{var a,o,n=r[0],c=r[1],d=r[2],i=0;if(n.some((t=>0!==e[t]))){for(a in c)f.o(c,a)&&(f.m[a]=c[a]);if(d)var b=d(f)}for(t&&t(r);i - + diff --git a/docs/circe/index.html b/docs/circe/index.html index 91c466e..ce61bcb 100644 --- a/docs/circe/index.html +++ b/docs/circe/index.html @@ -7,7 +7,7 @@ - + diff --git a/docs/core/index.html b/docs/core/index.html index fc0a390..bf2e862 100644 --- a/docs/core/index.html +++ b/docs/core/index.html @@ -7,7 +7,7 @@ - + diff --git a/docs/core/newtype-refined/index.html b/docs/core/newtype-refined/index.html index 5f1133c..5f7185f 100644 --- a/docs/core/newtype-refined/index.html +++ b/docs/core/newtype-refined/index.html @@ -7,7 +7,7 @@ - + diff --git a/docs/core/newtype/index.html b/docs/core/newtype/index.html index 8e82b6a..f3a8939 100644 --- a/docs/core/newtype/index.html +++ b/docs/core/newtype/index.html @@ -7,7 +7,7 @@ - + diff --git a/docs/core/refined/custom-type/index.html b/docs/core/refined/custom-type/index.html index be42f60..39a978d 100644 --- a/docs/core/refined/custom-type/index.html +++ b/docs/core/refined/custom-type/index.html @@ -7,7 +7,7 @@ - + diff --git a/docs/core/refined/index.html b/docs/core/refined/index.html index 6ec4ba9..56881c4 100644 --- a/docs/core/refined/index.html +++ b/docs/core/refined/index.html @@ -7,7 +7,7 @@ - + diff --git a/docs/core/refined/types/index.html b/docs/core/refined/types/index.html index e2be654..3bc9176 100644 --- a/docs/core/refined/types/index.html +++ b/docs/core/refined/types/index.html @@ -7,7 +7,7 @@ - + @@ -32,7 +32,7 @@

Min and M

NonNegInt: non-negative Int

Compile-time Validation

NonNegInt(0)
// res15: Type = 0
NonNegInt(1)
// res16: Type = 1
-
NonNegInt(-2)
// error:
// Invalid value: [-2]. It must be a non-negative Int
+
NonNegInt(-2)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegFloat.from(validNonNegFloat2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosFloat.from(validPosFloat2)
// ^

Runtime Validation

val validNonNegInt = 1 
// validNonNegInt: Int = 1
NonNegInt.from(validNonNegInt)
// res18: Either[String, Type] = Right(value = 1)
val invalidNonNegInt1 = -1
// invalidNonNegInt1: Int = -1
NonNegInt.from(invalidNonNegInt1)
// res19: Either[String, Type] = Left(
// value = "Invalid value: [-1]. It must be a non-negative Int"
// )

val invalidNonNegInt2 = -999
// invalidNonNegInt2: Int = -999
NonNegInt.from(invalidNonNegInt2)
// res20: Either[String, Type] = Left(
// value = "Invalid value: [-999]. It must be a non-negative Int"
// )
@@ -46,8 +46,8 @@

Min and

PosInt: positive Int

Compile-time Validation

PosInt(1)
// res30: Type = 1
PosInt(999)
// res31: Type = 999
-
PosInt(0)
// error:
// Invalid value: [0]. It must be a positive Int
-
PosInt(-2)
// error:
// Invalid value: [-2]. It must be a positive Int
+
PosInt(0)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegFloat.from(validNonNegFloat2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosFloat.from(validPosFloat2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString2)
// ^
+
PosInt(-2)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegFloat.from(validNonNegFloat2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosFloat.from(validPosFloat2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString2)
// ^

Runtime Validation

val validPosInt = 1
// validPosInt: Int = 1
PosInt.from(validPosInt)
// res34: Either[String, Type] = Right(value = 1)
val invalidPosInt1 = 0
// invalidPosInt1: Int = 0
PosInt.from(invalidPosInt1)
// res35: Either[String, Type] = Left(
// value = "Invalid value: [0]. It must be a positive Int"
// )

val invalidPosInt2 = -999
// invalidPosInt2: Int = -999
PosInt.from(invalidPosInt2)
// res36: Either[String, Type] = Left(
// value = "Invalid value: [-999]. It must be a positive Int"
// )
@@ -61,7 +61,7 @@

Min and

NonPosInt: non-positive Int

Compile-time Validation

NonPosInt(0)
// res46: Type = 0
NonPosInt(-999)
// res47: Type = -999
-
NonPosInt(1)
// error:
// Invalid value: [1]. It must be a non-positive Int
+
NonPosInt(1)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// negDouble123.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.from(validNonNegDouble2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// nonPosFloat0.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigInt.from(validNegBigInt)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString2)
// ^

Runtime Validation

val validNonPosInt = 0
// validNonPosInt: Int = 0
NonPosInt.from(validNonPosInt)
// res49: Either[String, Type] = Right(value = 0)

val validNonPosInt2 = -999
// validNonPosInt2: Int = -999
NonPosInt.from(validNonPosInt2)
// res50: Either[String, Type] = Right(value = -999)
val invalidNonPosInt1 = 1
// invalidNonPosInt1: Int = 1
NonPosInt.from(invalidNonPosInt1)
// res51: Either[String, Type] = Left(
// value = "Invalid value: [1]. It must be a non-positive Int"
// )

val invalidNonPosInt2 = 999
// invalidNonPosInt2: Int = 999
NonPosInt.from(invalidNonPosInt2)
// res52: Either[String, Type] = Left(
// value = "Invalid value: [999]. It must be a non-positive Int"
// )
@@ -76,8 +76,8 @@

Refined L

NegLong: negative Long

Compile-time Validation

NegLong(-1L)
// res62: Type = -1L
-
NegLong(0L)
// error:
// Invalid value: [0L]. It must be a negative Long
-
NegLong(1L)
// error:
// Invalid value: [1L]. It must be a negative Long
+
NegLong(0L)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.from(validNonPosLong2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// nonPosLong0.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// negFloat123.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegFloat.from(validNonNegFloat1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// nonNegBigInt123.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosBigInt.from(invalidPosBigInt1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString2)
// ^
+
NegLong(1L)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.from(validNonPosLong2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// nonPosLong0.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// negFloat123.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegFloat.from(validNonNegFloat1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// nonNegBigInt123.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosBigInt.from(invalidPosBigInt1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString2)
// ^

Runtime Validation

val validNegLong = -1L 
// validNegLong: Long = -1L
NegLong.from(validNegLong)
// res65: Either[String, Type] = Right(value = -1L)
val invalidNegLong1 = 0L 
// invalidNegLong1: Long = 0L
NegLong.from(invalidNegLong1)
// res66: Either[String, Type] = Left(
// value = "Invalid value: [0]. It must be a negative Long"
// )

val invalidNegLong2 = 1L
// invalidNegLong2: Long = 1L
NegLong.from(invalidNegLong2)
// res67: Either[String, Type] = Left(
// value = "Invalid value: [1]. It must be a negative Long"
// )
@@ -91,7 +91,7 @@

Min and

NonNegLong: non-negative Long

Compile-time Validation

NonNegLong(0L)
// res77: Type = 0L
NonNegLong(1L)
// res78: Type = 1L
-
NonNegLong(-2L)
// error:
// Invalid value: [-2L]. It must be a non-negative Long
+
NonNegLong(-2L)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// negLong123.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.from(invalidNonNegLong1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// nonNegDouble123.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.from(validPosDouble1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// posFloat123.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosFloat.from(validNonPosFloat)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigDecimal.from(validNegBigDecimal)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigDecimal.from(invalidNegBigDecimal1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(invalidNonEmptyString)
// ^

Runtime Validation

val validNonNegLong = 1L
// validNonNegLong: Long = 1L
NonNegLong.from(validNonNegLong)
// res80: Either[String, Type] = Right(value = 1L)
val invalidNonNegLong1 = -1L
// invalidNonNegLong1: Long = -1L
NonNegLong.from(invalidNonNegLong1)
// res81: Either[String, Type] = Left(
// value = "Invalid value: [-1]. It must be a non-negative Long"
// )

val invalidNonNegLong2 = -999L
// invalidNonNegLong2: Long = -999L
NonNegLong.from(invalidNonNegLong2)
// res82: Either[String, Type] = Left(
// value = "Invalid value: [-999]. It must be a non-negative Long"
// )
@@ -105,8 +105,8 @@

Min and

PosLong: positive Long

Compile-time Validation

PosLong(1L)
// res92: Type = 1L
PosLong(999L)
// res93: Type = 999L
-
PosLong(0L)
// error:
// Invalid value: [0L]. It must be a positive Long
-
PosLong(-2L)
// error:
// Invalid value: [-2L]. It must be a positive Long
+
PosLong(0L)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// nonNegLong123.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.from(invalidPosLong1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// posDouble123.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.from(validNonPosDouble)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// nonPosFloat0.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigInt.from(validNegBigInt)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigDecimal.from(validNegBigDecimal)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigDecimal.from(invalidNegBigDecimal1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(invalidNonEmptyString)
// ^
+
PosLong(-2L)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// nonNegLong123.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.from(invalidPosLong1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// posDouble123.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.from(validNonPosDouble)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// nonPosFloat0.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigInt.from(validNegBigInt)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigDecimal.from(validNegBigDecimal)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigDecimal.from(invalidNegBigDecimal1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(invalidNonEmptyString)
// ^

Runtime Validation

val validPosLong = 1L
// validPosLong: Long = 1L
PosLong.from(validPosLong)
// res96: Either[String, Type] = Right(value = 1L)
val invalidPosLong1 = 0L
// invalidPosLong1: Long = 0L
PosLong.from(invalidPosLong1)
// res97: Either[String, Type] = Left(
// value = "Invalid value: [0]. It must be a positive Long"
// )

val invalidPosLong2 = -999L
// invalidPosLong2: Long = -999L
PosLong.from(invalidPosLong2)
// res98: Either[String, Type] = Left(
// value = "Invalid value: [-999]. It must be a positive Long"
// )
@@ -120,7 +120,7 @@

Min and

NonPosLong: non-positive Long

Compile-time Validation

NonPosLong(0L)
// res108: Type = 0L
NonPosLong(-999L)
// res109: Type = -999L
-
NonPosLong(1L)
// error:
// Invalid value: [1L]. It must be a non-positive Long
+
NonPosLong(1L)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.from(invalidPosInt1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.from(invalidPosInt2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// posLong123.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.from(validNonPosLong)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// nonPosDouble0.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.from(validNegFloat)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigInt.from(invalidNegBigInt1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigInt.from(invalidNegBigInt2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigDecimal.from(invalidNegBigDecimal1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigDecimal.from(invalidNegBigDecimal2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(invalidNonEmptyString)
// ^

Runtime Validation

val validNonPosLong = 0L
// validNonPosLong: Long = 0L
NonPosLong.from(validNonPosLong)
// res111: Either[String, Type] = Right(value = 0L)

val validNonPosLong2 = -999L
// validNonPosLong2: Long = -999L
NonPosLong.from(validNonPosLong2)
// res112: Either[String, Type] = Right(value = -999L)
val invalidNonPosLong1 = 1L
// invalidNonPosLong1: Long = 1L
NonPosLong.from(invalidNonPosLong1)
// res113: Either[String, Type] = Left(
// value = "Invalid value: [1]. It must be a non-positive Long"
// )

val invalidNonPosLong2 = 999L
// invalidNonPosLong2: Long = 999L
NonPosLong.from(invalidNonPosLong2)
// res114: Either[String, Type] = Left(
// value = "Invalid value: [999]. It must be a non-positive Long"
// )
@@ -135,8 +135,8 @@

Refined NegDouble: negative Double

Compile-time Validation

NegDouble(-0.00001d)
// res124: Type = -1.0E-5
NegDouble(-999.999d)
// res125: Type = -999.999
-
NegDouble(0d)
// error:
// Invalid value: [0.0d]. It must be a negative Double
-
NegDouble(999.999d)
// error:
// Invalid value: [999.999d]. It must be a negative Double
+
NegDouble(0d)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.from(validNonPosInt)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.from(invalidNonPosInt1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// nonPosLong0.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.from(validNegDouble)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.from(invalidNegFloat1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.from(invalidNegFloat2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigInt.from(invalidNegBigInt1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigInt.from(invalidNegBigInt2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigDecimal.from(invalidNegBigDecimal1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigDecimal.from(invalidNegBigDecimal2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(invalidNonEmptyString)
// ^
+
NegDouble(999.999d)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.from(validNonPosInt)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.from(invalidNonPosInt1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// nonPosLong0.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.from(validNegDouble)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.from(invalidNegFloat1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.from(invalidNegFloat2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigInt.from(invalidNegBigInt1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigInt.from(invalidNegBigInt2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigDecimal.from(invalidNegBigDecimal1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigDecimal.from(invalidNegBigDecimal2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(invalidNonEmptyString)
// ^

Runtime Validation

val validNegDouble = -0.00001d 
// validNegDouble: Double = -1.0E-5
NegDouble.from(validNegDouble)
// res128: Either[String, Type] = Right(value = -1.0E-5)
val invalidNegDouble1 = 0d 
// invalidNegDouble1: Double = 0.0
NegDouble.from(invalidNegDouble1)
// res129: Either[String, Type] = Left(
// value = "Invalid value: [0.0]. It must be a negative Double"
// )

val invalidNegDouble2 = 999.999d
// invalidNegDouble2: Double = 999.999
NegDouble.from(invalidNegDouble2)
// res130: Either[String, Type] = Left(
// value = "Invalid value: [999.999]. It must be a negative Double"
// )
@@ -150,7 +150,7 @@

Min and

NonNegDouble: non-negative Double

Compile-time Validation

NonNegDouble(0d)
// res140: Type = 0.0
NonNegDouble(999.999d)
// res141: Type = 999.999
-
NonNegDouble(-0.00001d)
// error:
// Invalid value: [-1.0E-5d]. It must be a non-negative Double
+
NonNegDouble(-0.00001d)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// nonNegDouble123.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.from(validPosDouble1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// posFloat123.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosFloat.from(validNonPosFloat)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigDecimal.from(validNegBigDecimal)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigDecimal.from(invalidNegBigDecimal1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(invalidNonEmptyString)
// ^
```scala mdoc:fail
NonNegDouble(-999.999d)

Runtime Validation

val validNonNegDouble1 = 0d
// validNonNegDouble1: Double = 0.0
NonNegDouble.from(validNonNegDouble1)
// res143: Either[String, Type] = Right(value = 0.0)

val validNonNegDouble2 = 999.999d
// validNonNegDouble2: Double = 999.999
NonNegDouble.from(validNonNegDouble2)
// res144: Either[String, Type] = Right(value = 999.999)
@@ -165,8 +165,8 @@

Min and

PosDouble: positive Double

Compile-time Validation

PosDouble(0.00001d)
// res156: Type = 1.0E-5
PosDouble(999.999d)
// res157: Type = 999.999
-
PosDouble(0d)
// error:
// Invalid value: [0.0d]. It must be a positive Double
-
PosDouble(-999.999d)
// error:
// Invalid value: [-999.999d]. It must be a positive Double
+
PosDouble(0d)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.from(invalidPosLong1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.from(invalidPosLong2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// nonNegDouble123.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.from(validPosDouble1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosBigInt.from(validNonPosBigInt)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosBigInt.from(invalidNonPosBigInt1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(invalidNonEmptyString)
// ^
+
PosDouble(-999.999d)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.from(invalidPosLong1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.from(invalidPosLong2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// nonNegDouble123.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.from(validPosDouble1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosBigInt.from(validNonPosBigInt)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosBigInt.from(invalidNonPosBigInt1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(invalidNonEmptyString)
// ^

Runtime Validation

val validPosDouble1 = 0.00001d
// validPosDouble1: Double = 1.0E-5
PosDouble.from(validPosDouble1)
// res160: Either[String, Type] = Right(value = 1.0E-5)

val validPosDouble2 = 999.999d
// validPosDouble2: Double = 999.999
PosDouble.from(validPosDouble2)
// res161: Either[String, Type] = Right(value = 999.999)
val invalidPosDouble1 = 0d
// invalidPosDouble1: Double = 0.0
PosDouble.from(invalidPosDouble1)
// res162: Either[String, Type] = Left(
// value = "Invalid value: [0.0]. It must be a positive Double"
// )

val invalidPosDouble2 = -999.999d
// invalidPosDouble2: Double = -999.999
PosDouble.from(invalidPosDouble2)
// res163: Either[String, Type] = Left(
// value = "Invalid value: [-999.999]. It must be a positive Double"
// )
@@ -180,8 +180,8 @@

Min an

NonPosDouble: non-positive Double

Compile-time Validation

NonPosDouble(0d)
// res173: Type = 0.0
NonPosDouble(-999.999d)
// res174: Type = -999.999
-
NonPosDouble(0.00001d)
// error:
// Invalid value: [1.0E-5d]. It must be a non-positive Double
-
NonPosDouble(999.999d)
// error:
// Invalid value: [999.999d]. It must be a non-positive Double
+
NonPosDouble(0.00001d)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.from(validNonPosLong)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.from(invalidNonPosLong1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// nonPosDouble0.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.from(validNegFloat)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigInt.from(invalidNegBigInt1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigInt.from(invalidNegBigInt2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigDecimal.from(invalidNegBigDecimal1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigDecimal.from(invalidNegBigDecimal2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(invalidNonEmptyString)
// ^
+
NonPosDouble(999.999d)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.from(validNonPosLong)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.from(invalidNonPosLong1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// nonPosDouble0.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.from(validNegFloat)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigInt.from(invalidNegBigInt1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigInt.from(invalidNegBigInt2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigDecimal.from(invalidNegBigDecimal1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigDecimal.from(invalidNegBigDecimal2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(invalidNonEmptyString)
// ^

Runtime Validation

val validNonPosDouble = 0d
// validNonPosDouble: Double = 0.0
NonPosDouble.from(validNonPosDouble)
// res177: Either[String, Type] = Right(value = 0.0)

val validNonPosDouble2 = -999.999d
// validNonPosDouble2: Double = -999.999
NonPosDouble.from(validNonPosDouble2)
// res178: Either[String, Type] = Right(value = -999.999)
val invalidNonPosDouble1 = 0.00001d
// invalidNonPosDouble1: Double = 1.0E-5
NonPosDouble.from(invalidNonPosDouble1)
// res179: Either[String, Type] = Left(
// value = "Invalid value: [1.0E-5]. It must be a non-positive Double"
// )

val invalidNonPosDouble2 = 999.999d
// invalidNonPosDouble2: Double = 999.999
NonPosDouble.from(invalidNonPosDouble2)
// res180: Either[String, Type] = Left(
// value = "Invalid value: [999.999]. It must be a non-positive Double"
// )
@@ -196,8 +196,8 @@

Refined

NegFloat: negative Float

Compile-time Validation

NegFloat(-0.00001f)
// res190: Type = -1.0E-5F
NegFloat(-999.999f)
// res191: Type = -999.999F
-
NegFloat(0f)
// error:
// Invalid value: [0.0f]. It must be a negative Float
-
NegFloat(999.999f)
// error:
// Invalid value: [999.999f]. It must be a negative Float
+
NegFloat(0f)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.from(validNonNegDouble1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.from(invalidNonNegDouble1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// nonNegFloat123.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosFloat.from(validPosFloat1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosBigInt.from(validNonPosBigInt)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosBigInt.from(invalidNonPosBigInt1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString2)
// ^
+
NegFloat(999.999f)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.from(validNonNegDouble1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.from(invalidNonNegDouble1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// nonNegFloat123.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosFloat.from(validPosFloat1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosBigInt.from(validNonPosBigInt)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosBigInt.from(invalidNonPosBigInt1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString2)
// ^

Runtime Validation

val validNegFloat = -0.00001f 
// validNegFloat: Float = -1.0E-5F
NegFloat.from(validNegFloat)
// res194: Either[String, Type] = Right(value = -1.0E-5F)
val invalidNegFloat1 = 0f 
// invalidNegFloat1: Float = 0.0F
NegFloat.from(invalidNegFloat1)
// res195: Either[String, Type] = Left(
// value = "Invalid value: [0.0]. It must be a negative Float"
// )

val invalidNegFloat2 = 999.999f
// invalidNegFloat2: Float = 999.999F
NegFloat.from(invalidNegFloat2)
// res196: Either[String, Type] = Left(
// value = "Invalid value: [999.999]. It must be a negative Float"
// )
@@ -211,8 +211,8 @@

Min an

NonNegFloat: non-negative Float

Compile-time Validation

NonNegFloat(0f)
// res206: Type = 0.0F
NonNegFloat(999.999f)
// res207: Type = 999.999F
-
NonNegFloat(-0.00001f)
// error:
// Invalid value: [-1.0E-5f]. It must be a non-negative Float
-
NonNegFloat(-999.999f)
// error:
// Invalid value: [-999.999f]. It must be a non-negative Float
+
NonNegFloat(-0.00001f)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.from(validPosDouble1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.from(invalidPosDouble1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// posFloat123.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosFloat.from(validNonPosFloat)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigDecimal.from(validNegBigDecimal)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigDecimal.from(invalidNegBigDecimal1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(invalidNonEmptyString)
// ^
+
NonNegFloat(-999.999f)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.from(validPosDouble1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.from(invalidPosDouble1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// posFloat123.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosFloat.from(validNonPosFloat)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigDecimal.from(validNegBigDecimal)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigDecimal.from(invalidNegBigDecimal1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(invalidNonEmptyString)
// ^

Runtime Validation

val validNonNegFloat1 = 0f
// validNonNegFloat1: Float = 0.0F
NonNegFloat.from(validNonNegFloat1)
// res210: Either[String, Type] = Right(value = 0.0F)

val validNonNegFloat2 = 999.999f
// validNonNegFloat2: Float = 999.999F
NonNegFloat.from(validNonNegFloat2)
// res211: Either[String, Type] = Right(value = 999.999F)
val invalidNonNegFloat1 = -0.00001f
// invalidNonNegFloat1: Float = -1.0E-5F
NonNegFloat.from(invalidNonNegFloat1)
// res212: Either[String, Type] = Left(
// value = "Invalid value: [-1.0E-5]. It must be a non-negative Float"
// )

val invalidNonNegFloat2 = -999.999f
// invalidNonNegFloat2: Float = -999.999F
NonNegFloat.from(invalidNonNegFloat2)
// res213: Either[String, Type] = Left(
// value = "Invalid value: [-999.999]. It must be a non-negative Float"
// )
@@ -226,8 +226,8 @@

Min an

PosFloat: positive Float

Compile-time Validation

PosFloat(0.00001f)
// res223: Type = 1.0E-5F
PosFloat(999.999f)
// res224: Type = 999.999F
-
PosFloat(0f)
// error:
// Invalid value: [0.0f]. It must be a positive Float
-
PosFloat(-999.999f)
// error:
// Invalid value: [-999.999f]. It must be a positive Float
+
PosFloat(0f)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.from(validNonPosDouble)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.from(invalidNonPosDouble1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// nonPosFloat0.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigInt.from(validNegBigInt)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// nonPosBigInt0.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(invalidNonEmptyString)
// ^
+
PosFloat(-999.999f)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.from(validNonPosDouble)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.from(invalidNonPosDouble1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// nonPosFloat0.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigInt.from(validNegBigInt)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// nonPosBigInt0.value
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(invalidNonEmptyString)
// ^

Runtime Validation

val validPosFloat1 = 0.00001f
// validPosFloat1: Float = 1.0E-5F
PosFloat.from(validPosFloat1)
// res227: Either[String, Type] = Right(value = 1.0E-5F)

val validPosFloat2 = 999.999f
// validPosFloat2: Float = 999.999F
PosFloat.from(validPosFloat2)
// res228: Either[String, Type] = Right(value = 999.999F)
val invalidPosFloat1 = 0f
// invalidPosFloat1: Float = 0.0F
PosFloat.from(invalidPosFloat1)
// res229: Either[String, Type] = Left(
// value = "Invalid value: [0.0]. It must be a positive Float"
// )

val invalidPosFloat2 = -999.999f
// invalidPosFloat2: Float = -999.999F
PosFloat.from(invalidPosFloat2)
// res230: Either[String, Type] = Left(
// value = "Invalid value: [-999.999]. It must be a positive Float"
// )
@@ -241,8 +241,8 @@

Min an

NonPosFloat: non-positive Float

Compile-time Validation

NonPosFloat(0f)
// res240: Type = 0.0F
NonPosFloat(-999.999f)
// res241: Type = -999.999F
-
NonPosFloat(0.00001f)
// error:
// Invalid value: [1.0E-5f]. It must be a non-positive Float
-
NonPosFloat(999.999f)
// error:
// Invalid value: [999.999f]. It must be a non-positive Float
+
NonPosFloat(0.00001f)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegFloat.from(validNonNegFloat1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegFloat.from(invalidNonNegFloat1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosBigInt.from(validNonPosBigInt)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosBigInt.from(invalidNonPosBigInt1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(invalidNonEmptyString)
// ^
+
NonPosFloat(999.999f)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegFloat.from(validNonNegFloat1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegFloat.from(invalidNonNegFloat1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosBigInt.from(validNonPosBigInt)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosBigInt.from(invalidNonPosBigInt1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString2)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(invalidNonEmptyString)
// ^

Runtime Validation

val validNonPosFloat = 0f
// validNonPosFloat: Float = 0.0F
NonPosFloat.from(validNonPosFloat)
// res244: Either[String, Type] = Right(value = 0.0F)

val validNonPosFloat2 = -999.999f
// validNonPosFloat2: Float = -999.999F
NonPosFloat.from(validNonPosFloat2)
// res245: Either[String, Type] = Right(value = -999.999F)
val invalidNonPosFloat1 = 0.00001f
// invalidNonPosFloat1: Float = 1.0E-5F
NonPosFloat.from(invalidNonPosFloat1)
// res246: Either[String, Type] = Left(
// value = "Invalid value: [1.0E-5]. It must be a non-positive Float"
// )

val invalidNonPosFloat2 = 999.999f
// invalidNonPosFloat2: Float = 999.999F
NonPosFloat.from(invalidNonPosFloat2)
// res247: Either[String, Type] = Left(
// value = "Invalid value: [999.999]. It must be a non-positive Float"
// )
@@ -257,8 +257,8 @@

Refined NegBigInt: negative BigInt

Compile-time Validation

NegBigInt(-1)
// res257: Type = -1
-
NegBigInt(0)
// error:
// Invalid value: [BigInt.apply(0)]. It must be a negative BigInt
-
NegBigInt(1)
// error:
// Invalid value: [BigInt.apply(1)]. It must be a negative BigInt
+
NegBigInt(0)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.MinValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.MaxValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosFloat.from(validPosFloat1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosFloat.from(invalidPosFloat1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosBigInt.from(validNonPosBigInt)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosBigInt.from(invalidNonPosBigInt1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString2)
// ^
+
NegBigInt(1)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.MinValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.MaxValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosFloat.from(validPosFloat1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosFloat.from(invalidPosFloat1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosBigInt.from(validNonPosBigInt)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosBigInt.from(invalidNonPosBigInt1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonEmptyString.from(validNonEmptyString2)
// ^

Runtime Validation

val validNegBigInt = -1 
// validNegBigInt: Int = -1
NegBigInt.from(validNegBigInt)
// res260: Either[String, Type] = Right(value = -1)
val invalidNegBigInt1 = 0 
// invalidNegBigInt1: Int = 0
NegBigInt.from(invalidNegBigInt1)
// res261: Either[String, Type] = Left(
// value = "Invalid value: [0]. It must be a negative BigInt"
// )

val invalidNegBigInt2 = 1
// invalidNegBigInt2: Int = 1
NegBigInt.from(invalidNegBigInt2)
// res262: Either[String, Type] = Left(
// value = "Invalid value: [1]. It must be a negative BigInt"
// )
@@ -270,7 +270,7 @@

Get ValueNonNegBigInt: non-negative BigInt

Compile-time Validation

NonNegBigInt(0)
// res270: Type = 0
NonNegBigInt(1)
// res271: Type = 1
-
NonNegBigInt(-2)
// error:
// Invalid value: [BigInt.apply(-2)]. It must be a non-negative BigInt
+
NonNegBigInt(-2)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.MinValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.MaxValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegFloat.MinValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegFloat.MaxValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosFloat.from(validNonPosFloat)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosFloat.from(invalidNonPosFloat1)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigDecimal.from(validNegBigDecimal)
// ^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigDecimal.from(invalidNegBigDecimal1)
// ^

Runtime Validation

val validNonNegBigInt = 1 
// validNonNegBigInt: Int = 1
NonNegBigInt.from(validNonNegBigInt)
// res273: Either[String, Type] = Right(value = 1)
val invalidNonNegBigInt1 = -1
// invalidNonNegBigInt1: Int = -1
NonNegBigInt.from(invalidNonNegBigInt1)
// res274: Either[String, Type] = Left(
// value = "Invalid value: [-1]. It must be a non-negative BigInt"
// )

val invalidNonNegBigInt2 = -999
// invalidNonNegBigInt2: Int = -999
NonNegBigInt.from(invalidNonNegBigInt2)
// res275: Either[String, Type] = Left(
// value = "Invalid value: [-999]. It must be a non-negative BigInt"
// )
@@ -282,8 +282,8 @@

Get ValuePosBigInt: positive BigInt

Compile-time Validation

PosBigInt(1)
// res283: Type = 1
PosBigInt(999)
// res284: Type = 999
-
PosBigInt(0)
// error:
// Invalid value: [BigInt.apply(0)]. It must be a positive BigInt
-
PosBigInt(-2)
// error:
// Invalid value: [BigInt.apply(-2)]. It must be a positive BigInt
+
PosBigInt(0)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.MinValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.MaxValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegFloat.MinValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegFloat.MaxValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosFloat.MinValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosFloat.MaxValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosFloat.MinValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigInt.from(validNegBigInt)
// ^
+
PosBigInt(-2)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.MinValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.MaxValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegFloat.MinValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegFloat.MaxValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosFloat.MinValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosFloat.MaxValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosFloat.MinValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegBigInt.from(validNegBigInt)
// ^

Runtime Validation

val validPosBigInt = 1
// validPosBigInt: Int = 1
PosBigInt.from(validPosBigInt)
// res287: Either[String, Type] = Right(value = 1)
val invalidPosBigInt1 = 0
// invalidPosBigInt1: Int = 0
PosBigInt.from(invalidPosBigInt1)
// res288: Either[String, Type] = Left(
// value = "Invalid value: [0]. It must be a positive BigInt"
// )

val invalidPosBigInt2 = -999
// invalidPosBigInt2: Int = -999
PosBigInt.from(invalidPosBigInt2)
// res289: Either[String, Type] = Left(
// value = "Invalid value: [-999]. It must be a positive BigInt"
// )
@@ -295,7 +295,7 @@

Get ValueNonPosBigInt: non-positive BigInt

Compile-time Validation

NonPosBigInt(0)
// res297: Type = 0
NonPosBigInt(-999)
// res298: Type = -999
-
NonPosBigInt(1)
// error:
// Invalid value: [BigInt.apply(1)]. It must be a non-positive BigInt
+
NonPosBigInt(1)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.MinValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.MaxValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegFloat.MinValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegFloat.MaxValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosFloat.MinValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosFloat.MaxValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosFloat.MinValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosFloat.MaxValue
// ^^^^^^^^^^^^^^^^^^^^

Runtime Validation

val validNonPosBigInt = 0
// validNonPosBigInt: Int = 0
NonPosBigInt.from(validNonPosBigInt)
// res300: Either[String, Type] = Right(value = 0)

val validNonPosBigInt2 = -999
// validNonPosBigInt2: Int = -999
NonPosBigInt.from(validNonPosBigInt2)
// res301: Either[String, Type] = Right(value = -999)
val invalidNonPosBigInt1 = 1
// invalidNonPosBigInt1: Int = 1
NonPosBigInt.from(invalidNonPosBigInt1)
// res302: Either[String, Type] = Left(
// value = "Invalid value: [1]. It must be a non-positive BigInt"
// )

val invalidNonPosBigInt2 = 999
// invalidNonPosBigInt2: Int = 999
NonPosBigInt.from(invalidNonPosBigInt2)
// res303: Either[String, Type] = Left(
// value = "Invalid value: [999]. It must be a non-positive BigInt"
// )
@@ -308,8 +308,8 @@

Refined <

NegBigDecimal: negative BigDecimal

Compile-time Validation

NegBigDecimal(-0.00001d)
// res311: Type = -0.000010
NegBigDecimal(-999.999d)
// res312: Type = -999.999
-
NegBigDecimal(0d)
// error:
// Invalid value: [BigDecimal.apply(0.0d)]. It must be a negative BigDecimal
-
NegBigDecimal(999.999d)
// error:
// Invalid value: [BigDecimal.apply(999.999d)]. It must be a negative BigDecimal
+
NegBigDecimal(0d)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.MinValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.MaxValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegFloat.MinValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegFloat.MaxValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosFloat.MinValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosFloat.MaxValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosFloat.MinValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosFloat.MaxValue
// ^^^^^^^^^^^^^^^^^^^^
+
NegBigDecimal(999.999d)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.MinValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.MaxValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegFloat.MinValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegFloat.MaxValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosFloat.MinValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosFloat.MaxValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosFloat.MinValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosFloat.MaxValue
// ^^^^^^^^^^^^^^^^^^^^

Runtime Validation

val validNegBigDecimal = -0.00001d 
// validNegBigDecimal: Double = -1.0E-5
NegBigDecimal.from(validNegBigDecimal)
// res315: Either[String, Type] = Right(value = -0.000010)
val invalidNegBigDecimal1 = 0d 
// invalidNegBigDecimal1: Double = 0.0
NegBigDecimal.from(invalidNegBigDecimal1)
// res316: Either[String, Type] = Left(
// value = "Invalid value: [0.0]. It must be a negative BigDecimal"
// )

val invalidNegBigDecimal2 = 999.999d
// invalidNegBigDecimal2: Double = 999.999
NegBigDecimal.from(invalidNegBigDecimal2)
// res317: Either[String, Type] = Left(
// value = "Invalid value: [999.999]. It must be a negative BigDecimal"
// )
@@ -321,7 +321,7 @@

Get ValueNonNegBigDecimal: non-negative BigDecimal

Compile-time Validation

NonNegBigDecimal(0d)
// res325: Type = 0.0
NonNegBigDecimal(999.999d)
// res326: Type = 999.999
-
NonNegBigDecimal(-0.00001d)
// error:
// Invalid value: [BigDecimal.apply(-1.0E-5d)]. It must be a non-negative BigDecimal
+
NonNegBigDecimal(-0.00001d)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.MinValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.MaxValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegFloat.MinValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegFloat.MaxValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosFloat.MinValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosFloat.MaxValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosFloat.MinValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosFloat.MaxValue
// ^^^^^^^^^^^^^^^^^^^^
```scala mdoc:fail
NonNegBigDecimal(-999.999d)

Runtime Validation

val validNonNegBigDecimal1 = 0d
// validNonNegBigDecimal1: Double = 0.0
NonNegBigDecimal.from(validNonNegBigDecimal1)
// res328: Either[String, Type] = Right(value = 0.0)

val validNonNegBigDecimal2 = 999.999d
// validNonNegBigDecimal2: Double = 999.999
NonNegBigDecimal.from(validNonNegBigDecimal2)
// res329: Either[String, Type] = Right(value = 999.999)
@@ -334,8 +334,8 @@

Get ValuePosBigDecimal: positive BigDecimal

Compile-time Validation

PosBigDecimal(0.00001d)
// res339: Type = 0.000010
PosBigDecimal(999.999d)
// res340: Type = 999.999
-
PosBigDecimal(0d)
// error:
// Invalid value: [BigDecimal.apply(0.0d)]. It must be a positive BigDecimal
-
PosBigDecimal(-999.999d)
// error:
// Invalid value: [BigDecimal.apply(-999.999d)]. It must be a positive BigDecimal
+
PosBigDecimal(0d)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.MinValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.MaxValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegFloat.MinValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegFloat.MaxValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosFloat.MinValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosFloat.MaxValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosFloat.MinValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosFloat.MaxValue
// ^^^^^^^^^^^^^^^^^^^^
+
PosBigDecimal(-999.999d)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.MinValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.MaxValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegFloat.MinValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegFloat.MaxValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosFloat.MinValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosFloat.MaxValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosFloat.MinValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosFloat.MaxValue
// ^^^^^^^^^^^^^^^^^^^^

Runtime Validation

val validPosBigDecimal1 = 0.00001d
// validPosBigDecimal1: Double = 1.0E-5
PosBigDecimal.from(validPosBigDecimal1)
// res343: Either[String, Type] = Right(value = 0.000010)

val validPosBigDecimal2 = 999.999d
// validPosBigDecimal2: Double = 999.999
PosBigDecimal.from(validPosBigDecimal2)
// res344: Either[String, Type] = Right(value = 999.999)
val invalidPosBigDecimal1 = 0d
// invalidPosBigDecimal1: Double = 0.0
PosBigDecimal.from(invalidPosBigDecimal1)
// res345: Either[String, Type] = Left(
// value = "Invalid value: [0.0]. It must be a positive BigDecimal"
// )

val invalidPosBigDecimal2 = -999.999d
// invalidPosBigDecimal2: Double = -999.999
PosBigDecimal.from(invalidPosBigDecimal2)
// res346: Either[String, Type] = Left(
// value = "Invalid value: [-999.999]. It must be a positive BigDecimal"
// )
@@ -347,8 +347,8 @@

Get ValueNonPosBigDecimal: non-positive BigDecimal

Compile-time Validation

NonPosBigDecimal(0d)
// res354: Type = 0.0
NonPosBigDecimal(-999.999d)
// res355: Type = -999.999
-
NonPosBigDecimal(0.00001d)
// error:
// Invalid value: [BigDecimal.apply(1.0E-5d)]. It must be a non-positive BigDecimal
-
NonPosBigDecimal(999.999d)
// error:
// Invalid value: [BigDecimal.apply(999.999d)]. It must be a non-positive BigDecimal
+
NonPosBigDecimal(0.00001d)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.MinValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.MaxValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegFloat.MinValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegFloat.MaxValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosFloat.MinValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosFloat.MaxValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosFloat.MinValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosFloat.MaxValue
// ^^^^^^^^^^^^^^^^^^^^
+
NonPosBigDecimal(999.999d)
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MinValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosInt.MaxValue
// ^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosInt.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MinValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosLong.MaxValue
// ^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MinValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosLong.MaxValue
// ^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.MinValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.MinValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosDouble.MaxValue
// ^^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.MinValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NegFloat.MaxValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegFloat.MinValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonNegFloat.MaxValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosFloat.MinValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// PosFloat.MaxValue
// ^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosFloat.MinValue
// ^^^^^^^^^^^^^^^^^^^^
// error:
// A pure expression does nothing in statement position; you may be omitting necessary parentheses
// NonPosFloat.MaxValue
// ^^^^^^^^^^^^^^^^^^^^

Runtime Validation

val validNonPosBigDecimal = 0d
// validNonPosBigDecimal: Double = 0.0
NonPosBigDecimal.from(validNonPosBigDecimal)
// res358: Either[String, Type] = Right(value = 0.0)

val validNonPosBigDecimal2 = -999.999d
// validNonPosBigDecimal2: Double = -999.999
NonPosBigDecimal.from(validNonPosBigDecimal2)
// res359: Either[String, Type] = Right(value = -999.999)
val invalidNonPosBigDecimal1 = 0.00001d
// invalidNonPosBigDecimal1: Double = 1.0E-5
NonPosBigDecimal.from(invalidNonPosBigDecimal1)
// res360: Either[String, Type] = Left(
// value = "Invalid value: [0.000010]. It must be a non-positive BigDecimal"
// )

val invalidNonPosBigDecimal2 = 999.999d
// invalidNonPosBigDecimal2: Double = 999.999
NonPosBigDecimal.from(invalidNonPosBigDecimal2)
// res361: Either[String, Type] = Left(
// value = "Invalid value: [999.999]. It must be a non-positive BigDecimal"
// )
diff --git a/docs/doobie/index.html b/docs/doobie/index.html index e510a61..b084fef 100644 --- a/docs/doobie/index.html +++ b/docs/doobie/index.html @@ -7,7 +7,7 @@ - + diff --git a/docs/index.html b/docs/index.html index d362595..19df7f5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -7,7 +7,7 @@ - + @@ -21,23 +21,23 @@

Getting Started

To get refined4s for your project,

refined4s-core

-

In build.sbt,

"io.kevinlee" %% "refined4s-core" % "0.11.0"
+

In build.sbt,

"io.kevinlee" %% "refined4s-core" % "0.13.0"

refined4s-cats

-

In build.sbt,

"io.kevinlee" %% "refined4s-cats" % "0.11.0"
+

In build.sbt,

"io.kevinlee" %% "refined4s-cats" % "0.13.0"

refined4s-circe

-

In build.sbt,

"io.kevinlee" %% "refined4s-circe" % "0.11.0"
+

In build.sbt,

"io.kevinlee" %% "refined4s-circe" % "0.13.0"

refined4s-pureconfig

-

In build.sbt,

"io.kevinlee" %% "refined4s-pureconfig" % "0.11.0"
+

In build.sbt,

"io.kevinlee" %% "refined4s-pureconfig" % "0.13.0"

refined4s-doobie-ce2

-

In build.sbt,

"io.kevinlee" %% "refined4s-doobie-ce2" % "0.11.0"
+

In build.sbt,

"io.kevinlee" %% "refined4s-doobie-ce2" % "0.13.0"

refined4s-doobie-ce3

-

In build.sbt,

"io.kevinlee" %% "refined4s-doobie-ce3" % "0.11.0"
+

In build.sbt,

"io.kevinlee" %% "refined4s-doobie-ce3" % "0.13.0"

refined4s-extras-render

-

In build.sbt,

"io.kevinlee" %% "refined4s-extras-render" % "0.11.0"
+

In build.sbt,

"io.kevinlee" %% "refined4s-extras-render" % "0.13.0"

All refined4s modules

-

In build.sbt,

"io.kevinlee" %% "refined4s-core" % "0.11.0",
"io.kevinlee" %% "refined4s-cats" % "0.11.0",
"io.kevinlee" %% "refined4s-circe" % "0.11.0",
"io.kevinlee" %% "refined4s-pureconfig" % "0.11.0",
"io.kevinlee" %% "refined4s-doobie-ce2" % "0.11.0", // Use either refined4s-doobie-ce2
"io.kevinlee" %% "refined4s-doobie-ce3" % "0.11.0", // OR refined4s-doobie-ce3
"io.kevinlee" %% "refined4s-extras-render" % "0.11.0",
+

In build.sbt,

"io.kevinlee" %% "refined4s-core" % "0.13.0",
"io.kevinlee" %% "refined4s-cats" % "0.13.0",
"io.kevinlee" %% "refined4s-circe" % "0.13.0",
"io.kevinlee" %% "refined4s-pureconfig" % "0.13.0",
"io.kevinlee" %% "refined4s-doobie-ce2" % "0.13.0", // Use either refined4s-doobie-ce2
"io.kevinlee" %% "refined4s-doobie-ce3" % "0.13.0", // OR refined4s-doobie-ce3
"io.kevinlee" %% "refined4s-extras-render" % "0.13.0",

Why refined4s?

Given the following methods

def hello(name: String): Unit = println(s"Hello $name")
def sendEmail(email: String): Unit = {
println(s"Sending email to [email address: $email]")
// ... send email
}
diff --git a/docs/pureconfig/index.html b/docs/pureconfig/index.html index 020ec09..3f9703c 100644 --- a/docs/pureconfig/index.html +++ b/docs/pureconfig/index.html @@ -7,7 +7,7 @@ - + diff --git a/index.html b/index.html index 7c49604..1fdfe4a 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@ - + diff --git a/markdown-page/index.html b/markdown-page/index.html index b97701c..67e22ab 100644 --- a/markdown-page/index.html +++ b/markdown-page/index.html @@ -7,7 +7,7 @@ - +