Safe Haskell | None |
---|---|
Language | Haskell2010 |
Use this module when you need to add an IsStaticText
instance to a
type.
- class IsStaticText a where
Documentation
class IsStaticText a where Source #
Class of types which can be assigned a type-level length.
data Static a (i :: Nat) Source #
Data family which wraps values of the underlying type giving
them a type-level length. Static t 6
means a value of type t
of
length 6.
Basic element type. For IsStaticText [a]
, this is a
.
unsafeCreate :: a -> Static a i Source #
Simply wrap a value in a Static as is, assuming any length.
WARNING Use it only when you know what you're doing.
For example, an expression like
unsafeCreate "somestring" :: Static String 50
will typecheck, although the stored length information will not match actual string size. This may result in wrong behaviour of all functions defined for IsStaticText.
When writing new IsStaticText instances, make this simply apply the constructor of Static.
unwrap :: Static a i -> a Source #
Forget type-level length, obtaining the underlying value.
append :: a -> a -> a Source #
replicate :: Int -> Elem a -> a Source #
map :: (Elem a -> Elem a) -> a -> a Source #
IsStaticText ShortByteString Source # | IsStaticText instance for |
IsStaticText ByteString Source # | |
IsStaticText Text Source # | |
IsStaticText [a] Source # | |
IsStaticText (Vector a) Source # | |