This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE ExistentialQuantification #-} | |
-- This file is a direct translation of the example for the Visitor pattern from | |
-- Wikipedia [1] to Haskell | |
-- | |
-- The Visitor pattern essentially tackles two dispatching problems: | |
-- | |
-- 1. double dispatching | |
-- 2. dispatching subtypes | |
-- | |
-- While double dispatching of static types could be solved in Haskell by using |