Skip to content

Instantly share code, notes, and snippets.

@eagletmt
Created October 28, 2009 08:23
Show Gist options
  • Save eagletmt/220355 to your computer and use it in GitHub Desktop.
Save eagletmt/220355 to your computer and use it in GitHub Desktop.
module Bar where
myReverse [] = []
myReverse (x:xs) = myReverse xs ++ [x]
module Foo where
myReverse = foldl (flip (:)) []
Name: Hoge
Version: 0.0.0
License: BSD3
Cabal-Version: >= 1.2
Build-Type: Simple
Executable foo
Main-is: Main.hs
Build-Depends: base
CPP-Options: "-DUSE_FOO"
Executable bar
Main-is: Main.hs
Build-Depends: base
CPP-Options: "-DUSE_BAR"
{-# LANGUAGE CPP #-}
module Main where
#if defined(USE_FOO)
import Foo
#elif defined(USE_BAR)
import Bar
#endif
main = print $ myReverse [1..10]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment