lean4-htt/library/init/category/functor.lean
2017-02-08 17:23:04 -08:00

16 lines
472 B
Text

/-
Copyright (c) Luke Nelson and Jared Roesch. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Luke Nelson and Jared Roesch
-/
prelude
import init.core
universes u v
class functor (f : Type u → Type v) : Type (max u+1 v) :=
(map : Π {a b : Type u}, (a → b) → f a → f b)
@[inline] def fmap {f : Type u → Type v} [functor f] {a b : Type u} : (a → b) → f a → f b :=
functor.map
infixr ` <$> `:100 := fmap