Permalink
Browse files

Remove non-pretty-printing stuff (of base), and rename package to "pr…

…etty"
  • Loading branch information...
1 parent 4bff620 commit 590fce93f61ec5b68e58761653fc967efc8b2678 @igfoo igfoo committed May 18, 2007
Showing with 21 additions and 63,134 deletions.
  1. +0 −220 Control/Applicative.hs
  2. +0 −281 Control/Arrow.hs
  3. +0 −546 Control/Concurrent.hs
  4. +0 −132 Control/Concurrent/Chan.hs
  5. +0 −114 Control/Concurrent/MVar.hs
  6. +0 −77 Control/Concurrent/QSem.hs
  7. +0 −70 Control/Concurrent/QSemN.hs
  8. +0 −117 Control/Concurrent/SampleVar.hs
  9. +0 −592 Control/Exception.hs
  10. +0 −334 Control/Monad.hs
  11. +0 −73 Control/Monad/Fix.hs
  12. +0 −31 Control/Monad/Instances.hs
  13. +0 −64 Control/Monad/ST.hs
  14. +0 −152 Control/Monad/ST/Lazy.hs
  15. +0 −20 Control/Monad/ST/Strict.hs
  16. +0 −104 Control/Parallel.hs
  17. +0 −593 Control/Parallel/Strategies.hs
  18. +0 −88 Data/Array.hs
  19. +0 −1,686 Data/Array/Base.hs
  20. +0 −423 Data/Array/Diff.hs
  21. +0 −51 Data/Array/IArray.hs
  22. +0 −262 Data/Array/IO.hs
  23. +0 −322 Data/Array/IO/Internals.hs
  24. +0 −55 Data/Array/MArray.hs
  25. +0 −77 Data/Array/ST.hs
  26. +0 −92 Data/Array/Storable.hs
  27. +0 −26 Data/Array/Unboxed.hs
  28. +0 −342 Data/Bits.hs
  29. +0 −39 Data/Bool.hs
  30. +0 −2,020 Data/ByteString.hs
  31. +0 −514 Data/ByteString/Base.hs
  32. +0 −995 Data/ByteString/Char8.hs
  33. +0 −699 Data/ByteString/Fusion.hs
  34. +0 −1,293 Data/ByteString/Lazy.hs
  35. +0 −748 Data/ByteString/Lazy/Char8.hs
  36. +0 −211 Data/Char.hs
  37. +0 −200 Data/Complex.hs
  38. +0 −166 Data/Dynamic.hs
  39. +0 −5 Data/Dynamic.hs-boot
  40. +0 −42 Data/Either.hs
  41. +0 −22 Data/Eq.hs
  42. +0 −147 Data/Fixed.hs
  43. +0 −301 Data/Foldable.hs
  44. +0 −83 Data/Function.hs
  45. +0 −53 Data/Generics.hs
  46. +0 −368 Data/Generics/Aliases.hs
  47. +0 −766 Data/Generics/Basics.hs
  48. +0 −617 Data/Generics/Instances.hs
  49. +0 −168 Data/Generics/Schemes.hs
  50. +0 −124 Data/Generics/Text.hs
  51. +0 −250 Data/Generics/Twins.hs
  52. +0 −432 Data/Graph.hs
  53. +0 −466 Data/HashTable.hs
  54. +0 −93 Data/IORef.hs
  55. +0 −65 Data/Int.hs
  56. +0 −1,549 Data/IntMap.hs
  57. +0 −1,020 Data/IntSet.hs
  58. +0 −76 Data/Ix.hs
  59. +0 −969 Data/List.hs
  60. +0 −1,846 Data/Map.hs
  61. +0 −149 Data/Maybe.hs
  62. +0 −253 Data/Monoid.hs
  63. +0 −34 Data/Ord.hs
  64. +0 −434 Data/PackedString.hs
  65. +0 −94 Data/Ratio.hs
  66. +0 −41 Data/STRef.hs
  67. +0 −34 Data/STRef/Lazy.hs
  68. +0 −20 Data/STRef/Strict.hs
  69. +0 −1,124 Data/Sequence.hs
  70. +0 −1,149 Data/Set.hs
  71. +0 −31 Data/String.hs
  72. +0 −139 Data/Traversable.hs
  73. +0 −166 Data/Tree.hs
  74. +0 −276 Data/Tuple.hs
  75. +0 −683 Data/Typeable.hs
  76. +0 −18 Data/Typeable.hs-boot
  77. +0 −61 Data/Unique.hs
  78. +0 −152 Data/Version.hs
  79. +0 −68 Data/Word.hs
  80. +0 −67 Debug/Trace.hs
  81. +0 −41 Foreign.hs
  82. +0 −24 Foreign/C.hs
  83. +0 −570 Foreign/C/Error.hs
  84. +0 −478 Foreign/C/String.hs
  85. +0 −304 Foreign/C/Types.hs
  86. +0 −54 Foreign/Concurrent.hs
  87. +0 −200 Foreign/ForeignPtr.hs
  88. +0 −28 Foreign/Marshal.hs
  89. +0 −195 Foreign/Marshal/Alloc.hs
  90. +0 −275 Foreign/Marshal/Array.hs
  91. +0 −83 Foreign/Marshal/Error.hs
  92. +0 −208 Foreign/Marshal/Pool.hs
  93. +0 −179 Foreign/Marshal/Utils.hs
  94. +0 −154 Foreign/Ptr.hs
  95. +0 −61 Foreign/StablePtr.hs
  96. +0 −245 Foreign/Storable.hs
  97. +0 −22 Foreign/Storable.hs-boot
  98. +0 −683 GHC/Arr.lhs
  99. +0 −1,082 GHC/Base.lhs
  100. +0 −1,103 GHC/Conc.lhs
  101. +0 −132 GHC/ConsoleHandler.hs
  102. +0 −71 GHC/Dotnet.hs
  103. +0 −536 GHC/Enum.lhs
  104. +0 −147 GHC/Err.lhs
  105. +0 −26 GHC/Err.lhs-boot
  106. +0 −123 GHC/Exception.lhs
  107. +0 −48 GHC/Exts.hs
  108. +0 −962 GHC/Float.lhs
  109. +0 −314 GHC/ForeignPtr.hs
  110. +0 −1,770 GHC/Handle.hs
  111. +0 −961 GHC/IO.hs
  112. +0 −989 GHC/IOBase.lhs
  113. +0 −835 GHC/Int.hs
  114. +0 −725 GHC/List.lhs
  115. +0 −543 GHC/Num.lhs
  116. +0 −719 GHC/PArr.hs
  117. +0 −103 GHC/Pack.lhs
  118. +0 −164 GHC/Ptr.lhs
  119. +0 −716 GHC/Read.lhs
  120. +0 −463 GHC/Real.lhs
  121. +0 −164 GHC/ST.lhs
  122. +0 −46 GHC/STRef.lhs
  123. +0 −414 GHC/Show.lhs
  124. +0 −106 GHC/Stable.lhs
  125. +0 −164 GHC/Storable.lhs
  126. +0 −138 GHC/TopHandler.lhs
  127. +0 −10 GHC/TopHandler.lhs-boot
  128. +0 −228 GHC/Unicode.hs
  129. +0 −17 GHC/Unicode.hs-boot
  130. +0 −133 GHC/Weak.lhs
  131. +0 −889 GHC/Word.hs
  132. +3 −47 LICENSE
  133. +0 −141 Makefile
  134. +0 −67 Makefile.nhc98
  135. 0 NHC/Makefile
  136. +0 −88 NHC/PosixTypes.hsc
  137. +0 −49 NHC/SizedTypes.hs
  138. +0 −219 Numeric.hs
  139. +0 −194 Prelude.hs
  140. +4 −104 Setup.hs
  141. +0 −147 System/CPUTime.hsc
  142. +0 −140 System/Cmd.hs
  143. +0 −392 System/Console/GetOpt.hs
  144. +0 −1,044 System/Directory.hs
  145. +0 −186 System/Directory/Internals.hs
  146. +0 −196 System/Environment.hs
  147. +0 −74 System/Exit.hs
  148. +0 −441 System/IO.hs
  149. +0 −386 System/IO/Error.hs
  150. +0 −37 System/IO/Unsafe.hs
  151. +0 −66 System/Info.hs
  152. +0 −85 System/Locale.hs
  153. +0 −32 System/Mem.hs
  154. +0 −114 System/Mem/StableName.hs
  155. +0 −153 System/Mem/Weak.hs
  156. +0 −518 System/Posix/Internals.hs
  157. +0 −537 System/Posix/Signals.hs
  158. +0 −201 System/Posix/Types.hs
  159. +0 −326 System/Process.hs
  160. +0 −429 System/Process/Internals.hs
  161. +0 −449 System/Random.hs
  162. +0 −756 System/Time.hsc
  163. +0 −72 System/Timeout.hs
  164. +0 −524 Text/ParserCombinators/ReadP.hs
  165. +0 −162 Text/ParserCombinators/ReadPrec.hs
  166. +0 −278 Text/Printf.hs
  167. +0 −70 Text/Read.hs
  168. +0 −442 Text/Read/Lex.hs
  169. +0 −47 Text/Show.hs
  170. +0 −25 Text/Show/Functions.hs
  171. +0 −31 Unsafe/Coerce.hs
  172. +0 −247 aclocal.m4
  173. +0 −196 base.cabal
  174. +0 −20 cbits/Makefile
  175. +0 −9 cbits/PrelIOUtils.c
  176. +0 −3,099 cbits/WCsubst.c
  177. +0 −123 cbits/Win32Utils.c
  178. +0 −88 cbits/consUtils.c
  179. +0 −217 cbits/dirUtils.c
  180. +0 −175 cbits/execvpe.c
  181. +0 −82 cbits/fpstring.c
  182. +0 −96 cbits/inputReady.c
  183. +0 −112 cbits/lockFile.c
  184. +0 −129 cbits/longlong.c
  185. +0 −461 cbits/runProcess.c
  186. +0 −3 cbits/selectUtils.c
  187. +0 −15 cbits/timeUtils.c
  188. +0 −344 cbits/ubconfc
  189. +0 −116 configure.ac
  190. +0 −210 include/CTypes.h
  191. +0 −781 include/HsBase.h
  192. +0 −14 include/Makefile
  193. +0 −64 include/Typeable.h
  194. +0 −24 include/WCsubst.h
  195. +0 −12 include/consUtils.h
  196. +0 −20 include/dirUtils.h
  197. +0 −6 include/fpstring.h
  198. +0 −14 include/lockFile.h
  199. +0 −46 include/runProcess.h
  200. +0 −12 include/timeUtils.h
  201. +0 −198 package.conf.in
  202. +13 −0 pretty.cabal
  203. +1 −3 prologue.txt
