git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Preserve newlines in embedded comments
commit6be7df9953f12caee71571801dbd770c3c35236c authorPhil Freeman <paf31@cantab.net> dateTue 10 Feb 2015, 14:19 (12 years ago) parent2b4b1b0
2 files changed+7−2
prelude/README.md+5 psc-docs/Main.hs+2−2
prelude/README.md+5
@@ -278,8 +278,11 @@
278278
279279This function returns its first argument, and can be used to assert type equalities.
280280This can be useful when types are otherwise ambiguous.
281+
281282E.g.
283+
282284 main = print $ [] `asTypeOf` [0]
285+
283286If instead, we had written `main = print []`, the type of the argument `[]` would have
284287been ambiguous, resulting in a compile-time error.
285288
@@ -312,7 +315,9 @@ Flips the order of the arguments to a function of two arguments.
312315#### `otherwise`
313316
314317An alias for `true`, which can be useful in guard clauses:
318+
315319E.g.
320+
316321 max x y | x >= y = x
317322 | otherwise = y
318323
psc-docs/Main.hs+2−2
@@ -183,8 +183,8 @@ renderComments cs = do
183183 let raw = concatMap toLines cs
184184
185185 if all hasPipe raw
186− then mapM_ (atIndent 0) (map stripPipes raw)
187− else mapM_ (atIndent 4) raw
186+ then atIndent 0 . unlines . map stripPipes $ raw
187+ else atIndent 4 $ unlines raw
188188
189189 unless (null raw) spacer
190190 where