Skip to content

Tackles #2124 as regards renaming case_return_of_ #2157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1776,6 +1776,11 @@ Deprecated names
map-++-commute ↦ map-++
```

* In `Function.Base`:
```
case_return_of_ ↦ case_returning_of_
```

* In `Function.Construct.Composition`:
```
_∘-⟶_ ↦ _⟶-∘_
Expand Down
4 changes: 2 additions & 2 deletions README/Case.agda
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module README.Case where
open import Data.Fin hiding (pred)
open import Data.Maybe hiding (from-just)
open import Data.Nat hiding (pred)
open import Function.Base using (case_of_; case_return_of_)
open import Function.Base using (case_of_; case_returning_of_)
open import Relation.Nullary

------------------------------------------------------------------------
Expand All @@ -35,7 +35,7 @@ pred n = case n of λ
-- where-introduced and indentation-identified block of list of clauses

from-just : ∀ {a} {A : Set a} (x : Maybe A) → From-just x
from-just x = case x return From-just of λ where
from-just x = case x returning From-just of λ where
(just x) → x
nothing → _

Expand Down
24 changes: 19 additions & 5 deletions src/Function/Base.agda
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ f $- = f _
-- Case expressions (to be used with pattern-matching lambdas, see
-- README.Case).

case_return_of_ : ∀ {A : Set a} (x : A) (B : A → Set b) →
case_returning_of_ : ∀ {A : Set a} (x : A) (B : A → Set b) →
((x : A) → B x) → B x
case x return B of f = f x
{-# INLINE case_return_of_ #-}
case x returning B of f = f x
{-# INLINE case_returning_of_ #-}

------------------------------------------------------------------------
-- Non-dependent versions of dependent operations
Expand Down Expand Up @@ -156,7 +156,7 @@ _|>′_ = _|>_
-- README.Case).

case_of_ : A → (A → B) → B
case x of f = case x return _ of f
case x of f = case x returning _ of f
{-# INLINE case_of_ #-}

------------------------------------------------------------------------
Expand Down Expand Up @@ -247,10 +247,24 @@ _*_ on f = f -⟨ _*_ ⟩- f


------------------------------------------------------------------------
-- Deprecated
-- DEPRECATED NAMES
------------------------------------------------------------------------
-- Please use the new names as continuing support for the old names is
-- not guaranteed.

-- Version 1.4

_-[_]-_ = _-⟪_⟫-_
{-# WARNING_ON_USAGE _-[_]-_
"Warning: Function._-[_]-_ was deprecated in v1.4.
Please use _-⟪_⟫-_ instead."
#-}

-- Version 2.0

case_return_of_ = case_returning_of_
{-# WARNING_ON_USAGE case_return_of_
"case_return_of_ was deprecated in v2.0.
Please use case_returning_of_ instead."
#-}