View
@@ -1,220 +0,0 @@
------------------------------------------------------------------------------
--- |
--- Module : Control.Applicative
--- Copyright : Conor McBride and Ross Paterson 2005
--- License : BSD-style (see the LICENSE file in the distribution)
---
--- Maintainer : ross@soi.city.ac.uk
--- Stability : experimental
--- Portability : portable
---
--- This module describes a structure intermediate between a functor and
--- a monad: it provides pure expressions and sequencing, but no binding.
--- (Technically, a strong lax monoidal functor.) For more details, see
--- /Applicative Programming with Effects/,
--- by Conor McBride and Ross Paterson, online at
--- <http://www.soi.city.ac.uk/~ross/papers/Applicative.html>.
---
--- This interface was introduced for parsers by Niklas R&#xF6;jemo, because
--- it admits more sharing than the monadic interface. The names here are
--- mostly based on recent parsing work by Doaitse Swierstra.
---
--- This class is also useful with instances of the
--- 'Data.Traversable.Traversable' class.
-
-module Control.Applicative (
- -- * Applicative functors
- Applicative(..),
- -- * Alternatives
- Alternative(..),
- -- * Instances
- Const(..), WrappedMonad(..), WrappedArrow(..), ZipList(..),
- -- * Utility functions
- (<$>), (<$), (*>), (<*), (<**>),
- liftA, liftA2, liftA3,
- optional, some, many
- ) where
-
-#ifdef __HADDOCK__
-import Prelude
-#endif
-
-import Control.Arrow
- (Arrow(arr, (>>>), (&&&)), ArrowZero(zeroArrow), ArrowPlus((<+>)))
-import Control.Monad (liftM, ap, MonadPlus(..))
-import Control.Monad.Instances ()
-import Data.Monoid (Monoid(..))
-
-infixl 3 <|>
-infixl 4 <$>, <$
-infixl 4 <*>, <*, *>, <**>
-
--- | A functor with application.
---
--- Instances should satisfy the following laws:
---
--- [/identity/]
--- @'pure' 'id' '<*>' v = v@
---
--- [/composition/]
--- @'pure' (.) '<*>' u '<*>' v '<*>' w = u '<*>' (v '<*>' w)@
---
--- [/homomorphism/]
--- @'pure' f '<*>' 'pure' x = 'pure' (f x)@
---
--- [/interchange/]
--- @u '<*>' 'pure' y = 'pure' ('$' y) '<*>' u@
---
--- The 'Functor' instance should satisfy
---
--- @
--- 'fmap' f x = 'pure' f '<*>' x
--- @
---
--- If @f@ is also a 'Monad', define @'pure' = 'return'@ and @('<*>') = 'ap'@.
-
-class Functor f => Applicative f where
- -- | Lift a value.
- pure :: a -> f a
-
- -- | Sequential application.
- (<*>) :: f (a -> b) -> f a -> f b
-
--- | A monoid on applicative functors.
-class Applicative f => Alternative f where
- -- | The identity of '<|>'
- empty :: f a
- -- | An associative binary operation
- (<|>) :: f a -> f a -> f a
-
--- instances for Prelude types
-
-instance Applicative Maybe where
- pure = return
- (<*>) = ap
-
-instance Alternative Maybe where
- empty = Nothing
- Nothing <|> p = p
- Just x <|> _ = Just x
-
-instance Applicative [] where
- pure = return
- (<*>) = ap
-
-instance Alternative [] where
- empty = []
- (<|>) = (++)
-
-instance Applicative IO where
- pure = return
- (<*>) = ap
-
-instance Applicative ((->) a) where
- pure = const
- (<*>) f g x = f x (g x)
-
-instance Monoid a => Applicative ((,) a) where
- pure x = (mempty, x)
- (u, f) <*> (v, x) = (u `mappend` v, f x)
-
--- new instances
-
-newtype Const a b = Const { getConst :: a }
-
-instance Functor (Const m) where
- fmap _ (Const v) = Const v
-
-instance Monoid m => Applicative (Const m) where
- pure _ = Const mempty
- Const f <*> Const v = Const (f `mappend` v)
-
-newtype WrappedMonad m a = WrapMonad { unwrapMonad :: m a }
-
-instance Monad m => Functor (WrappedMonad m) where
- fmap f (WrapMonad v) = WrapMonad (liftM f v)
-
-instance Monad m => Applicative (WrappedMonad m) where
- pure = WrapMonad . return
- WrapMonad f <*> WrapMonad v = WrapMonad (f `ap` v)
-
-instance MonadPlus m => Alternative (WrappedMonad m) where
- empty = WrapMonad mzero
- WrapMonad u <|> WrapMonad v = WrapMonad (u `mplus` v)
-
-newtype WrappedArrow a b c = WrapArrow { unwrapArrow :: a b c }
-
-instance Arrow a => Functor (WrappedArrow a b) where
- fmap f (WrapArrow a) = WrapArrow (a >>> arr f)
-
-instance Arrow a => Applicative (WrappedArrow a b) where
- pure x = WrapArrow (arr (const x))
- WrapArrow f <*> WrapArrow v = WrapArrow (f &&& v >>> arr (uncurry id))
-
-instance (ArrowZero a, ArrowPlus a) => Alternative (WrappedArrow a b) where
- empty = WrapArrow zeroArrow
- WrapArrow u <|> WrapArrow v = WrapArrow (u <+> v)
-
--- | Lists, but with an 'Applicative' functor based on zipping, so that
---
--- @f '<$>' 'ZipList' xs1 '<*>' ... '<*>' 'ZipList' xsn = 'ZipList' (zipWithn f xs1 ... xsn)@
---
-newtype ZipList a = ZipList { getZipList :: [a] }
-
-instance Functor ZipList where
- fmap f (ZipList xs) = ZipList (map f xs)
-
-instance Applicative ZipList where
- pure x = ZipList (repeat x)
- ZipList fs <*> ZipList xs = ZipList (zipWith id fs xs)
-
--- extra functions
-
--- | A synonym for 'fmap'.
-(<$>) :: Functor f => (a -> b) -> f a -> f b
-f <$> a = fmap f a
-
--- | Replace the value.
-(<$) :: Functor f => a -> f b -> f a
-(<$) = (<$>) . const
-
--- | Sequence actions, discarding the value of the first argument.
-(*>) :: Applicative f => f a -> f b -> f b
-(*>) = liftA2 (const id)
-
--- | Sequence actions, discarding the value of the second argument.
-(<*) :: Applicative f => f a -> f b -> f a
-(<*) = liftA2 const
-
--- | A variant of '<*>' with the arguments reversed.
-(<**>) :: Applicative f => f a -> f (a -> b) -> f b
-(<**>) = liftA2 (flip ($))
-
--- | Lift a function to actions.
--- This function may be used as a value for `fmap` in a `Functor` instance.
-liftA :: Applicative f => (a -> b) -> f a -> f b
-liftA f a = pure f <*> a
-
--- | Lift a binary function to actions.
-liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c
-liftA2 f a b = f <$> a <*> b
-
--- | Lift a ternary function to actions.
-liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d
-liftA3 f a b c = f <$> a <*> b <*> c
-
--- | One or none.
-optional :: Alternative f => f a -> f (Maybe a)
-optional v = Just <$> v <|> pure Nothing
-
--- | One or more.
-some :: Alternative f => f a -> f [a]
-some v = some_v
- where many_v = some_v <|> pure []
- some_v = (:) <$> v <*> many_v
-
--- | Zero or more.
-many :: Alternative f => f a -> f [a]
-many v = many_v
- where many_v = some_v <|> pure []
- some_v = (:) <$> v <*> many_v
Oops, something went wrong.

0 comments on commit 590fce9

Please sign in to comment.