| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
Data.Diverse.CaseTypeable
- newtype CaseTypeable r xs = CaseTypeable (forall x. Typeable x => x -> r)
Documentation
newtype CaseTypeable r xs Source #
This handler stores a polymorphic function for all Typeables.
let y =pick(5 :: Int) ::Which'[Int, Bool]switchy (CaseTypeable(show . typeRep . (pure @Proxy))) `shouldBe` Int
let x = (5 :: Int)./False./'X'./Just 'O'./(6 :: Int)./Just 'A'./nulafoldr(:) [] (forMany(CaseTypeable(show . typeRep . (pure @Proxy))) x) `shouldBe` ["Int", "Bool", "Char", "Maybe Char", "Int", "Maybe Char"]
Constructors
| CaseTypeable (forall x. Typeable x => x -> r) |
Instances
| Reiterate (CaseTypeable r) xs Source # | |
| Typeable Type x => Case (CaseTypeable r) ((:) Type x xs) Source # | |
| type CaseResult * Type (CaseTypeable r) x Source # | |