------------------------------------------------------------------------
-- The Agda standard library
--
-- An effectful view of the identity function
------------------------------------------------------------------------

{-# OPTIONS --cubical-compatible --safe #-}

module Function.Identity.Effectful where

open import Effect.Functor
open import Effect.Applicative
open import Effect.Monad
open import Effect.Comonad
open import Function.Base using (id; _∘′_; _|>′_; _$′_; flip)
open import Level

private
  variable
     : Level

Identity : (A : Set )  Set 
Identity A = A

functor : RawFunctor {} Identity
functor = record
  { _<$>_ = id
  }

applicative : RawApplicative {} Identity
applicative = record
  { rawFunctor = functor
  ; pure = id
  ; _<*>_  = _$′_
  }

monad : RawMonad {} Identity
monad = record
  { rawApplicative = applicative
  ; _>>=_  = _|>′_
  }

comonad : RawComonad {} Identity
comonad = record
  { extract = id
  ; extend  = _$′_
  }