string-variants-0.3.1.1: Constrained text newtypes
Safe HaskellNone
LanguageHaskell2010

Data.StringVariants.Util

Synopsis

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