Skip to content

Commit

Permalink
moved stuff from .ghci to ghci.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno rasic committed Jul 22, 2014
1 parent 42bfceb commit e925500
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .ghc/ghci.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

:set prompt "\ESC[1;34mλ> \ESC[m"

--:def hoogle \str -> return $ ":! hoogle --count=15 \"" ++ str ++ "\""
:def hoogle \x -> return $ ":!hoogle --count=15 \"" ++ x ++ "\""
-- :def hoogle \x -> return $ ":!hoogle \"" ++ x ++ "\""
:def doc \x -> return $ ":!hoogle --info \"" ++ x ++ "\""

-- <http://www.cs.kent.ac.uk/people/staff/cr3/toolbox/haskell/dot-squashed.ghci641>
let { redir varcmd = case break Data.Char.isSpace varcmd of { (var,_:cmd) -> return $ unlines [":set -fno-print-bind-result","tmp <- System.Directory.getTemporaryDirectory","(f,h) <- System.IO.openTempFile tmp \"ghci\"","sto <- GHC.Handle.hDuplicate System.IO.stdout","GHC.Handle.hDuplicateTo h System.IO.stdout","System.IO.hClose h",cmd,"GHC.Handle.hDuplicateTo sto System.IO.stdout","let readFileNow f = readFile f >>= \\t->length t `seq` return t",var++" <- readFileNow f","System.Directory.removeFile f"]; _ -> return "putStrLn \"usage: :redir <var> <cmd>\"" } }
Expand Down
4 changes: 0 additions & 4 deletions .ghci
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@


:def hoogle \x -> return $ ":!hoogle \"" ++ x ++ "\""
:def doc \x -> return $ ":!hoogle --info \"" ++ x ++ "\""

0 comments on commit e925500

Please sign in to comment.