haskelldb-2.2.4: A library of combinators for generating and executing SQL statements.

Copyright | HWT Group (c) 2003, haskelldb-users@lists.sourceforge.net
License | BSD-style
Maintainer | haskelldb-users@lists.sourceforge.net
Stability | experimental
Portability | non-portable
Safe Haskell | None
Language | Haskell98

Database.HaskellDB.BoundedList

Description

The main idea of bounded lists is to create lists with predetermined maximum size.

BoundedList is a simple, fast and type safe approach to implementing this idea. The implementation is based on inductive instances, making it very easy to expand with new bounds. A new bound only requires one instance of size and two instances of Less.

BoundedList works as follows. Every bound is build up by declaring a data-type representing the new bound. The instance of size only returns the size as an Int. The first instance of Less is for telling the typechecker that this bound is greater than the largest smaller bound. The second instance of Less is used by the typechecker to construct a chain of instances if there is no hardcoded instance available. This way the type checker can determine if a bound is smaller/greater then any other bound.

This inductive approach gives the complexity O(n) on the number of instances and very short type checking times compared to an O(n^2) implementation.

BoundedList also comes with a few utility function for manipulation an contructing bounded lists.

To be noted: Since each bound is a unique type: Explicit shrink and/or grow is needed before using (==). BoundedList does not have an instance of Ordering. (This might change)

Synopsis

- shrink :: (Size n, Size m) => BoundedList a n -> Maybe (BoundedList a m)
- grow :: LessEq n m => BoundedList a n -> BoundedList a m
- trunc :: Size n => [a] -> BoundedList a n
- listBound :: Size n => BoundedList a n -> Int
- toBounded :: Size n => [a] -> Maybe (BoundedList a n)
- fromBounded :: Size n => BoundedList a n -> [a]
- class Size n
- data BoundedList a n
- data N0
- data N1
- data N2
- data N3
- data N4
- data N5
- data N6
- data N7
- data N8
- data N9
- data N10
- data N11
- data N12
- data N13
- data N14
- data N15
- data N16
- data N17
- data N18
- data N19
- data N20
- data N21
- data N22
- data N23
- data N24
- data N25
- data N26
- data N27
- data N28
- data N29
- data N30
- data N31
- data N32
- data N33
- data N34
- data N35
- data N36
- data N37
- data N38
- data N39
- data N40
- data N41
- data N42
- data N43
- data N44
- data N45
- data N46
- data N47
- data N48
- data N49
- data N50
- data N51
- data N52
- data N53
- data N54
- data N55
- data N56
- data N57
- data N58
- data N59
- data N60
- data N61
- data N62
- data N63
- data N64
- data N65
- data N66
- data N67
- data N68
- data N69
- data N70
- data N71
- data N72
- data N73
- data N74
- data N75
- data N76
- data N77
- data N78
- data N79
- data N80
- data N81
- data N82
- data N83
- data N84
- data N85
- data N86
- data N87
- data N88
- data N89
- data N90
- data N91
- data N92
- data N93
- data N94
- data N95
- data N96
- data N97
- data N98
- data N99
- data N100
- data N101
- data N102
- data N103
- data N104
- data N105
- data N106
- data N107
- data N108
- data N109
- data N110
- data N111
- data N112
- data N113
- data N114
- data N115
- data N116
- data N117
- data N118
- data N119
- data N120
- data N121
- data N122
- data N123
- data N124
- data N125
- data N126
- data N127
- data N128
- data N129
- data N130
- data N131
- data N132
- data N133
- data N134
- data N135
- data N136
- data N137
- data N138
- data N139
- data N140
- data N141
- data N142
- data N143
- data N144
- data N145
- data N146
- data N147
- data N148
- data N149
- data N150
- data N151
- data N152
- data N153
- data N154
- data N155
- data N156
- data N157
- data N158
- data N159
- data N160
- data N161
- data N162
- data N163
- data N164
- data N165
- data N166
- data N167
- data N168
- data N169
- data N170
- data N171
- data N172
- data N173
- data N174
- data N175
- data N176
- data N177
- data N178
- data N179
- data N180
- data N181
- data N182
- data N183
- data N184
- data N185
- data N186
- data N187
- data N188
- data N189
- data N190
- data N191
- data N192
- data N193
- data N194
- data N195
- data N196
- data N197
- data N198
- data N199
- data N200
- data N201
- data N202
- data N203
- data N204
- data N205
- data N206
- data N207
- data N208
- data N209
- data N210
- data N211
- data N212
- data N213
- data N214
- data N215
- data N216
- data N217
- data N218
- data N219
- data N220
- data N221
- data N222
- data N223
- data N224
- data N225
- data N226
- data N227
- data N228
- data N229
- data N230
- data N231
- data N232
- data N233
- data N234
- data N235
- data N236
- data N237
- data N238
- data N239
- data N240
- data N241
- data N242
- data N243
- data N244
- data N245
- data N246
- data N247
- data N248
- data N249
- data N250
- data N251
- data N252
- data N253
- data N254
- data N255
- data N65535

