HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulelinear-base-0.4.0Haskell2010

Data.Replicator.Linear.Internal.ReplicationStream

  • 1 type
  • 6 values
  • Packagelinear-base-0.4.0
  • Exports7
  • LanguageHaskell2010
  • LicenceMIT
  • SourceReplicationStream.hs
datadata ReplicationStream a where
#

ReplicationStream s g dup2 c is the infinite linear stream repeat (g s) where dup2 is used to make as many copies of s as necessary, and c is used to consume s when consuming the stream.

Although it isn't enforced at type level, dup2 should abide by the same laws as dup2: * first c (dup2 a) ≃ a ≃ second c (dup2 a) (neutrality) * first dup2 (dup2 a) ≃ (second dup2 (dup2 a)) (associativity)

This type is solely used to implement Data.Replicator.Linear

Constructors

  • ReplicationStream :: s -> (s %1 -> a) -> (s %1 -> (s, s)) -> (s %1 -> ()) -> ReplicationStream a
Instances4Functor, Applicative, Consumable, Dupable
  • Functor ReplicationStreamDefined in linear-base-0.4.0 · Data.Replicator.Linear.Internal.Instances · orphan
  • Applicative ReplicationStreamDefined in linear-base-0.4.0 · Data.Replicator.Linear.Internal.Instances · orphan
  • Consumable (ReplicationStream a)Defined in linear-base-0.4.0 · Data.Unrestricted.Linear.Internal.Consumable
  • Dupable (ReplicationStream a)Defined in linear-base-0.4.0 · Data.Unrestricted.Linear.Internal.Dupable
valueconsume :: ReplicationStream a %1 -> ()
#
valueduplicate
  1. :: ReplicationStream a
  2. -> ReplicationStream (ReplicationStream a)
#
valuemap :: (a %1 -> b) -> ReplicationStream a %1 -> ReplicationStream b
#
valuepure :: a -> ReplicationStream a
#
value(<*>)
  1. :: ReplicationStream (a %1 -> b)
  2. -> ReplicationStream a
  3. -> ReplicationStream b
#
valueliftA2
  1. :: a %1 -> b %1 -> c
  2. -> ReplicationStream a
  3. -> ReplicationStream b
  4. -> ReplicationStream c
#