-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Sized types in Haskell. -- @package sized-types @version 0.3.5.1 module Data.Sized.Vector data Vector ix a Vector :: (Array ix a) -> Vector ix a vector :: Bounds ix => ix -> [a] -> Vector ix a class Ix ix => Bounds ix toBounds :: Bounds ix => ix -> (ix, ix) fromBounds :: Bounds ix => (ix, ix) -> ix range :: Bounds ix => (ix, ix) -> [ix] (!) :: Bounds ix => Vector ix a -> ix -> a toList :: Bounds ix => Vector ix a -> [a] assocs :: Bounds ix => Vector ix a -> [(ix, a)] size :: Bounds ix => Vector ix a -> ix bounds :: Bounds s => Vector s a -> (s, s) indices :: Bounds ix => Vector ix a -> [ix] ixmap :: (Bounds i, Bounds j) => i -> (i -> j) -> Vector j a -> Vector i a transpose :: (Bounds x, Bounds y) => Vector (x, y) a -> Vector (y, x) a identity :: (Bounds ix, Num a) => ix -> Vector (ix, ix) a rows :: (Bounds x, Bounds y) => Vector (x, y) a -> Vector x (Vector y a) cols :: (Bounds x, Bounds y) => Vector (x, y) a -> Vector y (Vector x a) above :: (Bounds x, Bounds y, Num x, Num y) => Vector (x, y) a -> Vector (x, y) a -> Vector (x, y) a beside :: (Bounds x, Bounds y, Num x, Num y) => Vector (x, y) a -> Vector (x, y) a -> Vector (x, y) a show' :: (Bounds ix, Show a) => Vector (ix, ix) a -> String foo :: (Bounds ix1, Bounds ix, Show a) => Vector (ix, ix1) a -> [[String]] seeIn2D :: (Bounds ix, Num ix) => Vector ix a -> Vector (ix, ix) a showMatrix' :: Bounds ix => (ix, ix) -> [[String]] -> String instance [overlap ok] (Show a, Bounds ix, Num ix) => Show (Vector ix a) instance [overlap ok] (Show a, Bounds ix) => Show (Vector (ix, ix) a) instance [overlap ok] (Bounds a, Bounds b) => Bounds (a, b) instance [overlap ok] Bounds Int instance [overlap ok] Bounds ix => Functor (Vector ix) -- | Basic type-level arithmetic, using base two. -- -- Copyright: (c) 2009 University of Kansas License: BSD3 -- -- Maintainer: Andy Gill andygill@ku.edu Stability: unstable -- Portability: ghc module Data.Sized.Arith data N1 data X0 X0 :: X0 data X0_ a X0_ :: Integer -> X0_ a data X1_ a X1_ :: Integer -> X1_ a type SUB a b = ADD a (SUCC (NOT b)) instance Eq X0 instance Ord X0 -- | Sized types X0 to X256. -- -- Copyright: (c) 2009 University of Kansas License: BSD3 -- -- Maintainer: Andy Gill andygill@ku.edu Stability: unstable -- Portability: ghc module Data.Sized.Ix data X0 type X1 = X1_ X0 type X2 = X0_ (X1_ X0) type X3 = X1_ (X1_ X0) type X4 = X0_ (X0_ (X1_ X0)) type X5 = X1_ (X0_ (X1_ X0)) type X6 = X0_ (X1_ (X1_ X0)) type X7 = X1_ (X1_ (X1_ X0)) type X8 = X0_ (X0_ (X0_ (X1_ X0))) type X9 = X1_ (X0_ (X0_ (X1_ X0))) type X10 = X0_ (X1_ (X0_ (X1_ X0))) type X11 = X1_ (X1_ (X0_ (X1_ X0))) type X12 = X0_ (X0_ (X1_ (X1_ X0))) type X13 = X1_ (X0_ (X1_ (X1_ X0))) type X14 = X0_ (X1_ (X1_ (X1_ X0))) type X15 = X1_ (X1_ (X1_ (X1_ X0))) type X16 = X0_ (X0_ (X0_ (X0_ (X1_ X0)))) type X17 = X1_ (X0_ (X0_ (X0_ (X1_ X0)))) type X18 = X0_ (X1_ (X0_ (X0_ (X1_ X0)))) type X19 = X1_ (X1_ (X0_ (X0_ (X1_ X0)))) type X20 = X0_ (X0_ (X1_ (X0_ (X1_ X0)))) type X21 = X1_ (X0_ (X1_ (X0_ (X1_ X0)))) type X22 = X0_ (X1_ (X1_ (X0_ (X1_ X0)))) type X23 = X1_ (X1_ (X1_ (X0_ (X1_ X0)))) type X24 = X0_ (X0_ (X0_ (X1_ (X1_ X0)))) type X25 = X1_ (X0_ (X0_ (X1_ (X1_ X0)))) type X26 = X0_ (X1_ (X0_ (X1_ (X1_ X0)))) type X27 = X1_ (X1_ (X0_ (X1_ (X1_ X0)))) type X28 = X0_ (X0_ (X1_ (X1_ (X1_ X0)))) type X29 = X1_ (X0_ (X1_ (X1_ (X1_ X0)))) type X30 = X0_ (X1_ (X1_ (X1_ (X1_ X0)))) type X31 = X1_ (X1_ (X1_ (X1_ (X1_ X0)))) type X32 = X0_ (X0_ (X0_ (X0_ (X0_ (X1_ X0))))) type X33 = X1_ (X0_ (X0_ (X0_ (X0_ (X1_ X0))))) type X34 = X0_ (X1_ (X0_ (X0_ (X0_ (X1_ X0))))) type X35 = X1_ (X1_ (X0_ (X0_ (X0_ (X1_ X0))))) type X36 = X0_ (X0_ (X1_ (X0_ (X0_ (X1_ X0))))) type X37 = X1_ (X0_ (X1_ (X0_ (X0_ (X1_ X0))))) type X38 = X0_ (X1_ (X1_ (X0_ (X0_ (X1_ X0))))) type X39 = X1_ (X1_ (X1_ (X0_ (X0_ (X1_ X0))))) type X40 = X0_ (X0_ (X0_ (X1_ (X0_ (X1_ X0))))) type X41 = X1_ (X0_ (X0_ (X1_ (X0_ (X1_ X0))))) type X42 = X0_ (X1_ (X0_ (X1_ (X0_ (X1_ X0))))) type X43 = X1_ (X1_ (X0_ (X1_ (X0_ (X1_ X0))))) type X44 = X0_ (X0_ (X1_ (X1_ (X0_ (X1_ X0))))) type X45 = X1_ (X0_ (X1_ (X1_ (X0_ (X1_ X0))))) type X46 = X0_ (X1_ (X1_ (X1_ (X0_ (X1_ X0))))) type X47 = X1_ (X1_ (X1_ (X1_ (X0_ (X1_ X0))))) type X48 = X0_ (X0_ (X0_ (X0_ (X1_ (X1_ X0))))) type X49 = X1_ (X0_ (X0_ (X0_ (X1_ (X1_ X0))))) type X50 = X0_ (X1_ (X0_ (X0_ (X1_ (X1_ X0))))) type X51 = X1_ (X1_ (X0_ (X0_ (X1_ (X1_ X0))))) type X52 = X0_ (X0_ (X1_ (X0_ (X1_ (X1_ X0))))) type X53 = X1_ (X0_ (X1_ (X0_ (X1_ (X1_ X0))))) type X54 = X0_ (X1_ (X1_ (X0_ (X1_ (X1_ X0))))) type X55 = X1_ (X1_ (X1_ (X0_ (X1_ (X1_ X0))))) type X56 = X0_ (X0_ (X0_ (X1_ (X1_ (X1_ X0))))) type X57 = X1_ (X0_ (X0_ (X1_ (X1_ (X1_ X0))))) type X58 = X0_ (X1_ (X0_ (X1_ (X1_ (X1_ X0))))) type X59 = X1_ (X1_ (X0_ (X1_ (X1_ (X1_ X0))))) type X60 = X0_ (X0_ (X1_ (X1_ (X1_ (X1_ X0))))) type X61 = X1_ (X0_ (X1_ (X1_ (X1_ (X1_ X0))))) type X62 = X0_ (X1_ (X1_ (X1_ (X1_ (X1_ X0))))) type X63 = X1_ (X1_ (X1_ (X1_ (X1_ (X1_ X0))))) type X64 = X0_ (X0_ (X0_ (X0_ (X0_ (X0_ (X1_ X0)))))) type X65 = X1_ (X0_ (X0_ (X0_ (X0_ (X0_ (X1_ X0)))))) type X66 = X0_ (X1_ (X0_ (X0_ (X0_ (X0_ (X1_ X0)))))) type X67 = X1_ (X1_ (X0_ (X0_ (X0_ (X0_ (X1_ X0)))))) type X68 = X0_ (X0_ (X1_ (X0_ (X0_ (X0_ (X1_ X0)))))) type X69 = X1_ (X0_ (X1_ (X0_ (X0_ (X0_ (X1_ X0)))))) type X70 = X0_ (X1_ (X1_ (X0_ (X0_ (X0_ (X1_ X0)))))) type X71 = X1_ (X1_ (X1_ (X0_ (X0_ (X0_ (X1_ X0)))))) type X72 = X0_ (X0_ (X0_ (X1_ (X0_ (X0_ (X1_ X0)))))) type X73 = X1_ (X0_ (X0_ (X1_ (X0_ (X0_ (X1_ X0)))))) type X74 = X0_ (X1_ (X0_ (X1_ (X0_ (X0_ (X1_ X0)))))) type X75 = X1_ (X1_ (X0_ (X1_ (X0_ (X0_ (X1_ X0)))))) type X76 = X0_ (X0_ (X1_ (X1_ (X0_ (X0_ (X1_ X0)))))) type X77 = X1_ (X0_ (X1_ (X1_ (X0_ (X0_ (X1_ X0)))))) type X78 = X0_ (X1_ (X1_ (X1_ (X0_ (X0_ (X1_ X0)))))) type X79 = X1_ (X1_ (X1_ (X1_ (X0_ (X0_ (X1_ X0)))))) type X80 = X0_ (X0_ (X0_ (X0_ (X1_ (X0_ (X1_ X0)))))) type X81 = X1_ (X0_ (X0_ (X0_ (X1_ (X0_ (X1_ X0)))))) type X82 = X0_ (X1_ (X0_ (X0_ (X1_ (X0_ (X1_ X0)))))) type X83 = X1_ (X1_ (X0_ (X0_ (X1_ (X0_ (X1_ X0)))))) type X84 = X0_ (X0_ (X1_ (X0_ (X1_ (X0_ (X1_ X0)))))) type X85 = X1_ (X0_ (X1_ (X0_ (X1_ (X0_ (X1_ X0)))))) type X86 = X0_ (X1_ (X1_ (X0_ (X1_ (X0_ (X1_ X0)))))) type X87 = X1_ (X1_ (X1_ (X0_ (X1_ (X0_ (X1_ X0)))))) type X88 = X0_ (X0_ (X0_ (X1_ (X1_ (X0_ (X1_ X0)))))) type X89 = X1_ (X0_ (X0_ (X1_ (X1_ (X0_ (X1_ X0)))))) type X90 = X0_ (X1_ (X0_ (X1_ (X1_ (X0_ (X1_ X0)))))) type X91 = X1_ (X1_ (X0_ (X1_ (X1_ (X0_ (X1_ X0)))))) type X92 = X0_ (X0_ (X1_ (X1_ (X1_ (X0_ (X1_ X0)))))) type X93 = X1_ (X0_ (X1_ (X1_ (X1_ (X0_ (X1_ X0)))))) type X94 = X0_ (X1_ (X1_ (X1_ (X1_ (X0_ (X1_ X0)))))) type X95 = X1_ (X1_ (X1_ (X1_ (X1_ (X0_ (X1_ X0)))))) type X96 = X0_ (X0_ (X0_ (X0_ (X0_ (X1_ (X1_ X0)))))) type X97 = X1_ (X0_ (X0_ (X0_ (X0_ (X1_ (X1_ X0)))))) type X98 = X0_ (X1_ (X0_ (X0_ (X0_ (X1_ (X1_ X0)))))) type X99 = X1_ (X1_ (X0_ (X0_ (X0_ (X1_ (X1_ X0)))))) type X100 = X0_ (X0_ (X1_ (X0_ (X0_ (X1_ (X1_ X0)))))) type X101 = X1_ (X0_ (X1_ (X0_ (X0_ (X1_ (X1_ X0)))))) type X102 = X0_ (X1_ (X1_ (X0_ (X0_ (X1_ (X1_ X0)))))) type X103 = X1_ (X1_ (X1_ (X0_ (X0_ (X1_ (X1_ X0)))))) type X104 = X0_ (X0_ (X0_ (X1_ (X0_ (X1_ (X1_ X0)))))) type X105 = X1_ (X0_ (X0_ (X1_ (X0_ (X1_ (X1_ X0)))))) type X106 = X0_ (X1_ (X0_ (X1_ (X0_ (X1_ (X1_ X0)))))) type X107 = X1_ (X1_ (X0_ (X1_ (X0_ (X1_ (X1_ X0)))))) type X108 = X0_ (X0_ (X1_ (X1_ (X0_ (X1_ (X1_ X0)))))) type X109 = X1_ (X0_ (X1_ (X1_ (X0_ (X1_ (X1_ X0)))))) type X110 = X0_ (X1_ (X1_ (X1_ (X0_ (X1_ (X1_ X0)))))) type X111 = X1_ (X1_ (X1_ (X1_ (X0_ (X1_ (X1_ X0)))))) type X112 = X0_ (X0_ (X0_ (X0_ (X1_ (X1_ (X1_ X0)))))) type X113 = X1_ (X0_ (X0_ (X0_ (X1_ (X1_ (X1_ X0)))))) type X114 = X0_ (X1_ (X0_ (X0_ (X1_ (X1_ (X1_ X0)))))) type X115 = X1_ (X1_ (X0_ (X0_ (X1_ (X1_ (X1_ X0)))))) type X116 = X0_ (X0_ (X1_ (X0_ (X1_ (X1_ (X1_ X0)))))) type X117 = X1_ (X0_ (X1_ (X0_ (X1_ (X1_ (X1_ X0)))))) type X118 = X0_ (X1_ (X1_ (X0_ (X1_ (X1_ (X1_ X0)))))) type X119 = X1_ (X1_ (X1_ (X0_ (X1_ (X1_ (X1_ X0)))))) type X120 = X0_ (X0_ (X0_ (X1_ (X1_ (X1_ (X1_ X0)))))) type X121 = X1_ (X0_ (X0_ (X1_ (X1_ (X1_ (X1_ X0)))))) type X122 = X0_ (X1_ (X0_ (X1_ (X1_ (X1_ (X1_ X0)))))) type X123 = X1_ (X1_ (X0_ (X1_ (X1_ (X1_ (X1_ X0)))))) type X124 = X0_ (X0_ (X1_ (X1_ (X1_ (X1_ (X1_ X0)))))) type X125 = X1_ (X0_ (X1_ (X1_ (X1_ (X1_ (X1_ X0)))))) type X126 = X0_ (X1_ (X1_ (X1_ (X1_ (X1_ (X1_ X0)))))) type X127 = X1_ (X1_ (X1_ (X1_ (X1_ (X1_ (X1_ X0)))))) type X128 = X0_ (X0_ (X0_ (X0_ (X0_ (X0_ (X0_ (X1_ X0))))))) type X129 = X1_ (X0_ (X0_ (X0_ (X0_ (X0_ (X0_ (X1_ X0))))))) type X130 = X0_ (X1_ (X0_ (X0_ (X0_ (X0_ (X0_ (X1_ X0))))))) type X131 = X1_ (X1_ (X0_ (X0_ (X0_ (X0_ (X0_ (X1_ X0))))))) type X132 = X0_ (X0_ (X1_ (X0_ (X0_ (X0_ (X0_ (X1_ X0))))))) type X133 = X1_ (X0_ (X1_ (X0_ (X0_ (X0_ (X0_ (X1_ X0))))))) type X134 = X0_ (X1_ (X1_ (X0_ (X0_ (X0_ (X0_ (X1_ X0))))))) type X135 = X1_ (X1_ (X1_ (X0_ (X0_ (X0_ (X0_ (X1_ X0))))))) type X136 = X0_ (X0_ (X0_ (X1_ (X0_ (X0_ (X0_ (X1_ X0))))))) type X137 = X1_ (X0_ (X0_ (X1_ (X0_ (X0_ (X0_ (X1_ X0))))))) type X138 = X0_ (X1_ (X0_ (X1_ (X0_ (X0_ (X0_ (X1_ X0))))))) type X139 = X1_ (X1_ (X0_ (X1_ (X0_ (X0_ (X0_ (X1_ X0))))))) type X140 = X0_ (X0_ (X1_ (X1_ (X0_ (X0_ (X0_ (X1_ X0))))))) type X141 = X1_ (X0_ (X1_ (X1_ (X0_ (X0_ (X0_ (X1_ X0))))))) type X142 = X0_ (X1_ (X1_ (X1_ (X0_ (X0_ (X0_ (X1_ X0))))))) type X143 = X1_ (X1_ (X1_ (X1_ (X0_ (X0_ (X0_ (X1_ X0))))))) type X144 = X0_ (X0_ (X0_ (X0_ (X1_ (X0_ (X0_ (X1_ X0))))))) type X145 = X1_ (X0_ (X0_ (X0_ (X1_ (X0_ (X0_ (X1_ X0))))))) type X146 = X0_ (X1_ (X0_ (X0_ (X1_ (X0_ (X0_ (X1_ X0))))))) type X147 = X1_ (X1_ (X0_ (X0_ (X1_ (X0_ (X0_ (X1_ X0))))))) type X148 = X0_ (X0_ (X1_ (X0_ (X1_ (X0_ (X0_ (X1_ X0))))))) type X149 = X1_ (X0_ (X1_ (X0_ (X1_ (X0_ (X0_ (X1_ X0))))))) type X150 = X0_ (X1_ (X1_ (X0_ (X1_ (X0_ (X0_ (X1_ X0))))))) type X151 = X1_ (X1_ (X1_ (X0_ (X1_ (X0_ (X0_ (X1_ X0))))))) type X152 = X0_ (X0_ (X0_ (X1_ (X1_ (X0_ (X0_ (X1_ X0))))))) type X153 = X1_ (X0_ (X0_ (X1_ (X1_ (X0_ (X0_ (X1_ X0))))))) type X154 = X0_ (X1_ (X0_ (X1_ (X1_ (X0_ (X0_ (X1_ X0))))))) type X155 = X1_ (X1_ (X0_ (X1_ (X1_ (X0_ (X0_ (X1_ X0))))))) type X156 = X0_ (X0_ (X1_ (X1_ (X1_ (X0_ (X0_ (X1_ X0))))))) type X157 = X1_ (X0_ (X1_ (X1_ (X1_ (X0_ (X0_ (X1_ X0))))))) type X158 = X0_ (X1_ (X1_ (X1_ (X1_ (X0_ (X0_ (X1_ X0))))))) type X159 = X1_ (X1_ (X1_ (X1_ (X1_ (X0_ (X0_ (X1_ X0))))))) type X160 = X0_ (X0_ (X0_ (X0_ (X0_ (X1_ (X0_ (X1_ X0))))))) type X161 = X1_ (X0_ (X0_ (X0_ (X0_ (X1_ (X0_ (X1_ X0))))))) type X162 = X0_ (X1_ (X0_ (X0_ (X0_ (X1_ (X0_ (X1_ X0))))))) type X163 = X1_ (X1_ (X0_ (X0_ (X0_ (X1_ (X0_ (X1_ X0))))))) type X164 = X0_ (X0_ (X1_ (X0_ (X0_ (X1_ (X0_ (X1_ X0))))))) type X165 = X1_ (X0_ (X1_ (X0_ (X0_ (X1_ (X0_ (X1_ X0))))))) type X166 = X0_ (X1_ (X1_ (X0_ (X0_ (X1_ (X0_ (X1_ X0))))))) type X167 = X1_ (X1_ (X1_ (X0_ (X0_ (X1_ (X0_ (X1_ X0))))))) type X168 = X0_ (X0_ (X0_ (X1_ (X0_ (X1_ (X0_ (X1_ X0))))))) type X169 = X1_ (X0_ (X0_ (X1_ (X0_ (X1_ (X0_ (X1_ X0))))))) type X170 = X0_ (X1_ (X0_ (X1_ (X0_ (X1_ (X0_ (X1_ X0))))))) type X171 = X1_ (X1_ (X0_ (X1_ (X0_ (X1_ (X0_ (X1_ X0))))))) type X172 = X0_ (X0_ (X1_ (X1_ (X0_ (X1_ (X0_ (X1_ X0))))))) type X173 = X1_ (X0_ (X1_ (X1_ (X0_ (X1_ (X0_ (X1_ X0))))))) type X174 = X0_ (X1_ (X1_ (X1_ (X0_ (X1_ (X0_ (X1_ X0))))))) type X175 = X1_ (X1_ (X1_ (X1_ (X0_ (X1_ (X0_ (X1_ X0))))))) type X176 = X0_ (X0_ (X0_ (X0_ (X1_ (X1_ (X0_ (X1_ X0))))))) type X177 = X1_ (X0_ (X0_ (X0_ (X1_ (X1_ (X0_ (X1_ X0))))))) type X178 = X0_ (X1_ (X0_ (X0_ (X1_ (X1_ (X0_ (X1_ X0))))))) type X179 = X1_ (X1_ (X0_ (X0_ (X1_ (X1_ (X0_ (X1_ X0))))))) type X180 = X0_ (X0_ (X1_ (X0_ (X1_ (X1_ (X0_ (X1_ X0))))))) type X181 = X1_ (X0_ (X1_ (X0_ (X1_ (X1_ (X0_ (X1_ X0))))))) type X182 = X0_ (X1_ (X1_ (X0_ (X1_ (X1_ (X0_ (X1_ X0))))))) type X183 = X1_ (X1_ (X1_ (X0_ (X1_ (X1_ (X0_ (X1_ X0))))))) type X184 = X0_ (X0_ (X0_ (X1_ (X1_ (X1_ (X0_ (X1_ X0))))))) type X185 = X1_ (X0_ (X0_ (X1_ (X1_ (X1_ (X0_ (X1_ X0))))))) type X186 = X0_ (X1_ (X0_ (X1_ (X1_ (X1_ (X0_ (X1_ X0))))))) type X187 = X1_ (X1_ (X0_ (X1_ (X1_ (X1_ (X0_ (X1_ X0))))))) type X188 = X0_ (X0_ (X1_ (X1_ (X1_ (X1_ (X0_ (X1_ X0))))))) type X189 = X1_ (X0_ (X1_ (X1_ (X1_ (X1_ (X0_ (X1_ X0))))))) type X190 = X0_ (X1_ (X1_ (X1_ (X1_ (X1_ (X0_ (X1_ X0))))))) type X191 = X1_ (X1_ (X1_ (X1_ (X1_ (X1_ (X0_ (X1_ X0))))))) type X192 = X0_ (X0_ (X0_ (X0_ (X0_ (X0_ (X1_ (X1_ X0))))))) type X193 = X1_ (X0_ (X0_ (X0_ (X0_ (X0_ (X1_ (X1_ X0))))))) type X194 = X0_ (X1_ (X0_ (X0_ (X0_ (X0_ (X1_ (X1_ X0))))))) type X195 = X1_ (X1_ (X0_ (X0_ (X0_ (X0_ (X1_ (X1_ X0))))))) type X196 = X0_ (X0_ (X1_ (X0_ (X0_ (X0_ (X1_ (X1_ X0))))))) type X197 = X1_ (X0_ (X1_ (X0_ (X0_ (X0_ (X1_ (X1_ X0))))))) type X198 = X0_ (X1_ (X1_ (X0_ (X0_ (X0_ (X1_ (X1_ X0))))))) type X199 = X1_ (X1_ (X1_ (X0_ (X0_ (X0_ (X1_ (X1_ X0))))))) type X200 = X0_ (X0_ (X0_ (X1_ (X0_ (X0_ (X1_ (X1_ X0))))))) type X201 = X1_ (X0_ (X0_ (X1_ (X0_ (X0_ (X1_ (X1_ X0))))))) type X202 = X0_ (X1_ (X0_ (X1_ (X0_ (X0_ (X1_ (X1_ X0))))))) type X203 = X1_ (X1_ (X0_ (X1_ (X0_ (X0_ (X1_ (X1_ X0))))))) type X204 = X0_ (X0_ (X1_ (X1_ (X0_ (X0_ (X1_ (X1_ X0))))))) type X205 = X1_ (X0_ (X1_ (X1_ (X0_ (X0_ (X1_ (X1_ X0))))))) type X206 = X0_ (X1_ (X1_ (X1_ (X0_ (X0_ (X1_ (X1_ X0))))))) type X207 = X1_ (X1_ (X1_ (X1_ (X0_ (X0_ (X1_ (X1_ X0))))))) type X208 = X0_ (X0_ (X0_ (X0_ (X1_ (X0_ (X1_ (X1_ X0))))))) type X209 = X1_ (X0_ (X0_ (X0_ (X1_ (X0_ (X1_ (X1_ X0))))))) type X210 = X0_ (X1_ (X0_ (X0_ (X1_ (X0_ (X1_ (X1_ X0))))))) type X211 = X1_ (X1_ (X0_ (X0_ (X1_ (X0_ (X1_ (X1_ X0))))))) type X212 = X0_ (X0_ (X1_ (X0_ (X1_ (X0_ (X1_ (X1_ X0))))))) type X213 = X1_ (X0_ (X1_ (X0_ (X1_ (X0_ (X1_ (X1_ X0))))))) type X214 = X0_ (X1_ (X1_ (X0_ (X1_ (X0_ (X1_ (X1_ X0))))))) type X215 = X1_ (X1_ (X1_ (X0_ (X1_ (X0_ (X1_ (X1_ X0))))))) type X216 = X0_ (X0_ (X0_ (X1_ (X1_ (X0_ (X1_ (X1_ X0))))))) type X217 = X1_ (X0_ (X0_ (X1_ (X1_ (X0_ (X1_ (X1_ X0))))))) type X218 = X0_ (X1_ (X0_ (X1_ (X1_ (X0_ (X1_ (X1_ X0))))))) type X219 = X1_ (X1_ (X0_ (X1_ (X1_ (X0_ (X1_ (X1_ X0))))))) type X220 = X0_ (X0_ (X1_ (X1_ (X1_ (X0_ (X1_ (X1_ X0))))))) type X221 = X1_ (X0_ (X1_ (X1_ (X1_ (X0_ (X1_ (X1_ X0))))))) type X222 = X0_ (X1_ (X1_ (X1_ (X1_ (X0_ (X1_ (X1_ X0))))))) type X223 = X1_ (X1_ (X1_ (X1_ (X1_ (X0_ (X1_ (X1_ X0))))))) type X224 = X0_ (X0_ (X0_ (X0_ (X0_ (X1_ (X1_ (X1_ X0))))))) type X225 = X1_ (X0_ (X0_ (X0_ (X0_ (X1_ (X1_ (X1_ X0))))))) type X226 = X0_ (X1_ (X0_ (X0_ (X0_ (X1_ (X1_ (X1_ X0))))))) type X227 = X1_ (X1_ (X0_ (X0_ (X0_ (X1_ (X1_ (X1_ X0))))))) type X228 = X0_ (X0_ (X1_ (X0_ (X0_ (X1_ (X1_ (X1_ X0))))))) type X229 = X1_ (X0_ (X1_ (X0_ (X0_ (X1_ (X1_ (X1_ X0))))))) type X230 = X0_ (X1_ (X1_ (X0_ (X0_ (X1_ (X1_ (X1_ X0))))))) type X231 = X1_ (X1_ (X1_ (X0_ (X0_ (X1_ (X1_ (X1_ X0))))))) type X232 = X0_ (X0_ (X0_ (X1_ (X0_ (X1_ (X1_ (X1_ X0))))))) type X233 = X1_ (X0_ (X0_ (X1_ (X0_ (X1_ (X1_ (X1_ X0))))))) type X234 = X0_ (X1_ (X0_ (X1_ (X0_ (X1_ (X1_ (X1_ X0))))))) type X235 = X1_ (X1_ (X0_ (X1_ (X0_ (X1_ (X1_ (X1_ X0))))))) type X236 = X0_ (X0_ (X1_ (X1_ (X0_ (X1_ (X1_ (X1_ X0))))))) type X237 = X1_ (X0_ (X1_ (X1_ (X0_ (X1_ (X1_ (X1_ X0))))))) type X238 = X0_ (X1_ (X1_ (X1_ (X0_ (X1_ (X1_ (X1_ X0))))))) type X239 = X1_ (X1_ (X1_ (X1_ (X0_ (X1_ (X1_ (X1_ X0))))))) type X240 = X0_ (X0_ (X0_ (X0_ (X1_ (X1_ (X1_ (X1_ X0))))))) type X241 = X1_ (X0_ (X0_ (X0_ (X1_ (X1_ (X1_ (X1_ X0))))))) type X242 = X0_ (X1_ (X0_ (X0_ (X1_ (X1_ (X1_ (X1_ X0))))))) type X243 = X1_ (X1_ (X0_ (X0_ (X1_ (X1_ (X1_ (X1_ X0))))))) type X244 = X0_ (X0_ (X1_ (X0_ (X1_ (X1_ (X1_ (X1_ X0))))))) type X245 = X1_ (X0_ (X1_ (X0_ (X1_ (X1_ (X1_ (X1_ X0))))))) type X246 = X0_ (X1_ (X1_ (X0_ (X1_ (X1_ (X1_ (X1_ X0))))))) type X247 = X1_ (X1_ (X1_ (X0_ (X1_ (X1_ (X1_ (X1_ X0))))))) type X248 = X0_ (X0_ (X0_ (X1_ (X1_ (X1_ (X1_ (X1_ X0))))))) type X249 = X1_ (X0_ (X0_ (X1_ (X1_ (X1_ (X1_ (X1_ X0))))))) type X250 = X0_ (X1_ (X0_ (X1_ (X1_ (X1_ (X1_ (X1_ X0))))))) type X251 = X1_ (X1_ (X0_ (X1_ (X1_ (X1_ (X1_ (X1_ X0))))))) type X252 = X0_ (X0_ (X1_ (X1_ (X1_ (X1_ (X1_ (X1_ X0))))))) type X253 = X1_ (X0_ (X1_ (X1_ (X1_ (X1_ (X1_ (X1_ X0))))))) type X254 = X0_ (X1_ (X1_ (X1_ (X1_ (X1_ (X1_ (X1_ X0))))))) type X255 = X1_ (X1_ (X1_ (X1_ (X1_ (X1_ (X1_ (X1_ X0))))))) type X256 = X0_ (X0_ (X0_ (X0_ (X0_ (X0_ (X0_ (X0_ (X1_ X0)))))))) class (Eq ix, Ord ix, Show ix, Ix ix, Bounded ix) => Size ix size :: Size ix => ix -> Int addIndex :: Size ix => ix -> Index ix -> ix toIndex :: Size ix => ix -> Index ix -- | A list of all possible indices. Unlike indices in Matrix, -- this does not need the Matrix argument, because the types -- determine the contents. all :: Size i => [i] -- | A good way of converting from one index type to another index type, -- typically in another base. coerceSize :: (Index ix1 ~ Index ix2, Size ix1, Size ix2, Num ix2) => ix1 -> ix2 type SUB a b = ADD a (SUCC (NOT b)) instance Show X0 instance Ix X0 instance Bounded X0 instance Show (X1_ a) instance Size a => Num (X1_ a) instance Size a => Enum (X1_ a) instance Size a => Ix (X1_ a) instance Ord (X1_ a) instance Eq (X1_ a) instance Show (X0_ a) instance Size a => Num (X0_ a) instance Size a => Enum (X0_ a) instance Size a => Ix (X0_ a) instance Ord (X0_ a) instance Eq (X0_ a) instance (Size a, Size (X0_ a), Integral a) => Integral (X0_ a) instance Size a => Real (X0_ a) instance Size a => Size (X0_ a) instance Size a => Bounded (X0_ a) instance Size a => Size (X1_ a) instance (Size a, Size (X1_ a), Integral a) => Integral (X1_ a) instance Size a => Real (X1_ a) instance Size a => Bounded (X1_ a) instance Num X0 instance Enum X0 instance Real X0 instance Integral X0 instance Size X0 instance (Size x, Size y, Size z, Size z2) => Size (x, y, z, z2) instance (Size x, Size y, Size z) => Size (x, y, z) instance (Size x, Size y) => Size (x, y) instance Size () -- | Sized matrixes. -- -- Copyright: (c) 2009 University of Kansas License: BSD3 -- -- Maintainer: Andy Gill andygill@ku.edu Stability: unstable -- Portability: ghc module Data.Sized.Matrix -- | A Matrix is an array with the sized determined uniquely by the -- type of the index type, ix. data Matrix ix a Matrix :: (Array ix a) -> Matrix ix a NullMatrix :: Matrix ix a -- | ! looks up an element in the matrix. (!) :: Size n => Matrix n a -> n -> a -- | toList turns a matrix into an always finite list. toList :: Size i => Matrix i a -> [a] -- | fromList turns a finite list into a matrix. You often need to -- give the type of the result. fromList :: Size i => [a] -> Matrix i a -- | matrix turns a finite list into a matrix. You often need to -- give the type of the result. matrix :: Size i => [a] -> Matrix i a -- | indices is a version of all that takes a type, for -- forcing the result type using the Matrix type. indices :: Size i => Matrix i a -> [i] -- | what is the length of a matrix? length :: Size i => Matrix i a -> Int -- | assocs extracts the index/value pairs. assocs :: Size i => Matrix i a -> [(i, a)] (//) :: Size i => Matrix i e -> [(i, e)] -> Matrix i e accum :: Size i => (e -> a -> e) -> Matrix i e -> [(i, a)] -> Matrix i e -- | zeroOf is for use to force typing issues, and is 0. zeroOf :: Size i => Matrix i a -> i -- | coord returns a matrix filled with indexes. coord :: Size i => Matrix i i -- | Same as for lists. zipWith :: Size i => (a -> b -> c) -> Matrix i a -> Matrix i b -> Matrix i c -- | forEach takes a matrix, and calls a function for each element, -- to give a new matrix of the same size. forEach :: Size i => Matrix i a -> (i -> a -> b) -> Matrix i b -- | forAll creates a matrix out of a mapping from the coordinates. forAll :: Size i => (i -> a) -> Matrix i a -- | mm is the 2D matrix multiply. mm :: (Size m, Size n, Size m', Size n', n ~ m', Num a) => Matrix (m, n) a -> Matrix (m', n') a -> Matrix (m, n') a -- | transpose a 2D matrix. transpose :: (Size x, Size y) => Matrix (x, y) a -> Matrix (y, x) a -- | return the identity for a specific matrix size. identity :: (Size x, Num a) => Matrix (x, x) a -- | stack two matrixes above each other. above :: (Size m, Size top, Size bottom, Size both, ADD top bottom ~ both, SUB both top ~ bottom, SUB both bottom ~ top) => Matrix (top, m) a -> Matrix (bottom, m) a -> Matrix (both, m) a -- | stack two matrixes beside each other. beside :: (Size m, Size left, Size right, Size both, ADD left right ~ both, SUB both left ~ right, SUB both right ~ left) => Matrix (m, left) a -> Matrix (m, right) a -> Matrix (m, both) a -- | append two 1-d matrixes append :: (Size left, Size right, Size both, ADD left right ~ both, SUB both left ~ right, SUB both right ~ left) => Matrix left a -> Matrix right a -> Matrix both a -- | look at a matrix through a lens to another matrix. ixmap :: (Size i, Size j) => (i -> j) -> Matrix j a -> Matrix i a -- | look at a matrix through a functor lens, to another matrix. ixfmap :: (Size i, Size j, Functor f) => (i -> f j) -> Matrix j a -> Matrix i (f a) -- | grab part of a matrix. cropAt :: (Index i ~ Index ix, Size i, Size ix) => Matrix ix a -> ix -> Matrix i a -- | slice a 2D matrix into rows. rows :: (Bounded n, Size n, Bounded m, Size m) => Matrix (m, n) a -> Matrix m (Matrix n a) -- | slice a 2D matrix into columns. columns :: (Bounded n, Size n, Bounded m, Size m) => Matrix (m, n) a -> Matrix n (Matrix m a) -- | join a matrix of matrixes into a single matrix. joinRows :: (Bounded n, Size n, Bounded m, Size m) => Matrix m (Matrix n a) -> Matrix (m, n) a -- | join a matrix of matrixes into a single matrix. joinColumns :: (Bounded n, Size n, Bounded m, Size m) => Matrix n (Matrix m a) -> Matrix (m, n) a -- | generate a 2D single row from a 1D matrix. unitRow :: (Size m, Bounded m) => Matrix m a -> Matrix (X1, m) a -- | generate a 1D matrix from a 2D matrix. unRow :: (Size m, Bounded m) => Matrix (X1, m) a -> Matrix m a -- | generate a 2D single column from a 1D matrix. unitColumn :: (Size m, Bounded m) => Matrix m a -> Matrix (m, X1) a -- | generate a 1D matrix from a 2D matrix. unColumn :: (Size m, Bounded m) => Matrix (m, X1) a -> Matrix m a -- | very general; required that m and n have the same number of elements, -- rebundle please. squash :: (Size n, Size m) => Matrix m a -> Matrix n a -- | showMatrix displays a 2D matrix, and is the worker for -- show. -- --
--   GHCi> matrix [1..42] :: Matrix (X7,X6) Int
--   [  1,  2,  3,  4,  5,  6,
--      7,  8,  9, 10, 11, 12,
--     13, 14, 15, 16, 17, 18,
--     19, 20, 21, 22, 23, 24,
--     25, 26, 27, 28, 29, 30,
--     31, 32, 33, 34, 35, 36,
--     37, 38, 39, 40, 41, 42 ]
--   
showMatrix :: (Size n, Size m) => Matrix (m, n) String -> String -- | S is shown as the contents, without the quotes. One use is a -- matrix of S, so that you can do show-style functions using fmap. newtype S S :: String -> S showAsE :: RealFloat a => Int -> a -> S showAsF :: RealFloat a => Int -> a -> S scanM :: (Size ix, Bounded ix, Enum ix) => ((left, a, right) -> (right, b, left)) -> (left, Matrix ix a, right) -> (right, Matrix ix b, left) scanL :: (Size ix, Bounded ix, Enum ix) => ((a, right) -> (right, b)) -> (Matrix ix a, right) -> (right, Matrix ix b) scanR :: (Size ix, Bounded ix, Enum ix) => ((left, a) -> (b, left)) -> (left, Matrix ix a) -> (Matrix ix b, left) instance (Eq a, Ix ix) => Eq (Matrix ix a) instance (Ord a, Ix ix) => Ord (Matrix ix a) instance Show S instance (Show a, Size ix) => Show (Matrix ix a) instance Size ix => Foldable (Matrix ix) instance Size ix => Traversable (Matrix ix) instance Size i => Applicative (Matrix i) instance Size i => Functor (Matrix i) -- | Sparse Matrix. -- -- Copyright: (c) 2009 University of Kansas License: BSD3 -- -- Maintainer: Andy Gill andygill@ku.edu Stability: unstable -- Portability: ghc module Data.Sized.Sparse.Matrix data Matrix ix a Matrix :: a -> (Map ix a) -> Matrix ix a fromAssocList :: (Ord i, Eq a) => a -> [(i, a)] -> Matrix i a toAssocList :: (Matrix i a) -> (a, [(i, a)]) -- | ! looks up an element in the sparse matrix. If the element is -- not found in the sparse matrix, ! returns the default value. (!) :: Ord ix => Matrix ix a -> ix -> a fill :: Size ix => Matrix ix a -> Matrix ix a prune :: (Size ix, Eq a) => a -> Matrix ix a -> Matrix ix a -- | Make a Matrix sparse, with a default zero value. sparse :: (Size ix, Eq a) => a -> Matrix ix a -> Matrix ix a mm :: (Size m, Size n, Size m', Size n', n ~ m', Eq a, Num a) => Matrix (m, n) a -> Matrix (m', n') a -> Matrix (m, n') a rowSets :: (Size a, Ord b) => Set (a, b) -> Matrix a (Set b) columnSets :: (Size b, Ord a) => Set (a, b) -> Matrix b (Set a) transpose :: (Size x, Size y, Eq a) => Matrix (x, y) a -> Matrix (y, x) a zipWith :: Size x => (a -> b -> c) -> Matrix x a -> Matrix x b -> Matrix x c instance (Show a, Size ix) => Show (Matrix ix a) instance Size i => Applicative (Matrix i) instance Functor (Matrix ix) -- | Signed, fixed sized numbers. -- -- Copyright: (c) 2009 University of Kansas License: BSD3 -- -- Maintainer: Andy Gill andygill@ku.edu Stability: unstable -- Portability: ghc module Data.Sized.Signed data Signed ix toMatrix :: Size ix => Signed ix -> Matrix ix Bool fromMatrix :: Size ix => Matrix ix Bool -> Signed ix type S2 = Signed X2 type S3 = Signed X3 type S4 = Signed X4 type S5 = Signed X5 type S6 = Signed X6 type S7 = Signed X7 type S8 = Signed X8 type S9 = Signed X9 type S10 = Signed X10 type S11 = Signed X11 type S12 = Signed X12 type S13 = Signed X13 type S14 = Signed X14 type S15 = Signed X15 type S16 = Signed X16 type S17 = Signed X17 type S18 = Signed X18 type S19 = Signed X19 type S20 = Signed X20 type S21 = Signed X21 type S22 = Signed X22 type S23 = Signed X23 type S24 = Signed X24 type S25 = Signed X25 type S26 = Signed X26 type S27 = Signed X27 type S28 = Signed X28 type S29 = Signed X29 type S30 = Signed X30 type S31 = Signed X31 type S32 = Signed X32 instance Size ix => Bounded (Signed ix) instance (Size ix, Integral ix) => Bits (Signed ix) instance Size ix => Enum (Signed ix) instance Size ix => Real (Signed ix) instance Size ix => Num (Signed ix) instance Size ix => Integral (Signed ix) instance (Enum ix, Size ix) => Read (Signed ix) instance Size ix => Show (Signed ix) instance Size ix => Ord (Signed ix) instance Size ix => Eq (Signed ix) -- | Unsigned, fixed sized numbers. -- -- Copyright: (c) 2009 University of Kansas License: BSD3 -- -- Maintainer: Andy Gill andygill@ku.edu Stability: unstable -- Portability: ghc module Data.Sized.Unsigned data Unsigned ix toMatrix :: Size ix => Unsigned ix -> Matrix ix Bool fromMatrix :: Size ix => Matrix ix Bool -> Unsigned ix -- | common; numerically boolean. type U1 = Unsigned X1 type U2 = Unsigned X2 type U3 = Unsigned X3 type U4 = Unsigned X4 type U5 = Unsigned X5 type U6 = Unsigned X6 type U7 = Unsigned X7 type U8 = Unsigned X8 type U9 = Unsigned X9 type U10 = Unsigned X10 type U11 = Unsigned X11 type U12 = Unsigned X12 type U13 = Unsigned X13 type U14 = Unsigned X14 type U15 = Unsigned X15 type U16 = Unsigned X16 type U17 = Unsigned X17 type U18 = Unsigned X18 type U19 = Unsigned X19 type U20 = Unsigned X20 type U21 = Unsigned X21 type U22 = Unsigned X22 type U23 = Unsigned X23 type U24 = Unsigned X24 type U25 = Unsigned X25 type U26 = Unsigned X26 type U27 = Unsigned X27 type U28 = Unsigned X28 type U29 = Unsigned X29 type U30 = Unsigned X30 type U31 = Unsigned X31 type U32 = Unsigned X32 instance Size ix => Size (Unsigned ix) instance Size ix => Ix (Unsigned ix) instance Size ix => Bounded (Unsigned ix) instance (Size ix, Integral ix) => Bits (Unsigned ix) instance Size ix => Enum (Unsigned ix) instance Size ix => Real (Unsigned ix) instance Size ix => Num (Unsigned ix) instance Size ix => Integral (Unsigned ix) instance Size ix => Read (Unsigned ix) instance Size ix => Show (Unsigned ix) instance Size ix => Ord (Unsigned ix) instance Size ix => Eq (Unsigned ix) module Data.Sized.Sampled data Sampled m n Sampled :: (Signed n) -> Rational -> Sampled m n toMatrix :: Size n => Sampled m n -> Matrix n Bool fromMatrix :: (Size n, Size m) => Matrix n Bool -> Sampled m n mkSampled :: (Size n, Size m) => Rational -> Sampled m n instance (Size ix, Size m) => Enum (Sampled m ix) instance (Size ix, Size m) => Fractional (Sampled m ix) instance (Size ix, Size m) => Real (Sampled m ix) instance (Size ix, Size m) => Num (Sampled m ix) instance (Size ix, Size m) => Read (Sampled m ix) instance Size ix => Show (Sampled m ix) instance Size ix => Ord (Sampled m ix) instance Size ix => Eq (Sampled m ix)