packages feed

hw-int (empty) → 0.0.0.1

raw patch · 15 files changed

+389/−0 lines, 15 filesdep +basesetup-changed

Dependencies added: base

Files

+ LICENSE view
@@ -0,0 +1,30 @@+Copyright John Ky (c) 2016++All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are met:++    * Redistributions of source code must retain the above copyright+      notice, this list of conditions and the following disclaimer.++    * Redistributions in binary form must reproduce the above+      copyright notice, this list of conditions and the following+      disclaimer in the documentation and/or other materials provided+      with the distribution.++    * Neither the name of Author name here nor the names of other+      contributors may be used to endorse or promote products derived+      from this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ README.md view
@@ -0,0 +1,2 @@+# hw-int+[![CircleCI](https://circleci.com/gh/haskell-works/hw-int/tree/0-branch.svg?style=svg)](https://circleci.com/gh/haskell-works/hw-int/tree/0-branch)
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ hw-int.cabal view
@@ -0,0 +1,37 @@+name:                   hw-int+version:                0.0.0.1+synopsis:               Integers+description:            Please see README.md+homepage:               http://github.com/haskell-works/hw-int#readme+license:                BSD3+license-file:           LICENSE+author:                 John Ky+maintainer:             newhoggy@gmail.com+copyright:              2016 John Ky+category:               Data+stability:              Experimental+build-type:             Simple+extra-source-files:     README.md+cabal-version:          >= 1.22++library+  hs-source-dirs:       src+  exposed-modules:      HaskellWorks.Data.Int+                      , HaskellWorks.Data.Int.Narrow+                      , HaskellWorks.Data.Int.Narrow.Narrow8+                      , HaskellWorks.Data.Int.Narrow.Narrow16+                      , HaskellWorks.Data.Int.Narrow.Narrow32+                      , HaskellWorks.Data.Int.Narrow.Narrow64+                      , HaskellWorks.Data.Int.Widen+                      , HaskellWorks.Data.Int.Widen.Widen8+                      , HaskellWorks.Data.Int.Widen.Widen16+                      , HaskellWorks.Data.Int.Widen.Widen32+                      , HaskellWorks.Data.Int.Widen.Widen64+  build-depends:        base                          >= 4          && < 5++  default-language:     Haskell2010+  ghc-options:          -Wall -O2++source-repository head+  type:     git+  location: https://github.com/haskell-works/hw-int
+ src/HaskellWorks/Data/Int.hs view
@@ -0,0 +1,6 @@+module HaskellWorks.Data.Int+  ( module X+  ) where++import HaskellWorks.Data.Int.Narrow as X+import HaskellWorks.Data.Int.Widen  as X
+ src/HaskellWorks/Data/Int/Narrow.hs view
@@ -0,0 +1,8 @@+module HaskellWorks.Data.Int.Narrow+  ( module X+  ) where++import HaskellWorks.Data.Int.Narrow.Narrow8   as X+import HaskellWorks.Data.Int.Narrow.Narrow16  as X+import HaskellWorks.Data.Int.Narrow.Narrow32  as X+import HaskellWorks.Data.Int.Narrow.Narrow64  as X
+ src/HaskellWorks/Data/Int/Narrow/Narrow16.hs view
@@ -0,0 +1,42 @@+{-# LANGUAGE TypeFamilies #-}++module HaskellWorks.Data.Int.Narrow.Narrow16+  ( Narrow16(..)+  ) where++import Data.Int+import Data.Word++class Narrow16 a where+  type Narrowed16 a+  narrow16 :: a -> Narrowed16 a++instance Narrow16 Word16 where+  type Narrowed16 Word16 = Word16+  narrow16 = fromIntegral+  {-# INLINE narrow16 #-}++instance Narrow16 Word32 where+  type Narrowed16 Word32 = Word16+  narrow16 = fromIntegral+  {-# INLINE narrow16 #-}++instance Narrow16 Word64 where+  type Narrowed16 Word64 = Word16+  narrow16 = fromIntegral+  {-# INLINE narrow16 #-}++instance Narrow16 Int16 where+  type Narrowed16 Int16 = Int16+  narrow16 = fromIntegral+  {-# INLINE narrow16 #-}++instance Narrow16 Int32 where+  type Narrowed16 Int32 = Int16+  narrow16 = fromIntegral+  {-# INLINE narrow16 #-}++instance Narrow16 Int64 where+  type Narrowed16 Int64 = Int16+  narrow16 = fromIntegral+  {-# INLINE narrow16 #-}
+ src/HaskellWorks/Data/Int/Narrow/Narrow32.hs view
@@ -0,0 +1,32 @@+{-# LANGUAGE TypeFamilies #-}++module HaskellWorks.Data.Int.Narrow.Narrow32+  ( Narrow32(..)+  ) where++import Data.Int+import Data.Word++class Narrow32 a where+  type Narrowed32 a+  narrow32 :: a -> Narrowed32 a++instance Narrow32 Word32 where+  type Narrowed32 Word32 = Word32+  narrow32 = fromIntegral+  {-# INLINE narrow32 #-}++instance Narrow32 Word64 where+  type Narrowed32 Word64 = Word32+  narrow32 = fromIntegral+  {-# INLINE narrow32 #-}++instance Narrow32 Int32 where+  type Narrowed32 Int32 = Int32+  narrow32 = fromIntegral+  {-# INLINE narrow32 #-}++instance Narrow32 Int64 where+  type Narrowed32 Int64 = Int32+  narrow32 = fromIntegral+  {-# INLINE narrow32 #-}
+ src/HaskellWorks/Data/Int/Narrow/Narrow64.hs view
@@ -0,0 +1,22 @@+{-# LANGUAGE TypeFamilies #-}++module HaskellWorks.Data.Int.Narrow.Narrow64+  ( Narrow64(..)+  ) where++import Data.Int+import Data.Word++class Narrow64 a where+  type Narrowed64 a+  narrow64 :: a -> Narrowed64 a++instance Narrow64 Word64 where+  type Narrowed64 Word64 = Word64+  narrow64 = fromIntegral+  {-# INLINE narrow64 #-}++instance Narrow64 Int64 where+  type Narrowed64 Int64 = Int64+  narrow64 = fromIntegral+  {-# INLINE narrow64 #-}
+ src/HaskellWorks/Data/Int/Narrow/Narrow8.hs view
@@ -0,0 +1,52 @@+{-# LANGUAGE TypeFamilies #-}++module HaskellWorks.Data.Int.Narrow.Narrow8+  ( Narrow8(..)+  ) where++import Data.Int+import Data.Word++class Narrow8 a where+  type Narrowed8 a+  narrow8 :: a -> Narrowed8 a++instance Narrow8 Word8 where+  type Narrowed8 Word8 = Word8+  narrow8 = fromIntegral+  {-# INLINE narrow8 #-}++instance Narrow8 Word16 where+  type Narrowed8 Word16 = Word8+  narrow8 = fromIntegral+  {-# INLINE narrow8 #-}++instance Narrow8 Word32 where+  type Narrowed8 Word32 = Word8+  narrow8 = fromIntegral+  {-# INLINE narrow8 #-}++instance Narrow8 Word64 where+  type Narrowed8 Word64 = Word8+  narrow8 = fromIntegral+  {-# INLINE narrow8 #-}++instance Narrow8 Int8 where+  type Narrowed8 Int8 = Int8+  narrow8 = fromIntegral+  {-# INLINE narrow8 #-}++instance Narrow8 Int16 where+  type Narrowed8 Int16 = Int8+  narrow8 = fromIntegral+  {-# INLINE narrow8 #-}++instance Narrow8 Int32 where+  type Narrowed8 Int32 = Int8+  narrow8 = fromIntegral+  {-# INLINE narrow8 #-}++instance Narrow8 Int64 where+  type Narrowed8 Int64 = Int8+  narrow8 = fromIntegral+  {-# INLINE narrow8 #-}
+ src/HaskellWorks/Data/Int/Widen.hs view
@@ -0,0 +1,8 @@+module HaskellWorks.Data.Int.Widen+  ( module X+  ) where++import HaskellWorks.Data.Int.Widen.Widen8  as X+import HaskellWorks.Data.Int.Widen.Widen16 as X+import HaskellWorks.Data.Int.Widen.Widen32 as X+import HaskellWorks.Data.Int.Widen.Widen64 as X
+ src/HaskellWorks/Data/Int/Widen/Widen16.hs view
@@ -0,0 +1,32 @@+{-# LANGUAGE TypeFamilies #-}++module HaskellWorks.Data.Int.Widen.Widen16+  ( Widen16(..)+  ) where++import Data.Int+import Data.Word++class Widen16 a where+  type Widened16 a+  widen16 :: a -> Widened16 a++instance Widen16 Word8 where+  type Widened16 Word8 = Word16+  widen16 = fromIntegral+  {-# INLINE widen16 #-}++instance Widen16 Word16 where+  type Widened16 Word16 = Word16+  widen16 = fromIntegral+  {-# INLINE widen16 #-}++instance Widen16 Int8 where+  type Widened16 Int8 = Int16+  widen16 = fromIntegral+  {-# INLINE widen16 #-}++instance Widen16 Int16 where+  type Widened16 Int16 = Int16+  widen16 = fromIntegral+  {-# INLINE widen16 #-}
+ src/HaskellWorks/Data/Int/Widen/Widen32.hs view
@@ -0,0 +1,42 @@+{-# LANGUAGE TypeFamilies #-}++module HaskellWorks.Data.Int.Widen.Widen32+  ( Widen32(..)+  ) where++import Data.Int+import Data.Word++class Widen32 a where+  type Widened32 a+  widen32 :: a -> Widened32 a++instance Widen32 Word8 where+  type Widened32 Word8 = Word32+  widen32 = fromIntegral+  {-# INLINE widen32 #-}++instance Widen32 Word16 where+  type Widened32 Word16 = Word32+  widen32 = fromIntegral+  {-# INLINE widen32 #-}++instance Widen32 Word32 where+  type Widened32 Word32 = Word32+  widen32 = fromIntegral+  {-# INLINE widen32 #-}++instance Widen32 Int8 where+  type Widened32 Int8 = Int32+  widen32 = fromIntegral+  {-# INLINE widen32 #-}++instance Widen32 Int16 where+  type Widened32 Int16 = Int32+  widen32 = fromIntegral+  {-# INLINE widen32 #-}++instance Widen32 Int32 where+  type Widened32 Int32 = Int32+  widen32 = fromIntegral+  {-# INLINE widen32 #-}
+ src/HaskellWorks/Data/Int/Widen/Widen64.hs view
@@ -0,0 +1,52 @@+{-# LANGUAGE TypeFamilies #-}++module HaskellWorks.Data.Int.Widen.Widen64+  ( Widen64(..)+  ) where++import Data.Int+import Data.Word++class Widen64 a where+  type Widened64 a+  widen64 :: a -> Widened64 a++instance Widen64 Word8 where+  type Widened64 Word8 = Word64+  widen64 = fromIntegral+  {-# INLINE widen64 #-}++instance Widen64 Word16 where+  type Widened64 Word16 = Word64+  widen64 = fromIntegral+  {-# INLINE widen64 #-}++instance Widen64 Word32 where+  type Widened64 Word32 = Word64+  widen64 = fromIntegral+  {-# INLINE widen64 #-}++instance Widen64 Word64 where+  type Widened64 Word64 = Word64+  widen64 = id+  {-# INLINE widen64 #-}++instance Widen64 Int8 where+  type Widened64 Int8 = Int64+  widen64 = fromIntegral+  {-# INLINE widen64 #-}++instance Widen64 Int16 where+  type Widened64 Int16 = Int64+  widen64 = fromIntegral+  {-# INLINE widen64 #-}++instance Widen64 Int32 where+  type Widened64 Int32 = Int64+  widen64 = fromIntegral+  {-# INLINE widen64 #-}++instance Widen64 Int64 where+  type Widened64 Int64 = Int64+  widen64 = id+  {-# INLINE widen64 #-}
+ src/HaskellWorks/Data/Int/Widen/Widen8.hs view
@@ -0,0 +1,22 @@+{-# LANGUAGE TypeFamilies #-}++module HaskellWorks.Data.Int.Widen.Widen8+  ( Widen8(..)+  ) where++import Data.Int+import Data.Word++class Widen8 a where+  type Widened8 a+  widen8 :: a -> Widened8 a++instance Widen8 Word8 where+  type Widened8 Word8 = Word8+  widen8 = fromIntegral+  {-# INLINE widen8 #-}++instance Widen8 Int8 where+  type Widened8 Int8 = Int8+  widen8 = fromIntegral+  {-# INLINE widen8 #-}