I’m looking for a type family, giving me the type of a field in a record verifying
HasField symbol record type
I know this should theoretically exist given the functional dependency defined in the class :
class HasField (x :: k) r a | x r -> a where getField :: r -> a
But does it exist indeed ?
e.g.
data SomeData = SomeData { foo :: Int, bar :: [Int] }
type WhatTheFoo = GetType "foo" SomeData -- == Int
type WhatTheBar = GetType "bar" SomeData -- == [Int]