opentheory-byte (empty) → 1.123
raw patch · 4 files changed
+78/−0 lines, 4 filesdep +QuickCheckdep +basedep +opentheorysetup-changed
Dependencies added: QuickCheck, base, opentheory, opentheory-bits, opentheory-primitive, opentheory-probability
Files
- LICENSE +17/−0
- Setup.hs +6/−0
- opentheory-byte.cabal +29/−0
- src/OpenTheory/Byte.hs +26/−0
+ LICENSE view
@@ -0,0 +1,17 @@+Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in+all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN+THE SOFTWARE.
+ Setup.hs view
@@ -0,0 +1,6 @@+module Main(main)++import Distribution.Simple++main :: IO ()+main = defaultMain
+ opentheory-byte.cabal view
@@ -0,0 +1,29 @@+name: opentheory-byte+version: 1.123+category: Formal Methods+synopsis: Bytes+license: MIT+license-file: LICENSE+cabal-version: >= 1.8.0.2+build-type: Simple+author: Joe Leslie-Hurd <joe@gilith.com>+maintainer: Joe Leslie-Hurd <joe@gilith.com>+description:+ Bytes - this package was automatically generated from the OpenTheory+ package byte-1.123++library+ build-depends:+ base >= 4.0 && < 5.0,+ QuickCheck >= 2.4.0.1 && < 3.0,+ opentheory-primitive >= 1.3 && < 2.0,+ opentheory >= 1.193 && < 1.196,+ opentheory-bits >= 1.63 && < 1.64,+ opentheory-probability >= 1.46 && < 1.47++ hs-source-dirs: src++ ghc-options: -Wall++ exposed-modules:+ OpenTheory.Byte
+ src/OpenTheory/Byte.hs view
@@ -0,0 +1,26 @@+{- |+module: $Header$+description: Bytes+license: MIT++maintainer: Joe Leslie-Hurd <joe@gilith.com>+stability: provisional+portability: portable+-}++module OpenTheory.Byte+where++import qualified OpenTheory.Natural.Uniform as Uniform+import qualified OpenTheory.Primitive.Byte as Byte+import qualified OpenTheory.Primitive.Natural as Natural+import qualified OpenTheory.Primitive.Random as Random++width :: Natural.Natural+width = 8++modulus :: Natural.Natural+modulus = 2 ^ width++random :: Random.Random -> Byte.Byte+random r = Byte.fromNatural (Uniform.random modulus r)