# Documentation

shrink :: (Size n, Size m) => BoundedList a n -> Maybe (BoundedList a m) Source

Shrinks the `BoundedList` supplied if it can do so without truncating the list. Returns Nothing if the list inside was to long.

grow :: LessEq n m => BoundedList a n -> BoundedList a m Source

Takes a `BoundedList` add grows it size.

trunc :: Size n => [a] -> BoundedList a n Source

Takes a list and transforms it to a `BoundedList`. If the list doesn'n fit, the list is truncated to make it fit into the bounded list.

listBound :: Size n => BoundedList a n -> Int Source

Returns the length of a `BoundedList`.

toBounded :: Size n => [a] -> Maybe (BoundedList a n) Source

Takes a list and transforms it to a `BoundedList`. If the list doesn't fit, Nothing is returned.

fromBounded :: Size n => BoundedList a n -> [a] Source

Takes a `BoundedList` and return the list inside.

class Size n Source

Minimal complete definition

size

Instances

Size N65535 Source |
Size N255 Source |
Size N254 Source |
Size N253 Source |
Size N252 Source |
Size N251 Source |
Size N250 Source |
Size N249 Source |
Size N248 Source |
Size N247 Source |
Size N246 Source |
Size N245 Source |
Size N244 Source |
Size N243 Source |
Size N242 Source |
Size N241 Source |
Size N240 Source |
Size N239 Source |
Size N238 Source |
Size N237 Source |
Size N236 Source |
Size N235 Source |
Size N234 Source |
Size N233 Source |
Size N232 Source |
Size N231 Source |
Size N230 Source |
Size N229 Source |
Size N228 Source |
Size N227 Source |
Size N226 Source |
Size N225 Source |
Size N224 Source |
Size N223 Source |
Size N222 Source |
Size N221 Source |
Size N220 Source |
Size N219 Source |
Size N218 Source |
Size N217 Source |
Size N216 Source |
Size N215 Source |
Size N214 Source |
Size N213 Source |
Size N212 Source |
Size N211 Source |
Size N210 Source |
Size N209 Source |
Size N208 Source |
Size N207 Source |
Size N206 Source |
Size N205 Source |
Size N204 Source |
Size N203 Source |
Size N202 Source |
Size N201 Source |
Size N200 Source |
Size N199 Source |
Size N198 Source |
Size N197 Source |
Size N196 Source |
Size N195 Source |
Size N194 Source |
Size N193 Source |
Size N192 Source |
Size N191 Source |
Size N190 Source |
Size N189 Source |
Size N188 Source |
Size N187 Source |
Size N186 Source |
Size N185 Source |
Size N184 Source |
Size N183 Source |
Size N182 Source |
Size N181 Source |
Size N180 Source |
Size N179 Source |
Size N178 Source |
Size N177 Source |
Size N176 Source |
Size N175 Source |
Size N174 Source |
Size N173 Source |
Size N172 Source |
Size N171 Source |
Size N170 Source |
Size N169 Source |
Size N168 Source |
Size N167 Source |
Size N166 Source |
Size N165 Source |
Size N164 Source |
Size N163 Source |
Size N162 Source |
Size N161 Source |
Size N160 Source |
Size N159 Source |
Size N158 Source |
Size N157 Source |
Size N156 Source |
Size N155 Source |
Size N154 Source |
Size N153 Source |
Size N152 Source |
Size N151 Source |
Size N150 Source |
Size N149 Source |
Size N148 Source |
Size N147 Source |
Size N146 Source |
Size N145 Source |
Size N144 Source |
Size N143 Source |
Size N142 Source |
Size N141 Source |
Size N140 Source |
Size N139 Source |
Size N138 Source |
Size N137 Source |
Size N136 Source |
Size N135 Source |
Size N134 Source |
Size N133 Source |
Size N132 Source |
Size N131 Source |
Size N130 Source |
Size N129 Source |
Size N128 Source |
Size N127 Source |
Size N126 Source |
Size N125 Source |
Size N124 Source |
Size N123 Source |
Size N122 Source |
Size N121 Source |
Size N120 Source |
Size N119 Source |
Size N118 Source |
Size N117 Source |
Size N116 Source |
Size N115 Source |
Size N114 Source |
Size N113 Source |
Size N112 Source |
Size N111 Source |
Size N110 Source |
Size N109 Source |
Size N108 Source |
Size N107 Source |
Size N106 Source |
Size N105 Source |
Size N104 Source |
Size N103 Source |
Size N102 Source |
Size N101 Source |
Size N100 Source |
Size N99 Source |
Size N98 Source |
Size N97 Source |
Size N96 Source |
Size N95 Source |
Size N94 Source |
Size N93 Source |
Size N92 Source |
Size N91 Source |
Size N90 Source |
Size N89 Source |
Size N88 Source |
Size N87 Source |
Size N86 Source |
Size N85 Source |
Size N84 Source |
Size N83 Source |
Size N82 Source |
Size N81 Source |
Size N80 Source |
Size N79 Source |
Size N78 Source |
Size N77 Source |
Size N76 Source |
Size N75 Source |
Size N74 Source |
Size N73 Source |
Size N72 Source |
Size N71 Source |
Size N70 Source |
Size N69 Source |
Size N68 Source |
Size N67 Source |
Size N66 Source |
Size N65 Source |
Size N64 Source |
Size N63 Source |
Size N62 Source |
Size N61 Source |
Size N60 Source |
Size N59 Source |
Size N58 Source |
Size N57 Source |
Size N56 Source |
Size N55 Source |
Size N54 Source |
Size N53 Source |
Size N52 Source |
Size N51 Source |
Size N50 Source |
Size N49 Source |
Size N48 Source |
Size N47 Source |
Size N46 Source |
Size N45 Source |
Size N44 Source |
Size N43 Source |
Size N42 Source |
Size N41 Source |
Size N40 Source |
Size N39 Source |
Size N38 Source |
Size N37 Source |
Size N36 Source |
Size N35 Source |
Size N34 Source |
Size N33 Source |
Size N32 Source |
Size N31 Source |
Size N30 Source |
Size N29 Source |
Size N28 Source |
Size N27 Source |
Size N26 Source |
Size N25 Source |
Size N24 Source |
Size N23 Source |
Size N22 Source |
Size N21 Source |
Size N20 Source |
Size N19 Source |
Size N18 Source |
Size N17 Source |
Size N16 Source |
Size N15 Source |
Size N14 Source |
Size N13 Source |
Size N12 Source |
Size N11 Source |
Size N10 Source |
Size N9 Source |
Size N8 Source |
Size N7 Source |
Size N6 Source |
Size N5 Source |
Size N4 Source |
Size N3 Source |
Size N2 Source |
Size N1 Source |
Size N0 Source |

