Skip to content
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

Add Monad instance for Prelude.id #3086

Closed
wants to merge 1 commit into from
Closed
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
13 changes: 13 additions & 0 deletions libs/base/Control/Monad/Identity.idr
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ import Data.Bits

%default total

public export
Functor Prelude.id where
map f x = f x

public export
Applicative Prelude.id where
pure x = x
f <*> x = f x

public export
Monad Prelude.id where
x >>= f = f x

||| The identity monad. This monad provides no abilities other than pure
||| computation.
public export
Expand Down
Loading