@hackage / composite-xstep

ReaderT transformer pattern for higher kinded composite data.

Latest0.1.0.0

About

Metadata

  • Last updated , by locallycompact
  • License MIT
  • Categories Data Structures
  • Maintained by: dan.firth@homotopic.tech

  • Lottery factor: 0

Links

Installation

Readme

composite-xstep

This package provides a specific XRec pattern for composite records, where the interpretation functor is isomorphic to ReaderT r m.

For example

import Path
import Composite.Record
import Composite.TH

withLensesAndProxies [d|
  type FPath          = "path"            :-> Path Rel File
  type FPath2         = "path2"           :-> Path Rel File
  |]

type A = '[FPath, FPath2]

foo :: MonadThrow m => XStep m FilePath A
foo =  parseRelDir
   ::& stripProperPrefix $(mkRelFile "foo") =<< parseRelDir
   ::& XRNil