git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix prettyPrintType and update docs #174
d71ddeePhil Freeman
docs/source/prelude.rst+56−56
@@ -59,11 +59,11 @@ Type Classes
59 (/=) :: a -> a -> Prelude.Boolean
59 (/=) :: a -> a -> Prelude.Boolean
60
60
61 class Functor f where
61 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
63
63
64 class Monad m where
64 class Monad m where
65 ret :: forall a. a -> m a
65 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
67
67
68 class Num a where
68 class Num a where
69 (+) :: a -> a -> a
69 (+) :: a -> a -> a
@@ -106,7 +106,7 @@ Type Class Instances
106
106
107 instance Eq Prelude.Boolean
107 instance Eq Prelude.Boolean
108
108
109− (Eq (a)) => instance Eq Prelude.Array a
109+ (Eq (a)) => instance Eq [a]
110
110
111 (Applicative (f)) => instance Functor f
111 (Applicative (f)) => instance Functor f
112
112
@@ -129,11 +129,11 @@ Values
129
129
130::
130::
131
131
132− (!!) :: forall a. Prelude.Array a -> Prelude.Number -> a
132+ (!!) :: forall a. [a] -> Prelude.Number -> a
133
133
134− (#) :: forall b. forall a. a -> Prelude.Function a b -> b
134+ (#) :: forall b. forall a. a -> (a -> b) -> b
135
135
136− ($) :: forall b. forall a. Prelude.Function a b -> a -> b
136+ ($) :: forall b. forall a. (a -> b) -> a -> b
137
137
138 (++) :: Prelude.String -> Prelude.String -> Prelude.String
138 (++) :: Prelude.String -> Prelude.String -> Prelude.String
139
139
@@ -143,7 +143,7 @@ Values
143
143
144 boolOr :: Prelude.Boolean -> Prelude.Boolean -> Prelude.Boolean
144 boolOr :: Prelude.Boolean -> Prelude.Boolean -> Prelude.Boolean
145
145
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
147
147
148 konst :: forall b. forall a. a -> b -> a
148 konst :: forall b. forall a. a -> b -> a
149
149
@@ -218,7 +218,7 @@ Values
218
218
219::
219::
220
220
221− mconcat :: forall m. (Monoid (m)) => Prelude.Array m -> m
221+ mconcat :: forall m. (Monoid (m)) => [m] -> m
222
222
223Module Monad
223Module Monad
224------------
224------------
@@ -237,19 +237,19 @@ Values
237
237
238::
238::
239
239
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
241
241
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
243
243
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
245
245
246 join :: forall a. forall m. (Monad (m)) => m (m a) -> m a
246 join :: forall a. forall m. (Monad (m)) => m (m a) -> m a
247
247
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]
249
249
250 replicateM :: forall a. forall m. (Monad (m)) => Prelude.Number -> m a -> m [a]
250 replicateM :: forall a. forall m. (Monad (m)) => Prelude.Number -> m a -> m [a]
251
251
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]
253
253
254 when :: forall m. (Monad (m)) => Prelude.Boolean -> m { } -> m { }
254 when :: forall m. (Monad (m)) => Prelude.Boolean -> m { } -> m { }
255
255
@@ -282,7 +282,7 @@ Values
282
282
283 fromMaybe :: forall a. a -> Maybe a -> a
283 fromMaybe :: forall a. a -> Maybe a -> a
284
284
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
286
286
287Module Either
287Module Either
288-------------
288-------------
@@ -311,7 +311,7 @@ Values
311
311
312::
312::
313
313
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
315
315
316Module Arrays
316Module Arrays
317-------------
317-------------
@@ -331,68 +331,68 @@ Type Class Instances
331
331
332 instance Prelude.Monad Prelude.Array
332 instance Prelude.Monad Prelude.Array
333
333
334− (Prelude.Show (a)) => instance Prelude.Show Prelude.Array a
334+ (Prelude.Show (a)) => instance Prelude.Show [a]
335
335
336Values
336Values
337~~~~~~
337~~~~~~
338
338
339::
339::
340
340
341− (:) :: forall a. a -> Prelude.Array a -> Prelude.Array a
341+ (:) :: forall a. a -> [a] -> [a]
342
342
343− all :: forall a. Prelude.Function a Prelude.Boolean -> Prelude.Array a -> Prelude.Boolean
343+ all :: forall a. (a -> Prelude.Boolean) -> [a] -> Prelude.Boolean
344
344
345− any :: forall a. Prelude.Function a Prelude.Boolean -> Prelude.Array a -> Prelude.Boolean
345+ any :: forall a. (a -> Prelude.Boolean) -> [a] -> Prelude.Boolean
346
346
347− concat :: forall a. Prelude.Array a -> Prelude.Array a -> Prelude.Array a
347+ concat :: forall a. [a] -> [a] -> [a]
348
348
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]
350
350
351− filter :: forall a. Prelude.Function a Prelude.Boolean -> Prelude.Array a -> Prelude.Array a
351+ filter :: forall a. (a -> Prelude.Boolean) -> [a] -> [a]
352
352
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
354
354
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
356
356
357− head :: forall a. Prelude.Array a -> a
357+ head :: forall a. [a] -> a
358
358
359− headSafe :: forall a. Prelude.Array a -> Maybe a
359+ headSafe :: forall a. [a] -> Maybe a
360
360
361− indexOf :: forall a. Prelude.Array a -> a -> Prelude.Number
361+ indexOf :: forall a. [a] -> a -> Prelude.Number
362
362
363− isEmpty :: forall a. Prelude.Array a -> Prelude.Boolean
363+ isEmpty :: forall a. [a] -> Prelude.Boolean
364
364
365− joinS :: Prelude.Array Prelude.String -> Prelude.String
365+ joinS :: [Prelude.String] -> Prelude.String
366
366
367− joinWith :: Prelude.Array Prelude.String -> Prelude.String -> Prelude.String
367+ joinWith :: [Prelude.String] -> Prelude.String -> Prelude.String
368
368
369− lastIndexOf :: forall a. Prelude.Array a -> a -> Prelude.Number
369+ lastIndexOf :: forall a. [a] -> a -> Prelude.Number
370
370
371− length :: forall a. Prelude.Array a -> Prelude.Number
371+ length :: forall a. [a] -> Prelude.Number
372
372
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]
374
374
375− push :: forall a. Prelude.Array a -> a -> Prelude.Array a
375+ push :: forall a. [a] -> a -> [a]
376
376
377− range :: Prelude.Number -> Prelude.Number -> Prelude.Array Prelude.Number
377+ range :: Prelude.Number -> Prelude.Number -> [Prelude.Number]
378
378
379− reverse :: forall a. Prelude.Array a -> Prelude.Array a
379+ reverse :: forall a. [a] -> [a]
380
380
381− shift :: forall a. Prelude.Array a -> Prelude.Array a
381+ shift :: forall a. [a] -> [a]
382
382
383− singleton :: forall a. a -> Prelude.Array a
383+ singleton :: forall a. a -> [a]
384
384
385− slice :: forall a. Prelude.Number -> Prelude.Number -> Prelude.Array a -> Prelude.Array a
385+ slice :: forall a. Prelude.Number -> Prelude.Number -> [a] -> [a]
386
386
387− sort :: forall a. Prelude.Array a -> Prelude.Array a
387+ sort :: forall a. [a] -> [a]
388
388
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]
390
390
391− tail :: forall a. Prelude.Array a -> Prelude.Array a
391+ tail :: forall a. [a] -> [a]
392
392
393− tailSafe :: forall a. Prelude.Array a -> Maybe [a]
393+ tailSafe :: forall a. [a] -> Maybe [a]
394
394
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]
396
396
397Module Tuple
397Module Tuple
398------------
398------------
@@ -415,15 +415,15 @@ Values
415
415
416::
416::
417
417
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
419
419
420 tuple :: forall b. forall a. a -> b -> Tuple a b
420 tuple :: forall b. forall a. a -> b -> Tuple a b
421
421
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
423
423
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]
425
425
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]
427
427
428Module String
428Module String
429-------------
429-------------
@@ -456,7 +456,7 @@ Values
456
456
457 sliceS :: Prelude.Number -> Prelude.Number -> Prelude.String -> Prelude.String
457 sliceS :: Prelude.Number -> Prelude.Number -> Prelude.String -> Prelude.String
458
458
459− split :: Prelude.String -> Prelude.String -> Prelude.Array Prelude.String
459+ split :: Prelude.String -> Prelude.String -> [Prelude.String]
460
460
461 substr :: Prelude.Number -> Prelude.Number -> Prelude.String -> Prelude.String
461 substr :: Prelude.Number -> Prelude.Number -> Prelude.String -> Prelude.String
462
462
@@ -489,7 +489,7 @@ Values
489
489
490::
490::
491
491
492− match :: Regex -> Prelude.String -> Prelude.Array Prelude.String
492+ match :: Regex -> Prelude.String -> [Prelude.String]
493
493
494 regex :: Prelude.String -> Prelude.String -> Regex
494 regex :: Prelude.String -> Prelude.String -> Regex
495
495
@@ -620,11 +620,11 @@ Values
620
620
621::
621::
622
622
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
624
624
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 { }
626
626
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 { }
628
628
629 retEff :: forall a. forall e. a -> Eff e a
629 retEff :: forall a. forall e. a -> Eff e a
630
630
@@ -678,7 +678,7 @@ Values
678
678
679::
679::
680
680
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
682
682
683 throwError :: forall r. forall e. forall a. e -> Eff err :: Error e | r a
683 throwError :: forall r. forall e. forall a. e -> Eff err :: Error e | r a
684
684
@@ -705,7 +705,7 @@ Values
705
705
706::
706::
707
707
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 { }
709
709
710 newIORef :: forall r. forall s. s -> Eff ref :: Ref | r (IORef s)
710 newIORef :: forall r. forall s. s -> Eff ref :: Ref | r (IORef s)
711
711
@@ -761,7 +761,7 @@ Values
761
761
762::
762::
763
763
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 { }
765
765
766 newSTRef :: forall r. forall h. forall a. a -> Eff st :: ST h | r (STRef h a)
766 newSTRef :: forall r. forall h. forall a. a -> Eff st :: ST h | r (STRef h a)
767
767
libraries/prelude/README.md+56−56
@@ -51,11 +51,11 @@
51 (/=) :: a -> a -> Prelude.Boolean
51 (/=) :: a -> a -> Prelude.Boolean
52
52
53 class Functor f where
53 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
55
55
56 class Monad m where
56 class Monad m where
57 ret :: forall a. a -> m a
57 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
59
59
60 class Num a where
60 class Num a where
61 (+) :: a -> a -> a
61 (+) :: a -> a -> a
@@ -96,7 +96,7 @@
96
96
97 instance Eq Prelude.Boolean
97 instance Eq Prelude.Boolean
98
98
99− (Eq (a)) => instance Eq Prelude.Array a
99+ (Eq (a)) => instance Eq [a]
100
100
101 (Applicative (f)) => instance Functor f
101 (Applicative (f)) => instance Functor f
102
102
@@ -117,11 +117,11 @@
117
117
118### Values
118### Values
119
119
120− (!!) :: forall a. Prelude.Array a -> Prelude.Number -> a
120+ (!!) :: forall a. [a] -> Prelude.Number -> a
121
121
122− (#) :: forall b. forall a. a -> Prelude.Function a b -> b
122+ (#) :: forall b. forall a. a -> (a -> b) -> b
123
123
124− ($) :: forall b. forall a. Prelude.Function a b -> a -> b
124+ ($) :: forall b. forall a. (a -> b) -> a -> b
125
125
126 (++) :: Prelude.String -> Prelude.String -> Prelude.String
126 (++) :: Prelude.String -> Prelude.String -> Prelude.String
127
127
@@ -131,7 +131,7 @@
131
131
132 boolOr :: Prelude.Boolean -> Prelude.Boolean -> Prelude.Boolean
132 boolOr :: Prelude.Boolean -> Prelude.Boolean -> Prelude.Boolean
133
133
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
135
135
136 konst :: forall b. forall a. a -> b -> a
136 konst :: forall b. forall a. a -> b -> a
137
137
@@ -199,7 +199,7 @@
199
199
200### Values
200### Values
201
201
202− mconcat :: forall m. (Monoid (m)) => Prelude.Array m -> m
202+ mconcat :: forall m. (Monoid (m)) => [m] -> m
203
203
204
204
205## Module Monad
205## Module Monad
@@ -215,19 +215,19 @@
215
215
216### Values
216### Values
217
217
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
219
219
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
221
221
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
223
223
224 join :: forall a. forall m. (Monad (m)) => m (m a) -> m a
224 join :: forall a. forall m. (Monad (m)) => m (m a) -> m a
225
225
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]
227
227
228 replicateM :: forall a. forall m. (Monad (m)) => Prelude.Number -> m a -> m [a]
228 replicateM :: forall a. forall m. (Monad (m)) => Prelude.Number -> m a -> m [a]
229
229
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]
231
231
232 when :: forall m. (Monad (m)) => Prelude.Boolean -> m { } -> m { }
232 when :: forall m. (Monad (m)) => Prelude.Boolean -> m { } -> m { }
233
233
@@ -253,7 +253,7 @@
253
253
254 fromMaybe :: forall a. a -> Maybe a -> a
254 fromMaybe :: forall a. a -> Maybe a -> a
255
255
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
257
257
258
258
259## Module Either
259## Module Either
@@ -275,7 +275,7 @@
275
275
276### Values
276### Values
277
277
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
279
279
280
280
281## Module Arrays
281## Module Arrays
@@ -292,66 +292,66 @@
292
292
293 instance Prelude.Monad Prelude.Array
293 instance Prelude.Monad Prelude.Array
294
294
295− (Prelude.Show (a)) => instance Prelude.Show Prelude.Array a
295+ (Prelude.Show (a)) => instance Prelude.Show [a]
296
296
297
297
298### Values
298### Values
299
299
300− (:) :: forall a. a -> Prelude.Array a -> Prelude.Array a
300+ (:) :: forall a. a -> [a] -> [a]
301
301
302− all :: forall a. Prelude.Function a Prelude.Boolean -> Prelude.Array a -> Prelude.Boolean
302+ all :: forall a. (a -> Prelude.Boolean) -> [a] -> Prelude.Boolean
303
303
304− any :: forall a. Prelude.Function a Prelude.Boolean -> Prelude.Array a -> Prelude.Boolean
304+ any :: forall a. (a -> Prelude.Boolean) -> [a] -> Prelude.Boolean
305
305
306− concat :: forall a. Prelude.Array a -> Prelude.Array a -> Prelude.Array a
306+ concat :: forall a. [a] -> [a] -> [a]
307
307
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]
309
309
310− filter :: forall a. Prelude.Function a Prelude.Boolean -> Prelude.Array a -> Prelude.Array a
310+ filter :: forall a. (a -> Prelude.Boolean) -> [a] -> [a]
311
311
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
313
313
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
315
315
316− head :: forall a. Prelude.Array a -> a
316+ head :: forall a. [a] -> a
317
317
318− headSafe :: forall a. Prelude.Array a -> Maybe a
318+ headSafe :: forall a. [a] -> Maybe a
319
319
320− indexOf :: forall a. Prelude.Array a -> a -> Prelude.Number
320+ indexOf :: forall a. [a] -> a -> Prelude.Number
321
321
322− isEmpty :: forall a. Prelude.Array a -> Prelude.Boolean
322+ isEmpty :: forall a. [a] -> Prelude.Boolean
323
323
324− joinS :: Prelude.Array Prelude.String -> Prelude.String
324+ joinS :: [Prelude.String] -> Prelude.String
325
325
326− joinWith :: Prelude.Array Prelude.String -> Prelude.String -> Prelude.String
326+ joinWith :: [Prelude.String] -> Prelude.String -> Prelude.String
327
327
328− lastIndexOf :: forall a. Prelude.Array a -> a -> Prelude.Number
328+ lastIndexOf :: forall a. [a] -> a -> Prelude.Number
329
329
330− length :: forall a. Prelude.Array a -> Prelude.Number
330+ length :: forall a. [a] -> Prelude.Number
331
331
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]
333
333
334− push :: forall a. Prelude.Array a -> a -> Prelude.Array a
334+ push :: forall a. [a] -> a -> [a]
335
335
336− range :: Prelude.Number -> Prelude.Number -> Prelude.Array Prelude.Number
336+ range :: Prelude.Number -> Prelude.Number -> [Prelude.Number]
337
337
338− reverse :: forall a. Prelude.Array a -> Prelude.Array a
338+ reverse :: forall a. [a] -> [a]
339
339
340− shift :: forall a. Prelude.Array a -> Prelude.Array a
340+ shift :: forall a. [a] -> [a]
341
341
342− singleton :: forall a. a -> Prelude.Array a
342+ singleton :: forall a. a -> [a]
343
343
344− slice :: forall a. Prelude.Number -> Prelude.Number -> Prelude.Array a -> Prelude.Array a
344+ slice :: forall a. Prelude.Number -> Prelude.Number -> [a] -> [a]
345
345
346− sort :: forall a. Prelude.Array a -> Prelude.Array a
346+ sort :: forall a. [a] -> [a]
347
347
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]
349
349
350− tail :: forall a. Prelude.Array a -> Prelude.Array a
350+ tail :: forall a. [a] -> [a]
351
351
352− tailSafe :: forall a. Prelude.Array a -> Maybe [a]
352+ tailSafe :: forall a. [a] -> Maybe [a]
353
353
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]
355
355
356
356
357## Module Tuple
357## Module Tuple
@@ -369,15 +369,15 @@
369
369
370### Values
370### Values
371
371
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
373
373
374 tuple :: forall b. forall a. a -> b -> Tuple a b
374 tuple :: forall b. forall a. a -> b -> Tuple a b
375
375
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
377
377
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]
379
379
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]
381
381
382
382
383## Module String
383## Module String
@@ -407,7 +407,7 @@
407
407
408 sliceS :: Prelude.Number -> Prelude.Number -> Prelude.String -> Prelude.String
408 sliceS :: Prelude.Number -> Prelude.Number -> Prelude.String -> Prelude.String
409
409
410− split :: Prelude.String -> Prelude.String -> Prelude.Array Prelude.String
410+ split :: Prelude.String -> Prelude.String -> [Prelude.String]
411
411
412 substr :: Prelude.Number -> Prelude.Number -> Prelude.String -> Prelude.String
412 substr :: Prelude.Number -> Prelude.Number -> Prelude.String -> Prelude.String
413
413
@@ -435,7 +435,7 @@
435
435
436### Values
436### Values
437
437
438− match :: Regex -> Prelude.String -> Prelude.Array Prelude.String
438+ match :: Regex -> Prelude.String -> [Prelude.String]
439
439
440 regex :: Prelude.String -> Prelude.String -> Regex
440 regex :: Prelude.String -> Prelude.String -> Regex
441
441
@@ -553,11 +553,11 @@
553
553
554### Values
554### Values
555
555
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
557
557
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 { }
559
559
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 { }
561
561
562 retEff :: forall a. forall e. a -> Eff e a
562 retEff :: forall a. forall e. a -> Eff e a
563
563
@@ -601,7 +601,7 @@
601
601
602### Values
602### Values
603
603
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
605
605
606 throwError :: forall r. forall e. forall a. e -> Eff err :: Error e | r a
606 throwError :: forall r. forall e. forall a. e -> Eff err :: Error e | r a
607
607
@@ -623,7 +623,7 @@
623
623
624### Values
624### Values
625
625
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 { }
627
627
628 newIORef :: forall r. forall s. s -> Eff ref :: Ref | r (IORef s)
628 newIORef :: forall r. forall s. s -> Eff ref :: Ref | r (IORef s)
629
629
@@ -669,7 +669,7 @@
669
669
670### Values
670### Values
671
671
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 { }
673
673
674 newSTRef :: forall r. forall h. forall a. a -> Eff st :: ST h | r (STRef h a)
674 newSTRef :: forall r. forall h. forall a. a -> Eff st :: ST h | r (STRef h a)
675
675
src/Language/PureScript/Pretty/Types.hs+15−7
@@ -20,6 +20,7 @@ module Language.PureScript.Pretty.Types (
20
20
21import Data.Maybe (fromMaybe)
21import Data.Maybe (fromMaybe)
22import Data.List (intercalate)
22import Data.List (intercalate)
23+import Data.Generics (mkT, everywhere)
23
24
24import Control.Arrow ((<+>))
25import Control.Arrow ((<+>))
25import Control.PatternArrows
26import Control.PatternArrows
@@ -33,8 +34,8 @@ typeLiterals = mkPattern match
33 where
34 where
34 match (Object row) = Just $ "{ " ++ prettyPrintType row ++ " }"
35 match (Object row) = Just $ "{ " ++ prettyPrintType row ++ " }"
35 match (TypeVar var) = Just var
36 match (TypeVar var) = Just var
36− match (TypeApp arr ty) | arr == tyArray = Just $ "[" ++ prettyPrintType ty ++ "]"
37+ match (PrettyPrintArray ty) = Just $ "[" ++ prettyPrintType ty ++ "]"
37− match (TypeConstructor ctor) = Just $ show ctor
38+ match ty@(TypeConstructor ctor) = Just $ show ctor
38 match (TUnknown (Unknown u)) = Just $ 'u' : show u
39 match (TUnknown (Unknown u)) = Just $ 'u' : show u
39 match (Skolem s _) = Just $ 's' : show s
40 match (Skolem s _) = Just $ 's' : show s
40 match (ConstrainedType deps ty) = Just $ "(" ++ intercalate "," (map (\(pn, ty') -> show pn ++ " (" ++ prettyPrintType ty' ++ ")") deps) ++ ") => " ++ prettyPrintType ty
41 match (ConstrainedType deps ty) = Just $ "(" ++ intercalate "," (map (\(pn, ty') -> show pn ++ " (" ++ prettyPrintType ty' ++ ")") deps) ++ ") => " ++ prettyPrintType ty
@@ -68,23 +69,30 @@ typeApp = mkPattern match
68 match (TypeApp f x) = Just (f, x)
69 match (TypeApp f x) = Just (f, x)
69 match _ = Nothing
70 match _ = Nothing
70
71
71−singleArgumentFunction :: Pattern () Type (Type, Type)
72+appliedFunction :: Pattern () Type (Type, Type)
72−singleArgumentFunction = mkPattern match
73+appliedFunction = mkPattern match
73 where
74 where
74− match (TypeApp (TypeApp t arg) ret) | t == tyFunction = Just (arg, ret)
75+ match (PrettyPrintFunction arg ret) = Just (arg, ret)
75 match _ = Nothing
76 match _ = Nothing
76
77
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+
77-- |
85-- |
78-- Generate a pretty-printed string representing a Type
86-- Generate a pretty-printed string representing a Type
79--
87--
80prettyPrintType :: Type -> String
88prettyPrintType :: Type -> String
81−prettyPrintType = fromMaybe (error "Incomplete pattern") . pattern matchType ()
89+prettyPrintType = fromMaybe (error "Incomplete pattern") . pattern matchType () . insertPlaceholders
82 where
90 where
83 matchType :: Pattern () Type String
91 matchType :: Pattern () Type String
84 matchType = buildPrettyPrinter operators (typeLiterals <+> fmap parens matchType)
92 matchType = buildPrettyPrinter operators (typeLiterals <+> fmap parens matchType)
85 operators :: OperatorTable () Type String
93 operators :: OperatorTable () Type String
86 operators =
94 operators =
87 OperatorTable [ [ AssocL typeApp $ \f x -> f ++ " " ++ x ]
95 OperatorTable [ [ AssocL typeApp $ \f x -> f ++ " " ++ x ]
88− , [ AssocR singleArgumentFunction $ \arg ret -> arg ++ " -> " ++ ret
96+ , [ AssocR appliedFunction $ \arg ret -> arg ++ " -> " ++ ret
89 ]
97 ]
90 ]
98 ]
src/Language/PureScript/Types.hs+9−1
@@ -76,7 +76,15 @@ data Type
76 -- |
76 -- |
77 -- A non-empty row
77 -- A non-empty row
78 --
78 --
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)
80
88
81-- |
89-- |
82-- Type constructor for functions
90-- Type constructor for functions