git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix docgen, update Prelude docs
commit869c4e10d31d1e02ebf86316b92a82bcbcb9cd9a authorPhil Freeman <paf31@cantab.net> dateThu 3 Apr 2014, 14:26 (13 years ago) parent5337859
3 files changed+247−2
docgen/Main.hs+6 docs/source/conf.py+2−2 docs/source/prelude.rst+239
docgen/Main.hs+6
@@ -93,6 +93,7 @@ isExported (Just exps) decl = any (matches decl) exps
9393 matches (P.ExternDataDeclaration ident _) (P.TypeRef ident' _) = ident == ident'
9494 matches (P.TypeSynonymDeclaration ident _ _) (P.TypeRef ident' _) = ident == ident'
9595 matches (P.TypeClassDeclaration ident _ _) (P.TypeClassRef ident') = ident == ident'
96+ matches (P.PositionedDeclaration _ d) r = d `matches` r
9697 matches _ _ = False
9798
9899isDctorExported :: P.ProperName -> Maybe [P.DeclarationRef] -> P.ProperName -> Bool
@@ -143,25 +144,30 @@ getName (P.ExternDataDeclaration name _) = P.runProperName name
143144getName (P.TypeSynonymDeclaration name _ _) = P.runProperName name
144145getName (P.TypeClassDeclaration name _ _) = P.runProperName name
145146getName (P.TypeInstanceDeclaration name _ _ _ _) = show name
147+getName (P.PositionedDeclaration _ d) = getName d
146148getName _ = error "Invalid argument to getName"
147149
148150isValueDeclaration :: P.Declaration -> Bool
149151isValueDeclaration P.TypeDeclaration{} = True
150152isValueDeclaration P.ExternDeclaration{} = True
153+isValueDeclaration (P.PositionedDeclaration _ d) = isValueDeclaration d
151154isValueDeclaration _ = False
152155
153156isTypeDeclaration :: P.Declaration -> Bool
154157isTypeDeclaration P.DataDeclaration{} = True
155158isTypeDeclaration P.ExternDataDeclaration{} = True
156159isTypeDeclaration P.TypeSynonymDeclaration{} = True
160+isTypeDeclaration (P.PositionedDeclaration _ d) = isTypeDeclaration d
157161isTypeDeclaration _ = False
158162
159163isTypeClassDeclaration :: P.Declaration -> Bool
160164isTypeClassDeclaration P.TypeClassDeclaration{} = True
165+isTypeClassDeclaration (P.PositionedDeclaration _ d) = isTypeClassDeclaration d
161166isTypeClassDeclaration _ = False
162167
163168isTypeInstanceDeclaration :: P.Declaration -> Bool
164169isTypeInstanceDeclaration P.TypeInstanceDeclaration{} = True
170+isTypeInstanceDeclaration (P.PositionedDeclaration _ d) = isTypeInstanceDeclaration d
165171isTypeInstanceDeclaration _ = False
166172
167173inputFile :: Term FilePath
docs/source/conf.py+2−2
@@ -51,9 +51,9 @@ copyright = u'2014, Phil Freeman'
5151# built documents.
5252#
5353# The short X.Y version.
54−version = '0.4.0'
54+version = '0.5.0'
5555# The full version, including alpha/beta/rc tags.
56−release = '0.4.0'
56+release = '0.5.0'
5757
5858# The language for content autogenerated by Sphinx. Refer to documentation
5959# for a list of supported languages.
docs/source/prelude.rst+239
@@ -7,45 +7,242 @@ Module Prelude
77Types
88~~~~~
99
10+::
11+
12+ data Ordering where
13+ LT :: Ordering
14+ GT :: Ordering
15+ EQ :: Ordering
16+
1017Type Classes
1118~~~~~~~~~~~~
1219
20+::
21+
22+ class Alternative f where
23+ empty :: forall a. f a
24+ (<|>) :: forall a. f a -> f a -> f a
25+
26+ class Applicative f where
27+ pure :: forall a. a -> f a
28+ (<*>) :: forall a b. f (a -> b) -> f a -> f b
29+
30+ class Bits b where
31+ (&) :: b -> b -> b
32+ (|) :: b -> b -> b
33+ (^) :: b -> b -> b
34+ shl :: b -> Prim.Number -> b
35+ shr :: b -> Prim.Number -> b
36+ zshr :: b -> Prim.Number -> b
37+ complement :: b -> b
38+
39+ class BoolLike b where
40+ (&&) :: b -> b -> b
41+ (||) :: b -> b -> b
42+ not :: b -> b
43+
44+ class Category a where
45+ id :: forall t. a t t
46+ (<<<) :: forall b c d. a c d -> a b c -> a b d
47+
48+ class Eq a where
49+ (==) :: a -> a -> Prim.Boolean
50+ (/=) :: a -> a -> Prim.Boolean
51+
52+ class Functor f where
53+ (<$>) :: forall a b. (a -> b) -> f a -> f b
54+
55+ class Monad m where
56+ return :: forall a. a -> m a
57+ (>>=) :: forall a b. m a -> (a -> m b) -> m b
58+
59+ class Num a where
60+ (+) :: a -> a -> a
61+ (-) :: a -> a -> a
62+ (*) :: a -> a -> a
63+ (/) :: a -> a -> a
64+ (%) :: a -> a -> a
65+ negate :: a -> a
66+
67+ class Ord a where
68+ compare :: a -> a -> Ordering
69+
70+ class Show a where
71+ show :: a -> Prim.String
72+
1373Type Class Instances
1474~~~~~~~~~~~~~~~~~~~~
1575
76+::
77+
78+ instance applicativeFromMonad :: (Monad m) => Applicative m
79+
80+ instance bitsNumber :: Bits Prim.Number
81+
82+ instance boolLikeBoolean :: BoolLike Prim.Boolean
83+
84+ instance categoryArr :: Category Prim.Function
85+
86+ instance eqArray :: (Eq a) => Eq [a]
87+
88+ instance eqBoolean :: Eq Prim.Boolean
89+
90+ instance eqNumber :: Eq Prim.Number
91+
92+ instance eqString :: Eq Prim.String
93+
94+ instance functorFromApplicative :: (Applicative f) => Functor f
95+
96+ instance numNumber :: Num Prim.Number
97+
98+ instance ordNumber :: Ord Prim.Number
99+
100+ instance showBoolean :: Show Prim.Boolean
101+
102+ instance showNumber :: Show Prim.Number
103+
104+ instance showOrdering :: Show Ordering
105+
106+ instance showString :: Show Prim.String
107+
16108Values
17109~~~~~~
18110
111+::
112+
113+ (!!) :: forall a. [a] -> Prim.Number -> a
114+
115+ (#) :: forall a b. a -> (a -> b) -> b
116+
117+ ($) :: forall a b. (a -> b) -> a -> b
118+
119+ (++) :: Prim.String -> Prim.String -> Prim.String
120+
121+ (<) :: forall a. (Ord a) => a -> a -> Prim.Boolean
122+
123+ (<=) :: forall a. (Ord a) => a -> a -> Prim.Boolean
124+
125+ (>) :: forall a. (Ord a) => a -> a -> Prim.Boolean
126+
127+ (>=) :: forall a. (Ord a) => a -> a -> Prim.Boolean
128+
129+ (>>>) :: forall a b c d. (Category a) => a b c -> a c d -> a b d
130+
131+ boolAnd :: Prim.Boolean -> Prim.Boolean -> Prim.Boolean
132+
133+ boolNot :: Prim.Boolean -> Prim.Boolean
134+
135+ boolOr :: Prim.Boolean -> Prim.Boolean -> Prim.Boolean
136+
137+ const :: forall a b. a -> b -> a
138+
139+ flip :: forall a b c. (a -> b -> c) -> b -> a -> c
140+
141+ numAdd :: Prim.Number -> Prim.Number -> Prim.Number
142+
143+ numAnd :: Prim.Number -> Prim.Number -> Prim.Number
144+
145+ numCompare :: Prim.Number -> Prim.Number -> Ordering
146+
147+ numComplement :: Prim.Number -> Prim.Number
148+
149+ numDiv :: Prim.Number -> Prim.Number -> Prim.Number
150+
151+ numMod :: Prim.Number -> Prim.Number -> Prim.Number
152+
153+ numMul :: Prim.Number -> Prim.Number -> Prim.Number
154+
155+ numNegate :: Prim.Number -> Prim.Number
156+
157+ numOr :: Prim.Number -> Prim.Number -> Prim.Number
158+
159+ numShl :: Prim.Number -> Prim.Number -> Prim.Number
160+
161+ numShr :: Prim.Number -> Prim.Number -> Prim.Number
162+
163+ numSub :: Prim.Number -> Prim.Number -> Prim.Number
164+
165+ numXor :: Prim.Number -> Prim.Number -> Prim.Number
166+
167+ numZshr :: Prim.Number -> Prim.Number -> Prim.Number
168+
169+ on :: forall a b c. (b -> b -> c) -> (a -> b) -> a -> a -> c
170+
171+ refEq :: forall a. a -> a -> Prim.Boolean
172+
173+ refIneq :: forall a. a -> a -> Prim.Boolean
174+
175+ showNumberImpl :: Prim.Number -> Prim.String
176+
19177Module Data.Eq
20178--------------
21179
22180Types
23181~~~~~
24182
183+::
184+
185+ data Ref a where
186+ Ref :: a -> Ref a
187+
25188Type Classes
26189~~~~~~~~~~~~
27190
28191Type Class Instances
29192~~~~~~~~~~~~~~~~~~~~
30193
194+::
195+
196+ instance eqRef :: Eq (Ref a)
197+
31198Values
32199~~~~~~
33200
201+::
202+
203+ liftRef :: forall a b. (a -> a -> b) -> Ref a -> Ref a -> b
204+
34205Module Control.Monad.Eff
35206------------------------
36207
37208Types
38209~~~~~
39210
211+::
212+
213+ data Eff :: # ! -> * -> *
214+
215+ type Pure a = forall e. Eff e a
216+
40217Type Classes
41218~~~~~~~~~~~~
42219
43220Type Class Instances
44221~~~~~~~~~~~~~~~~~~~~
45222
223+::
224+
225+ instance monadEff :: Monad (Eff e)
226+
46227Values
47228~~~~~~
48229
230+::
231+
232+ bindEff :: forall e a b. Eff e a -> (a -> Eff e b) -> Eff e b
233+
234+ forE :: forall e. Prim.Number -> Prim.Number -> (Prim.Number -> Eff e { }) -> Eff e { }
235+
236+ foreachE :: forall e a. [a] -> (a -> Eff e { }) -> Eff e { }
237+
238+ retEff :: forall e a. a -> Eff e a
239+
240+ runPure :: forall a. Pure a -> a
241+
242+ untilE :: forall e. Eff e Prim.Boolean -> Eff e { }
243+
244+ whileE :: forall e a. Eff e Prim.Boolean -> Eff e a -> Eff e { }
245+
49246Module Control.Monad.Eff.Unsafe
50247-------------------------------
51248
@@ -61,12 +258,20 @@ Type Class Instances
61258Values
62259~~~~~~
63260
261+::
262+
263+ unsafeInterleaveEff :: forall eff1 eff2 a. Eff eff1 a -> Eff eff2 a
264+
64265Module Debug.Trace
65266------------------
66267
67268Types
68269~~~~~
69270
271+::
272+
273+ data Trace :: !
274+
70275Type Classes
71276~~~~~~~~~~~~
72277
@@ -76,12 +281,26 @@ Type Class Instances
76281Values
77282~~~~~~
78283
284+::
285+
286+ print :: forall a r. (Show a) => a -> Eff (trace :: Trace | r) { }
287+
288+ trace :: forall r. Prim.String -> Eff (trace :: Trace | r) { }
289+
79290Module Control.Monad.ST
80291-----------------------
81292
82293Types
83294~~~~~
84295
296+::
297+
298+ data ST :: * -> !
299+
300+ data STArray :: * -> * -> *
301+
302+ data STRef :: * -> * -> *
303+
85304Type Classes
86305~~~~~~~~~~~~
87306
@@ -91,3 +310,23 @@ Type Class Instances
91310Values
92311~~~~~~
93312
313+::
314+
315+ modifySTRef :: forall a h r. STRef h a -> (a -> a) -> Eff (st :: ST h | r) a
316+
317+ newSTArray :: forall a h r. Prim.Number -> a -> Eff (st :: ST h | r) (STArray h a)
318+
319+ newSTRef :: forall a h r. a -> Eff (st :: ST h | r) (STRef h a)
320+
321+ peekSTArray :: forall a h r. STArray h a -> Eff (st :: ST h | r) a
322+
323+ pokeSTArray :: forall a h r. STArray h a -> Prim.Number -> a -> Eff (st :: ST h | r) a
324+
325+ readSTRef :: forall a h r. STRef h a -> Eff (st :: ST h | r) a
326+
327+ runST :: forall a r. (forall h. Eff (st :: ST h | r) a) -> Eff r a
328+
329+ runSTArray :: forall a r. (forall h. Eff (st :: ST h | r) (STArray h a)) -> Eff r [a]
330+
331+ writeSTRef :: forall a h r. STRef h a -> a -> Eff (st :: ST h | r) a
332+