HORIZON HASKELLDocslts/ghc-10.0.x77a86622026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 77a8662 · 2026-10-31

Moduleselective-0.7.0.1Haskell2010

Control.Selective.Free

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 free selective functors using the ideas from the Sjoerd Visscher's package 'free-functors': https://hackage.haskell.org/package/free-functors-1.0.1/docs/Data-Functor-HFree.html.

Contents
  1. Free selective functors
  2. Static analysis
Synopsis

Free 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.

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. Note that here we rely on the fact that g is a lawful selective functor.