-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Sized types in Haskell. -- -- Providing indices, matrixes, sparse matrixes, and signed and unsigned -- bit vectors. @package sized-types @version 0.1 -- | 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_ :: Int -> X0_ a data X1_ a X1_ :: Int -> X1_ a type SUB a b = ADD a (SUCC (NOT b)) instance Eq X0 instance Ord X0 instance Show X0 instance Ix X0 instance Bounded X0 instance Show (X1_ a) instance Num (X1_ a) instance Enum (X1_ a) instance Ix (X1_ a) instance Ord (X1_ a) instance Eq (X1_ a) instance Show (X0_ a) instance Num (X0_ a) instance Enum (X0_ a) instance Ix (X0_ a) instance Ord (X0_ a) instance Eq (X0_ a) -- | 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 seeIn2D :: (Size ix) => (Row ix, Column ix) -> 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 (Size a) => Size (X0_ a) instance (Size a) => Bounded (X0_ a) instance (Size a) => Size (X1_ a) instance (Size a) => Bounded (X1_ a) 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) -- | 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 -- | ! 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 -- | 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 showAs :: (RealFloat a) => Int -> a -> S instance (Eq a, Ix ix) => Eq (Matrix ix a) instance Show S instance (Show a, Size ix, Size (Row ix), Size (Column 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 :: (Size i, Eq a) => a -> [(i, a)] -> Matrix i a -- | ! looks up an element in the sparse matrix. If the element is -- not found in the sparse matrix, ! returns the default value. (!) :: (Size 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', 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, Size (Row ix), Size (Column 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 instance (Size 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 (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 instance (Size 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) => Show (Unsigned ix) instance (Size ix) => Ord (Unsigned ix) instance (Size ix) => Eq (Unsigned ix)