Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ea2f97c

Browse files
committedMar 11, 2022
Get rid of return
1 parent 8272e74 commit ea2f97c

File tree

5 files changed

+3
-16
lines changed

5 files changed

+3
-16
lines changed
 

‎src/Course/Alternative.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Course.Functor
1111
import Course.List
1212
import Course.Optional
1313
import Course.Parser
14-
import qualified Prelude as P(fmap, return, (>>=))
14+
import qualified Prelude as P(fmap, (>>=))
1515

1616
-- | All instances of the `Alternative` type-class must satisfy three laws.
1717
-- These laws are not checked by the compiler. These laws are given as:

‎src/Course/Applicative.hs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Course.ExactlyOne
1010
import Course.Functor
1111
import Course.List
1212
import Course.Optional
13-
import qualified Prelude as P(fmap, return, (>>=))
13+
import qualified Prelude as P(fmap, pure, (>>=))
1414

1515
-- | All instances of the `Applicative` type-class must satisfy four laws.
1616
-- These laws are not checked by the compiler. These laws are given as:
@@ -390,17 +390,10 @@ filtering =
390390

391391
instance Applicative IO where
392392
pure =
393-
P.return
393+
P.pure
394394
f <*> a =
395395
f P.>>= \f' -> P.fmap f' a
396396

397-
return ::
398-
Applicative k =>
399-
a
400-
-> k a
401-
return =
402-
pure
403-
404397
fail ::
405398
Applicative k =>
406399
Chars

‎src/Course/ExactlyOne.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,4 @@ instance A.Applicative ExactlyOne where
3232
instance P.Monad ExactlyOne where
3333
(>>=) =
3434
flip bindExactlyOne
35-
return =
36-
ExactlyOne
3735

‎src/Course/List.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -701,5 +701,3 @@ instance A.Applicative List where
701701
instance P.Monad List where
702702
(>>=) =
703703
flip flatMap
704-
return =
705-
(:. Nil)

‎src/Course/Optional.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,5 +120,3 @@ instance A.Applicative Optional where
120120
instance P.Monad Optional where
121121
(>>=) =
122122
flip bindOptional
123-
return =
124-
Full

0 commit comments

Comments
 (0)
Please sign in to comment.