{-# LANGUAGE GADTs #-}{-# LANGUAGE Rank2Types #-}{-# LANGUAGE ScopedTypeVariables #-}-- | Pattern functors existentially quantified in their top-level index type @ix@.moduleAnnotations.MultiRec.Any(Any(..),mkAny,matchAny,AnyF(..),mkAnyF,matchAnyF,unwrapAnyF,($?))whereimportAnnotations.MultiRec.ShowFamimportGenerics.MultiRec-- | A value of some type in data family @s@, together with its witness.dataAnyswhereAny::six->ix->AnysinstanceShowFams=>Show(Anys)whereshow=showAnyshowAny::ShowFams=>Anys->StringshowAny(Anywx)=showFamwx-- | Helper constructor.mkAny::Elsix=>ix->AnysmkAny=Anyproof-- | Unify an 'Any' with an @a@.matchAny::forallsa.EqSs=>sa->Anys->MaybeamatchAnyp(Anywx)=match'wxpwherematch'::forallb.sb->b->sa->Maybeamatch'wxw'=caseeqSww'ofNothing->NothingJustRefl->Justx-- | A value of some type in data family @s@ wrapped in an @f@, together with its witness.dataAnyFsfwhereAnyF::six->fix->AnyFsf-- | Helper constructor.mkAnyF::Elsix=>rix->AnyFsrmkAnyF=AnyFproof-- | Unify an 'AnyF' with an @f a@.matchAnyF::forallsfa.EqSs=>sa->AnyFsf->Maybe(fa)matchAnyFp(AnyFwx)=match'wxpwherematch'::forallb.sb->fb->sa->Maybe(fa)match'wxw'=caseeqSww'ofNothing->NothingJustRefl->Justx-- | Unwrap an 'AnyF' and pass it to a function.($?)::(forallb.sb->fb->a)->AnyFsf->af$?(AnyFpx)=fpx-- | Removes the value from its functor @f@.unwrapAnyF::(forallix.fix->ix)->AnyFsf->AnysunwrapAnyFg(AnyFixrix)=Anyix(grix)