[{"name":"Typed","comment":"\n\n\n## building blocks\n\n@docs Typed, NoUser, Anyone\n\n\n## created by anyone\n\n@docs tag, Tagged\n\n\n## checked\n\n@docs Checked, isChecked\n\n\n## access\n\n@docs value, values2, hiddenValueIn\n\n\n## hidden\n\n@docs TaggedHidden, CheckedHidden\n\n\n## modify\n\n@docs map, map2\n\n","unions":[{"name":"Anyone","comment":" Anyone who wanted.\n","args":[],"cases":[]},{"name":"NoUser","comment":" Only the ones with access to the `tag` constructor.\n","args":[],"cases":[]},{"name":"Typed","comment":" A value is wrapped in a `type` with a phantom `tag`,\nso that a `Typed A Int ...` is not a `Typed B Int ...`.\n\nThe wrappers of type `Typed`\n\n  - [`Checked`](Typed#Checked)\n\n  - [`Tagged`](Typed#Tagged)\n\n  - [`TaggedHidden`](Typed#TaggedHidden)\n\n  - [`CheckedHidden`](Typed#TaggedHidden)\n\nall promise additional type-safety.\n\nYou will see `Typed` as a function argument type.\n\n    map :\n        (value -> mappedValue)\n        -> Typed tag value { whoCanAccess | createdBy : whoCreated }\n        -> Typed mappedTag mappedValue { whoCanAccess | createdBy : Anyone }\n\nIs saying: `map` works on every `Typed`.\nThe result has the same one `whoCreated` it.\n\nMeaning if the input was\n\n  - `Checked` or `Tagged`, the result becomes a `Tagged`\n  - `CheckedHidden` or `TaggedHidden`, the result becomes a `TaggedHidden`\n\n","args":["tag","value","whoCreatedAndWhoCanAccess"],"cases":[]}],"aliases":[{"name":"Checked","comment":" Instances that are validated from inside the module where the `tag` is.\n\nAnyone can read the valid `value`, but once you modify it, it just becomes a `Tagged`.\n\n","args":["tag","value"],"type":"Typed.Typed tag value { canAccess : Typed.Anyone, createdBy : Typed.NoUser }"},{"name":"CheckedHidden","comment":" A `Checked` value, but not everything about the `value` is exposed. This allows\n\n  - hiding implementation details\n  - hiding data you don't want users to see\n\n","args":["tag","value"],"type":"Typed.Typed tag value { createdBy : Typed.NoUser, canAccess : Typed.NoUser }"},{"name":"Tagged","comment":" Every possible `value` can be described with this `tag`.\n\n  - `Tagged MetersTag Float`\n      - **✓** Every Float can describe `Meters`\n  - `Tagged NaturalNumberTag Int`\n      - **⨯ Not** every `Int` can be called a `NaturalNumber`\n      - Use [`Checked`](Typed#Checked) instead!\n\nAnyone can access its `value`.\n\nInstances can be created & updated everywhere.\n\n","args":["tag","value"],"type":"Typed.Typed tag value { canAccess : Typed.Anyone, createdBy : Typed.Anyone }"},{"name":"TaggedHidden","comment":" Using its value isn't allowed.\n\n    type alias Password =\n        TaggedHidden PasswordTag String\n\n    type PasswordTag\n        = Password Never\n\n    type alias User =\n        { password : Password\n\n        --...\n        }\n\n    showUsYourPassword user =\n        -- compile-time error\n        user.password |> Typed.value\n\nThe only thing you can still use is `==` on 2 `TaggedHidden`s of the same type.\n\n","args":["tag","value"],"type":"Typed.Typed tag value { createdBy : Typed.Anyone, canAccess : Typed.NoUser }"}],"values":[{"name":"hiddenValueIn","comment":" If you have a `CheckedHidden`, its value isn't readable by users.\n\nIf you have the `tag` however, you can access this data hidden from the user.\n\n","type":"tag -> Typed.Typed tag value { whoCreated | canAccess : Typed.NoUser } -> value"},{"name":"isChecked","comment":" After calling `tag` or modifying a checked value, you get a `Tagged`. To tell the type that the result value is `Checked`, use `isChecked tag`.\n\nThe type of `tag` might even change in that operation.\n\n    oddPlusOdd : Odd -> Odd -> Even\n    oddPlusOdd oddToAdd =\n        Typed.map2 (+) oddToAdd\n            >> isChecked Even\n\n","type":"checkedTag -> Typed.Typed tag value { whoCanAccess | createdBy : whoCreated } -> Typed.Typed checkedTag value { whoCanAccess | createdBy : Typed.NoUser }"},{"name":"map","comment":" Alter the value inside.\n\nIf the `Typed` was a `Checked`, it becomes a `Typed`.\n\n    type alias Meters =\n        Typed MetersTag Int Typed\n\n    type alias Millimeters =\n        Typed MilliMetersTag Typed\n\n    go1km : Meters -> Meters\n    go1km =\n        Typed.map ((+) 1000)\n\n","type":"(value -> mappedValue) -> Typed.Typed tag value { whoCanAccess | createdBy : whoCreated } -> Typed.Typed mappedTag mappedValue { whoCanAccess | createdBy : Typed.Anyone }"},{"name":"map2","comment":" Use the values of 2 `Typed`s to return a result.\n\nThe result becomes a `CreatableAndModifiable` with the same reading permission as the 2 inputs.\n\n    type alias PrimeNumber =\n        Typed PrimeNumberTag Int Checked\n\n    prime3 : PrimeNumber\n    prime3 =\n        tag 3 |> isChecked PrimeNumber\n\n    prime5 =\n        tag 5 |> isChecked PrimeNumber\n\nAnywhere\n\n    Typed.values2 (+) prime3 prime5\n    --> 8\n\nIn another module\n\n    type alias NonPrime =\n        Checked NonPrimeTag Int\n\n    fromMultiplyingPrimes aPrime bPrime =\n        Typed.map2 (*) aPrime bPrime\n            |> isChecked NonPrime\n\n","type":"(aValue -> bValue -> combinedValue) -> Typed.Typed aTag aValue { whoCanAccess | createdBy : aWhoCanCreate } -> Typed.Typed bTag bValue { whoCanAccess | createdBy : bWhoCanCreate } -> Typed.Typed combinedTag combinedValue { whoCanAccess | createdBy : Typed.Anyone }"},{"name":"tag","comment":" Create a new tagged value.\n\n  - can be `Checked` with [`isChecked`](Typed#isChecked)\n  - if you start modifying that value, it becomes a `Tagged`\n  - becomes a `TaggedHidden` when annotated / used as an argument\n\n","type":"value -> Typed.Typed tag value { whoCanAccess | createdBy : Typed.Anyone }"},{"name":"value","comment":" Read the value inside a `Tagged` or `Checked`.\n","type":"Typed.Typed tag value { whoCreated | canAccess : Typed.Anyone } -> value"},{"name":"values2","comment":" Use the values of 2 `Accessible`s to return a result.\n\n    type alias PrimeNumber =\n        Checked PrimeNumberTag Int\n\n    prime3 : PrimeNumber\n    prime3 =\n        tag 3 |> isChecked PrimeNumber\n\n    prime5 =\n        tag 5 |> isChecked PrimeNumber\n\nAnywhere\n\n    Typed.values2 (+) prime3 prime5\n    --> 8\n\n    Typed.values2 Tuple.pair prime3 prime5\n    --> ( 3, 5 )\n\n","type":"(aValue -> bValue -> resultValue) -> Typed.Typed aTag aValue { whoCreateda | canAccess : Typed.Anyone } -> Typed.Typed bTag bValue { whoCreatedb | canAccess : Typed.Anyone } -> resultValue"}],"binops":[]}]