Created
October 15, 2016 20:26
-
-
Save TethysSvensson/d334edfac2420a4e6a4fd0360f340382 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Test where | |
open import Function using (id ; _∘_) | |
open import Relation.Binary.PropositionalEquality using (_≡_ ; refl) | |
record RawFunctor (F : Set → Set) : Set₁ where | |
field | |
fmap : ∀ {A B} → (A → B) → F A → F B | |
open RawFunctor {{...}} public | |
record Functor (F : Set → Set) : Set₁ where | |
field | |
raw : RawFunctor F | |
fmap-id : | |
∀ {A} → (x : F A) → fmap id x ≡ x | |
fmap-combine : | |
∀ {A B C} (f : A → B) (g : B → C) (x : F A) → | |
fmap g (fmap f x) ≡ fmap (g ∘ f) x | |
open Functor {{...}} hiding (raw) public |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment