| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.Util.SOP
Synopsis
- sequence_NS' :: forall xs f g. Functor f => NS (f :.: g) xs -> f (NS g xs)
- map_NP' :: forall f g xs. (forall a. f a -> g a) -> NP f xs -> NP g xs
- partition_NS :: forall xs f. SListI xs => [NS f xs] -> NP ([] :.: f) xs
- npWithIndices :: SListI xs => NP (K Word8) xs
- nsToIndex :: SListI xs => NS f xs -> Word8
- nsFromIndex :: SListI xs => Word8 -> Maybe (NS (K ()) xs)
- data Lens f xs a = Lens {}
- lenses_NP :: forall f xs. SListI xs => NP (Lens f xs) xs
- npToSListI :: NP a xs -> (SListI xs => r) -> r
- allComposeShowK :: (SListI xs, Show a) => Proxy xs -> Proxy a -> Dict (All (Compose Show (K a))) xs
- fn_5 :: (f0 a -> f1 a -> f2 a -> f3 a -> f4 a -> f5 a) -> (f0 -.-> (f1 -.-> (f2 -.-> (f3 -.-> (f4 -.-> f5))))) a
- class IsNonEmpty xs where
- isNonEmpty :: proxy xs -> ProofNonEmpty xs
- data ProofNonEmpty :: [Type] -> Type where
- ProofNonEmpty :: Proxy x -> Proxy xs -> ProofNonEmpty (x ': xs)
- checkIsNonEmpty :: forall xs. SListI xs => Proxy xs -> Maybe (ProofNonEmpty xs)
Minor variations on standard SOP operators
sequence_NS' :: forall xs f g. Functor f => NS (f :.: g) xs -> f (NS g xs) Source #
Version of sequence_NS that requires only Functor
The version in the library requires Applicative, which is unnecessary.
map_NP' :: forall f g xs. (forall a. f a -> g a) -> NP f xs -> NP g xs Source #
Version of map_NP that does not require a singleton
nsFromIndex :: SListI xs => Word8 -> Maybe (NS (K ()) xs) Source #
We only allow up to 23, see npWithIndices.
Simple lens to access an element of an n-ary product.
lenses_NP :: forall f xs. SListI xs => NP (Lens f xs) xs Source #
Generate all lenses to access the element of an n-ary product.
allComposeShowK :: (SListI xs, Show a) => Proxy xs -> Proxy a -> Dict (All (Compose Show (K a))) xs Source #
fn_5 :: (f0 a -> f1 a -> f2 a -> f3 a -> f4 a -> f5 a) -> (f0 -.-> (f1 -.-> (f2 -.-> (f3 -.-> (f4 -.-> f5))))) a Source #
Type-level non-empty lists
class IsNonEmpty xs where Source #
Methods
isNonEmpty :: proxy xs -> ProofNonEmpty xs Source #
Instances
| IsNonEmpty (x ': xs) Source # | |
Defined in Ouroboros.Consensus.Util.SOP Methods isNonEmpty :: proxy (x ': xs) -> ProofNonEmpty (x ': xs) Source # | |
data ProofNonEmpty :: [Type] -> Type where Source #
Constructors
| ProofNonEmpty :: Proxy x -> Proxy xs -> ProofNonEmpty (x ': xs) |
checkIsNonEmpty :: forall xs. SListI xs => Proxy xs -> Maybe (ProofNonEmpty xs) Source #