/usr/share/doc/libghc-event-list-doc/html/src/Data-EventList-Relative-TimeTimePrivate.html is in libghc-event-list-doc 0.1.0.2-3build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<!-- Generated by HsColour, http://code.haskell.org/~malcolm/hscolour/ -->
<title>src/Data/EventList/Relative/TimeTimePrivate.hs</title>
<link type='text/css' rel='stylesheet' href='hscolour.css' />
</head>
<body>
<pre><a name="line-1"></a><span class='hs-comment'>{- |
<a name="line-2"></a>Copyright : (c) Henning Thielemann 2007-2010
<a name="line-3"></a>
<a name="line-4"></a>Maintainer : haskell@henning-thielemann.de
<a name="line-5"></a>Stability : stable
<a name="line-6"></a>Portability : Haskell 98
<a name="line-7"></a>-}</span>
<a name="line-8"></a><span class='hs-keyword'>module</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>EventList</span><span class='hs-varop'>.</span><span class='hs-conid'>Relative</span><span class='hs-varop'>.</span><span class='hs-conid'>TimeTimePrivate</span> <span class='hs-keyword'>where</span>
<a name="line-9"></a>
<a name="line-10"></a><span class='hs-keyword'>import</span> <span class='hs-keyword'>qualified</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>EventList</span><span class='hs-varop'>.</span><span class='hs-conid'>Relative</span><span class='hs-varop'>.</span><span class='hs-conid'>TimeBodyPrivate</span> <span class='hs-keyword'>as</span> <span class='hs-conid'>TimeBodyList</span>
<a name="line-11"></a><span class='hs-keyword'>import</span> <span class='hs-keyword'>qualified</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>EventList</span><span class='hs-varop'>.</span><span class='hs-conid'>Relative</span><span class='hs-varop'>.</span><span class='hs-conid'>TimeBodyPrivate</span> <span class='hs-keyword'>as</span> <span class='hs-conid'>TimeBodyPriv</span>
<a name="line-12"></a>
<a name="line-13"></a><span class='hs-keyword'>import</span> <span class='hs-keyword'>qualified</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>EventList</span><span class='hs-varop'>.</span><span class='hs-conid'>Relative</span><span class='hs-varop'>.</span><span class='hs-conid'>BodyTimePrivate</span> <span class='hs-keyword'>as</span> <span class='hs-conid'>BodyTimeList</span>
<a name="line-14"></a><span class='hs-keyword'>import</span> <span class='hs-keyword'>qualified</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>EventList</span><span class='hs-varop'>.</span><span class='hs-conid'>Relative</span><span class='hs-varop'>.</span><span class='hs-conid'>BodyTimePrivate</span> <span class='hs-keyword'>as</span> <span class='hs-conid'>BodyTimePriv</span>
<a name="line-15"></a>
<a name="line-16"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>EventList</span><span class='hs-varop'>.</span><span class='hs-conid'>Relative</span><span class='hs-varop'>.</span><span class='hs-conid'>TimeBodyPrivate</span> <span class='hs-layout'>(</span><span class='hs-layout'>(</span><span class='hs-varop'>$~*</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span>
<a name="line-17"></a>
<a name="line-18"></a><span class='hs-keyword'>import</span> <span class='hs-keyword'>qualified</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>AlternatingList</span><span class='hs-varop'>.</span><span class='hs-conid'>List</span><span class='hs-varop'>.</span><span class='hs-conid'>Disparate</span> <span class='hs-keyword'>as</span> <span class='hs-conid'>Disp</span>
<a name="line-19"></a><span class='hs-keyword'>import</span> <span class='hs-keyword'>qualified</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>AlternatingList</span><span class='hs-varop'>.</span><span class='hs-conid'>List</span><span class='hs-varop'>.</span><span class='hs-conid'>Uniform</span> <span class='hs-keyword'>as</span> <span class='hs-conid'>Uniform</span>
<a name="line-20"></a><span class='hs-keyword'>import</span> <span class='hs-keyword'>qualified</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>AlternatingList</span><span class='hs-varop'>.</span><span class='hs-conid'>List</span><span class='hs-varop'>.</span><span class='hs-conid'>Mixed</span> <span class='hs-keyword'>as</span> <span class='hs-conid'>Mixed</span>
<a name="line-21"></a>
<a name="line-22"></a><span class='hs-keyword'>import</span> <span class='hs-keyword'>qualified</span> <span class='hs-conid'>Numeric</span><span class='hs-varop'>.</span><span class='hs-conid'>NonNegative</span><span class='hs-varop'>.</span><span class='hs-conid'>Class</span> <span class='hs-keyword'>as</span> <span class='hs-conid'>NonNeg</span>
<a name="line-23"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Numeric</span><span class='hs-varop'>.</span><span class='hs-conid'>NonNegative</span><span class='hs-varop'>.</span><span class='hs-conid'>Class</span> <span class='hs-layout'>(</span><span class='hs-varid'>zero</span><span class='hs-layout'>,</span> <span class='hs-varid'>add</span><span class='hs-layout'>,</span> <span class='hs-layout'>)</span>
<a name="line-24"></a>
<a name="line-25"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>Tuple</span><span class='hs-varop'>.</span><span class='hs-conid'>HT</span> <span class='hs-layout'>(</span><span class='hs-varid'>mapFst</span><span class='hs-layout'>,</span> <span class='hs-varid'>mapSnd</span><span class='hs-layout'>,</span> <span class='hs-layout'>)</span>
<a name="line-26"></a>
<a name="line-27"></a><span class='hs-keyword'>import</span> <span class='hs-keyword'>qualified</span> <span class='hs-conid'>Control</span><span class='hs-varop'>.</span><span class='hs-conid'>Monad</span> <span class='hs-keyword'>as</span> <span class='hs-conid'>Monad</span>
<a name="line-28"></a><span class='hs-keyword'>import</span> <span class='hs-keyword'>qualified</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>Foldable</span> <span class='hs-keyword'>as</span> <span class='hs-conid'>Fold</span>
<a name="line-29"></a><span class='hs-keyword'>import</span> <span class='hs-keyword'>qualified</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>Traversable</span> <span class='hs-keyword'>as</span> <span class='hs-conid'>Trav</span>
<a name="line-30"></a><span class='hs-keyword'>import</span> <span class='hs-keyword'>qualified</span> <span class='hs-conid'>Control</span><span class='hs-varop'>.</span><span class='hs-conid'>Applicative</span> <span class='hs-keyword'>as</span> <span class='hs-conid'>App</span>
<a name="line-31"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Control</span><span class='hs-varop'>.</span><span class='hs-conid'>Applicative</span> <span class='hs-layout'>(</span><span class='hs-conid'>Applicative</span><span class='hs-layout'>,</span> <span class='hs-layout'>)</span>
<a name="line-32"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>Monoid</span> <span class='hs-layout'>(</span><span class='hs-conid'>Monoid</span><span class='hs-layout'>,</span> <span class='hs-varid'>mempty</span><span class='hs-layout'>,</span> <span class='hs-varid'>mappend</span><span class='hs-layout'>,</span> <span class='hs-varid'>mconcat</span><span class='hs-layout'>,</span> <span class='hs-layout'>)</span>
<a name="line-33"></a>
<a name="line-34"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Test</span><span class='hs-varop'>.</span><span class='hs-conid'>QuickCheck</span> <span class='hs-layout'>(</span><span class='hs-conid'>Arbitrary</span><span class='hs-layout'>(</span><span class='hs-varid'>arbitrary</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span>
<a name="line-35"></a>
<a name="line-36"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Prelude</span> <span class='hs-varid'>hiding</span> <span class='hs-layout'>(</span><span class='hs-varid'>foldr</span><span class='hs-layout'>,</span> <span class='hs-layout'>)</span>
<a name="line-37"></a>
<a name="line-38"></a>
<a name="line-39"></a><a name="T"></a><span class='hs-keyword'>newtype</span> <span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Cons</span> <span class='hs-layout'>{</span><span class='hs-varid'>decons</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Uniform</span><span class='hs-varop'>.</span><span class='hs-conid'>T</span> <span class='hs-varid'>body</span> <span class='hs-varid'>time</span><span class='hs-layout'>}</span>
<a name="line-40"></a> <span class='hs-keyword'>deriving</span> <span class='hs-layout'>(</span><span class='hs-conid'>Eq</span><span class='hs-layout'>,</span> <span class='hs-conid'>Ord</span><span class='hs-layout'>)</span>
<a name="line-41"></a>
<a name="line-42"></a>
<a name="line-43"></a><a name="instance%20Show%20(T%20time%20body)"></a><span class='hs-keyword'>instance</span> <span class='hs-layout'>(</span><span class='hs-conid'>Show</span> <span class='hs-varid'>time</span><span class='hs-layout'>,</span> <span class='hs-conid'>Show</span> <span class='hs-varid'>body</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=></span> <span class='hs-conid'>Show</span> <span class='hs-layout'>(</span><span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span><span class='hs-layout'>)</span> <span class='hs-keyword'>where</span>
<a name="line-44"></a> <span class='hs-varid'>showsPrec</span> <span class='hs-varid'>p</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Uniform</span><span class='hs-varop'>.</span><span class='hs-varid'>format</span> <span class='hs-str'>" ./ "</span> <span class='hs-str'>" /. "</span> <span class='hs-varid'>p</span> <span class='hs-varop'>.</span> <span class='hs-varid'>decons</span>
<a name="line-45"></a>
<a name="line-46"></a><a name="instance%20Arbitrary%20(T%20time%20body)"></a><span class='hs-keyword'>instance</span> <span class='hs-layout'>(</span><span class='hs-conid'>Arbitrary</span> <span class='hs-varid'>time</span><span class='hs-layout'>,</span> <span class='hs-conid'>Arbitrary</span> <span class='hs-varid'>body</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=></span>
<a name="line-47"></a> <span class='hs-conid'>Arbitrary</span> <span class='hs-layout'>(</span><span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span><span class='hs-layout'>)</span> <span class='hs-keyword'>where</span>
<a name="line-48"></a> <span class='hs-varid'>arbitrary</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Monad</span><span class='hs-varop'>.</span><span class='hs-varid'>liftM</span> <span class='hs-conid'>Cons</span> <span class='hs-varid'>arbitrary</span>
<a name="line-49"></a>
<a name="line-50"></a>
<a name="line-51"></a><a name="instance%20Monoid%20(T%20time%20body)"></a><span class='hs-keyword'>instance</span> <span class='hs-layout'>(</span><span class='hs-conid'>NonNeg</span><span class='hs-varop'>.</span><span class='hs-conid'>C</span> <span class='hs-varid'>time</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=></span> <span class='hs-conid'>Monoid</span> <span class='hs-layout'>(</span><span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span><span class='hs-layout'>)</span> <span class='hs-keyword'>where</span>
<a name="line-52"></a> <span class='hs-varid'>mempty</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Cons</span> <span class='hs-layout'>(</span><span class='hs-conid'>Uniform</span><span class='hs-varop'>.</span><span class='hs-varid'>singleton</span> <span class='hs-varid'>zero</span><span class='hs-layout'>)</span>
<a name="line-53"></a> <span class='hs-varid'>mappend</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>append</span>
<a name="line-54"></a> <span class='hs-varid'>mconcat</span> <span class='hs-keyglyph'>=</span>
<a name="line-55"></a> <span class='hs-varid'>flatten</span> <span class='hs-varop'>.</span> <span class='hs-varid'>consTime</span> <span class='hs-varid'>zero</span> <span class='hs-varop'>.</span>
<a name="line-56"></a> <span class='hs-varid'>mconcat</span> <span class='hs-varop'>.</span>
<a name="line-57"></a> <span class='hs-varid'>map</span> <span class='hs-layout'>(</span><span class='hs-varid'>consBody</span> <span class='hs-conid'>[]</span> <span class='hs-varop'>.</span> <span class='hs-varid'>fmap</span> <span class='hs-layout'>(</span><span class='hs-conop'>:</span><span class='hs-conid'>[]</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span>
<a name="line-58"></a>
<a name="line-59"></a><a name="append"></a><span class='hs-definition'>append</span><span class='hs-layout'>,</span> <span class='hs-varid'>appendAlt</span><span class='hs-layout'>,</span> <span class='hs-varid'>appendSwitch</span> <span class='hs-keyglyph'>::</span>
<a name="line-60"></a> <span class='hs-layout'>(</span><span class='hs-conid'>NonNeg</span><span class='hs-varop'>.</span><span class='hs-conid'>C</span> <span class='hs-varid'>time</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=></span>
<a name="line-61"></a> <span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span>
<a name="line-62"></a><span class='hs-definition'>append</span> <span class='hs-varid'>xs</span> <span class='hs-varid'>ys</span> <span class='hs-keyglyph'>=</span>
<a name="line-63"></a> <span class='hs-varid'>forceTimeHead</span> <span class='hs-varop'>$</span>
<a name="line-64"></a> <span class='hs-varid'>foldr</span>
<a name="line-65"></a> <span class='hs-varid'>delay</span>
<a name="line-66"></a> <span class='hs-layout'>(</span><span class='hs-keyglyph'>\</span><span class='hs-varid'>b</span> <span class='hs-keyglyph'>-></span>
<a name="line-67"></a> <span class='hs-varid'>consTime</span> <span class='hs-conid'>NonNeg</span><span class='hs-varop'>.</span><span class='hs-varid'>zero</span> <span class='hs-varop'>.</span>
<a name="line-68"></a> <span class='hs-varid'>consBody</span> <span class='hs-varid'>b</span><span class='hs-layout'>)</span>
<a name="line-69"></a> <span class='hs-varid'>ys</span> <span class='hs-varid'>xs</span>
<a name="line-70"></a>
<a name="line-71"></a><a name="appendAlt"></a><span class='hs-definition'>appendAlt</span> <span class='hs-varid'>xs</span> <span class='hs-varid'>ys</span> <span class='hs-keyglyph'>=</span>
<a name="line-72"></a> <span class='hs-varid'>foldr</span>
<a name="line-73"></a> <span class='hs-layout'>(</span><span class='hs-keyglyph'>\</span><span class='hs-varid'>t</span> <span class='hs-keyglyph'>-></span>
<a name="line-74"></a> <span class='hs-varid'>delay</span> <span class='hs-varid'>t</span> <span class='hs-varop'>.</span>
<a name="line-75"></a> <span class='hs-varid'>either</span> <span class='hs-varid'>id</span> <span class='hs-layout'>(</span><span class='hs-varid'>consTime</span> <span class='hs-conid'>NonNeg</span><span class='hs-varop'>.</span><span class='hs-varid'>zero</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span>
<a name="line-76"></a> <span class='hs-layout'>(</span><span class='hs-keyglyph'>\</span><span class='hs-varid'>b</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Right</span> <span class='hs-varop'>.</span> <span class='hs-varid'>consBody</span> <span class='hs-varid'>b</span><span class='hs-layout'>)</span>
<a name="line-77"></a> <span class='hs-layout'>(</span><span class='hs-conid'>Left</span> <span class='hs-varid'>ys</span><span class='hs-layout'>)</span> <span class='hs-varid'>xs</span>
<a name="line-78"></a>
<a name="line-79"></a><a name="appendSwitch"></a><span class='hs-comment'>{-
<a name="line-80"></a>not lazy enough for @append (2 /. 'a' ./ 4 /. 'b' ./ 2 /. undefined) undefined@
<a name="line-81"></a>-}</span>
<a name="line-82"></a><span class='hs-definition'>appendSwitch</span> <span class='hs-keyglyph'>=</span>
<a name="line-83"></a> <span class='hs-varid'>switchTimeR</span>
<a name="line-84"></a> <span class='hs-layout'>(</span><span class='hs-keyglyph'>\</span> <span class='hs-varid'>xs</span> <span class='hs-varid'>t</span> <span class='hs-keyglyph'>-></span>
<a name="line-85"></a> <span class='hs-varid'>lift</span> <span class='hs-layout'>(</span><span class='hs-conid'>Mixed</span><span class='hs-varop'>.</span><span class='hs-varid'>appendDisparateUniform</span> <span class='hs-varop'>$~*</span> <span class='hs-varid'>xs</span><span class='hs-layout'>)</span> <span class='hs-varop'>.</span>
<a name="line-86"></a> <span class='hs-varid'>delay</span> <span class='hs-varid'>t</span><span class='hs-layout'>)</span>
<a name="line-87"></a>
<a name="line-88"></a>
<a name="line-89"></a><a name="instance%20Functor%20(T%20time)"></a><span class='hs-keyword'>instance</span> <span class='hs-conid'>Functor</span> <span class='hs-layout'>(</span><span class='hs-conid'>T</span> <span class='hs-varid'>time</span><span class='hs-layout'>)</span> <span class='hs-keyword'>where</span>
<a name="line-90"></a> <span class='hs-varid'>fmap</span> <span class='hs-varid'>f</span> <span class='hs-layout'>(</span><span class='hs-conid'>Cons</span> <span class='hs-varid'>x</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Cons</span> <span class='hs-layout'>(</span><span class='hs-conid'>Uniform</span><span class='hs-varop'>.</span><span class='hs-varid'>mapFirst</span> <span class='hs-varid'>f</span> <span class='hs-varid'>x</span><span class='hs-layout'>)</span>
<a name="line-91"></a>
<a name="line-92"></a><a name="instance%20Fold.Foldable%20(T%20time)"></a><span class='hs-keyword'>instance</span> <span class='hs-conid'>Fold</span><span class='hs-varop'>.</span><span class='hs-conid'>Foldable</span> <span class='hs-layout'>(</span><span class='hs-conid'>T</span> <span class='hs-varid'>time</span><span class='hs-layout'>)</span> <span class='hs-keyword'>where</span>
<a name="line-93"></a> <span class='hs-varid'>foldMap</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Trav</span><span class='hs-varop'>.</span><span class='hs-varid'>foldMapDefault</span>
<a name="line-94"></a>
<a name="line-95"></a><a name="instance%20Trav.Traversable%20(T%20time)"></a><span class='hs-keyword'>instance</span> <span class='hs-conid'>Trav</span><span class='hs-varop'>.</span><span class='hs-conid'>Traversable</span> <span class='hs-layout'>(</span><span class='hs-conid'>T</span> <span class='hs-varid'>time</span><span class='hs-layout'>)</span> <span class='hs-keyword'>where</span>
<a name="line-96"></a> <span class='hs-varid'>traverse</span> <span class='hs-varid'>f</span> <span class='hs-keyglyph'>=</span>
<a name="line-97"></a> <span class='hs-conid'>App</span><span class='hs-varop'>.</span><span class='hs-varid'>liftA</span> <span class='hs-conid'>Cons</span> <span class='hs-varop'>.</span> <span class='hs-conid'>Uniform</span><span class='hs-varop'>.</span><span class='hs-varid'>traverse</span> <span class='hs-varid'>f</span> <span class='hs-conid'>App</span><span class='hs-varop'>.</span><span class='hs-varid'>pure</span> <span class='hs-varop'>.</span> <span class='hs-varid'>decons</span>
<a name="line-98"></a>
<a name="line-99"></a>
<a name="line-100"></a><span class='hs-keyword'>infixl</span> <span class='hs-num'>5</span> <span class='hs-varop'>$~~</span>
<a name="line-101"></a>
<a name="line-102"></a><a name="$~~"></a><span class='hs-layout'>(</span><span class='hs-varop'>$~~</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>::</span> <span class='hs-layout'>(</span><span class='hs-conid'>Uniform</span><span class='hs-varop'>.</span><span class='hs-conid'>T</span> <span class='hs-varid'>body</span> <span class='hs-varid'>time</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-></span> <span class='hs-layout'>(</span><span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span>
<a name="line-103"></a><span class='hs-layout'>(</span><span class='hs-varop'>$~~</span><span class='hs-layout'>)</span> <span class='hs-varid'>f</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>f</span> <span class='hs-varop'>.</span> <span class='hs-varid'>decons</span>
<a name="line-104"></a>
<a name="line-105"></a>
<a name="line-106"></a><a name="lift"></a><span class='hs-definition'>lift</span> <span class='hs-keyglyph'>::</span>
<a name="line-107"></a> <span class='hs-layout'>(</span><span class='hs-conid'>Uniform</span><span class='hs-varop'>.</span><span class='hs-conid'>T</span> <span class='hs-varid'>body0</span> <span class='hs-varid'>time0</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Uniform</span><span class='hs-varop'>.</span><span class='hs-conid'>T</span> <span class='hs-varid'>body1</span> <span class='hs-varid'>time1</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-></span>
<a name="line-108"></a> <span class='hs-layout'>(</span><span class='hs-conid'>T</span> <span class='hs-varid'>time0</span> <span class='hs-varid'>body0</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>T</span> <span class='hs-varid'>time1</span> <span class='hs-varid'>body1</span><span class='hs-layout'>)</span>
<a name="line-109"></a><span class='hs-definition'>lift</span> <span class='hs-varid'>f</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Cons</span> <span class='hs-varop'>.</span> <span class='hs-varid'>f</span> <span class='hs-varop'>.</span> <span class='hs-varid'>decons</span>
<a name="line-110"></a>
<a name="line-111"></a><a name="liftA"></a><span class='hs-definition'>liftA</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Applicative</span> <span class='hs-varid'>m</span> <span class='hs-keyglyph'>=></span>
<a name="line-112"></a> <span class='hs-layout'>(</span><span class='hs-conid'>Uniform</span><span class='hs-varop'>.</span><span class='hs-conid'>T</span> <span class='hs-varid'>body0</span> <span class='hs-varid'>time0</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>m</span> <span class='hs-layout'>(</span><span class='hs-conid'>Uniform</span><span class='hs-varop'>.</span><span class='hs-conid'>T</span> <span class='hs-varid'>body1</span> <span class='hs-varid'>time1</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-></span>
<a name="line-113"></a> <span class='hs-layout'>(</span><span class='hs-conid'>T</span> <span class='hs-varid'>time0</span> <span class='hs-varid'>body0</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>m</span> <span class='hs-layout'>(</span><span class='hs-conid'>T</span> <span class='hs-varid'>time1</span> <span class='hs-varid'>body1</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span>
<a name="line-114"></a><span class='hs-definition'>liftA</span> <span class='hs-varid'>f</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>App</span><span class='hs-varop'>.</span><span class='hs-varid'>liftA</span> <span class='hs-conid'>Cons</span> <span class='hs-varop'>.</span> <span class='hs-varid'>f</span> <span class='hs-varop'>.</span> <span class='hs-varid'>decons</span>
<a name="line-115"></a>
<a name="line-116"></a><a name="liftM"></a><span class='hs-definition'>liftM</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>Monad</span> <span class='hs-varid'>m</span> <span class='hs-keyglyph'>=></span>
<a name="line-117"></a> <span class='hs-layout'>(</span><span class='hs-conid'>Uniform</span><span class='hs-varop'>.</span><span class='hs-conid'>T</span> <span class='hs-varid'>body0</span> <span class='hs-varid'>time0</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>m</span> <span class='hs-layout'>(</span><span class='hs-conid'>Uniform</span><span class='hs-varop'>.</span><span class='hs-conid'>T</span> <span class='hs-varid'>body1</span> <span class='hs-varid'>time1</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-></span>
<a name="line-118"></a> <span class='hs-layout'>(</span><span class='hs-conid'>T</span> <span class='hs-varid'>time0</span> <span class='hs-varid'>body0</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>m</span> <span class='hs-layout'>(</span><span class='hs-conid'>T</span> <span class='hs-varid'>time1</span> <span class='hs-varid'>body1</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span>
<a name="line-119"></a><span class='hs-definition'>liftM</span> <span class='hs-varid'>f</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Monad</span><span class='hs-varop'>.</span><span class='hs-varid'>liftM</span> <span class='hs-conid'>Cons</span> <span class='hs-varop'>.</span> <span class='hs-varid'>f</span> <span class='hs-varop'>.</span> <span class='hs-varid'>decons</span>
<a name="line-120"></a>
<a name="line-121"></a><a name="unlift"></a><span class='hs-definition'>unlift</span> <span class='hs-keyglyph'>::</span>
<a name="line-122"></a> <span class='hs-layout'>(</span><span class='hs-conid'>T</span> <span class='hs-varid'>time0</span> <span class='hs-varid'>body0</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>T</span> <span class='hs-varid'>time1</span> <span class='hs-varid'>body1</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-></span>
<a name="line-123"></a> <span class='hs-layout'>(</span><span class='hs-conid'>Uniform</span><span class='hs-varop'>.</span><span class='hs-conid'>T</span> <span class='hs-varid'>body0</span> <span class='hs-varid'>time0</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Uniform</span><span class='hs-varop'>.</span><span class='hs-conid'>T</span> <span class='hs-varid'>body1</span> <span class='hs-varid'>time1</span><span class='hs-layout'>)</span>
<a name="line-124"></a><span class='hs-definition'>unlift</span> <span class='hs-varid'>f</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>decons</span> <span class='hs-varop'>.</span> <span class='hs-varid'>f</span> <span class='hs-varop'>.</span> <span class='hs-conid'>Cons</span>
<a name="line-125"></a>
<a name="line-126"></a>
<a name="line-127"></a>
<a name="line-128"></a>
<a name="line-129"></a><a name="consBody"></a><span class='hs-definition'>consBody</span> <span class='hs-keyglyph'>::</span> <span class='hs-varid'>body</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>BodyTimeList</span><span class='hs-varop'>.</span><span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span>
<a name="line-130"></a><span class='hs-definition'>consBody</span> <span class='hs-varid'>b</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>BodyTimePriv</span><span class='hs-varop'>.</span><span class='hs-conid'>Cons</span> <span class='hs-varop'>.</span> <span class='hs-conid'>Mixed</span><span class='hs-varop'>.</span><span class='hs-varid'>consFirst</span> <span class='hs-varid'>b</span> <span class='hs-varop'>.</span> <span class='hs-varid'>decons</span>
<a name="line-131"></a>
<a name="line-132"></a><a name="consTime"></a><span class='hs-definition'>consTime</span> <span class='hs-keyglyph'>::</span> <span class='hs-varid'>time</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>BodyTimeList</span><span class='hs-varop'>.</span><span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span>
<a name="line-133"></a><span class='hs-definition'>consTime</span> <span class='hs-varid'>t</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Cons</span> <span class='hs-varop'>.</span> <span class='hs-conid'>Mixed</span><span class='hs-varop'>.</span><span class='hs-varid'>consSecond</span> <span class='hs-varid'>t</span> <span class='hs-varop'>.</span> <span class='hs-conid'>BodyTimePriv</span><span class='hs-varop'>.</span><span class='hs-varid'>decons</span>
<a name="line-134"></a>
<a name="line-135"></a>
<a name="line-136"></a><a name="viewTimeL"></a><span class='hs-definition'>viewTimeL</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span> <span class='hs-keyglyph'>-></span> <span class='hs-layout'>(</span><span class='hs-varid'>time</span><span class='hs-layout'>,</span> <span class='hs-conid'>BodyTimeList</span><span class='hs-varop'>.</span><span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span><span class='hs-layout'>)</span>
<a name="line-137"></a><span class='hs-definition'>viewTimeL</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>mapSnd</span> <span class='hs-conid'>BodyTimePriv</span><span class='hs-varop'>.</span><span class='hs-conid'>Cons</span> <span class='hs-varop'>.</span> <span class='hs-conid'>Mixed</span><span class='hs-varop'>.</span><span class='hs-varid'>viewSecondL</span> <span class='hs-varop'>.</span> <span class='hs-varid'>decons</span>
<a name="line-138"></a>
<a name="line-139"></a><a name="viewBodyL"></a><span class='hs-definition'>viewBodyL</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>BodyTimeList</span><span class='hs-varop'>.</span><span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Maybe</span> <span class='hs-layout'>(</span><span class='hs-varid'>body</span><span class='hs-layout'>,</span> <span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span><span class='hs-layout'>)</span>
<a name="line-140"></a><span class='hs-definition'>viewBodyL</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>fmap</span> <span class='hs-layout'>(</span><span class='hs-varid'>mapSnd</span> <span class='hs-conid'>Cons</span><span class='hs-layout'>)</span> <span class='hs-varop'>.</span> <span class='hs-conid'>Mixed</span><span class='hs-varop'>.</span><span class='hs-varid'>viewFirstL</span> <span class='hs-varop'>.</span> <span class='hs-conid'>BodyTimePriv</span><span class='hs-varop'>.</span><span class='hs-varid'>decons</span>
<a name="line-141"></a>
<a name="line-142"></a>
<a name="line-143"></a><a name="viewTimeR"></a><span class='hs-definition'>viewTimeR</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span> <span class='hs-keyglyph'>-></span> <span class='hs-layout'>(</span><span class='hs-conid'>TimeBodyList</span><span class='hs-varop'>.</span><span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span><span class='hs-layout'>,</span> <span class='hs-varid'>time</span><span class='hs-layout'>)</span>
<a name="line-144"></a><span class='hs-definition'>viewTimeR</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>mapFst</span> <span class='hs-conid'>TimeBodyPriv</span><span class='hs-varop'>.</span><span class='hs-conid'>Cons</span> <span class='hs-varop'>.</span> <span class='hs-conid'>Mixed</span><span class='hs-varop'>.</span><span class='hs-varid'>viewSecondR</span> <span class='hs-varop'>.</span> <span class='hs-varid'>decons</span>
<a name="line-145"></a>
<a name="line-146"></a><a name="viewBodyR"></a><span class='hs-definition'>viewBodyR</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>TimeBodyList</span><span class='hs-varop'>.</span><span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Maybe</span> <span class='hs-layout'>(</span><span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span><span class='hs-layout'>,</span> <span class='hs-varid'>body</span><span class='hs-layout'>)</span>
<a name="line-147"></a><span class='hs-definition'>viewBodyR</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>fmap</span> <span class='hs-layout'>(</span><span class='hs-varid'>mapFst</span> <span class='hs-conid'>Cons</span><span class='hs-layout'>)</span> <span class='hs-varop'>.</span> <span class='hs-conid'>Mixed</span><span class='hs-varop'>.</span><span class='hs-varid'>viewFirstR</span> <span class='hs-varop'>.</span> <span class='hs-conid'>TimeBodyPriv</span><span class='hs-varop'>.</span><span class='hs-varid'>decons</span>
<a name="line-148"></a>
<a name="line-149"></a>
<a name="line-150"></a><a name="switchTimeL"></a><span class='hs-comment'>{-# INLINE switchTimeL #-}</span>
<a name="line-151"></a><span class='hs-definition'>switchTimeL</span> <span class='hs-keyglyph'>::</span> <span class='hs-layout'>(</span><span class='hs-varid'>time</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>BodyTimeList</span><span class='hs-varop'>.</span><span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>a</span>
<a name="line-152"></a><span class='hs-definition'>switchTimeL</span> <span class='hs-varid'>f</span> <span class='hs-keyglyph'>=</span>
<a name="line-153"></a> <span class='hs-conid'>Mixed</span><span class='hs-varop'>.</span><span class='hs-varid'>switchSecondL</span> <span class='hs-layout'>(</span><span class='hs-keyglyph'>\</span><span class='hs-varid'>b</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>f</span> <span class='hs-varid'>b</span> <span class='hs-varop'>.</span> <span class='hs-conid'>BodyTimePriv</span><span class='hs-varop'>.</span><span class='hs-conid'>Cons</span><span class='hs-layout'>)</span> <span class='hs-varop'>.</span> <span class='hs-varid'>decons</span>
<a name="line-154"></a>
<a name="line-155"></a><a name="switchBodyL"></a><span class='hs-comment'>{-# INLINE switchBodyL #-}</span>
<a name="line-156"></a><span class='hs-definition'>switchBodyL</span> <span class='hs-keyglyph'>::</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-></span> <span class='hs-layout'>(</span><span class='hs-varid'>body</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>BodyTimeList</span><span class='hs-varop'>.</span><span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>a</span>
<a name="line-157"></a><span class='hs-definition'>switchBodyL</span> <span class='hs-varid'>f</span> <span class='hs-varid'>g</span> <span class='hs-keyglyph'>=</span>
<a name="line-158"></a> <span class='hs-conid'>Mixed</span><span class='hs-varop'>.</span><span class='hs-varid'>switchFirstL</span> <span class='hs-varid'>f</span> <span class='hs-layout'>(</span><span class='hs-keyglyph'>\</span><span class='hs-varid'>t</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>g</span> <span class='hs-varid'>t</span> <span class='hs-varop'>.</span> <span class='hs-conid'>Cons</span><span class='hs-layout'>)</span> <span class='hs-varop'>.</span> <span class='hs-conid'>BodyTimePriv</span><span class='hs-varop'>.</span><span class='hs-varid'>decons</span>
<a name="line-159"></a>
<a name="line-160"></a>
<a name="line-161"></a><a name="switchTimeR"></a><span class='hs-comment'>{-# INLINE switchTimeR #-}</span>
<a name="line-162"></a><span class='hs-definition'>switchTimeR</span> <span class='hs-keyglyph'>::</span> <span class='hs-layout'>(</span><span class='hs-conid'>TimeBodyList</span><span class='hs-varop'>.</span><span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>time</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>a</span>
<a name="line-163"></a><span class='hs-definition'>switchTimeR</span> <span class='hs-varid'>f</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Mixed</span><span class='hs-varop'>.</span><span class='hs-varid'>switchSecondR</span> <span class='hs-layout'>(</span><span class='hs-varid'>f</span> <span class='hs-varop'>.</span> <span class='hs-conid'>TimeBodyPriv</span><span class='hs-varop'>.</span><span class='hs-conid'>Cons</span><span class='hs-layout'>)</span> <span class='hs-varop'>.</span> <span class='hs-varid'>decons</span>
<a name="line-164"></a>
<a name="line-165"></a><a name="switchBodyR"></a><span class='hs-comment'>{-# INLINE switchBodyR #-}</span>
<a name="line-166"></a><span class='hs-definition'>switchBodyR</span> <span class='hs-keyglyph'>::</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-></span> <span class='hs-layout'>(</span><span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>body</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>TimeBodyList</span><span class='hs-varop'>.</span><span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>a</span>
<a name="line-167"></a><span class='hs-definition'>switchBodyR</span> <span class='hs-varid'>f</span> <span class='hs-varid'>g</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Mixed</span><span class='hs-varop'>.</span><span class='hs-varid'>switchFirstR</span> <span class='hs-varid'>f</span> <span class='hs-layout'>(</span><span class='hs-varid'>g</span> <span class='hs-varop'>.</span> <span class='hs-conid'>Cons</span><span class='hs-layout'>)</span> <span class='hs-varop'>.</span> <span class='hs-conid'>TimeBodyPriv</span><span class='hs-varop'>.</span><span class='hs-varid'>decons</span>
<a name="line-168"></a>
<a name="line-169"></a>
<a name="line-170"></a><a name="mapTimeL"></a><span class='hs-definition'>mapTimeL</span> <span class='hs-keyglyph'>::</span>
<a name="line-171"></a> <span class='hs-layout'>(</span><span class='hs-varid'>time</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>time</span><span class='hs-layout'>,</span> <span class='hs-conid'>BodyTimeList</span><span class='hs-varop'>.</span><span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body0</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>BodyTimeList</span><span class='hs-varop'>.</span><span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body1</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-></span>
<a name="line-172"></a> <span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body0</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body1</span>
<a name="line-173"></a><span class='hs-definition'>mapTimeL</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>lift</span> <span class='hs-varop'>.</span> <span class='hs-conid'>Mixed</span><span class='hs-varop'>.</span><span class='hs-varid'>mapSecondL</span> <span class='hs-varop'>.</span> <span class='hs-varid'>mapSnd</span> <span class='hs-conid'>BodyTimePriv</span><span class='hs-varop'>.</span><span class='hs-varid'>unlift</span>
<a name="line-174"></a>
<a name="line-175"></a><a name="mapTimeHead"></a><span class='hs-definition'>mapTimeHead</span> <span class='hs-keyglyph'>::</span>
<a name="line-176"></a> <span class='hs-layout'>(</span><span class='hs-varid'>time</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>time</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-></span>
<a name="line-177"></a> <span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span>
<a name="line-178"></a><span class='hs-definition'>mapTimeHead</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>lift</span> <span class='hs-varop'>.</span> <span class='hs-conid'>Mixed</span><span class='hs-varop'>.</span><span class='hs-varid'>mapSecondHead</span>
<a name="line-179"></a>
<a name="line-180"></a><a name="mapTimeTail"></a><span class='hs-definition'>mapTimeTail</span> <span class='hs-keyglyph'>::</span>
<a name="line-181"></a> <span class='hs-layout'>(</span><span class='hs-conid'>BodyTimeList</span><span class='hs-varop'>.</span><span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body0</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>BodyTimeList</span><span class='hs-varop'>.</span><span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body1</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-></span>
<a name="line-182"></a> <span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body0</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body1</span>
<a name="line-183"></a><span class='hs-definition'>mapTimeTail</span> <span class='hs-varid'>f</span> <span class='hs-keyglyph'>=</span>
<a name="line-184"></a> <span class='hs-varid'>switchTimeL</span> <span class='hs-layout'>(</span><span class='hs-keyglyph'>\</span><span class='hs-varid'>time</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>consTime</span> <span class='hs-varid'>time</span> <span class='hs-varop'>.</span> <span class='hs-varid'>f</span><span class='hs-layout'>)</span>
<a name="line-185"></a><span class='hs-comment'>{-
<a name="line-186"></a>This causes a memory leak when used with chunky time values.
<a name="line-187"></a>I have found this problem in synthesizer-alsa:EventList.MIDI.matchNote,
<a name="line-188"></a>but I could not reliably reproduce that in smaller setups.
<a name="line-189"></a>
<a name="line-190"></a>mapTimeTail =
<a name="line-191"></a> lift . Mixed.mapSecondTail . BodyTimePriv.unlift
<a name="line-192"></a>-}</span>
<a name="line-193"></a>
<a name="line-194"></a>
<a name="line-195"></a><a name="mapTimeR"></a><span class='hs-definition'>mapTimeR</span> <span class='hs-keyglyph'>::</span>
<a name="line-196"></a> <span class='hs-layout'>(</span><span class='hs-conid'>TimeBodyList</span><span class='hs-varop'>.</span><span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body0</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>TimeBodyList</span><span class='hs-varop'>.</span><span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body1</span><span class='hs-layout'>,</span> <span class='hs-varid'>time</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>time</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-></span>
<a name="line-197"></a> <span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body0</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body1</span>
<a name="line-198"></a><span class='hs-definition'>mapTimeR</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>lift</span> <span class='hs-varop'>.</span> <span class='hs-conid'>Mixed</span><span class='hs-varop'>.</span><span class='hs-varid'>mapSecondR</span> <span class='hs-varop'>.</span> <span class='hs-varid'>mapFst</span> <span class='hs-conid'>TimeBodyPriv</span><span class='hs-varop'>.</span><span class='hs-varid'>unlift</span>
<a name="line-199"></a>
<a name="line-200"></a><a name="mapTimeLast"></a><span class='hs-definition'>mapTimeLast</span> <span class='hs-keyglyph'>::</span>
<a name="line-201"></a> <span class='hs-layout'>(</span><span class='hs-varid'>time</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>time</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-></span>
<a name="line-202"></a> <span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span>
<a name="line-203"></a><span class='hs-definition'>mapTimeLast</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>lift</span> <span class='hs-varop'>.</span> <span class='hs-conid'>Mixed</span><span class='hs-varop'>.</span><span class='hs-varid'>mapSecondLast</span>
<a name="line-204"></a>
<a name="line-205"></a><a name="mapTimeInit"></a><span class='hs-definition'>mapTimeInit</span> <span class='hs-keyglyph'>::</span>
<a name="line-206"></a> <span class='hs-layout'>(</span><span class='hs-conid'>TimeBodyList</span><span class='hs-varop'>.</span><span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body0</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>TimeBodyList</span><span class='hs-varop'>.</span><span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body1</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-></span>
<a name="line-207"></a> <span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body0</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body1</span>
<a name="line-208"></a><span class='hs-definition'>mapTimeInit</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>lift</span> <span class='hs-varop'>.</span> <span class='hs-conid'>Mixed</span><span class='hs-varop'>.</span><span class='hs-varid'>mapSecondInit</span> <span class='hs-varop'>.</span> <span class='hs-conid'>TimeBodyPriv</span><span class='hs-varop'>.</span><span class='hs-varid'>unlift</span>
<a name="line-209"></a>
<a name="line-210"></a>
<a name="line-211"></a><a name="foldr"></a><span class='hs-definition'>foldr</span> <span class='hs-keyglyph'>::</span> <span class='hs-layout'>(</span><span class='hs-varid'>time</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>b</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-></span> <span class='hs-layout'>(</span><span class='hs-varid'>body</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>b</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>a</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>b</span>
<a name="line-212"></a><span class='hs-definition'>foldr</span> <span class='hs-varid'>f</span> <span class='hs-varid'>g</span> <span class='hs-varid'>x</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Uniform</span><span class='hs-varop'>.</span><span class='hs-varid'>foldr</span> <span class='hs-varid'>g</span> <span class='hs-varid'>f</span> <span class='hs-varid'>x</span> <span class='hs-varop'>.</span> <span class='hs-varid'>decons</span>
<a name="line-213"></a>
<a name="line-214"></a><a name="forceTimeHead"></a><span class='hs-definition'>forceTimeHead</span> <span class='hs-keyglyph'>::</span> <span class='hs-layout'>(</span><span class='hs-conid'>NonNeg</span><span class='hs-varop'>.</span><span class='hs-conid'>C</span> <span class='hs-varid'>time</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=></span>
<a name="line-215"></a> <span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span>
<a name="line-216"></a><span class='hs-definition'>forceTimeHead</span> <span class='hs-keyglyph'>=</span>
<a name="line-217"></a> <span class='hs-varid'>mapTimeHead</span> <span class='hs-varid'>id</span>
<a name="line-218"></a>
<a name="line-219"></a><a name="delay"></a><span class='hs-definition'>delay</span> <span class='hs-keyglyph'>::</span> <span class='hs-layout'>(</span><span class='hs-conid'>NonNeg</span><span class='hs-varop'>.</span><span class='hs-conid'>C</span> <span class='hs-varid'>time</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=></span>
<a name="line-220"></a> <span class='hs-varid'>time</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span>
<a name="line-221"></a><span class='hs-definition'>delay</span> <span class='hs-varid'>dif</span> <span class='hs-keyglyph'>=</span>
<a name="line-222"></a> <span class='hs-varid'>mapTimeHead</span> <span class='hs-layout'>(</span><span class='hs-varid'>add</span> <span class='hs-varid'>dif</span><span class='hs-layout'>)</span>
<a name="line-223"></a>
<a name="line-224"></a><a name="flatten"></a><span class='hs-definition'>flatten</span> <span class='hs-keyglyph'>::</span> <span class='hs-layout'>(</span><span class='hs-conid'>NonNeg</span><span class='hs-varop'>.</span><span class='hs-conid'>C</span> <span class='hs-varid'>time</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=></span> <span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-keyglyph'>[</span><span class='hs-varid'>body</span><span class='hs-keyglyph'>]</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>T</span> <span class='hs-varid'>time</span> <span class='hs-varid'>body</span>
<a name="line-225"></a><span class='hs-definition'>flatten</span> <span class='hs-keyglyph'>=</span>
<a name="line-226"></a> <span class='hs-conid'>Cons</span> <span class='hs-varop'>.</span>
<a name="line-227"></a> <span class='hs-conid'>Uniform</span><span class='hs-varop'>.</span><span class='hs-varid'>foldr</span>
<a name="line-228"></a> <span class='hs-layout'>(</span><span class='hs-conid'>Mixed</span><span class='hs-varop'>.</span><span class='hs-varid'>appendUniformUniform</span> <span class='hs-varop'>.</span> <span class='hs-conid'>Uniform</span><span class='hs-varop'>.</span><span class='hs-varid'>fromSecondList</span> <span class='hs-varid'>zero</span><span class='hs-layout'>)</span>
<a name="line-229"></a> <span class='hs-conid'>Mixed</span><span class='hs-varop'>.</span><span class='hs-varid'>consSecond</span> <span class='hs-comment'>-- consTime</span>
<a name="line-230"></a> <span class='hs-conid'>Disp</span><span class='hs-varop'>.</span><span class='hs-varid'>empty</span> <span class='hs-varop'>.</span>
<a name="line-231"></a><span class='hs-comment'>-- (\(b:bs) xs -> consBody b (List.foldr (cons 0) xs bs)) empty .</span>
<a name="line-232"></a> <span class='hs-conid'>Uniform</span><span class='hs-varop'>.</span><span class='hs-varid'>mapSecond</span> <span class='hs-conid'>NonNeg</span><span class='hs-varop'>.</span><span class='hs-varid'>sum</span> <span class='hs-varop'>.</span>
<a name="line-233"></a> <span class='hs-conid'>Uniform</span><span class='hs-varop'>.</span><span class='hs-varid'>filterFirst</span> <span class='hs-layout'>(</span><span class='hs-varid'>not</span> <span class='hs-varop'>.</span> <span class='hs-varid'>null</span><span class='hs-layout'>)</span> <span class='hs-varop'>.</span>
<a name="line-234"></a> <span class='hs-varid'>decons</span>
</pre></body>
</html>
|