Module

Data.Inject

Package
purescript-injectDEPRECATED
Repository
purescript/purescript-inject

This module defines a type class Inject which is useful when working with coproducts of functors.

#Inject Source

class Inject f g  where

The Inject class asserts a coproduct relationship between two functors.

Specifically, an instance Inject f g indicates that g is isomorphic to a coproduct of f and some third functor.

Laws:

  • prj g = Just f if and only if inj f = g

Members

  • inj :: forall a. f a -> g a
  • prj :: forall a. g a -> Maybe (f a)

Instances

Modules
Data.Inject