Skip to content

Commit 038dd43

Browse files
Add FLIP infix operator: # (#73)
* Add type-level op for FLIP * Add changelog entry
1 parent 89c4d30 commit 038dd43

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Breaking changes:
99
- Replaced polymorphic proxies with monomorphic `Proxy` (#72 by @JordanMartinez)
1010

1111
New features:
12+
- Added `#` infix operator for `FLIP` (e.g. `Int # Maybe` == `Maybe Int`) (#73 by @JordanMartinez)
1213

1314
Bugfixes:
1415

src/Type/Function.purs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,9 @@ infixr 0 type APPLY as $
1515
-- |
1616
-- | For example...
1717
-- | ```
18-
-- | FLIP Int Maybe == Maybe Int
18+
-- | FLIP Int Maybe == Int # Maybe == Maybe Int
1919
-- | ```
20-
-- | Note: an infix for FLIP (e.g. `Int # Maybe`) is not allowed.
21-
-- | Before the `0.14.0` release, we used `# Type` to refer to a row of types.
22-
-- | In the `0.14.0` release, the `# Type` syntax was deprecated,
23-
-- | and `Row Type` is the correct way to do this now. To help mitigate
24-
-- | breakage, `# Type` was made an alias to `Row Type`. When the `# Type`
25-
-- | syntax is fully dropped in a later language release, we can then
26-
-- | support the infix version: `Int # Maybe`.
2720
type FLIP :: forall a b. a -> (a -> b) -> b
2821
type FLIP a f = f a
22+
23+
infixl 1 type FLIP as #

0 commit comments

Comments
 (0)