diff --git a/haskell/.ghc.hs b/haskell/.ghc.hs new file mode 100644 index 0000000..b154291 --- /dev/null +++ b/haskell/.ghc.hs @@ -0,0 +1,9 @@ +import Control.Applicative +import Control.Monad +import Data.Monoid +import Data.Maybe +import Data.List +import Data.Bool +import qualified Data.Set as S +import qualified Data.Map as M +import qualified Data.Text as T diff --git a/haskell/.ghci b/haskell/.ghci index 31f559e..afa0f08 100644 --- a/haskell/.ghci +++ b/haskell/.ghci @@ -1 +1,5 @@ :set prompt "λ " +:set -XPackageImports +:set -XOverloadedStrings +:set -XScopedTypeVariables -XRankNTypes +:l ~/.ghc.hs diff --git a/haskell/.profile.d/10-path-haskell.sh b/haskell/.profile.d/10-path-haskell.sh index 8ae4d33..e27f8eb 100644 --- a/haskell/.profile.d/10-path-haskell.sh +++ b/haskell/.profile.d/10-path-haskell.sh @@ -1,3 +1,3 @@ # haskell/.profile.d/10-path-haskell.sh -PATH="${HOME}/.cabal/bin:${PATH}:${HOME}/.cabin/bin" +PATH="${PATH}:${HOME}/.cabal/bin" export PATH diff --git a/haskell/.profile.d/20-functions-haskell.sh b/haskell/.profile.d/20-functions-haskell.sh new file mode 100644 index 0000000..7b43c71 --- /dev/null +++ b/haskell/.profile.d/20-functions-haskell.sh @@ -0,0 +1,15 @@ +# haskell/.profile.d/20-functions-haskell.sh +hmap() +{ + ghc -e "interact ($*)" +} + +hmapl() +{ + hmap "unlines.($*).lines" +} + +hmapw() +{ + hmapl "map (unwords.($*).words)" +} diff --git a/haskell/.profile.d/99-alias-haskell.sh b/haskell/.profile.d/99-alias-haskell.sh new file mode 100644 index 0000000..596828c --- /dev/null +++ b/haskell/.profile.d/99-alias-haskell.sh @@ -0,0 +1,2 @@ +# haskell/.profile.d/99-alias-haskell.sh +alias ghce="ghc -e ':l ~/.ghc.hs' -e"