mu-schema-0.1.0.0: Format-independent schemas for serialization

Safe HaskellSafe
LanguageHaskell2010

Data.Functor.MaybeLike

Description

Type constructors which can be turned into Maybe.

Synopsis

Documentation

class MaybeLike f where Source #

This class may be defined in two ways:

  • Type constructors which can be turned into Maybe generically.
  • Type constructors which admit a natural transformation to Maybe.

We expect the following rules to hold for those instances of MaybeLike which are also Alternative:

  • likeMaybe empty = empty = Nothing
  • likeMaybe (x | y) = likeMaybe x | likeMaybe y

Methods

likeMaybe :: f a -> Maybe a Source #

Instances
MaybeLike Maybe Source # 
Instance details

Defined in Data.Functor.MaybeLike

Methods

likeMaybe :: Maybe a -> Maybe a Source #

MaybeLike Identity Source # 
Instance details

Defined in Data.Functor.MaybeLike

Methods

likeMaybe :: Identity a -> Maybe a Source #

MaybeLike (Either a) Source # 
Instance details

Defined in Data.Functor.MaybeLike

Methods

likeMaybe :: Either a a0 -> Maybe a0 Source #