| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
Kleene.Functor.NonEmpty
Synopsis
- data K1 c a
- data Greediness
- some1 :: K1 c a -> K1 c (NonEmpty a)
- anyChar :: (Ord c, Enum c, Bounded c) => K1 c c
- oneof :: (Ord c, Enum c, Foldable f) => f c -> K1 c c
- char :: (Ord c, Enum c) => c -> K1 c c
- charRange :: (Enum c, Ord c) => c -> c -> K1 c c
- dot :: K1 Char Char
- everything1 :: (Ord c, Enum c, Bounded c) => K1 c (NonEmpty c)
- string :: String -> K1 Char (NonEmpty Char)
- isEmpty :: (Ord c, Enum c, Bounded c) => K1 c a -> Bool
- isEverything :: (Ord c, Enum c, Bounded c) => K1 c a -> Bool
- match :: K1 c a -> [c] -> Maybe a
- toRE :: (Ord c, Enum c, Bounded c) => K1 c a -> RE c
- toKleene :: FiniteKleene c k => K1 c a -> k
- toRA :: K1 c a -> RE c a
- nullableProof :: K c a -> Either (K1 c a) (a, K1 c a)
Documentation
Applicative Functor regular expression.
Instances
| Functor (K1 c) Source # | |
| Alt (K1 c) Source # | |
| Apply (K1 c) Source # | |
| c ~ Char => Pretty (K1 c a) Source # | Convert to non-matching JavaScript string which can be used
as an argument to
|
data Greediness Source #
Star behaviour
Instances
Constructors
oneof :: (Ord c, Enum c, Foldable f) => f c -> K1 c c Source #
>>>putPretty $ oneof ("foobar" :: [Char])^[a-bfor]$
everything1 :: (Ord c, Enum c, Bounded c) => K1 c (NonEmpty c) Source #
>>>putPretty everything1^[^][^]*$
Queries
Matching
Conversions
toRE :: (Ord c, Enum c, Bounded c) => K1 c a -> RE c Source #
Convert to RE.
>>>putPretty (toRE $ some1 (string "foo") :: RE.RE Char)^foo(foo)*$
toKleene :: FiniteKleene c k => K1 c a -> k Source #
Convert to any Kleene
nullableProof :: K c a -> Either (K1 c a) (a, K1 c a) Source #
>>>putPretty $ nullableProof (pure True)Right 1 , ^[]$
>>>putPretty $ nullableProof (many "xyz" :: K Char [String])Right [] , ^xyz(xyz)*$
>>>putPretty $ nullableProof (many $ toList <$> optional "x" <|> many "yz" :: K Char [[String]])Right [] , ^(x|yz(yz)*)(x|yz(yz)*)*$