git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Started on hierarchy.
43b93bajoneshf
docgen/Main.hs+5
@@ -70,6 +70,8 @@ renderModule (P.Module moduleName ds exps) =
70 spacer
70 spacer
71 headerLevel 3 "Type Classes"
71 headerLevel 3 "Type Classes"
72 spacer
72 spacer
73+ renderTypeclassImage
74+ spacer
73 renderTopLevel exps (filter isTypeClassDeclaration exported)
75 renderTopLevel exps (filter isTypeClassDeclaration exported)
74 spacer
76 spacer
75 headerLevel 3 "Type Class Instances"
77 headerLevel 3 "Type Class Instances"
@@ -108,6 +110,9 @@ renderTopLevel exps decls = forM_ (sortBy (compare `on` getName) decls) $ \decl
108 renderDeclaration 4 exps decl
110 renderDeclaration 4 exps decl
109 spacer
111 spacer
110
112
113+renderTypeclassImage :: Docs
114+renderTypeclassImage = tell ["![typeclasses](typeclasses.png)"]
115+
111renderDeclaration :: Int -> Maybe [P.DeclarationRef] -> P.Declaration -> Docs
116renderDeclaration :: Int -> Maybe [P.DeclarationRef] -> P.Declaration -> Docs
112renderDeclaration n _ (P.TypeDeclaration ident ty) =
117renderDeclaration n _ (P.TypeDeclaration ident ty) =
113 atIndent n $ show ident ++ " :: " ++ P.prettyPrintType ty
118 atIndent n $ show ident ++ " :: " ++ P.prettyPrintType ty
docs/source/prelude.rst+125−19
@@ -17,16 +17,25 @@ Types
17Type Classes
17Type Classes
18~~~~~~~~~~~~
18~~~~~~~~~~~~
19
19
20+.. figure:: typeclasses.png
21+ :alt: typeclasses
22+
23+ typeclasses
20::
24::
21
25
22 class Alternative f where
26 class Alternative f where
23 empty :: forall a. f a
27 empty :: forall a. f a
24 (<|>) :: forall a. f a -> f a -> f a
28 (<|>) :: forall a. f a -> f a -> f a
25
29
26− class Applicative f where
30+ class (Apply f) <= Applicative f where
27 pure :: forall a. a -> f a
31 pure :: forall a. a -> f a
32+
33+ class (Functor f) <= Apply f where
28 (<*>) :: forall a b. f (a -> b) -> f a -> f b
34 (<*>) :: forall a b. f (a -> b) -> f a -> f b
29
35
36+ class (Apply m) <= Bind m where
37+ (>>=) :: forall a b. m a -> (a -> m b) -> m b
38+
30 class Bits b where
39 class Bits b where
31 (&) :: b -> b -> b
40 (&) :: b -> b -> b
32 (|) :: b -> b -> b
41 (|) :: b -> b -> b
@@ -41,9 +50,8 @@ Type Classes
41 (||) :: b -> b -> b
50 (||) :: b -> b -> b
42 not :: b -> b
51 not :: b -> b
43
52
44− class Category a where
53+ class (Semigroupoid a) <= Category a where
45 id :: forall t. a t t
54 id :: forall t. a t t
46− (<<<) :: forall b c d. a c d -> a b c -> a b d
47
55
48 class Eq a where
56 class Eq a where
49 (==) :: a -> a -> Prim.Boolean
57 (==) :: a -> a -> Prim.Boolean
@@ -52,9 +60,7 @@ Type Classes
52 class Functor f where
60 class Functor f where
53 (<$>) :: forall a b. (a -> b) -> f a -> f b
61 (<$>) :: forall a b. (a -> b) -> f a -> f b
54
62
55− class Monad m where
63+ class (Applicative m, Bind m) <= Monad m where
56− return :: forall a. a -> m a
57− (>>=) :: forall a b. m a -> (a -> m b) -> m b
58
64
59 class Num a where
65 class Num a where
60 (+) :: a -> a -> a
66 (+) :: a -> a -> a
@@ -64,9 +70,15 @@ Type Classes
64 (%) :: a -> a -> a
70 (%) :: a -> a -> a
65 negate :: a -> a
71 negate :: a -> a
66
72
67− class Ord a where
73+ class (Eq a) <= Ord a where
68 compare :: a -> a -> Ordering
74 compare :: a -> a -> Ordering
69
75
76+ class Semigroup a where
77+ (<>) :: a -> a -> a
78+
79+ class Semigroupoid a where
80+ (<<<) :: forall b c d. a c d -> a b c -> a b d
81+
70 class Show a where
82 class Show a where
71 show :: a -> Prim.String
83 show :: a -> Prim.String
72
84
@@ -75,8 +87,6 @@ Type Class Instances
75
87
76::
88::
77
89
78− instance applicativeFromMonad :: (Monad m) => Applicative m
79−
80 instance bitsNumber :: Bits Prim.Number
90 instance bitsNumber :: Bits Prim.Number
81
91
82 instance boolLikeBoolean :: BoolLike Prim.Boolean
92 instance boolLikeBoolean :: BoolLike Prim.Boolean
@@ -89,14 +99,20 @@ Type Class Instances
89
99
90 instance eqNumber :: Eq Prim.Number
100 instance eqNumber :: Eq Prim.Number
91
101
92− instance eqString :: Eq Prim.String
102+ instance eqOrdering :: Eq Ordering
93
103
94− instance functorFromApplicative :: (Applicative f) => Functor f
104+ instance eqString :: Eq Prim.String
95
105
96 instance numNumber :: Num Prim.Number
106 instance numNumber :: Num Prim.Number
97
107
98 instance ordNumber :: Ord Prim.Number
108 instance ordNumber :: Ord Prim.Number
99
109
110+ instance semigroupString :: Semigroup Prim.String
111+
112+ instance semigroupoidArr :: Semigroupoid Prim.Function
113+
114+ instance showArray :: (Show a) => Show [a]
115+
100 instance showBoolean :: Show Prim.Boolean
116 instance showBoolean :: Show Prim.Boolean
101
117
102 instance showNumber :: Show Prim.Number
118 instance showNumber :: Show Prim.Number
@@ -110,13 +126,13 @@ Values
110
126
111::
127::
112
128
113− (!!) :: forall a. [a] -> Prim.Number -> a
114−
115 (#) :: forall a b. a -> (a -> b) -> b
129 (#) :: forall a b. a -> (a -> b) -> b
116
130
117 ($) :: forall a b. (a -> b) -> a -> b
131 ($) :: forall a b. (a -> b) -> a -> b
118
132
119− (++) :: Prim.String -> Prim.String -> Prim.String
133+ (++) :: forall s. (Semigroup s) => s -> s -> s
134+
135+ (:) :: forall a. a -> [a] -> [a]
120
136
121 (<) :: forall a. (Ord a) => a -> a -> Prim.Boolean
137 (<) :: forall a. (Ord a) => a -> a -> Prim.Boolean
122
138
@@ -126,7 +142,11 @@ Values
126
142
127 (>=) :: forall a. (Ord a) => a -> a -> Prim.Boolean
143 (>=) :: forall a. (Ord a) => a -> a -> Prim.Boolean
128
144
129− (>>>) :: forall a b c d. (Category a) => a b c -> a c d -> a b d
145+ (>>>) :: forall a b c d. (Semigroupoid a) => a b c -> a c d -> a b d
146+
147+ ap :: forall m a b. (Monad m) => m (a -> b) -> m a -> m b
148+
149+ asTypeOf :: forall a. a -> a -> a
130
150
131 boolAnd :: Prim.Boolean -> Prim.Boolean -> Prim.Boolean
151 boolAnd :: Prim.Boolean -> Prim.Boolean -> Prim.Boolean
132
152
@@ -134,10 +154,18 @@ Values
134
154
135 boolOr :: Prim.Boolean -> Prim.Boolean -> Prim.Boolean
155 boolOr :: Prim.Boolean -> Prim.Boolean -> Prim.Boolean
136
156
157+ concatString :: Prim.String -> Prim.String -> Prim.String
158+
159+ cons :: forall a. a -> [a] -> [a]
160+
137 const :: forall a b. a -> b -> a
161 const :: forall a b. a -> b -> a
138
162
139 flip :: forall a b c. (a -> b -> c) -> b -> a -> c
163 flip :: forall a b c. (a -> b -> c) -> b -> a -> c
140
164
165+ liftA1 :: forall f a b. (Applicative f) => (a -> b) -> f a -> f b
166+
167+ liftM1 :: forall m a b. (Monad m) => (a -> b) -> m a -> m b
168+
141 numAdd :: Prim.Number -> Prim.Number -> Prim.Number
169 numAdd :: Prim.Number -> Prim.Number -> Prim.Number
142
170
143 numAnd :: Prim.Number -> Prim.Number -> Prim.Number
171 numAnd :: Prim.Number -> Prim.Number -> Prim.Number
@@ -166,14 +194,41 @@ Values
166
194
167 numZshr :: Prim.Number -> Prim.Number -> Prim.Number
195 numZshr :: Prim.Number -> Prim.Number -> Prim.Number
168
196
169− on :: forall a b c. (b -> b -> c) -> (a -> b) -> a -> a -> c
170−
171 refEq :: forall a. a -> a -> Prim.Boolean
197 refEq :: forall a. a -> a -> Prim.Boolean
172
198
173 refIneq :: forall a. a -> a -> Prim.Boolean
199 refIneq :: forall a. a -> a -> Prim.Boolean
174
200
201+ return :: forall m a. (Monad m) => a -> m a
202+
203+ showArrayImpl :: forall a. (a -> Prim.String) -> [a] -> Prim.String
204+
175 showNumberImpl :: Prim.Number -> Prim.String
205 showNumberImpl :: Prim.Number -> Prim.String
176
206
207+ showStringImpl :: Prim.String -> Prim.String
208+
209+Module Data.Function
210+--------------------
211+
212+Types
213+~~~~~
214+
215+Type Classes
216+~~~~~~~~~~~~
217+
218+.. figure:: typeclasses.png
219+ :alt: typeclasses
220+
221+ typeclasses
222+Type Class Instances
223+~~~~~~~~~~~~~~~~~~~~
224+
225+Values
226+~~~~~~
227+
228+::
229+
230+ on :: forall a b c. (b -> b -> c) -> (a -> b) -> a -> a -> c
231+
177Module Data.Eq
232Module Data.Eq
178--------------
233--------------
179
234
@@ -188,6 +243,10 @@ Types
188Type Classes
243Type Classes
189~~~~~~~~~~~~
244~~~~~~~~~~~~
190
245
246+.. figure:: typeclasses.png
247+ :alt: typeclasses
248+
249+ typeclasses
191Type Class Instances
250Type Class Instances
192~~~~~~~~~~~~~~~~~~~~
251~~~~~~~~~~~~~~~~~~~~
193
252
@@ -202,6 +261,29 @@ Values
202
261
203 liftRef :: forall a b. (a -> a -> b) -> Ref a -> Ref a -> b
262 liftRef :: forall a b. (a -> a -> b) -> Ref a -> Ref a -> b
204
263
264+Module Prelude.Unsafe
265+---------------------
266+
267+Types
268+~~~~~
269+
270+Type Classes
271+~~~~~~~~~~~~
272+
273+.. figure:: typeclasses.png
274+ :alt: typeclasses
275+
276+ typeclasses
277+Type Class Instances
278+~~~~~~~~~~~~~~~~~~~~
279+
280+Values
281+~~~~~~
282+
283+::
284+
285+ unsafeIndex :: forall a. [a] -> Prim.Number -> a
286+
205Module Control.Monad.Eff
287Module Control.Monad.Eff
206------------------------
288------------------------
207
289
@@ -217,11 +299,23 @@ Types
217Type Classes
299Type Classes
218~~~~~~~~~~~~
300~~~~~~~~~~~~
219
301
302+.. figure:: typeclasses.png
303+ :alt: typeclasses
304+
305+ typeclasses
220Type Class Instances
306Type Class Instances
221~~~~~~~~~~~~~~~~~~~~
307~~~~~~~~~~~~~~~~~~~~
222
308
223::
309::
224
310
311+ instance applicativeEff :: Applicative (Eff e)
312+
313+ instance applyEff :: Apply (Eff e)
314+
315+ instance bindEff :: Bind (Eff e)
316+
317+ instance functorEff :: Functor (Eff e)
318+
225 instance monadEff :: Monad (Eff e)
319 instance monadEff :: Monad (Eff e)
226
320
227Values
321Values
@@ -229,13 +323,13 @@ Values
229
323
230::
324::
231
325
232− bindEff :: forall e a b. Eff e a -> (a -> Eff e b) -> Eff e b
326+ bindE :: forall e a b. Eff e a -> (a -> Eff e b) -> Eff e b
233
327
234 forE :: forall e. Prim.Number -> Prim.Number -> (Prim.Number -> Eff e { }) -> Eff e { }
328 forE :: forall e. Prim.Number -> Prim.Number -> (Prim.Number -> Eff e { }) -> Eff e { }
235
329
236 foreachE :: forall e a. [a] -> (a -> Eff e { }) -> Eff e { }
330 foreachE :: forall e a. [a] -> (a -> Eff e { }) -> Eff e { }
237
331
238− retEff :: forall e a. a -> Eff e a
332+ returnE :: forall e a. a -> Eff e a
239
333
240 runPure :: forall a. Pure a -> a
334 runPure :: forall a. Pure a -> a
241
335
@@ -252,6 +346,10 @@ Types
252Type Classes
346Type Classes
253~~~~~~~~~~~~
347~~~~~~~~~~~~
254
348
349+.. figure:: typeclasses.png
350+ :alt: typeclasses
351+
352+ typeclasses
255Type Class Instances
353Type Class Instances
256~~~~~~~~~~~~~~~~~~~~
354~~~~~~~~~~~~~~~~~~~~
257
355
@@ -275,6 +373,10 @@ Types
275Type Classes
373Type Classes
276~~~~~~~~~~~~
374~~~~~~~~~~~~
277
375
376+.. figure:: typeclasses.png
377+ :alt: typeclasses
378+
379+ typeclasses
278Type Class Instances
380Type Class Instances
279~~~~~~~~~~~~~~~~~~~~
381~~~~~~~~~~~~~~~~~~~~
280
382
@@ -304,6 +406,10 @@ Types
304Type Classes
406Type Classes
305~~~~~~~~~~~~
407~~~~~~~~~~~~
306
408
409+.. figure:: typeclasses.png
410+ :alt: typeclasses
411+
412+ typeclasses
307Type Class Instances
413Type Class Instances
308~~~~~~~~~~~~~~~~~~~~
414~~~~~~~~~~~~~~~~~~~~
309
415
hierarchy/Main.hsnew file+88
@@ -0,0 +1,88 @@
1+-----------------------------------------------------------------------------
2+--
3+-- Module : Main
4+-- Copyright : (c) Phil Freeman 2014
5+-- License : MIT
6+--
7+-- Maintainer : Phil Freeman <paf31@cantab.net>
8+-- Stability : experimental
9+-- Portability :
10+--
11+-- |
12+-- Generate Directed Graphs of PureScript TypeClasses
13+--
14+-----------------------------------------------------------------------------
15+
16+module Main where
17+
18+import Control.Applicative ((<*>), (<$>))
19+
20+import Data.List (intercalate,nub,sort)
21+import Data.Version (showVersion)
22+
23+import System.Console.CmdTheLine
24+import System.Exit (exitFailure, exitSuccess)
25+
26+import Text.Parsec (ParseError)
27+
28+import qualified Language.PureScript as P
29+import qualified Paths_purescript as Paths
30+import qualified System.IO.UTF8 as U
31+
32+newtype SuperMap = SuperMap { unSuperMap :: Either P.ProperName (P.ProperName, P.ProperName) }
33+ deriving Eq
34+
35+instance Show SuperMap where
36+ show (SuperMap (Left sub)) = show sub
37+ show (SuperMap (Right (super, sub))) = show super ++ " -> " ++ show sub
38+
39+instance Ord SuperMap where
40+ compare (SuperMap s) (SuperMap s') = getCls s `compare` getCls s'
41+ where
42+ getCls = either id snd
43+
44+readInput :: FilePath -> IO (Either ParseError [P.Module])
45+readInput p = do
46+ text <- U.readFile p
47+ return $ P.runIndentParser p P.parseModules text
48+
49+compile :: FilePath -> Maybe FilePath -> IO ()
50+compile input mOutput = do
51+ modules <- readInput input
52+ case modules of
53+ Left err -> U.print err >> exitFailure
54+ Right (P.Module _ decls _ : _) -> do
55+ let tcs = filter P.isTypeClassDeclaration decls
56+ let supers = sort . nub . filter (not . null) $ fmap superClasses tcs
57+ let hier = "digraph Prelude {\n" ++ intercalate "\n" (concatMap (fmap ((" " ++) . (++ ";") . show)) supers) ++ "\n}"
58+ case mOutput of
59+ Just output -> U.writeFile output hier
60+ Nothing -> U.putStrLn hier
61+ exitSuccess
62+
63+superClasses :: P.Declaration -> [SuperMap]
64+superClasses (P.TypeClassDeclaration sub _ supers@(_:_) _) =
65+ fmap (\(P.Qualified _ super, _) -> SuperMap (Right (super, sub))) supers
66+superClasses (P.TypeClassDeclaration sub _ _ _) = [SuperMap (Left sub)]
67+superClasses (P.PositionedDeclaration _ decl) = superClasses decl
68+superClasses _ = []
69+
70+outputFile :: Term (Maybe FilePath)
71+outputFile = value $ opt Nothing $ (optInfo [ "o", "output" ])
72+ { optDoc = "The output file" }
73+
74+inputFile :: Term FilePath
75+inputFile = value $ pos 0 "main.purs" $ posInfo { posDoc = "The input file to generate a hierarchy from" }
76+
77+term :: Term (IO ())
78+term = compile <$> inputFile <*> outputFile
79+
80+termInfo :: TermInfo
81+termInfo = defTI
82+ { termName = "hierarchy"
83+ , version = showVersion Paths.version
84+ , termDoc = "Creates a GraphViz directed graph of PureScript TypeClasses"
85+ }
86+
87+main :: IO ()
88+main = run (term, termInfo)
prelude/README.md+103−19
@@ -11,14 +11,21 @@
11
11
12### Type Classes
12### Type Classes
13
13
14+![typeclasses](typeclasses.png)
15+
14 class Alternative f where
16 class Alternative f where
15 empty :: forall a. f a
17 empty :: forall a. f a
16 (<|>) :: forall a. f a -> f a -> f a
18 (<|>) :: forall a. f a -> f a -> f a
17
19
18− class Applicative f where
20+ class (Apply f) <= Applicative f where
19 pure :: forall a. a -> f a
21 pure :: forall a. a -> f a
22+
23+ class (Functor f) <= Apply f where
20 (<*>) :: forall a b. f (a -> b) -> f a -> f b
24 (<*>) :: forall a b. f (a -> b) -> f a -> f b
21
25
26+ class (Apply m) <= Bind m where
27+ (>>=) :: forall a b. m a -> (a -> m b) -> m b
28+
22 class Bits b where
29 class Bits b where
23 (&) :: b -> b -> b
30 (&) :: b -> b -> b
24 (|) :: b -> b -> b
31 (|) :: b -> b -> b
@@ -33,9 +40,8 @@
33 (||) :: b -> b -> b
40 (||) :: b -> b -> b
34 not :: b -> b
41 not :: b -> b
35
42
36− class Category a where
43+ class (Semigroupoid a) <= Category a where
37 id :: forall t. a t t
44 id :: forall t. a t t
38− (<<<) :: forall b c d. a c d -> a b c -> a b d
39
45
40 class Eq a where
46 class Eq a where
41 (==) :: a -> a -> Prim.Boolean
47 (==) :: a -> a -> Prim.Boolean
@@ -44,9 +50,7 @@
44 class Functor f where
50 class Functor f where
45 (<$>) :: forall a b. (a -> b) -> f a -> f b
51 (<$>) :: forall a b. (a -> b) -> f a -> f b
46
52
47− class Monad m where
53+ class (Applicative m, Bind m) <= Monad m where
48− return :: forall a. a -> m a
49− (>>=) :: forall a b. m a -> (a -> m b) -> m b
50
54
51 class Num a where
55 class Num a where
52 (+) :: a -> a -> a
56 (+) :: a -> a -> a
@@ -56,17 +60,21 @@
56 (%) :: a -> a -> a
60 (%) :: a -> a -> a
57 negate :: a -> a
61 negate :: a -> a
58
62
59− class Ord a where
63+ class (Eq a) <= Ord a where
60 compare :: a -> a -> Ordering
64 compare :: a -> a -> Ordering
61
65
66+ class Semigroup a where
67+ (<>) :: a -> a -> a
68+
69+ class Semigroupoid a where
70+ (<<<) :: forall b c d. a c d -> a b c -> a b d
71+
62 class Show a where
72 class Show a where
63 show :: a -> Prim.String
73 show :: a -> Prim.String
64
74
65
75
66### Type Class Instances
76### Type Class Instances
67
77
68− instance applicativeFromMonad :: (Monad m) => Applicative m
69−
70 instance bitsNumber :: Bits Prim.Number
78 instance bitsNumber :: Bits Prim.Number
71
79
72 instance boolLikeBoolean :: BoolLike Prim.Boolean
80 instance boolLikeBoolean :: BoolLike Prim.Boolean
@@ -79,14 +87,20 @@
79
87
80 instance eqNumber :: Eq Prim.Number
88 instance eqNumber :: Eq Prim.Number
81
89
82− instance eqString :: Eq Prim.String
90+ instance eqOrdering :: Eq Ordering
83
91
84− instance functorFromApplicative :: (Applicative f) => Functor f
92+ instance eqString :: Eq Prim.String
85
93
86 instance numNumber :: Num Prim.Number
94 instance numNumber :: Num Prim.Number
87
95
88 instance ordNumber :: Ord Prim.Number
96 instance ordNumber :: Ord Prim.Number
89
97
98+ instance semigroupString :: Semigroup Prim.String
99+
100+ instance semigroupoidArr :: Semigroupoid Prim.Function
101+
102+ instance showArray :: (Show a) => Show [a]
103+
90 instance showBoolean :: Show Prim.Boolean
104 instance showBoolean :: Show Prim.Boolean
91
105
92 instance showNumber :: Show Prim.Number
106 instance showNumber :: Show Prim.Number
@@ -98,13 +112,13 @@
98
112
99### Values
113### Values
100
114
101− (!!) :: forall a. [a] -> Prim.Number -> a
102−
103 (#) :: forall a b. a -> (a -> b) -> b
115 (#) :: forall a b. a -> (a -> b) -> b
104
116
105 ($) :: forall a b. (a -> b) -> a -> b
117 ($) :: forall a b. (a -> b) -> a -> b
106
118
107− (++) :: Prim.String -> Prim.String -> Prim.String
119+ (++) :: forall s. (Semigroup s) => s -> s -> s
120+
121+ (:) :: forall a. a -> [a] -> [a]
108
122
109 (<) :: forall a. (Ord a) => a -> a -> Prim.Boolean
123 (<) :: forall a. (Ord a) => a -> a -> Prim.Boolean
110
124
@@ -114,7 +128,11 @@
114
128
115 (>=) :: forall a. (Ord a) => a -> a -> Prim.Boolean
129 (>=) :: forall a. (Ord a) => a -> a -> Prim.Boolean
116
130
117− (>>>) :: forall a b c d. (Category a) => a b c -> a c d -> a b d
131+ (>>>) :: forall a b c d. (Semigroupoid a) => a b c -> a c d -> a b d
132+
133+ ap :: forall m a b. (Monad m) => m (a -> b) -> m a -> m b
134+
135+ asTypeOf :: forall a. a -> a -> a
118
136
119 boolAnd :: Prim.Boolean -> Prim.Boolean -> Prim.Boolean
137 boolAnd :: Prim.Boolean -> Prim.Boolean -> Prim.Boolean
120
138
@@ -122,10 +140,18 @@
122
140
123 boolOr :: Prim.Boolean -> Prim.Boolean -> Prim.Boolean
141 boolOr :: Prim.Boolean -> Prim.Boolean -> Prim.Boolean
124
142
143+ concatString :: Prim.String -> Prim.String -> Prim.String
144+
145+ cons :: forall a. a -> [a] -> [a]
146+
125 const :: forall a b. a -> b -> a
147 const :: forall a b. a -> b -> a
126
148
127 flip :: forall a b c. (a -> b -> c) -> b -> a -> c
149 flip :: forall a b c. (a -> b -> c) -> b -> a -> c
128
150
151+ liftA1 :: forall f a b. (Applicative f) => (a -> b) -> f a -> f b
152+
153+ liftM1 :: forall m a b. (Monad m) => (a -> b) -> m a -> m b
154+
129 numAdd :: Prim.Number -> Prim.Number -> Prim.Number
155 numAdd :: Prim.Number -> Prim.Number -> Prim.Number
130
156
131 numAnd :: Prim.Number -> Prim.Number -> Prim.Number
157 numAnd :: Prim.Number -> Prim.Number -> Prim.Number
@@ -154,14 +180,36 @@
154
180
155 numZshr :: Prim.Number -> Prim.Number -> Prim.Number
181 numZshr :: Prim.Number -> Prim.Number -> Prim.Number
156
182
157− on :: forall a b c. (b -> b -> c) -> (a -> b) -> a -> a -> c
158−
159 refEq :: forall a. a -> a -> Prim.Boolean
183 refEq :: forall a. a -> a -> Prim.Boolean
160
184
161 refIneq :: forall a. a -> a -> Prim.Boolean
185 refIneq :: forall a. a -> a -> Prim.Boolean
162
186
187+ return :: forall m a. (Monad m) => a -> m a
188+
189+ showArrayImpl :: forall a. (a -> Prim.String) -> [a] -> Prim.String
190+
163 showNumberImpl :: Prim.Number -> Prim.String
191 showNumberImpl :: Prim.Number -> Prim.String
164
192
193+ showStringImpl :: Prim.String -> Prim.String
194+
195+
196+## Module Data.Function
197+
198+### Types
199+
200+
201+### Type Classes
202+
203+![typeclasses](typeclasses.png)
204+
205+
206+### Type Class Instances
207+
208+
209+### Values
210+
211+ on :: forall a b c. (b -> b -> c) -> (a -> b) -> a -> a -> c
212+
165
213
166## Module Data.Eq
214## Module Data.Eq
167
215
@@ -173,6 +221,8 @@
173
221
174### Type Classes
222### Type Classes
175
223
224+![typeclasses](typeclasses.png)
225+
176
226
177### Type Class Instances
227### Type Class Instances
178
228
@@ -184,6 +234,24 @@
184 liftRef :: forall a b. (a -> a -> b) -> Ref a -> Ref a -> b
234 liftRef :: forall a b. (a -> a -> b) -> Ref a -> Ref a -> b
185
235
186
236
237+## Module Prelude.Unsafe
238+
239+### Types
240+
241+
242+### Type Classes
243+
244+![typeclasses](typeclasses.png)
245+
246+
247+### Type Class Instances
248+
249+
250+### Values
251+
252+ unsafeIndex :: forall a. [a] -> Prim.Number -> a
253+
254+
187## Module Control.Monad.Eff
255## Module Control.Monad.Eff
188
256
189### Types
257### Types
@@ -195,21 +263,31 @@
195
263
196### Type Classes
264### Type Classes
197
265
266+![typeclasses](typeclasses.png)
267+
198
268
199### Type Class Instances
269### Type Class Instances
200
270
271+ instance applicativeEff :: Applicative (Eff e)
272+
273+ instance applyEff :: Apply (Eff e)
274+
275+ instance bindEff :: Bind (Eff e)
276+
277+ instance functorEff :: Functor (Eff e)
278+
201 instance monadEff :: Monad (Eff e)
279 instance monadEff :: Monad (Eff e)
202
280
203
281
204### Values
282### Values
205
283
206− bindEff :: forall e a b. Eff e a -> (a -> Eff e b) -> Eff e b
284+ bindE :: forall e a b. Eff e a -> (a -> Eff e b) -> Eff e b
207
285
208 forE :: forall e. Prim.Number -> Prim.Number -> (Prim.Number -> Eff e { }) -> Eff e { }
286 forE :: forall e. Prim.Number -> Prim.Number -> (Prim.Number -> Eff e { }) -> Eff e { }
209
287
210 foreachE :: forall e a. [a] -> (a -> Eff e { }) -> Eff e { }
288 foreachE :: forall e a. [a] -> (a -> Eff e { }) -> Eff e { }
211
289
212− retEff :: forall e a. a -> Eff e a
290+ returnE :: forall e a. a -> Eff e a
213
291
214 runPure :: forall a. Pure a -> a
292 runPure :: forall a. Pure a -> a
215
293
@@ -225,6 +303,8 @@
225
303
226### Type Classes
304### Type Classes
227
305
306+![typeclasses](typeclasses.png)
307+
228
308
229### Type Class Instances
309### Type Class Instances
230
310
@@ -243,6 +323,8 @@
243
323
244### Type Classes
324### Type Classes
245
325
326+![typeclasses](typeclasses.png)
327+
246
328
247### Type Class Instances
329### Type Class Instances
248
330
@@ -267,6 +349,8 @@
267
349
268### Type Classes
350### Type Classes
269
351
352+![typeclasses](typeclasses.png)
353+
270
354
271### Type Class Instances
355### Type Class Instances
272
356
prelude/typeclasses.pngnew file

Binary file not shown.

prelude/updateDocs.sh+1
@@ -1,2 +1,3 @@
1../dist/build/docgen/docgen prelude.purs > README.md
1../dist/build/docgen/docgen prelude.purs > README.md
2+../dist/build/hierarchy/hierarchy prelude.purs | dot -Tpng -o typeclasses.png
2pandoc -o ../docs/source/prelude.rst README.md
3pandoc -o ../docs/source/prelude.rst README.md
purescript.cabal+11−2
@@ -20,8 +20,8 @@ data-dir: ""
20library
20library
21 build-depends: base >=4 && <5, cmdtheline -any, containers -any,
21 build-depends: base >=4 && <5, cmdtheline -any, containers -any,
22 directory >= 1.2, filepath -any, mtl -any, parsec -any, syb >= 0.4.1 && < 0.5,
22 directory >= 1.2, filepath -any, mtl -any, parsec -any, syb >= 0.4.1 && < 0.5,
23− transformers -any, utf8-string -any,
23+ transformers -any, utf8-string -any,
24− pattern-arrows >= 0.0.2 && < 0.1,
24+ pattern-arrows >= 0.0.2 && < 0.1,
25 monad-unify >= 0.2.1 && < 0.3,
25 monad-unify >= 0.2.1 && < 0.3,
26 xdg-basedir -any, time -any
26 xdg-basedir -any, time -any
27 if (!os(windows))
27 if (!os(windows))
@@ -125,6 +125,15 @@ executable docgen
125 other-modules:
125 other-modules:
126 ghc-options: -Wall -O2
126 ghc-options: -Wall -O2
127
127
128+executable hierarchy
129+ build-depends: base >=4 && <5, cmdtheline -any, purescript -any, utf8-string -any,
130+ process -any, mtl -any, parsec -any
131+ main-is: Main.hs
132+ buildable: True
133+ hs-source-dirs: hierarchy
134+ other-modules:
135+ ghc-options: -Wall -O2
136+
128test-suite tests
137test-suite tests
129 build-depends: base >=4 && <5, containers -any, directory -any,
138 build-depends: base >=4 && <5, containers -any, directory -any,
130 filepath -any, mtl -any, parsec -any, purescript -any, syb >= 0.4.1 && < 0.5,
139 filepath -any, mtl -any, parsec -any, purescript -any, syb >= 0.4.1 && < 0.5,