Skip to content

Instantly share code, notes, and snippets.

@graninas
Created May 6, 2014 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save graninas/e93e32aa1950a6f7b040 to your computer and use it in GitHub Desktop.
Save graninas/e93e32aa1950a6f7b040 to your computer and use it in GitHub Desktop.
-- file PathFind/Dijkstra.hs
module PathFind.Dijkstra (findPath) where
findPath = undefined
-- file PathFind/AStar.hs
module PathFind.AStar (findPath) where
findPath = undefined
-- file PathFind.hs
module PathFind (findPath, dijkstra, aStar) where
import qualified PathFind.Dijkstra as D
import qualified PathFind.AStar as A
data FindPathAlgorithm = Dijkstra | AStar
findPath Dijkstra = D.findPath
findPath AStar = A.findPath
dijkstra = Dijkstra
aStar = AStar
-- file Main.hs
module Main where
import PathFind
f a b c = a (findPath dijkstra b) c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment