Skip to content

Commit 7f4e169

Browse files
Distinguish Void from lowercase void in C-deriving languages
1 parent da12208 commit 7f4e169

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Data/Void.purs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ import Data.Show (class Show)
88
-- | `Void` is useful to eliminate the possibility of a value being created.
99
-- | For example, a value of type `Either Void Boolean` can never have
1010
-- | a Left value created in PureScript.
11+
-- |
12+
-- | This should not be confused with the word, `void,` that commonly appears in
13+
-- | C-deriving languages, such as Java:
14+
-- | ```
15+
-- | public class Foo {
16+
-- | void doSomething() { System.out.println("hello world!"); }
17+
-- | }
18+
-- | ```
19+
-- |
20+
-- | In PureScript, one often uses `Unit` to achieve similar effects as
21+
-- | the lowercased `void` above.
1122
newtype Void = Void Void
1223

1324
instance showVoid :: Show Void where

0 commit comments

Comments
 (0)