Created
October 28, 2009 08:23
-
-
Save eagletmt/220355 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
module Bar where | |
myReverse [] = [] | |
myReverse (x:xs) = myReverse xs ++ [x] |
This file contains hidden or 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
module Foo where | |
myReverse = foldl (flip (:)) [] |
This file contains hidden or 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
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" |
This file contains hidden or 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 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