Safe Haskell | None |
---|---|
Language | Haskell2010 |
Use this only if you need to make some type Sextable.
Documentation
Class of types which can be assigned a type-level length.
Data family which wraps values of the underlying type giving
them a type-level length. Sext 6 t
means a value of type t
of
length 6.
Basic element type. For Sextable [a]
, this is a
.
unsafeCreate :: a -> Sext i a Source
Simply wrap a value in a Sext as is, assuming any length.
For example, an expression like
unsafeCreate "somestring" :: Sext 50 String
will typecheck, although the stored length information will not match actual string size. This may result in wrong behaviour of all functions defined for Sext.
Use it only when you know what you're doing.
When implementing new Sextable instances, code this to simply
apply the constructor of Sext
.
unwrap :: Sext i a -> a Source
Forget type-level length, obtaining the underlying value.
replicate :: Int -> Elem a -> a Source