Safe Haskell | None |
---|---|
Language | Haskell2010 |
- newtype CaseTypeable xs r = CaseTypeable (forall x. Typeable x => x -> r)
Documentation
newtype CaseTypeable xs r Source #
This handler stores a polymorphic function for all Typeables.
let y =pick
(5 :: Int) ::Which
'[Int, Bool]switch
y (CaseTypeable
(show . typeRep . (pure @Proxy))) `shouldBe` Int
let x = (5 :: Int)./
False./
'X'./
Just 'O'./
(6 :: Int)./
Just 'A'./
nul
afoldr
(:) [] (forMany
(CaseTypeable
(show . typeRep . (pure @Proxy))) x) `shouldBe` ["Int", "Bool", "Char", "Maybe Char", "Int", "Maybe Char"]
CaseTypeable (forall x. Typeable x => x -> r) |