on master help sign in
Merge pull request #4111 from msmorgan/alternative-infixr

change `<|>` operator to be right-associative

commitfddb326fe112f09610f31f1b5088789f0ae7c63a authorAhmad Salim Al-Sibahi <asal@itu.dk> dateMon 23 Oct 2017, 13:05 (9 years ago) parent3aa9c182366f36
2 files changed+2−1
CHANGELOG.md+1 libs/prelude/Prelude/Applicative.idr+1−1
CHANGELOG.md+1
@@ -19,6 +19,7 @@
1919+ Added `discriminate` and `construct` tactics to Pruviloj.
2020+ Added `IsSucc` type to `Prelude`, which proves that a `Nat` is a successor.
2121+ Added `Data.IOArray`, containing primitives for mutable arrays.
22++ The operator `<|>` is now right-associative (it retains the same precedence).
2223
2324## Tool Updates
2425+ Private functions are no longer visible in the REPL except for modules
libs/prelude/Prelude/Applicative.idr+1−1
@@ -38,7 +38,7 @@ liftA2 f a b = (map f a) <*> b
3838liftA3 : Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d
3939liftA3 f a b c = (map f a) <*> b <*> c
4040
41−infixl 3 <|>
41+infixr 3 <|>
4242interface Applicative f => Alternative (f : Type -> Type) where
4343 empty : f a
4444 (<|>) : f a -> f a -> f a