git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix docgen, update Prelude docs
869c4e1Phil Freeman
docgen/Main.hs+6
@@ -93,6 +93,7 @@ isExported (Just exps) decl = any (matches decl) exps
93 matches (P.ExternDataDeclaration ident _) (P.TypeRef ident' _) = ident == ident'
93 matches (P.ExternDataDeclaration ident _) (P.TypeRef ident' _) = ident == ident'
94 matches (P.TypeSynonymDeclaration ident _ _) (P.TypeRef ident' _) = ident == ident'
94 matches (P.TypeSynonymDeclaration ident _ _) (P.TypeRef ident' _) = ident == ident'
95 matches (P.TypeClassDeclaration ident _ _) (P.TypeClassRef ident') = ident == ident'
95 matches (P.TypeClassDeclaration ident _ _) (P.TypeClassRef ident') = ident == ident'
96+ matches (P.PositionedDeclaration _ d) r = d `matches` r
96 matches _ _ = False
97 matches _ _ = False
97
98
98isDctorExported :: P.ProperName -> Maybe [P.DeclarationRef] -> P.ProperName -> Bool
99isDctorExported :: P.ProperName -> Maybe [P.DeclarationRef] -> P.ProperName -> Bool
@@ -143,25 +144,30 @@ getName (P.ExternDataDeclaration name _) = P.runProperName name
143getName (P.TypeSynonymDeclaration name _ _) = P.runProperName name
144getName (P.TypeSynonymDeclaration name _ _) = P.runProperName name
144getName (P.TypeClassDeclaration name _ _) = P.runProperName name
145getName (P.TypeClassDeclaration name _ _) = P.runProperName name
145getName (P.TypeInstanceDeclaration name _ _ _ _) = show name
146getName (P.TypeInstanceDeclaration name _ _ _ _) = show name
147+getName (P.PositionedDeclaration _ d) = getName d
146getName _ = error "Invalid argument to getName"
148getName _ = error "Invalid argument to getName"
147
149
148isValueDeclaration :: P.Declaration -> Bool
150isValueDeclaration :: P.Declaration -> Bool
149isValueDeclaration P.TypeDeclaration{} = True
151isValueDeclaration P.TypeDeclaration{} = True
150isValueDeclaration P.ExternDeclaration{} = True
152isValueDeclaration P.ExternDeclaration{} = True
153+isValueDeclaration (P.PositionedDeclaration _ d) = isValueDeclaration d
151isValueDeclaration _ = False
154isValueDeclaration _ = False
152
155
153isTypeDeclaration :: P.Declaration -> Bool
156isTypeDeclaration :: P.Declaration -> Bool
154isTypeDeclaration P.DataDeclaration{} = True
157isTypeDeclaration P.DataDeclaration{} = True
155isTypeDeclaration P.ExternDataDeclaration{} = True
158isTypeDeclaration P.ExternDataDeclaration{} = True
156isTypeDeclaration P.TypeSynonymDeclaration{} = True
159isTypeDeclaration P.TypeSynonymDeclaration{} = True
160+isTypeDeclaration (P.PositionedDeclaration _ d) = isTypeDeclaration d
157isTypeDeclaration _ = False
161isTypeDeclaration _ = False
158
162
159isTypeClassDeclaration :: P.Declaration -> Bool
163isTypeClassDeclaration :: P.Declaration -> Bool
160isTypeClassDeclaration P.TypeClassDeclaration{} = True
164isTypeClassDeclaration P.TypeClassDeclaration{} = True
165+isTypeClassDeclaration (P.PositionedDeclaration _ d) = isTypeClassDeclaration d
161isTypeClassDeclaration _ = False
166isTypeClassDeclaration _ = False
162
167
163isTypeInstanceDeclaration :: P.Declaration -> Bool
168isTypeInstanceDeclaration :: P.Declaration -> Bool
164isTypeInstanceDeclaration P.TypeInstanceDeclaration{} = True
169isTypeInstanceDeclaration P.TypeInstanceDeclaration{} = True
170+isTypeInstanceDeclaration (P.PositionedDeclaration _ d) = isTypeInstanceDeclaration d
165isTypeInstanceDeclaration _ = False
171isTypeInstanceDeclaration _ = False
166
172
167inputFile :: Term FilePath
173inputFile :: Term FilePath
docs/source/conf.py+2−2
@@ -51,9 +51,9 @@ copyright = u'2014, Phil Freeman'
51# built documents.
51# built documents.
52#
52#
53# The short X.Y version.
53# The short X.Y version.
54−version = '0.4.0'
54+version = '0.5.0'
55# The full version, including alpha/beta/rc tags.
55# The full version, including alpha/beta/rc tags.
56−release = '0.4.0'
56+release = '0.5.0'
57
57
58# The language for content autogenerated by Sphinx. Refer to documentation
58# The language for content autogenerated by Sphinx. Refer to documentation
59# for a list of supported languages.
59# for a list of supported languages.
docs/source/prelude.rst+239
@@ -7,45 +7,242 @@ Module Prelude
7Types
7Types
8~~~~~
8~~~~~
9
9
10+::
11+
12+ data Ordering where
13+ LT :: Ordering
14+ GT :: Ordering
15+ EQ :: Ordering
16+
10Type Classes
17Type Classes
11~~~~~~~~~~~~
18~~~~~~~~~~~~
12
19
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+
13Type Class Instances
73Type Class Instances
14~~~~~~~~~~~~~~~~~~~~
74~~~~~~~~~~~~~~~~~~~~
15
75
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+
16Values
108Values
17~~~~~~
109~~~~~~
18
110
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+
19Module Data.Eq
177Module Data.Eq
20--------------
178--------------
21
179
22Types
180Types
23~~~~~
181~~~~~
24
182
183+::
184+
185+ data Ref a where
186+ Ref :: a -> Ref a
187+
25Type Classes
188Type Classes
26~~~~~~~~~~~~
189~~~~~~~~~~~~
27
190
28Type Class Instances
191Type Class Instances
29~~~~~~~~~~~~~~~~~~~~
192~~~~~~~~~~~~~~~~~~~~
30
193
194+::
195+
196+ instance eqRef :: Eq (Ref a)
197+
31Values
198Values
32~~~~~~
199~~~~~~
33
200
201+::
202+
203+ liftRef :: forall a b. (a -> a -> b) -> Ref a -> Ref a -> b
204+
34Module Control.Monad.Eff
205Module Control.Monad.Eff
35------------------------
206------------------------
36
207
37Types
208Types
38~~~~~
209~~~~~
39
210
211+::
212+
213+ data Eff :: # ! -> * -> *
214+
215+ type Pure a = forall e. Eff e a
216+
40Type Classes
217Type Classes
41~~~~~~~~~~~~
218~~~~~~~~~~~~
42
219
43Type Class Instances
220Type Class Instances
44~~~~~~~~~~~~~~~~~~~~
221~~~~~~~~~~~~~~~~~~~~
45
222
223+::
224+
225+ instance monadEff :: Monad (Eff e)
226+
46Values
227Values
47~~~~~~
228~~~~~~
48
229
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+
49Module Control.Monad.Eff.Unsafe
246Module Control.Monad.Eff.Unsafe
50-------------------------------
247-------------------------------
51
248
@@ -61,12 +258,20 @@ Type Class Instances
61Values
258Values
62~~~~~~
259~~~~~~
63
260
261+::
262+
263+ unsafeInterleaveEff :: forall eff1 eff2 a. Eff eff1 a -> Eff eff2 a
264+
64Module Debug.Trace
265Module Debug.Trace
65------------------
266------------------
66
267
67Types
268Types
68~~~~~
269~~~~~
69
270
271+::
272+
273+ data Trace :: !
274+
70Type Classes
275Type Classes
71~~~~~~~~~~~~
276~~~~~~~~~~~~
72
277
@@ -76,12 +281,26 @@ Type Class Instances
76Values
281Values
77~~~~~~
282~~~~~~
78
283
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+
79Module Control.Monad.ST
290Module Control.Monad.ST
80-----------------------
291-----------------------
81
292
82Types
293Types
83~~~~~
294~~~~~
84
295
296+::
297+
298+ data ST :: * -> !
299+
300+ data STArray :: * -> * -> *
301+
302+ data STRef :: * -> * -> *
303+
85Type Classes
304Type Classes
86~~~~~~~~~~~~
305~~~~~~~~~~~~
87
306
@@ -91,3 +310,23 @@ Type Class Instances
91Values
310Values
92~~~~~~
311~~~~~~
93
312
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+