7SFN5S4CUZZL523G6RHETVEJCJUIMXH2YPDTRKQWCGZTDYNWW4LQC module Algebra.Functorimport Builtin%default totalpublic exportinterface Functor t wheremap : (a -> b) -> t a -> t bproofIdentity : (x : t a) -> map Builtin.identity x = xproofComposition : (f : a -> b) -> (g : b -> c) -> (x : t a) -> map (g . f) x = map g . map f $ x
public exportFunctor Optional wheremap f Nothing = Nothingmap f (Some a) = Some . f $ aproofIdentity Nothing = ReflproofIdentity (Some a) = ReflproofComposition f g Nothing = ReflproofComposition f g (Some a) = Refl