data BoundedList a n Source

Instances

Size n => ShowConstant (BoundedString n) Source |
Size n => ExprType (BoundedString n) Source |
Size n => GetValue (Maybe (BoundedString n)) Source |
Size n => GetValue (BoundedString n) Source |
(Size n, Eq a) => Eq (BoundedList a n) Source |
(Show a, Size n) => Show (BoundedList a n) Source |

data N0 Source

Instances

Size N0 Source |

data N1 Source

Instances

Size N1 Source |

data N2 Source

Instances

Size N2 Source |

data N3 Source

Instances

Size N3 Source |

data N4 Source

Instances

Size N4 Source |

data N5 Source

Instances

Size N5 Source |

data N6 Source

Instances

Size N6 Source |

data N7 Source

Instances

Size N7 Source |

data N8 Source

Instances

Size N8 Source |

data N9 Source

Instances

Size N9 Source |

data N10 Source

Instances

Size N10 Source |

data N11 Source

Instances

Size N11 Source |

data N12 Source

Instances

Size N12 Source |

data N13 Source

Instances

Size N13 Source |

data N14 Source

Instances

Size N14 Source |

data N15 Source

Instances

Size N15 Source |

data N16 Source

Instances

Size N16 Source |

data N17 Source

Instances

Size N17 Source |

