| 1 | |
|---|
| 2 | New patches: |
|---|
| 3 | |
|---|
| 4 | [new Control.Compositor module |
|---|
| 5 | Ashley Yakeley <ashley@semantic.org>**20071013074851 |
|---|
| 6 | |
|---|
| 7 | The Compositor class is a superclass of Arrow. |
|---|
| 8 | ] { |
|---|
| 9 | addfile ./Control/Compositor.hs |
|---|
| 10 | hunk ./Control/Applicative.hs 42 |
|---|
| 11 | +import Control.Compositor |
|---|
| 12 | hunk ./Control/Applicative.hs 44 |
|---|
| 13 | - (Arrow(arr, (>>>), (&&&)), ArrowZero(zeroArrow), ArrowPlus((<+>))) |
|---|
| 14 | + (Arrow(arr, (&&&)), ArrowZero(zeroArrow), ArrowPlus((<+>))) |
|---|
| 15 | hunk ./Control/Arrow.hs 28 |
|---|
| 16 | - (<<<), (<<^), (^<<), |
|---|
| 17 | + (<<^), (^<<), |
|---|
| 18 | hunk ./Control/Arrow.hs 43 |
|---|
| 19 | +import Control.Compositor |
|---|
| 20 | hunk ./Control/Arrow.hs 50 |
|---|
| 21 | -infixr 1 >>>, ^>>, >>^ |
|---|
| 22 | -infixr 1 <<<, ^<<, <<^ |
|---|
| 23 | +infixr 1 ^>>, >>^ |
|---|
| 24 | +infixr 1 ^<<, <<^ |
|---|
| 25 | hunk ./Control/Arrow.hs 55 |
|---|
| 26 | --- as well as '>>>' and 'first'. The other combinators have sensible |
|---|
| 27 | +-- as well as 'first'. The other combinators have sensible |
|---|
| 28 | hunk ./Control/Arrow.hs 58 |
|---|
| 29 | -class Arrow a where |
|---|
| 30 | +class Compositor a => Arrow a where |
|---|
| 31 | hunk ./Control/Arrow.hs 69 |
|---|
| 32 | - -- | Left-to-right composition of arrows. |
|---|
| 33 | - (>>>) :: a b c -> a c d -> a b d |
|---|
| 34 | - |
|---|
| 35 | hunk ./Control/Arrow.hs 98 |
|---|
| 36 | +"identity" |
|---|
| 37 | + arr id = identity |
|---|
| 38 | hunk ./Control/Arrow.hs 120 |
|---|
| 39 | - f >>> g = g . f |
|---|
| 40 | hunk ./Control/Arrow.hs 130 |
|---|
| 41 | +instance Monad m => Compositor (Kleisli m) where |
|---|
| 42 | + identity = Kleisli return |
|---|
| 43 | + Kleisli f >>> Kleisli g = Kleisli (\b -> f b >>= g) |
|---|
| 44 | + |
|---|
| 45 | hunk ./Control/Arrow.hs 136 |
|---|
| 46 | - Kleisli f >>> Kleisli g = Kleisli (\b -> f b >>= g) |
|---|
| 47 | hunk ./Control/Arrow.hs 152 |
|---|
| 48 | --- | Right-to-left composition, for a better fit with arrow notation. |
|---|
| 49 | -(<<<) :: Arrow a => a c d -> a b c -> a b d |
|---|
| 50 | -f <<< g = g >>> f |
|---|
| 51 | - |
|---|
| 52 | hunk ./Control/Compositor.hs 1 |
|---|
| 53 | +----------------------------------------------------------------------------- |
|---|
| 54 | +-- | |
|---|
| 55 | +-- Module : Control.Compositor |
|---|
| 56 | +-- Copyright : (c) Ashley Yakeley 2007 |
|---|
| 57 | +-- License : BSD-style (see the LICENSE file in the distribution) |
|---|
| 58 | +-- |
|---|
| 59 | +-- Maintainer : ashley@semantic.org |
|---|
| 60 | +-- Stability : experimental |
|---|
| 61 | +-- Portability : portable |
|---|
| 62 | + |
|---|
| 63 | +module Control.Compositor where |
|---|
| 64 | + |
|---|
| 65 | +infixr 1 >>>, <<< |
|---|
| 66 | + |
|---|
| 67 | +class Compositor comp where |
|---|
| 68 | + identity :: comp a a |
|---|
| 69 | + |
|---|
| 70 | + -- | Left-to-right composition |
|---|
| 71 | + (>>>) :: comp a b -> comp b c -> comp a c |
|---|
| 72 | + |
|---|
| 73 | +{-# RULES |
|---|
| 74 | +"identity/left" forall p . |
|---|
| 75 | + identity >>> p = p |
|---|
| 76 | +"identity/right" forall p . |
|---|
| 77 | + p >>> identity = p |
|---|
| 78 | +"association" forall p q r . |
|---|
| 79 | + (p >>> q) >>> r = p >>> (q >>> r) |
|---|
| 80 | + #-} |
|---|
| 81 | + |
|---|
| 82 | +instance Compositor (->) where |
|---|
| 83 | + identity = id |
|---|
| 84 | + p >>> q = q . p |
|---|
| 85 | + |
|---|
| 86 | +-- | Right-to-left composition |
|---|
| 87 | +(<<<) :: Compositor comp => comp b c -> comp a b -> comp a c |
|---|
| 88 | +f <<< g = g >>> f |
|---|
| 89 | + |
|---|
| 90 | hunk ./base.cabal 72 |
|---|
| 91 | + Control.Compositor, |
|---|
| 92 | } |
|---|
| 93 | |
|---|
| 94 | [new Control.Category, ghc ticket #1773 |
|---|
| 95 | Ashley Yakeley <ashley@semantic.org>**20071029022526] { |
|---|
| 96 | move ./Control/Compositor.hs ./Control/Category.hs |
|---|
| 97 | replace ./Control/Applicative.hs [A-Za-z_0-9] Compositor Category |
|---|
| 98 | replace ./Control/Arrow.hs [A-Za-z_0-9] Compositor Category |
|---|
| 99 | replace ./Control/Category.hs [A-Za-z_0-9] Compositor Category |
|---|
| 100 | replace ./Control/Category.hs [A-Za-z_0-9] comp cat |
|---|
| 101 | replace ./base.cabal [A-Za-z_0-9] Compositor Category |
|---|
| 102 | hunk ./Control/Applicative.hs 38 |
|---|
| 103 | -#ifdef __HADDOCK__ |
|---|
| 104 | -import Prelude |
|---|
| 105 | -#endif |
|---|
| 106 | +import Prelude hiding (id,(.)) |
|---|
| 107 | hunk ./Control/Arrow.hs 39 |
|---|
| 108 | -import Prelude |
|---|
| 109 | +import Prelude hiding (id,(.)) |
|---|
| 110 | hunk ./Control/Arrow.hs 99 |
|---|
| 111 | - arr id = identity |
|---|
| 112 | + arr id = id |
|---|
| 113 | hunk ./Control/Arrow.hs 101 |
|---|
| 114 | - arr f >>> arr g = arr (f >>> g) |
|---|
| 115 | + (arr f) . (arr g) = arr (f . g) |
|---|
| 116 | hunk ./Control/Arrow.hs 111 |
|---|
| 117 | - first f >>> first g = first (f >>> g) |
|---|
| 118 | + (first f) . (first g) = first (f . g) |
|---|
| 119 | hunk ./Control/Arrow.hs 113 |
|---|
| 120 | - second f >>> second g = second (f >>> g) |
|---|
| 121 | + (second f) . (second g) = second (f . g) |
|---|
| 122 | hunk ./Control/Arrow.hs 131 |
|---|
| 123 | - identity = Kleisli return |
|---|
| 124 | - Kleisli f >>> Kleisli g = Kleisli (\b -> f b >>= g) |
|---|
| 125 | + id = Kleisli return |
|---|
| 126 | + (Kleisli f) . (Kleisli g) = Kleisli (\b -> g b >>= f) |
|---|
| 127 | hunk ./Control/Category.hs 11 |
|---|
| 128 | +-- http://hackage.haskell.org/trac/ghc/ticket/1773 |
|---|
| 129 | + |
|---|
| 130 | hunk ./Control/Category.hs 15 |
|---|
| 131 | +import Prelude hiding (id,(.)) |
|---|
| 132 | +import qualified Prelude |
|---|
| 133 | + |
|---|
| 134 | +infixr 9 . |
|---|
| 135 | hunk ./Control/Category.hs 21 |
|---|
| 136 | +-- | A class for categories. |
|---|
| 137 | +-- id and (.) must form a monoid. |
|---|
| 138 | hunk ./Control/Category.hs 24 |
|---|
| 139 | - identity :: cat a a |
|---|
| 140 | + -- | the identity morphism |
|---|
| 141 | + id :: cat a a |
|---|
| 142 | hunk ./Control/Category.hs 27 |
|---|
| 143 | - -- | Left-to-right composition |
|---|
| 144 | - (>>>) :: cat a b -> cat b c -> cat a c |
|---|
| 145 | + -- | morphism composition |
|---|
| 146 | + (.) :: cat b c -> cat a b -> cat a c |
|---|
| 147 | hunk ./Control/Category.hs 32 |
|---|
| 148 | - identity >>> p = p |
|---|
| 149 | + id . p = p |
|---|
| 150 | hunk ./Control/Category.hs 34 |
|---|
| 151 | - p >>> identity = p |
|---|
| 152 | + p . id = p |
|---|
| 153 | hunk ./Control/Category.hs 36 |
|---|
| 154 | - (p >>> q) >>> r = p >>> (q >>> r) |
|---|
| 155 | + (p . q) . r = p . (q . r) |
|---|
| 156 | hunk ./Control/Category.hs 40 |
|---|
| 157 | - identity = id |
|---|
| 158 | - p >>> q = q . p |
|---|
| 159 | + id = Prelude.id |
|---|
| 160 | + (.) = (Prelude..) |
|---|
| 161 | hunk ./Control/Category.hs 45 |
|---|
| 162 | -f <<< g = g >>> f |
|---|
| 163 | +(<<<) = (.) |
|---|
| 164 | hunk ./Control/Category.hs 47 |
|---|
| 165 | +-- | Left-to-right composition |
|---|
| 166 | +(>>>) :: Category cat => cat a b -> cat b c -> cat a c |
|---|
| 167 | +f >>> g = g . f |
|---|
| 168 | } |
|---|
| 169 | |
|---|
| 170 | Context: |
|---|
| 171 | |
|---|
| 172 | [Fix doc building with Haddock 0.9 |
|---|
| 173 | Simon Marlow <simonmar@microsoft.com>**20071024090947 |
|---|
| 174 | I was using a recent build here, which is more tolerant. |
|---|
| 175 | ] |
|---|
| 176 | [FIX #1258: document that openTempFile is secure(ish) |
|---|
| 177 | Simon Marlow <simonmar@microsoft.com>**20071023130928 |
|---|
| 178 | Also change the mode from 0666 to 0600, which seems like a more |
|---|
| 179 | sensible value and matches what C's mkstemp() does. |
|---|
| 180 | ] |
|---|
| 181 | [Clean up .cabal file a bit |
|---|
| 182 | Duncan Coutts <duncan@haskell.org>**20071022132708 |
|---|
| 183 | specify build-type and cabal-version >= 1.2 |
|---|
| 184 | put extra-tmp-files in the right place |
|---|
| 185 | use os(windows) rather than os(mingw32) |
|---|
| 186 | ] |
|---|
| 187 | [base in 6.8 and head branch should be version 3.0 |
|---|
| 188 | Don Stewart <dons@galois.com>**20071007150408] |
|---|
| 189 | [FIX #1652: openTempFile should accept an empty string for the directory |
|---|
| 190 | Simon Marlow <simonmar@microsoft.com>**20071018122345] |
|---|
| 191 | [clean up duplicate code |
|---|
| 192 | Simon Marlow <simonmar@microsoft.com>**20071017141311] |
|---|
| 193 | [expose the value of +RTS -N as GHC.Conc.numCapabilities (see #1733) |
|---|
| 194 | Simon Marlow <simonmar@microsoft.com>**20071009132042] |
|---|
| 195 | [typo |
|---|
| 196 | Simon Marlow <simonmar@microsoft.com>**20070917130703] |
|---|
| 197 | [put extra-tmp-files field in the right place |
|---|
| 198 | Simon Marlow <simonmar@microsoft.com>**20070914140812] |
|---|
| 199 | [Add more entries to boring file |
|---|
| 200 | Ian Lynagh <igloo@earth.li>**20070913210500] |
|---|
| 201 | [Add a boring file |
|---|
| 202 | Ian Lynagh <igloo@earth.li>**20070913204641] |
|---|
| 203 | [TAG 2007-09-13 |
|---|
| 204 | Ian Lynagh <igloo@earth.li>**20070913215720] |
|---|
| 205 | Patch bundle hash: |
|---|
| 206 | c9be4454266d7c68b75bb60609db84d73ad949e1 |
|---|