HORIZON HASKELLDocslts/ghc-9.14.x7a6c33e2026-10-12Search packagesCtrl K
Theme: |

GHC 9.14.1 · lts/ghc-9.14.x · 7a6c33e · 2026-10-12

Moduleselective-0.7.0.1Haskell2010

Control.Selective.Rigid.Freer

This is a library for selective applicative functors, or just selective functors for short, an abstraction between applicative functors and monads, introduced in this paper: https://dl.acm.org/doi/10.1145/3341694.

This module defines freer rigid selective functors. Rigid selective functors are those that satisfy the property <*> = apS. Compared to the "free" construction from Control.Selective.Rigid.Free, this "freer" construction does not require the underlying base data type to be a functor.

Contents
  1. Free rigid selective functors
  2. Static analysis
Synopsis

Free rigid selective functors

Static analysis

valuegetEffects :: Functor f => Select f a -> [f ()]

Collect all possible effects in the order they appear in a free selective computation.

valuegetNecessaryEffect :: Functor f => Select f a -> Maybe (f ())

Extract the necessary effect from a free selective computation. Note: there can be at most one effect that is statically guaranteed to be necessary.

valuerunSelect :: Selective g => (forall x. f x -> g x) -> Select f a -> g a

Given a natural transformation from f to g, this gives a canonical natural transformation from Select f to g.