Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data.StringVariants.Util
Synopsis
- type family SymbolNonEmpty (s :: Symbol) where ...
- type SymbolWithNoSpaceAround (s :: Symbol) = (SymbolNoLeadingSpace (UnconsSymbol s), SymbolNoTrailingSpace (UnconsSymbol s))
- type family SymbolNoLongerThan (s :: Symbol) (n :: Nat) where ...
- usePositiveNat :: Integer -> a -> (forall (n :: Nat) (proxy :: Nat -> Type). (KnownNat n, 1 <= n) => proxy n -> a) -> a
- textIsWhitespace :: Text -> Bool
- textHasNoMeaningfulContent :: Text -> Bool
Documentation
type family SymbolNonEmpty (s :: Symbol) where ... Source #
Equations
SymbolNonEmpty "" = TypeError ('Text "Symbol is empty") :: Constraint | |
SymbolNonEmpty _1 = () |
type SymbolWithNoSpaceAround (s :: Symbol) = (SymbolNoLeadingSpace (UnconsSymbol s), SymbolNoTrailingSpace (UnconsSymbol s)) Source #
type family SymbolNoLongerThan (s :: Symbol) (n :: Nat) where ... Source #
Equations
SymbolNoLongerThan s n = If (SymbolLength 0 (UnconsSymbol s) <=? n) () (TypeError (((('Text "Invalid NonEmptyText. Needs to be <= " ':<>: 'ShowType n) ':<>: 'Text " characters. Has ") ':<>: 'ShowType (SymbolLength 0 (UnconsSymbol s))) ':<>: 'Text " characters.") :: Constraint) |
usePositiveNat :: Integer -> a -> (forall (n :: Nat) (proxy :: Nat -> Type). (KnownNat n, 1 <= n) => proxy n -> a) -> a Source #
If the integer is >= 1, evaluate the function with the proof of that. Otherwise, return the default value
textIsWhitespace :: Text -> Bool Source #