Skip to content

Instantly share code, notes, and snippets.

@xrl
Created April 25, 2011 03:02
Show Gist options
  • Save xrl/940098 to your computer and use it in GitHub Desktop.
Save xrl/940098 to your computer and use it in GitHub Desktop.
Euler.hs Tips and Tricks for Everyday Coding
one:new_euler xavierlange$ ls prob[1-9] | xargs du
17224 prob1
17224 prob2
17240 prob3
17224 prob4
17256 prob5
17224 prob6
one:new_euler xavierlange$ ls prob[1-9] | xargs du -h
8.4M prob1
8.4M prob2
8.4M prob3
8.4M prob4
8.4M prob5
8.4M prob6
one:new_euler xavierlange$ otool -L prob10
prob10:
/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.4)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
.SUFFIXES: .hs .o
SRCS=$(wildcard *.hs)
OBJS=$(patsubst %.hs,%.o,${SRCS})
GHC_FLAGS=-O2 --make
%.o: %.hs
ghc ${GHC_FLAGS} $<
.PHONY: all
all: ${OBJS}
clean:
rm -rf *.hi *.o
module OtherModule where
import SomeName (sampleFunction)
-- Now we only have access to sampleFunction -- we know nothing of anotherFunction
module SomeName where
-- Declare module's functions
-- in the preceding lines
sampleFunction = reverse
anotherFunction = flip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment