(KnownBool (Elem Hidden (Options a)), Field a) => a -> Bool
                  
                  
                  isHidden field = boolVal $ Proxy @(Elem Hidden (Options a))
                  
                  
                  в который я запихиваю Field распаковывая экзистенциал 
                  
                  
                  SomeField :: forall a. Field a => a -> SomeField
                  
                  
                  т.е. filter (\(SomeField field) -> isHidden field)
                  
                  
                  Но он не может вывести KnownBool для (Elem Hidden (Options a)), которая определена как 
                  
                  
                  type Elem :: a -> [a] -> Bool
                  
                  
                  type family Elem a xs where
                  
                  
                      Elem a (x : xs) = If (x == a)
                  
                  
                          True
                  
                  
                          (Elem a xs)
                  
                  
                      Elem x '[] = False
                  
                  
                  
                  
                  
                  Field определен как
                  
                  
                  class Field a where
                  
                  
                      type FieldType a
                  
                  
                      -- | Raw field type (always equal to t)
                  
                  
                      type Options a :: [FieldOption]
                  
                  
                      fieldName :: a -> Text
                  
                  
                      -- | Schema field name
                  
                  
                
KnownBool из - ghc-typelits-knownnat
ScopedTypeVariables включен?
а почему ты решил писать Elem через If?
дык а как из Field a можно вывести KnownBool (Elem ... ) ?
Обсуждают сегодня