I released a Haskell library “has”, for creating type-indexed records in a casual way. Its usage is described here.

I will show another usage of this library. It is too trivial to write in documentation but attracting to me in its strangeness:

{-# LANGUAGE TypeFamilies,TypeOperators,FlexibleContexts #-} import Data.Has data Any = Any intBool = prjl Any (Any .> (42::Int) & Any .> True) test :: Int test = if intBool then intBool + 5 else 0

I noticed “has” can be used in this way while reading the paper about type-indexed records (I forgot the title and the author of the paper…)