Skip to content

Instantly share code, notes, and snippets.

View ghuysmans's full-sized avatar

ghuysmans

  • Belgium
  • 01:00 (UTC +02:00)
View GitHub Profile
@ghuysmans
ghuysmans / applicative.ml
Created June 4, 2020 23:46
Equivalent definitions of applicative functor
module type PA = sig
type 'a t
val pure : 'a -> 'a t
val apply : ('a -> 'b) t -> 'a t -> 'b t (* <*> *)
end
module type NMP = sig
type 'a t
val nil : unit t
val map : ('a -> 'b) -> 'a t -> 'b t (* <$> *)