string-variants-0.2.0.0: Constrained text newtypes
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.StringVariants.Util

Synopsis

Documentation

type family SymbolNonEmpty (s :: Symbol) :: Constraint where ... Source #

Equations

SymbolNonEmpty "" = TypeError ('Text "Symbol is empty") 
SymbolNonEmpty _ = () 

type SymbolWithNoSpaceAround s = (SymbolNoLeadingSpace (UnconsSymbol s), SymbolNoTrailingSpace (UnconsSymbol s)) Source #

type family SymbolNoLongerThan (s :: Symbol) (n :: Nat) :: Constraint where ... Source #

Equations

SymbolNoLongerThan s n = If (SymbolLength 0 (UnconsSymbol s) <=? n) (() :: Constraint) (TypeError (((('Text "Invalid NonEmptyText. Needs to be <= " :<>: 'ShowType n) :<>: 'Text " characters. Has ") :<>: 'ShowType (SymbolLength 0 (UnconsSymbol s))) :<>: 'Text " characters.")) 

usePositiveNat :: Integer -> a -> (forall n proxy. (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