:4:5: error: • Non type-variable argument in the constraint: HasField "name" r a • When checking the inferred type foo :: forall {r} {a}. HasField "name" r a => r -> a Suggested fix: Perhaps you intended to use FlexibleContexts