Copyright | (c) Matthew Naylor 2019 |
---|---|
License | MIT |
Maintainer | mattfn@gmail.com |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
Blarney.BitPat
Description
Inspired by Morten Rhiger's "Type-Safe Pattern Combinators".
Synopsis
- type BP n t0 t1 = Bit n -> t0 -> (Bit 1, t1)
- literal :: forall n t. KnownNat n => Bit n -> BP n t t
- variable :: forall n t. BP n (Bit n -> t) t
- (<#>) :: KnownNat n0 => BP n0 t0 t1 -> BP n1 t1 t2 -> BP (n0 + n1) t0 t2
- (==>) :: BP n t (Action ()) -> t -> Bit n -> Action ()
- match :: Bit n -> [Bit n -> Action ()] -> Action ()