[Haskell-cafe] Avoiding parametric function binding

Stephen Tetley stephen.tetley at gmail.com
Sat Dec 31 16:50:05 CET 2011


Maybe you want a deconstructor (sometime called an eliminator)?

deconsVar :: (Maybe Int -> a) -> (Maybe String -> a) -> Var -> a
deconsVar f g (V1 a) = f a
deconsVar f g (V2 b) = g b



More information about the Haskell-Cafe mailing list