data N18 Source

Instances

Size N18 Source |

data N19 Source

Instances

Size N19 Source |

data N20 Source

Instances

Size N20 Source |

data N21 Source

Instances

Size N21 Source |

data N22 Source

Instances

Size N22 Source |

data N23 Source

Instances

Size N23 Source |

data N24 Source

Instances

Size N24 Source |

data N25 Source

Instances

Size N25 Source |

data N26 Source

Instances

Size N26 Source |

data N27 Source

Instances

Size N27 Source |

data N28 Source

Instances

Size N28 Source |

data N29 Source

Instances

Size N29 Source |

data N30 Source

Instances

Size N30 Source |

data N31 Source

Instances

Size N31 Source |

data N32 Source

Instances

Size N32 Source |

data N33 Source

Instances

Size N33 Source |

data N34 Source

Instances

Size N34 Source |

data N35 Source

Instances

Size N35 Source |

data N36 Source

Instances

Size N36 Source |

data N37 Source

Instances

Size N37 Source |

data N38 Source

Instances

Size N38 Source |

data N39 Source

Instances

Size N39 Source |

data N40 Source

Instances

Size N40 Source |

data N41 Source

Instances

Size N41 Source |

data N42 Source

Instances

Size N42 Source |

data N43 Source

Instances

Size N43 Source |

data N44 Source

Instances

Size N44 Source |

data N45 Source

Instances

Size N45 Source |

data N46 Source

Instances

Size N46 Source |

data N47 Source

Instances

Size N47 Source |

data N48 Source

Instances

Size N48 Source |

data N49 Source

Instances

Size N49 Source |

data N50 Source

Instances

Size N50 Source |

data N51 Source

Instances

Size N51 Source |

data N52 Source

Instances

Size N52 Source |

data N53 Source

Instances

Size N53 Source |

data N54 Source

Instances

Size N54 Source |

data N55 Source

Instances

Size N55 Source |

data N56 Source

Instances

Size N56 Source |

data N57 Source

Instances

Size N57 Source |

data N58 Source

Instances

Size N58 Source |

data N59 Source

Instances

Size N59 Source |

data N60 Source

Instances

Size N60 Source |

data N61 Source

Instances

Size N61 Source |

data N62 Source

Instances

Size N62 Source |

data N63 Source

Instances

Size N63 Source |

data N64 Source

Instances

Size N64 Source |

data N65 Source

Instances

Size N65 Source |

data N66 Source

Instances

Size N66 Source |

data N67 Source

Instances

Size N67 Source |

data N68 Source

Instances

Size N68 Source |

data N69 Source

Instances

Size N69 Source |

data N70 Source

Instances

Size N70 Source |

data N71 Source

Instances

Size N71 Source |

data N72 Source

Instances

Size N72 Source |

data N73 Source

Instances

Size N73 Source |

data N74 Source

Instances

Size N74 Source |

data N75 Source

Instances

Size N75 Source |

data N76 Source

Instances

Size N76 Source |

data N77 Source

Instances

Size N77 Source |

data N78 Source

Instances

Size N78 Source |

data N79 Source

Instances

Size N79 Source |

data N80 Source

Instances

Size N80 Source |

data N81 Source

Instances

Size N81 Source |

data N82 Source

Instances

Size N82 Source |

data N83 Source

Instances

Size N83 Source |

data N84 Source

Instances

Size N84 Source |

data N85 Source

Instances

Size N85 Source |

data N86 Source

Instances

Size N86 Source |

data N87 Source

Instances

Size N87 Source |

data N88 Source

Instances

Size N88 Source |

data N89 Source

Instances

Size N89 Source |

data N90 Source

Instances

Size N90 Source |

data N91 Source

Instances

Size N91 Source |

data N92 Source

Instances

Size N92 Source |

data N93 Source

Instances

Size N93 Source |

data N94 Source

Instances

Size N94 Source |

data N95 Source

Instances

Size N95 Source |

data N96 Source

Instances

Size N96 Source |

data N97 Source

Instances

Size N97 Source |

data N98 Source

Instances

Size N98 Source |

data N99 Source

Instances

Size N99 Source |

data N100 Source

Instances

Size N100 Source |

data N101 Source

Instances

Size N101 Source |

data N102 Source

Instances

Size N102 Source |

data N103 Source

Instances

Size N103 Source |

data N104 Source

Instances

Size N104 Source |

data N105 Source

Instances

Size N105 Source |

data N106 Source

Instances

Size N106 Source |

data N107 Source

Instances

Size N107 Source |

data N108 Source

Instances

Size N108 Source |

data N109 Source

Instances

Size N109 Source |

data N110 Source

Instances

Size N110 Source |

data N111 Source

Instances

Size N111 Source |

data N112 Source

Instances

Size N112 Source |

data N113 Source

Instances

Size N113 Source |

data N114 Source

Instances

Size N114 Source |

data N115 Source

Instances

Size N115 Source |

data N116 Source

Instances

Size N116 Source |

data N117 Source

Instances

Size N117 Source |

data N118 Source

Instances

Size N118 Source |

data N119 Source

Instances

Size N119 Source |

data N120 Source

Instances

Size N120 Source |

data N121 Source

Instances

Size N121 Source |

data N122 Source

Instances

Size N122 Source |

data N123 Source

Instances

Size N123 Source |

data N124 Source

Instances

Size N124 Source |

data N125 Source

Instances

Size N125 Source |

data N126 Source

Instances

Size N126 Source |

data N127 Source

Instances

Size N127 Source |

data N128 Source

Instances

Size N128 Source |

data N129 Source

Instances

Size N129 Source |

data N130 Source

Instances

Size N130 Source |

data N131 Source

Instances

Size N131 Source |

data N132 Source

Instances

Size N132 Source |

data N133 Source

Instances

Size N133 Source |

data N134 Source

Instances

Size N134 Source |

data N135 Source

Instances

Size N135 Source |

data N136 Source

Instances

Size N136 Source |

data N137 Source

Instances

Size N137 Source |

data N138 Source

Instances

Size N138 Source |

data N139 Source

Instances

Size N139 Source |

data N140 Source

Instances

Size N140 Source |

data N141 Source

Instances

Size N141 Source |

data N142 Source

Instances

Size N142 Source |

data N143 Source

Instances

Size N143 Source |

data N144 Source

Instances

Size N144 Source |

data N145 Source

Instances

Size N145 Source |

data N146 Source

Instances

Size N146 Source |

data N147 Source

Instances

Size N147 Source |

data N148 Source

Instances

Size N148 Source |

data N149 Source

Instances

Size N149 Source |

data N150 Source

Instances

Size N150 Source |

data N151 Source

Instances

Size N151 Source |

data N152 Source

Instances

Size N152 Source |

data N153 Source

Instances

Size N153 Source |

data N154 Source

Instances

Size N154 Source |

data N155 Source

Instances

Size N155 Source |

data N156 Source

Instances

Size N156 Source |

data N157 Source

Instances

Size N157 Source |

data N158 Source

Instances

Size N158 Source |

data N159 Source

Instances

Size N159 Source |

data N160 Source

Instances

Size N160 Source |

data N161 Source

Instances

Size N161 Source |

data N162 Source

Instances

Size N162 Source |

data N163 Source

Instances

Size N163 Source |

data N164 Source

Instances

Size N164 Source |

data N165 Source

Instances

Size N165 Source |

data N166 Source

Instances

Size N166 Source |

data N167 Source

Instances

Size N167 Source |

data N168 Source

Instances

Size N168 Source |

data N169 Source

Instances

Size N169 Source |

data N170 Source

Instances

Size N170 Source |

data N171 Source

Instances

Size N171 Source |

data N172 Source

Instances

Size N172 Source |

data N173 Source

Instances

