From 9291f9a0bb5eee851ebd7ee79f6f4cb70b5e49e2 Mon Sep 17 00:00:00 2001 From: Ashok Kimmel <59121897+ashokkimmel@users.noreply.github.com> Date: Tue, 28 Oct 2025 14:58:37 -0500 Subject: [PATCH] Add Elem type family and ElemSym data type Note, I did not test this. --- src/Symparsec/Parser/While/Predicates.hs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Symparsec/Parser/While/Predicates.hs b/src/Symparsec/Parser/While/Predicates.hs index 9c8336c..16ab9bd 100644 --- a/src/Symparsec/Parser/While/Predicates.hs +++ b/src/Symparsec/Parser/While/Predicates.hs @@ -116,3 +116,11 @@ type family IsDecDigit ch where type IsDecDigitSym :: Char ~> Bool data IsDecDigitSym ch type instance App IsDecDigitSym ch = IsDecDigit ch + +type Elem :: [a] -> a -> Bool +type family Elem where + Elem (_:xs) x = Elem xs x + Elem '[] _ = 'False + Elem (x':_) x = 'True +data ElemSym lst ch +type instance (App (ElemSym lst)) a = Elem lst a