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.
For example, an expression like
unsafeCreate "somestring" :: Static 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 Static.
Use it only when you know what you're doing.
When implementing new IsStaticText instances, code this to simply
apply the constructor of StaticText
.
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 # | |