git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix prettyPrintType and update docs #174
commitd71ddee293c76e9cd412c5e056fa563895bbe35d authorPhil Freeman <paf31@cantab.net> dateThu 6 Feb 2014, 15:09 (13 years ago) parent20505a8
4 files changed+136−120
docs/source/prelude.rst+56−56 libraries/prelude/README.md+56−56 src/Language/PureScript/Pretty/Types.hs+15−7 src/Language/PureScript/Types.hs+9−1
docs/source/prelude.rst+56−56
@@ -59,11 +59,11 @@ Type Classes
5959 (/=) :: a -> a -> Prelude.Boolean
6060
6161 class Functor f where
62− (<$>) :: forall b. forall a. Prelude.Function a b -> f a -> f b
62+ (<$>) :: forall b. forall a. (a -> b) -> f a -> f b
6363
6464 class Monad m where
6565 ret :: forall a. a -> m a
66− (>>=) :: forall b. forall a. m a -> Prelude.Function a (m b) -> m b
66+ (>>=) :: forall b. forall a. m a -> (a -> m b) -> m b
6767
6868 class Num a where
6969 (+) :: a -> a -> a
@@ -106,7 +106,7 @@ Type Class Instances
106106
107107 instance Eq Prelude.Boolean
108108
109− (Eq (a)) => instance Eq Prelude.Array a
109+ (Eq (a)) => instance Eq [a]
110110
111111 (Applicative (f)) => instance Functor f
112112
@@ -129,11 +129,11 @@ Values
129129
130130::
131131
132− (!!) :: forall a. Prelude.Array a -> Prelude.Number -> a
132+ (!!) :: forall a. [a] -> Prelude.Number -> a
133133
134− (#) :: forall b. forall a. a -> Prelude.Function a b -> b
134+ (#) :: forall b. forall a. a -> (a -> b) -> b
135135
136− ($) :: forall b. forall a. Prelude.Function a b -> a -> b
136+ ($) :: forall b. forall a. (a -> b) -> a -> b
137137
138138 (++) :: Prelude.String -> Prelude.String -> Prelude.String
139139
@@ -143,7 +143,7 @@ Values
143143
144144 boolOr :: Prelude.Boolean -> Prelude.Boolean -> Prelude.Boolean
145145
146− flip :: forall c. forall b. forall a. Prelude.Function a (b -> c) -> b -> a -> c
146+ flip :: forall c. forall b. forall a. (a -> b -> c) -> b -> a -> c
147147
148148 konst :: forall b. forall a. a -> b -> a
149149
@@ -218,7 +218,7 @@ Values
218218
219219::
220220
221− mconcat :: forall m. (Monoid (m)) => Prelude.Array m -> m
221+ mconcat :: forall m. (Monoid (m)) => [m] -> m
222222
223223Module Monad
224224------------
@@ -237,19 +237,19 @@ Values
237237
238238::
239239
240− (<=<) :: forall c. forall b. forall a. forall m. (Monad (m)) => Prelude.Function b (m c) -> Prelude.Function a (m b) -> a -> m c
240+ (<=<) :: forall c. forall b. forall a. forall m. (Monad (m)) => (b -> m c) -> (a -> m b) -> a -> m c
241241
242− (>=>) :: forall c. forall b. forall a. forall m. (Monad (m)) => Prelude.Function a (m b) -> Prelude.Function b (m c) -> a -> m c
242+ (>=>) :: forall c. forall b. forall a. forall m. (Monad (m)) => (a -> m b) -> (b -> m c) -> a -> m c
243243
244− foldM :: forall b. forall a. forall m. (Monad (m)) => Prelude.Function a (b -> m a) -> a -> Prelude.Array b -> m a
244+ foldM :: forall b. forall a. forall m. (Monad (m)) => (a -> b -> m a) -> a -> [b] -> m a
245245
246246 join :: forall a. forall m. (Monad (m)) => m (m a) -> m a
247247
248− mapM :: forall b. forall a. forall m. (Monad (m)) => Prelude.Function a (m b) -> Prelude.Array a -> m [b]
248+ mapM :: forall b. forall a. forall m. (Monad (m)) => (a -> m b) -> [a] -> m [b]
249249
250250 replicateM :: forall a. forall m. (Monad (m)) => Prelude.Number -> m a -> m [a]
251251
252− sequence :: forall a. forall m. (Monad (m)) => Prelude.Array (m a) -> m [a]
252+ sequence :: forall a. forall m. (Monad (m)) => [m a] -> m [a]
253253
254254 when :: forall m. (Monad (m)) => Prelude.Boolean -> m { } -> m { }
255255
@@ -282,7 +282,7 @@ Values
282282
283283 fromMaybe :: forall a. a -> Maybe a -> a
284284
285− maybe :: forall b. forall a. b -> Prelude.Function a b -> Maybe a -> b
285+ maybe :: forall b. forall a. b -> (a -> b) -> Maybe a -> b
286286
287287Module Either
288288-------------
@@ -311,7 +311,7 @@ Values
311311
312312::
313313
314− either :: forall c. forall b. forall a. Prelude.Function a c -> Prelude.Function b c -> Either a b -> c
314+ either :: forall c. forall b. forall a. (a -> c) -> (b -> c) -> Either a b -> c
315315
316316Module Arrays
317317-------------
@@ -331,68 +331,68 @@ Type Class Instances
331331
332332 instance Prelude.Monad Prelude.Array
333333
334− (Prelude.Show (a)) => instance Prelude.Show Prelude.Array a
334+ (Prelude.Show (a)) => instance Prelude.Show [a]
335335
336336Values
337337~~~~~~
338338
339339::
340340
341− (:) :: forall a. a -> Prelude.Array a -> Prelude.Array a
341+ (:) :: forall a. a -> [a] -> [a]
342342
343− all :: forall a. Prelude.Function a Prelude.Boolean -> Prelude.Array a -> Prelude.Boolean
343+ all :: forall a. (a -> Prelude.Boolean) -> [a] -> Prelude.Boolean
344344
345− any :: forall a. Prelude.Function a Prelude.Boolean -> Prelude.Array a -> Prelude.Boolean
345+ any :: forall a. (a -> Prelude.Boolean) -> [a] -> Prelude.Boolean
346346
347− concat :: forall a. Prelude.Array a -> Prelude.Array a -> Prelude.Array a
347+ concat :: forall a. [a] -> [a] -> [a]
348348
349− concatMap :: forall b. forall a. Prelude.Array a -> Prelude.Function a [b] -> Prelude.Array b
349+ concatMap :: forall b. forall a. [a] -> (a -> [b]) -> [b]
350350
351− filter :: forall a. Prelude.Function a Prelude.Boolean -> Prelude.Array a -> Prelude.Array a
351+ filter :: forall a. (a -> Prelude.Boolean) -> [a] -> [a]
352352
353− foldl :: forall b. forall a. Prelude.Function a (b -> b) -> b -> Prelude.Array a -> b
353+ foldl :: forall b. forall a. (a -> b -> b) -> b -> [a] -> b
354354
355− foldr :: forall b. forall a. Prelude.Function a (b -> a) -> a -> Prelude.Array b -> a
355+ foldr :: forall b. forall a. (a -> b -> a) -> a -> [b] -> a
356356
357− head :: forall a. Prelude.Array a -> a
357+ head :: forall a. [a] -> a
358358
359− headSafe :: forall a. Prelude.Array a -> Maybe a
359+ headSafe :: forall a. [a] -> Maybe a
360360
361− indexOf :: forall a. Prelude.Array a -> a -> Prelude.Number
361+ indexOf :: forall a. [a] -> a -> Prelude.Number
362362
363− isEmpty :: forall a. Prelude.Array a -> Prelude.Boolean
363+ isEmpty :: forall a. [a] -> Prelude.Boolean
364364
365− joinS :: Prelude.Array Prelude.String -> Prelude.String
365+ joinS :: [Prelude.String] -> Prelude.String
366366
367− joinWith :: Prelude.Array Prelude.String -> Prelude.String -> Prelude.String
367+ joinWith :: [Prelude.String] -> Prelude.String -> Prelude.String
368368
369− lastIndexOf :: forall a. Prelude.Array a -> a -> Prelude.Number
369+ lastIndexOf :: forall a. [a] -> a -> Prelude.Number
370370
371− length :: forall a. Prelude.Array a -> Prelude.Number
371+ length :: forall a. [a] -> Prelude.Number
372372
373− map :: forall b. forall a. Prelude.Function a b -> Prelude.Array a -> Prelude.Array b
373+ map :: forall b. forall a. (a -> b) -> [a] -> [b]
374374
375− push :: forall a. Prelude.Array a -> a -> Prelude.Array a
375+ push :: forall a. [a] -> a -> [a]
376376
377− range :: Prelude.Number -> Prelude.Number -> Prelude.Array Prelude.Number
377+ range :: Prelude.Number -> Prelude.Number -> [Prelude.Number]
378378
379− reverse :: forall a. Prelude.Array a -> Prelude.Array a
379+ reverse :: forall a. [a] -> [a]
380380
381− shift :: forall a. Prelude.Array a -> Prelude.Array a
381+ shift :: forall a. [a] -> [a]
382382
383− singleton :: forall a. a -> Prelude.Array a
383+ singleton :: forall a. a -> [a]
384384
385− slice :: forall a. Prelude.Number -> Prelude.Number -> Prelude.Array a -> Prelude.Array a
385+ slice :: forall a. Prelude.Number -> Prelude.Number -> [a] -> [a]
386386
387− sort :: forall a. Prelude.Array a -> Prelude.Array a
387+ sort :: forall a. [a] -> [a]
388388
389− splice :: forall a. Prelude.Number -> Prelude.Number -> Prelude.Array a -> Prelude.Array a -> Prelude.Array a
389+ splice :: forall a. Prelude.Number -> Prelude.Number -> [a] -> [a] -> [a]
390390
391− tail :: forall a. Prelude.Array a -> Prelude.Array a
391+ tail :: forall a. [a] -> [a]
392392
393− tailSafe :: forall a. Prelude.Array a -> Maybe [a]
393+ tailSafe :: forall a. [a] -> Maybe [a]
394394
395− zipWith :: forall c. forall b. forall a. Prelude.Function a (b -> c) -> Prelude.Array a -> Prelude.Array b -> Prelude.Array c
395+ zipWith :: forall c. forall b. forall a. (a -> b -> c) -> [a] -> [b] -> [c]
396396
397397Module Tuple
398398------------
@@ -415,15 +415,15 @@ Values
415415
416416::
417417
418− curry :: forall c. forall b. forall a. Prelude.Function (Tuple a b) c -> a -> b -> c
418+ curry :: forall c. forall b. forall a. (Tuple a b -> c) -> a -> b -> c
419419
420420 tuple :: forall b. forall a. a -> b -> Tuple a b
421421
422− uncurry :: forall c. forall b. forall a. Prelude.Function a (b -> c) -> Tuple a b -> c
422+ uncurry :: forall c. forall b. forall a. (a -> b -> c) -> Tuple a b -> c
423423
424− unzip :: forall b. forall a. Prelude.Array (Tuple a b) -> Tuple [a] [b]
424+ unzip :: forall b. forall a. [Tuple a b] -> Tuple [a] [b]
425425
426− zip :: forall b. forall a. Prelude.Array a -> Prelude.Array b -> Prelude.Array (Tuple a b)
426+ zip :: forall b. forall a. [a] -> [b] -> [Tuple a b]
427427
428428Module String
429429-------------
@@ -456,7 +456,7 @@ Values
456456
457457 sliceS :: Prelude.Number -> Prelude.Number -> Prelude.String -> Prelude.String
458458
459− split :: Prelude.String -> Prelude.String -> Prelude.Array Prelude.String
459+ split :: Prelude.String -> Prelude.String -> [Prelude.String]
460460
461461 substr :: Prelude.Number -> Prelude.Number -> Prelude.String -> Prelude.String
462462
@@ -489,7 +489,7 @@ Values
489489
490490::
491491
492− match :: Regex -> Prelude.String -> Prelude.Array Prelude.String
492+ match :: Regex -> Prelude.String -> [Prelude.String]
493493
494494 regex :: Prelude.String -> Prelude.String -> Regex
495495
@@ -620,11 +620,11 @@ Values
620620
621621::
622622
623− bindEff :: forall b. forall a. forall e. Eff e a -> Prelude.Function a (Eff e b) -> Eff e b
623+ bindEff :: forall b. forall a. forall e. Eff e a -> (a -> Eff e b) -> Eff e b
624624
625− forE :: forall e. Prelude.Number -> Prelude.Number -> Prelude.Function Prelude.Number (Eff e { }) -> Eff e { }
625+ forE :: forall e. Prelude.Number -> Prelude.Number -> (Prelude.Number -> Eff e { }) -> Eff e { }
626626
627− foreachE :: forall a. forall e. Prelude.Array a -> Prelude.Function a (Eff e { }) -> Eff e { }
627+ foreachE :: forall a. forall e. [a] -> (a -> Eff e { }) -> Eff e { }
628628
629629 retEff :: forall a. forall e. a -> Eff e a
630630
@@ -678,7 +678,7 @@ Values
678678
679679::
680680
681− catchError :: forall a. forall r. forall e. Prelude.Function e (Eff r a) -> Eff err :: Error e | r a -> Eff r a
681+ catchError :: forall a. forall r. forall e. (e -> Eff r a) -> Eff err :: Error e | r a -> Eff r a
682682
683683 throwError :: forall r. forall e. forall a. e -> Eff err :: Error e | r a
684684
@@ -705,7 +705,7 @@ Values
705705
706706::
707707
708− modifyIORef :: forall r. forall s. IORef s -> Prelude.Function s s -> Eff ref :: Ref | r { }
708+ modifyIORef :: forall r. forall s. IORef s -> (s -> s) -> Eff ref :: Ref | r { }
709709
710710 newIORef :: forall r. forall s. s -> Eff ref :: Ref | r (IORef s)
711711
@@ -761,7 +761,7 @@ Values
761761
762762::
763763
764− modifySTRef :: forall r. forall h. forall a. STRef h a -> Prelude.Function a a -> Eff st :: ST h | r { }
764+ modifySTRef :: forall r. forall h. forall a. STRef h a -> (a -> a) -> Eff st :: ST h | r { }
765765
766766 newSTRef :: forall r. forall h. forall a. a -> Eff st :: ST h | r (STRef h a)
767767
libraries/prelude/README.md+56−56
@@ -51,11 +51,11 @@
5151 (/=) :: a -> a -> Prelude.Boolean
5252
5353 class Functor f where
54− (<$>) :: forall b. forall a. Prelude.Function a b -> f a -> f b
54+ (<$>) :: forall b. forall a. (a -> b) -> f a -> f b
5555
5656 class Monad m where
5757 ret :: forall a. a -> m a
58− (>>=) :: forall b. forall a. m a -> Prelude.Function a (m b) -> m b
58+ (>>=) :: forall b. forall a. m a -> (a -> m b) -> m b
5959
6060 class Num a where
6161 (+) :: a -> a -> a
@@ -96,7 +96,7 @@
9696
9797 instance Eq Prelude.Boolean
9898
99− (Eq (a)) => instance Eq Prelude.Array a
99+ (Eq (a)) => instance Eq [a]
100100
101101 (Applicative (f)) => instance Functor f
102102
@@ -117,11 +117,11 @@
117117
118118### Values
119119
120− (!!) :: forall a. Prelude.Array a -> Prelude.Number -> a
120+ (!!) :: forall a. [a] -> Prelude.Number -> a
121121
122− (#) :: forall b. forall a. a -> Prelude.Function a b -> b
122+ (#) :: forall b. forall a. a -> (a -> b) -> b
123123
124− ($) :: forall b. forall a. Prelude.Function a b -> a -> b
124+ ($) :: forall b. forall a. (a -> b) -> a -> b
125125
126126 (++) :: Prelude.String -> Prelude.String -> Prelude.String
127127
@@ -131,7 +131,7 @@
131131
132132 boolOr :: Prelude.Boolean -> Prelude.Boolean -> Prelude.Boolean
133133
134− flip :: forall c. forall b. forall a. Prelude.Function a (b -> c) -> b -> a -> c
134+ flip :: forall c. forall b. forall a. (a -> b -> c) -> b -> a -> c
135135
136136 konst :: forall b. forall a. a -> b -> a
137137
@@ -199,7 +199,7 @@
199199
200200### Values
201201
202− mconcat :: forall m. (Monoid (m)) => Prelude.Array m -> m
202+ mconcat :: forall m. (Monoid (m)) => [m] -> m
203203
204204
205205## Module Monad
@@ -215,19 +215,19 @@
215215
216216### Values
217217
218− (<=<) :: forall c. forall b. forall a. forall m. (Monad (m)) => Prelude.Function b (m c) -> Prelude.Function a (m b) -> a -> m c
218+ (<=<) :: forall c. forall b. forall a. forall m. (Monad (m)) => (b -> m c) -> (a -> m b) -> a -> m c
219219
220− (>=>) :: forall c. forall b. forall a. forall m. (Monad (m)) => Prelude.Function a (m b) -> Prelude.Function b (m c) -> a -> m c
220+ (>=>) :: forall c. forall b. forall a. forall m. (Monad (m)) => (a -> m b) -> (b -> m c) -> a -> m c
221221
222− foldM :: forall b. forall a. forall m. (Monad (m)) => Prelude.Function a (b -> m a) -> a -> Prelude.Array b -> m a
222+ foldM :: forall b. forall a. forall m. (Monad (m)) => (a -> b -> m a) -> a -> [b] -> m a
223223
224224 join :: forall a. forall m. (Monad (m)) => m (m a) -> m a
225225
226− mapM :: forall b. forall a. forall m. (Monad (m)) => Prelude.Function a (m b) -> Prelude.Array a -> m [b]
226+ mapM :: forall b. forall a. forall m. (Monad (m)) => (a -> m b) -> [a] -> m [b]
227227
228228 replicateM :: forall a. forall m. (Monad (m)) => Prelude.Number -> m a -> m [a]
229229
230− sequence :: forall a. forall m. (Monad (m)) => Prelude.Array (m a) -> m [a]
230+ sequence :: forall a. forall m. (Monad (m)) => [m a] -> m [a]
231231
232232 when :: forall m. (Monad (m)) => Prelude.Boolean -> m { } -> m { }
233233
@@ -253,7 +253,7 @@
253253
254254 fromMaybe :: forall a. a -> Maybe a -> a
255255
256− maybe :: forall b. forall a. b -> Prelude.Function a b -> Maybe a -> b
256+ maybe :: forall b. forall a. b -> (a -> b) -> Maybe a -> b
257257
258258
259259## Module Either
@@ -275,7 +275,7 @@
275275
276276### Values
277277
278− either :: forall c. forall b. forall a. Prelude.Function a c -> Prelude.Function b c -> Either a b -> c
278+ either :: forall c. forall b. forall a. (a -> c) -> (b -> c) -> Either a b -> c
279279
280280
281281## Module Arrays
@@ -292,66 +292,66 @@
292292
293293 instance Prelude.Monad Prelude.Array
294294
295− (Prelude.Show (a)) => instance Prelude.Show Prelude.Array a
295+ (Prelude.Show (a)) => instance Prelude.Show [a]
296296
297297
298298### Values
299299
300− (:) :: forall a. a -> Prelude.Array a -> Prelude.Array a
300+ (:) :: forall a. a -> [a] -> [a]
301301
302− all :: forall a. Prelude.Function a Prelude.Boolean -> Prelude.Array a -> Prelude.Boolean
302+ all :: forall a. (a -> Prelude.Boolean) -> [a] -> Prelude.Boolean
303303
304− any :: forall a. Prelude.Function a Prelude.Boolean -> Prelude.Array a -> Prelude.Boolean
304+ any :: forall a. (a -> Prelude.Boolean) -> [a] -> Prelude.Boolean
305305
306− concat :: forall a. Prelude.Array a -> Prelude.Array a -> Prelude.Array a
306+ concat :: forall a. [a] -> [a] -> [a]
307307
308− concatMap :: forall b. forall a. Prelude.Array a -> Prelude.Function a [b] -> Prelude.Array b
308+ concatMap :: forall b. forall a. [a] -> (a -> [b]) -> [b]
309309
310− filter :: forall a. Prelude.Function a Prelude.Boolean -> Prelude.Array a -> Prelude.Array a
310+ filter :: forall a. (a -> Prelude.Boolean) -> [a] -> [a]
311311
312− foldl :: forall b. forall a. Prelude.Function a (b -> b) -> b -> Prelude.Array a -> b
312+ foldl :: forall b. forall a. (a -> b -> b) -> b -> [a] -> b
313313
314− foldr :: forall b. forall a. Prelude.Function a (b -> a) -> a -> Prelude.Array b -> a
314+ foldr :: forall b. forall a. (a -> b -> a) -> a -> [b] -> a
315315
316− head :: forall a. Prelude.Array a -> a
316+ head :: forall a. [a] -> a
317317
318− headSafe :: forall a. Prelude.Array a -> Maybe a
318+ headSafe :: forall a. [a] -> Maybe a
319319
320− indexOf :: forall a. Prelude.Array a -> a -> Prelude.Number
320+ indexOf :: forall a. [a] -> a -> Prelude.Number
321321
322− isEmpty :: forall a. Prelude.Array a -> Prelude.Boolean
322+ isEmpty :: forall a. [a] -> Prelude.Boolean
323323
324− joinS :: Prelude.Array Prelude.String -> Prelude.String
324+ joinS :: [Prelude.String] -> Prelude.String
325325
326− joinWith :: Prelude.Array Prelude.String -> Prelude.String -> Prelude.String
326+ joinWith :: [Prelude.String] -> Prelude.String -> Prelude.String
327327
328− lastIndexOf :: forall a. Prelude.Array a -> a -> Prelude.Number
328+ lastIndexOf :: forall a. [a] -> a -> Prelude.Number
329329
330− length :: forall a. Prelude.Array a -> Prelude.Number
330+ length :: forall a. [a] -> Prelude.Number
331331
332− map :: forall b. forall a. Prelude.Function a b -> Prelude.Array a -> Prelude.Array b
332+ map :: forall b. forall a. (a -> b) -> [a] -> [b]
333333
334− push :: forall a. Prelude.Array a -> a -> Prelude.Array a
334+ push :: forall a. [a] -> a -> [a]
335335
336− range :: Prelude.Number -> Prelude.Number -> Prelude.Array Prelude.Number
336+ range :: Prelude.Number -> Prelude.Number -> [Prelude.Number]
337337
338− reverse :: forall a. Prelude.Array a -> Prelude.Array a
338+ reverse :: forall a. [a] -> [a]
339339
340− shift :: forall a. Prelude.Array a -> Prelude.Array a
340+ shift :: forall a. [a] -> [a]
341341
342− singleton :: forall a. a -> Prelude.Array a
342+ singleton :: forall a. a -> [a]
343343
344− slice :: forall a. Prelude.Number -> Prelude.Number -> Prelude.Array a -> Prelude.Array a
344+ slice :: forall a. Prelude.Number -> Prelude.Number -> [a] -> [a]
345345
346− sort :: forall a. Prelude.Array a -> Prelude.Array a
346+ sort :: forall a. [a] -> [a]
347347
348− splice :: forall a. Prelude.Number -> Prelude.Number -> Prelude.Array a -> Prelude.Array a -> Prelude.Array a
348+ splice :: forall a. Prelude.Number -> Prelude.Number -> [a] -> [a] -> [a]
349349
350− tail :: forall a. Prelude.Array a -> Prelude.Array a
350+ tail :: forall a. [a] -> [a]
351351
352− tailSafe :: forall a. Prelude.Array a -> Maybe [a]
352+ tailSafe :: forall a. [a] -> Maybe [a]
353353
354− zipWith :: forall c. forall b. forall a. Prelude.Function a (b -> c) -> Prelude.Array a -> Prelude.Array b -> Prelude.Array c
354+ zipWith :: forall c. forall b. forall a. (a -> b -> c) -> [a] -> [b] -> [c]
355355
356356
357357## Module Tuple
@@ -369,15 +369,15 @@
369369
370370### Values
371371
372− curry :: forall c. forall b. forall a. Prelude.Function (Tuple a b) c -> a -> b -> c
372+ curry :: forall c. forall b. forall a. (Tuple a b -> c) -> a -> b -> c
373373
374374 tuple :: forall b. forall a. a -> b -> Tuple a b
375375
376− uncurry :: forall c. forall b. forall a. Prelude.Function a (b -> c) -> Tuple a b -> c
376+ uncurry :: forall c. forall b. forall a. (a -> b -> c) -> Tuple a b -> c
377377
378− unzip :: forall b. forall a. Prelude.Array (Tuple a b) -> Tuple [a] [b]
378+ unzip :: forall b. forall a. [Tuple a b] -> Tuple [a] [b]
379379
380− zip :: forall b. forall a. Prelude.Array a -> Prelude.Array b -> Prelude.Array (Tuple a b)
380+ zip :: forall b. forall a. [a] -> [b] -> [Tuple a b]
381381
382382
383383## Module String
@@ -407,7 +407,7 @@
407407
408408 sliceS :: Prelude.Number -> Prelude.Number -> Prelude.String -> Prelude.String
409409
410− split :: Prelude.String -> Prelude.String -> Prelude.Array Prelude.String
410+ split :: Prelude.String -> Prelude.String -> [Prelude.String]
411411
412412 substr :: Prelude.Number -> Prelude.Number -> Prelude.String -> Prelude.String
413413
@@ -435,7 +435,7 @@
435435
436436### Values
437437
438− match :: Regex -> Prelude.String -> Prelude.Array Prelude.String
438+ match :: Regex -> Prelude.String -> [Prelude.String]
439439
440440 regex :: Prelude.String -> Prelude.String -> Regex
441441
@@ -553,11 +553,11 @@
553553
554554### Values
555555
556− bindEff :: forall b. forall a. forall e. Eff e a -> Prelude.Function a (Eff e b) -> Eff e b
556+ bindEff :: forall b. forall a. forall e. Eff e a -> (a -> Eff e b) -> Eff e b
557557
558− forE :: forall e. Prelude.Number -> Prelude.Number -> Prelude.Function Prelude.Number (Eff e { }) -> Eff e { }
558+ forE :: forall e. Prelude.Number -> Prelude.Number -> (Prelude.Number -> Eff e { }) -> Eff e { }
559559
560− foreachE :: forall a. forall e. Prelude.Array a -> Prelude.Function a (Eff e { }) -> Eff e { }
560+ foreachE :: forall a. forall e. [a] -> (a -> Eff e { }) -> Eff e { }
561561
562562 retEff :: forall a. forall e. a -> Eff e a
563563
@@ -601,7 +601,7 @@
601601
602602### Values
603603
604− catchError :: forall a. forall r. forall e. Prelude.Function e (Eff r a) -> Eff err :: Error e | r a -> Eff r a
604+ catchError :: forall a. forall r. forall e. (e -> Eff r a) -> Eff err :: Error e | r a -> Eff r a
605605
606606 throwError :: forall r. forall e. forall a. e -> Eff err :: Error e | r a
607607
@@ -623,7 +623,7 @@
623623
624624### Values
625625
626− modifyIORef :: forall r. forall s. IORef s -> Prelude.Function s s -> Eff ref :: Ref | r { }
626+ modifyIORef :: forall r. forall s. IORef s -> (s -> s) -> Eff ref :: Ref | r { }
627627
628628 newIORef :: forall r. forall s. s -> Eff ref :: Ref | r (IORef s)
629629
@@ -669,7 +669,7 @@
669669
670670### Values
671671
672− modifySTRef :: forall r. forall h. forall a. STRef h a -> Prelude.Function a a -> Eff st :: ST h | r { }
672+ modifySTRef :: forall r. forall h. forall a. STRef h a -> (a -> a) -> Eff st :: ST h | r { }
673673
674674 newSTRef :: forall r. forall h. forall a. a -> Eff st :: ST h | r (STRef h a)
675675
src/Language/PureScript/Pretty/Types.hs+15−7
@@ -20,6 +20,7 @@ module Language.PureScript.Pretty.Types (
2020
2121import Data.Maybe (fromMaybe)
2222import Data.List (intercalate)
23+import Data.Generics (mkT, everywhere)
2324
2425import Control.Arrow ((<+>))
2526import Control.PatternArrows
@@ -33,8 +34,8 @@ typeLiterals = mkPattern match
3334 where
3435 match (Object row) = Just $ "{ " ++ prettyPrintType row ++ " }"
3536 match (TypeVar var) = Just var
36− match (TypeApp arr ty) | arr == tyArray = Just $ "[" ++ prettyPrintType ty ++ "]"
37− match (TypeConstructor ctor) = Just $ show ctor
37+ match (PrettyPrintArray ty) = Just $ "[" ++ prettyPrintType ty ++ "]"
38+ match ty@(TypeConstructor ctor) = Just $ show ctor
3839 match (TUnknown (Unknown u)) = Just $ 'u' : show u
3940 match (Skolem s _) = Just $ 's' : show s
4041 match (ConstrainedType deps ty) = Just $ "(" ++ intercalate "," (map (\(pn, ty') -> show pn ++ " (" ++ prettyPrintType ty' ++ ")") deps) ++ ") => " ++ prettyPrintType ty
@@ -68,23 +69,30 @@ typeApp = mkPattern match
6869 match (TypeApp f x) = Just (f, x)
6970 match _ = Nothing
7071
71−singleArgumentFunction :: Pattern () Type (Type, Type)
72−singleArgumentFunction = mkPattern match
72+appliedFunction :: Pattern () Type (Type, Type)
73+appliedFunction = mkPattern match
7374 where
74− match (TypeApp (TypeApp t arg) ret) | t == tyFunction = Just (arg, ret)
75+ match (PrettyPrintFunction arg ret) = Just (arg, ret)
7576 match _ = Nothing
7677
78+insertPlaceholders :: Type -> Type
79+insertPlaceholders = everywhere (mkT convert)
80+ where
81+ convert (TypeApp (TypeApp f arg) ret) | f == tyFunction = PrettyPrintFunction arg ret
82+ convert (TypeApp a el) | a == tyArray = PrettyPrintArray el
83+ convert other = other
84+
7785-- |
7886-- Generate a pretty-printed string representing a Type
7987--
8088prettyPrintType :: Type -> String
81−prettyPrintType = fromMaybe (error "Incomplete pattern") . pattern matchType ()
89+prettyPrintType = fromMaybe (error "Incomplete pattern") . pattern matchType () . insertPlaceholders
8290 where
8391 matchType :: Pattern () Type String
8492 matchType = buildPrettyPrinter operators (typeLiterals <+> fmap parens matchType)
8593 operators :: OperatorTable () Type String
8694 operators =
8795 OperatorTable [ [ AssocL typeApp $ \f x -> f ++ " " ++ x ]
88− , [ AssocR singleArgumentFunction $ \arg ret -> arg ++ " -> " ++ ret
96+ , [ AssocR appliedFunction $ \arg ret -> arg ++ " -> " ++ ret
8997 ]
9098 ]
src/Language/PureScript/Types.hs+9−1
@@ -76,7 +76,15 @@ data Type
7676 -- |
7777 -- A non-empty row
7878 --
79− | RCons String Type Type deriving (Show, Eq, Data, Typeable)
79+ | RCons String Type Type
80+ -- |
81+ -- A placeholder used in pretty printing
82+ --
83+ | PrettyPrintFunction Type Type
84+ -- |
85+ -- A placeholder used in pretty printing
86+ --
87+ | PrettyPrintArray Type deriving (Show, Eq, Data, Typeable)
8088
8189-- |
8290-- Type constructor for functions