HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Modulebin-0.1.4.1Haskell2010

Data.BinP.PosP

  • 2 types
  • 13 values
  • Packagebin-0.1.4.1
  • Exports15
  • LanguageHaskell2010
  • LicenceGPL-2.0-or-later
  • SourcePosP.hs
newtypenewtype PosP (b :: BinP)
#

PosP is to BinP is what Fin is to Nat, when n is Z.

Constructors

Instances12EqP, GShow, OrdP, Bounded, Eq, Ord, …
  • EqP PosPDefined in bin-0.1.4.1 · Data.BinP.PosP
  • GShow PosPDefined in bin-0.1.4.1 · Data.BinP.PosP
  • OrdP PosPDefined in bin-0.1.4.1 · Data.BinP.PosP
  • SBinPI b => Bounded (PosP b)Defined in bin-0.1.4.1 · Data.BinP.PosP
  • Eq (PosP b)Defined in bin-0.1.4.1 · Data.BinP.PosP
  • Ord (PosP b)Defined in bin-0.1.4.1 · Data.BinP.PosP
  • Show (PosP b)Defined in bin-0.1.4.1 · Data.BinP.PosP
  • NFData (PosP b)Defined in bin-0.1.4.1 · Data.BinP.PosP
  • SBinPI b => Arbitrary (PosP b)Defined in bin-0.1.4.1 · Data.BinP.PosP
  • CoArbitrary (PosP b)Defined in bin-0.1.4.1 · Data.BinP.PosP
  • SBinPI b => Function (PosP b)Defined in bin-0.1.4.1 · Data.BinP.PosP
  • b ~ 'BE => Boring (PosP b)Defined in bin-0.1.4.1 · Data.BinP.PosP
datadata PosP' (n :: Nat) (b :: BinP) where
#

PosP' is a structure inside PosP.

Constructors

Instances9GShow, Bounded, Eq, Ord, Show, NFData, …

Top & Pop

2 declarations
valuetop :: SBinPI b => PosP b
#

top and pop serve as FZ and FS, with types specified so type-inference works backwards from the result.

Example1 expression
top :: PosP BinP40
Example1 expression
pop (pop top) :: PosP BinP42
Example1 expression
pop (pop top) :: PosP BinP92

Showing

4 declarations

Conversions

2 declarations

Interesting

1 declaration
valueboring :: PosP 'BE
#

Counting to one is boring

Example1 expression
boring0

Weakening (succ)

2 declarations

Universe

2 declarations
valueuniverse :: SBinPI b => [PosP b]
#
Example1 expression
universe :: [PosP BinP9][0,1,2,3,4,5,6,7,8]
valueuniverse' :: (SNatI n, SBinPI b) => [PosP' n b]
#

This gives a hint, what the n parameter means in PosP'.

Example1 expression
universe' :: [PosP' N.Nat2 BinP2][0,1,2,3,4,5,6,7]