Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/bash
- set -e
- rm -f *.hi *.o
- args="-O -package-env -"
- #args="$args -ddump-hi-diffs -ddump-hi"
- cat >Z.hs <<EOF
- module Z where
- class Hello a where
- hello :: a -> String
- instance Hello () where
- hello _ = "hello"
- EOF
- cat >Y.hs <<EOF
- module Y(Hello(..)) where
- import Z
- EOF
- cat >X.hs <<EOF
- module X(x) where
- import Y
- x = print (hello ())
- EOF
- compile() {
- echo "===================== $1 ==============================="
- ghc -c $args $1.hs
- echo >> $log
- echo "===================== $1 ===============================" >> $log
- ghc --show-iface $1.hi >> $log
- }
- echo
- echo
- echo "###############################################"
- echo " before "
- echo "###############################################"
- log=before
- rm -f $log
- compile Z
- compile Y
- compile X
- ls --time-style=full-iso -lh *.hi
- sleep 2
- cat >Z.hs <<EOF
- module Z where
- class Hello a where
- hello :: a -> String
- instance Hello () where
- hello _ = "hi"
- EOF
- echo
- echo
- echo "###############################################"
- echo " after "
- echo "###############################################"
- log=after
- rm -f $log
- compile Z
- compile Y
- compile X
- ls --time-style=full-iso -lh *.hi
- echo
- echo
- echo "###############################################"
- echo " diff "
- echo "###############################################"
- meld before after
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement