Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ouroboros.Consensus.HardFork.Combinator.Embed.Unary
Description
Witness isomorphism between b
and HardForkBlock '[b]
Synopsis
- class Isomorphic (f ∷ Type → Type) where
- project ∷ NoHardForks blk ⇒ f (HardForkBlock '[blk]) → f blk
- inject ∷ NoHardForks blk ⇒ f blk → f (HardForkBlock '[blk])
- inject' ∷ ∀ proxy f x y blk. (Isomorphic f, NoHardForks blk, Coercible x (f blk), Coercible y (f (HardForkBlock '[blk]))) ⇒ proxy (f blk) → x → y
- project' ∷ ∀ proxy f x y blk. (Isomorphic f, NoHardForks blk, Coercible x (f (HardForkBlock '[blk])), Coercible y (f blk)) ⇒ proxy (f blk) → x → y
- data ProjHardForkQuery (fp ∷ QueryFootprint) b res where
- ProjHardForkQuery ∷ ∀ b (fp ∷ QueryFootprint) result'. BlockQuery b fp result' → ProjHardForkQuery fp b (Either (MismatchEraInfo '[b]) result')
- injNestedCtxt ∷ ∀ (f ∷ Type → Type) blk a. NestedCtxt f blk a → NestedCtxt f (HardForkBlock '[blk]) a
- injQuery ∷ ∀ (fp ∷ QueryFootprint) b result. BlockQuery b fp result → BlockQuery (HardForkBlock '[b]) fp (HardForkQueryResult '[b] result)
- injQueryResult ∷ result → HardForkQueryResult '[b] result
- projNestedCtxt ∷ ∀ (f ∷ Type → Type) blk a. NestedCtxt f (HardForkBlock '[blk]) a → NestedCtxt f blk a
- projQuery ∷ ∀ b (fp ∷ QueryFootprint) result a. BlockQuery (HardForkBlock '[b]) fp result → (∀ result'. (result :~: HardForkQueryResult '[b] result') → BlockQuery b fp result' → a) → a
- projQuery' ∷ ∀ b (fp ∷ QueryFootprint) result. BlockQuery (HardForkBlock '[b]) fp result → ProjHardForkQuery fp b result
- projQueryResult ∷ HardForkQueryResult '[b] result → result
- newtype I a = I a
- data Proxy (t ∷ k) = Proxy
Documentation
class Isomorphic (f ∷ Type → Type) where Source #
Methods
project ∷ NoHardForks blk ⇒ f (HardForkBlock '[blk]) → f blk Source #
inject ∷ NoHardForks blk ⇒ f blk → f (HardForkBlock '[blk]) Source #
Instances
inject' ∷ ∀ proxy f x y blk. (Isomorphic f, NoHardForks blk, Coercible x (f blk), Coercible y (f (HardForkBlock '[blk]))) ⇒ proxy (f blk) → x → y Source #
project' ∷ ∀ proxy f x y blk. (Isomorphic f, NoHardForks blk, Coercible x (f (HardForkBlock '[blk])), Coercible y (f blk)) ⇒ proxy (f blk) → x → y Source #
Dependent types
data ProjHardForkQuery (fp ∷ QueryFootprint) b res where Source #
Constructors
ProjHardForkQuery ∷ ∀ b (fp ∷ QueryFootprint) result'. BlockQuery b fp result' → ProjHardForkQuery fp b (Either (MismatchEraInfo '[b]) result') |
injNestedCtxt ∷ ∀ (f ∷ Type → Type) blk a. NestedCtxt f blk a → NestedCtxt f (HardForkBlock '[blk]) a Source #
injQuery ∷ ∀ (fp ∷ QueryFootprint) b result. BlockQuery b fp result → BlockQuery (HardForkBlock '[b]) fp (HardForkQueryResult '[b] result) Source #
Inject BlockQuery
Not an instance of Isomorphic
because the types change.
injQueryResult ∷ result → HardForkQueryResult '[b] result Source #
projNestedCtxt ∷ ∀ (f ∷ Type → Type) blk a. NestedCtxt f (HardForkBlock '[blk]) a → NestedCtxt f blk a Source #
projQuery ∷ ∀ b (fp ∷ QueryFootprint) result a. BlockQuery (HardForkBlock '[b]) fp result → (∀ result'. (result :~: HardForkQueryResult '[b] result') → BlockQuery b fp result' → a) → a Source #
Project BlockQuery
Not an instance of Isomorphic
because the types change.
projQuery' ∷ ∀ b (fp ∷ QueryFootprint) result. BlockQuery (HardForkBlock '[b]) fp result → ProjHardForkQuery fp b result Source #
projQueryResult ∷ HardForkQueryResult '[b] result → result Source #
Convenience exports
The identity type functor.
Like Identity
, but with a shorter name.
Constructors
I a |
Instances
Proxy
is a type that holds no data, but has a phantom parameter of
arbitrary type (or even kind). Its use is to provide type information, even
though there is no value available of that type (or it may be too costly to
create one).
Historically,
is a safer alternative to the
Proxy
:: Proxy
a
idiom.undefined
:: a
>>>
Proxy :: Proxy (Void, Int -> Int)
Proxy
Proxy can even hold types of higher kinds,
>>>
Proxy :: Proxy Either
Proxy
>>>
Proxy :: Proxy Functor
Proxy
>>>
Proxy :: Proxy complicatedStructure
Proxy
Constructors
Proxy |
Instances
ApplicativeB (Proxy ∷ (k → Type) → Type) | |
ConstraintsB (Proxy ∷ (k → Type) → Type) | |
DistributiveB (Proxy ∷ (k → Type) → Type) | |
Defined in Barbies.Internal.DistributiveB | |
FunctorB (Proxy ∷ (k → Type) → Type) | |
TraversableB (Proxy ∷ (k → Type) → Type) | |
Defined in Barbies.Internal.TraversableB | |
Generic1 (Proxy ∷ k → Type) | |
Defined in GHC.Internal.Generics | |
RepeatWithIndex Void (Proxy ∷ Type → Type) | |
SemialignWithIndex Void (Proxy ∷ Type → Type) | |
Defined in Data.Semialign.Internal | |
ZipWithIndex Void (Proxy ∷ Type → Type) | |
Representable (Proxy ∷ Type → Type) | |
FromJSON1 (Proxy ∷ Type → Type) | |
Defined in Data.Aeson.Types.FromJSON | |
ToJSON1 (Proxy ∷ Type → Type) | |
Defined in Data.Aeson.Types.ToJSON Methods liftToJSON ∷ (a → Bool) → (a → Value) → ([a] → Value) → Proxy a → Value Source # liftToJSONList ∷ (a → Bool) → (a → Value) → ([a] → Value) → [Proxy a] → Value Source # liftToEncoding ∷ (a → Bool) → (a → Encoding) → ([a] → Encoding) → Proxy a → Encoding Source # liftToEncodingList ∷ (a → Bool) → (a → Encoding) → ([a] → Encoding) → [Proxy a] → Encoding Source # | |
MonadZip (Proxy ∷ Type → Type) | Since: base-4.9.0.0 |
Eq1 (Proxy ∷ Type → Type) | Since: base-4.9.0.0 |
Ord1 (Proxy ∷ Type → Type) | Since: base-4.9.0.0 |
Defined in Data.Functor.Classes | |
Read1 (Proxy ∷ Type → Type) | Since: base-4.9.0.0 |
Defined in Data.Functor.Classes | |
Show1 (Proxy ∷ Type → Type) | Since: base-4.9.0.0 |
Contravariant (Proxy ∷ Type → Type) | |
NFData1 (Proxy ∷ Type → Type) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
Alternative (Proxy ∷ Type → Type) | @since base-4.9.0.0 |
Applicative (Proxy ∷ Type → Type) | @since base-4.7.0.0 |
Functor (Proxy ∷ Type → Type) | @since base-4.7.0.0 |
Monad (Proxy ∷ Type → Type) | @since base-4.7.0.0 |
MonadPlus (Proxy ∷ Type → Type) | @since base-4.9.0.0 |
Foldable (Proxy ∷ Type → Type) | @since base-4.7.0.0 |
Defined in GHC.Internal.Data.Foldable Methods fold ∷ Monoid m ⇒ Proxy m → m # foldMap ∷ Monoid m ⇒ (a → m) → Proxy a → m # foldMap' ∷ Monoid m ⇒ (a → m) → Proxy a → m # foldr ∷ (a → b → b) → b → Proxy a → b # foldr' ∷ (a → b → b) → b → Proxy a → b # foldl ∷ (b → a → b) → b → Proxy a → b # foldl' ∷ (b → a → b) → b → Proxy a → b # foldr1 ∷ (a → a → a) → Proxy a → a # foldl1 ∷ (a → a → a) → Proxy a → a # elem ∷ Eq a ⇒ a → Proxy a → Bool # maximum ∷ Ord a ⇒ Proxy a → a # | |
Traversable (Proxy ∷ Type → Type) | @since base-4.7.0.0 |
Hashable1 (Proxy ∷ Type → Type) | |
Defined in Data.Hashable.Class | |
Align (Proxy ∷ Type → Type) | |
Defined in Data.Semialign.Internal | |
Repeat (Proxy ∷ Type → Type) | |
Defined in Data.Semialign.Internal | |
Semialign (Proxy ∷ Type → Type) | |
Unalign (Proxy ∷ Type → Type) | |
Unzip (Proxy ∷ Type → Type) | |
Zip (Proxy ∷ Type → Type) | |
FromJSON (Proxy a) | |
ToJSON (Proxy a) | |
NFData (Proxy a) | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
Monoid (Proxy s) | @since base-4.7.0.0 |
Semigroup (Proxy s) | @since base-4.9.0.0 |
Bounded (Proxy t) | @since base-4.7.0.0 |
Enum (Proxy s) | @since base-4.7.0.0 |
Defined in GHC.Internal.Data.Proxy | |
Generic (Proxy t) | |
Defined in GHC.Internal.Generics | |
Ix (Proxy s) | @since base-4.7.0.0 |
Defined in GHC.Internal.Data.Proxy | |
Read (Proxy t) | @since base-4.7.0.0 |
Show (Proxy s) | @since base-4.7.0.0 |
Eq (Proxy s) | @since base-4.7.0.0 |
Ord (Proxy s) | @since base-4.7.0.0 |
Hashable (Proxy a) | |
MonoFoldable (Proxy a) | Since: mono-traversable-1.0.11.0 |
Defined in Data.MonoTraversable Methods ofoldMap ∷ Monoid m ⇒ (Element (Proxy a) → m) → Proxy a → m Source # ofoldr ∷ (Element (Proxy a) → b → b) → b → Proxy a → b Source # ofoldl' ∷ (a0 → Element (Proxy a) → a0) → a0 → Proxy a → a0 Source # otoList ∷ Proxy a → [Element (Proxy a)] Source # oall ∷ (Element (Proxy a) → Bool) → Proxy a → Bool Source # oany ∷ (Element (Proxy a) → Bool) → Proxy a → Bool Source # onull ∷ Proxy a → Bool Source # olength ∷ Proxy a → Int Source # olength64 ∷ Proxy a → Int64 Source # ocompareLength ∷ Integral i ⇒ Proxy a → i → Ordering Source # otraverse_ ∷ Applicative f ⇒ (Element (Proxy a) → f b) → Proxy a → f () Source # ofor_ ∷ Applicative f ⇒ Proxy a → (Element (Proxy a) → f b) → f () Source # omapM_ ∷ Applicative m ⇒ (Element (Proxy a) → m ()) → Proxy a → m () Source # oforM_ ∷ Applicative m ⇒ Proxy a → (Element (Proxy a) → m ()) → m () Source # ofoldlM ∷ Monad m ⇒ (a0 → Element (Proxy a) → m a0) → a0 → Proxy a → m a0 Source # ofoldMap1Ex ∷ Semigroup m ⇒ (Element (Proxy a) → m) → Proxy a → m Source # ofoldr1Ex ∷ (Element (Proxy a) → Element (Proxy a) → Element (Proxy a)) → Proxy a → Element (Proxy a) Source # ofoldl1Ex' ∷ (Element (Proxy a) → Element (Proxy a) → Element (Proxy a)) → Proxy a → Element (Proxy a) Source # headEx ∷ Proxy a → Element (Proxy a) Source # lastEx ∷ Proxy a → Element (Proxy a) Source # unsafeHead ∷ Proxy a → Element (Proxy a) Source # unsafeLast ∷ Proxy a → Element (Proxy a) Source # maximumByEx ∷ (Element (Proxy a) → Element (Proxy a) → Ordering) → Proxy a → Element (Proxy a) Source # minimumByEx ∷ (Element (Proxy a) → Element (Proxy a) → Ordering) → Proxy a → Element (Proxy a) Source # | |
MonoFunctor (Proxy a) | Since: mono-traversable-1.0.11.0 |
MonoPointed (Proxy a) | Since: mono-traversable-1.0.11.0 |
MonoTraversable (Proxy a) | Since: mono-traversable-1.0.11.0 |
MonoidNull (Proxy a) | Since: monoid-subclasses-1.2.5.0 |
PositiveMonoid (Proxy a) | Since: monoid-subclasses-1.2.5.0 |
Defined in Data.Monoid.Null | |
Serialise (Proxy a) | Since: serialise-0.2.0.0 |
type AllB (c ∷ k → Constraint) (Proxy ∷ (k → Type) → Type) | |
Defined in Barbies.Internal.ConstraintsB | |
type Rep1 (Proxy ∷ k → Type) | @since base-4.6.0.0 |
type Rep (Proxy ∷ Type → Type) | |
type Rep (Proxy t) | @since base-4.6.0.0 |
type Element (Proxy a) | |
Defined in Data.MonoTraversable |