Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Internal module of NonEmptyText, allowing breaking the abstraction.
Prefer to use Data.StringVariants.NonEmptyText instead.
Synopsis
- newtype NonEmptyText (n :: Nat) = NonEmptyText Text
- mkNonEmptyText :: forall n. (KnownNat n, 1 <= n) => Text -> Maybe (NonEmptyText n)
- mkNonEmptyTextWithTruncate :: forall n. (KnownNat n, 1 <= n) => Text -> Maybe (NonEmptyText n)
- unsafeMkNonEmptyText :: forall n. (KnownNat n, 1 <= n) => Text -> NonEmptyText n
- widen :: (1 <= n, n <= m) => NonEmptyText n -> NonEmptyText m
- compileNonEmptyTextKnownLength :: QuasiQuoter
Documentation
newtype NonEmptyText (n :: Nat) Source #
Non Empty Text, requires the input is between 1 and n
chars and not just whitespace.
Instances
mkNonEmptyText :: forall n. (KnownNat n, 1 <= n) => Text -> Maybe (NonEmptyText n) Source #
mkNonEmptyTextWithTruncate :: forall n. (KnownNat n, 1 <= n) => Text -> Maybe (NonEmptyText n) Source #
unsafeMkNonEmptyText :: forall n. (KnownNat n, 1 <= n) => Text -> NonEmptyText n Source #
Make a NonEmptyText when you can manually verify the length
widen :: (1 <= n, n <= m) => NonEmptyText n -> NonEmptyText m Source #
Converts a NonEmptyText
to a wider NonEmptyText