Size N173 Source |

data N174 Source

Instances

Size N174 Source |

data N175 Source

Instances

Size N175 Source |

data N176 Source

Instances

Size N176 Source |

data N177 Source

Instances

Size N177 Source |

data N178 Source

Instances

Size N178 Source |

data N179 Source

Instances

Size N179 Source |

data N180 Source

Instances

Size N180 Source |

data N181 Source

Instances

Size N181 Source |

data N182 Source

Instances

Size N182 Source |

data N183 Source

Instances

Size N183 Source |

data N184 Source

Instances

Size N184 Source |

data N185 Source

Instances

Size N185 Source |

data N186 Source

Instances

Size N186 Source |

data N187 Source

Instances

Size N187 Source |

data N188 Source

Instances

Size N188 Source |

data N189 Source

Instances

Size N189 Source |

data N190 Source

Instances

Size N190 Source |

data N191 Source

Instances

Size N191 Source |

data N192 Source

Instances

Size N192 Source |

data N193 Source

Instances

Size N193 Source |

data N194 Source

Instances

Size N194 Source |

data N195 Source

Instances

Size N195 Source |

data N196 Source

Instances

Size N196 Source |

data N197 Source

Instances

Size N197 Source |

data N198 Source

Instances

Size N198 Source |

data N199 Source

Instances

Size N199 Source |

data N200 Source

Instances

Size N200 Source |

data N201 Source

Instances

Size N201 Source |

data N202 Source

Instances

Size N202 Source |

data N203 Source

Instances

Size N203 Source |

data N204 Source

Instances

Size N204 Source |

data N205 Source

Instances

Size N205 Source |

data N206 Source

Instances

Size N206 Source |

data N207 Source

Instances

Size N207 Source |

data N208 Source

Instances

Size N208 Source |

data N209 Source

Instances

Size N209 Source |

data N210 Source

Instances

Size N210 Source |

data N211 Source

Instances

Size N211 Source |

data N212 Source

Instances

Size N212 Source |

data N213 Source

Instances

Size N213 Source |

data N214 Source

Instances

Size N214 Source |

data N215 Source

Instances

Size N215 Source |

data N216 Source

Instances

Size N216 Source |

data N217 Source

Instances

Size N217 Source |

data N218 Source

Instances

Size N218 Source |

data N219 Source

Instances

Size N219 Source |

data N220 Source

Instances

Size N220 Source |

data N221 Source

Instances

Size N221 Source |

data N222 Source

Instances

Size N222 Source |

data N223 Source

Instances

Size N223 Source |

data N224 Source

Instances

Size N224 Source |

data N225 Source

Instances

Size N225 Source |

data N226 Source

Instances

Size N226 Source |

data N227 Source

Instances

Size N227 Source |

data N228 Source

Instances

Size N228 Source |

data N229 Source

Instances

Size N229 Source |

data N230 Source

Instances

Size N230 Source |

data N231 Source

Instances

Size N231 Source |

data N232 Source

Instances

Size N232 Source |

data N233 Source

Instances

Size N233 Source |

data N234 Source

Instances

Size N234 Source |

data N235 Source

Instances

Size N235 Source |

data N236 Source

Instances

Size N236 Source |

data N237 Source

Instances

Size N237 Source |

data N238 Source

Instances

Size N238 Source |

data N239 Source

Instances

Size N239 Source |

data N240 Source

Instances

Size N240 Source |

data N241 Source

Instances

Size N241 Source |

data N242 Source

Instances

Size N242 Source |

data N243 Source

Instances

Size N243 Source |

data N244 Source

Instances

Size N244 Source |

data N245 Source

Instances

Size N245 Source |

data N246 Source

Instances

Size N246 Source |

data N247 Source

Instances

Size N247 Source |

data N248 Source

Instances

Size N248 Source |

data N249 Source

Instances

Size N249 Source |

data N250 Source

Instances

Size N250 Source |

data N251 Source

Instances

Size N251 Source |

data N252 Source

Instances

Size N252 Source |

data N253 Source

Instances

Size N253 Source |

data N254 Source

Instances

Size N254 Source |

data N255 Source

Instances

Size N255 Source |

data N65535 Source

Instances

Size N65535 Source |