File tree 3 files changed +18
-6
lines changed
3 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -774,8 +774,7 @@ Non-backwards compatible changes
774
774
This is needed for level-increasing functors like `IO : Set l → Set (suc l)`.
775
775
776
776
* `RawApplicative` is now `RawFunctor + pure + _<*>_` and `RawMonad` is now
777
- `RawApplicative` + `_>>=_` and so `return` is not used anywhere anymore.
778
- This fixes the conflict with `case_return_of` (#356)
777
+ `RawApplicative` + `_>>=_`.
779
778
This reorganisation means in particular that the functor/applicative of a monad
780
779
are not computed using `_>>=_`. This may break proofs.
781
780
Original file line number Diff line number Diff line change @@ -53,6 +53,10 @@ record RawApplicative (F : Set f → Set g) : Set (suc f ⊔ g) where
53
53
zip : F A → F B → F (A × B)
54
54
zip = zipWith _,_
55
55
56
+ -- Haskell-style alternative name for pure
57
+ return : A → F A
58
+ return = pure
59
+
56
60
-- backwards compatibility: unicode variants
57
61
_⊛_ : F (A → B) → F A → F B
58
62
_⊛_ = _<*>_
Original file line number Diff line number Diff line change 10
10
11
11
module IO.Primitive where
12
12
13
- open import Agda.Builtin.IO
13
+ open import Level using (Level)
14
+ private
15
+ variable
16
+ a : Level
17
+ A B : Set a
14
18
15
19
------------------------------------------------------------------------
16
20
-- The IO monad
17
21
18
- open import Agda.Builtin.IO public using (IO)
22
+ open import Agda.Builtin.IO public
23
+ using (IO)
19
24
20
25
infixl 1 _>>=_
21
26
22
27
postulate
23
- pure : ∀ {a} {A : Set a} → A → IO A
24
- _>>=_ : ∀ {a b} {A : Set a} {B : Set b} → IO A → (A → IO B) → IO B
28
+ pure : A → IO A
29
+ _>>=_ : IO A → (A → IO B) → IO B
25
30
26
31
{-# COMPILE GHC pure = \_ _ -> return #-}
27
32
{-# COMPILE GHC _>>=_ = \_ _ _ _ -> (>>=) #-}
28
33
{-# COMPILE UHC pure = \_ _ x -> UHC.Agda.Builtins.primReturn x #-}
29
34
{-# COMPILE UHC _>>=_ = \_ _ _ _ x y -> UHC.Agda.Builtins.primBind x y #-}
35
+
36
+ -- Haskell-style alternative syntax
37
+ return : A → IO A
38
+ return = pure
You can’t perform that action at this time.
0 commit comments