https://github.com/seliopou/typo
Raw File
Tip revision: cc64ec38603a50c6543b3834d47b4ff0431c2b3e authored by Spiros Eliopoulos on 13 July 2014, 15:16:52 UTC
compiler: port to template haskell
Tip revision: cc64ec3
typo
#!/bin/bash

# Only compile one file at a time
INPUT=/dev/stdin
TEMPFILE=`mktemp TypoXXX.hs`
trap "rm $TEMPFILE" EXIT

# Ensure that typoc is in your PATH.  During development, you'll have to add
#
#   ./dist/build/typoc
#
# to your PATH.
#
typoc < $INPUT > $TEMPFILE
ghc -e ':t result' $TEMPFILE | awk '
    BEGIN { FS="(" }
    /:: True$/ { print "#t" }
    /:: False$/ { print "#f" }
    /:: Z$/ { print 0 }
    /:: S/ { print NF }
'
back to top