Git Product home page Git Product logo

ghcid-script's Introduction

ghcid-script

A way to combine the powers of the automatic and fast reloading from ghcid, and the full interactive powers from GHCi.

Usage

Put the function from the ghcid_script.sh in your bash_aliases (or similar) and use it like this:

Test-mode (default) :

Prints out the ghci-command before the result. Also inserts one blank between

ghcid_script testDefinitions.hs testscript.hs

example :

"hei"
===>    "hei"

:t "hei"
===>    "hei" :: [Char]

:k []
===>    [] :: * -> *

123 + 23
===>    146

:t testFunc
===>    testFunc :: [a] -> a

xs = [1..5]
===>
testFunc xs
===>    5

testFunc [1..10]
===>    10

...done

Clear-mode : Run ghcid on testDefinitions.hs and run all ghci-commands in testscript.hs.

ghcid_script testDefinitions.hs testscript.hs -c

"hei"
"hei" :: [Char]
[] :: * -> *
146
testFunc :: [a] -> a
5
10

Line-mode : Same as above, but the ghcid.script changes every blank line to 'putStrLn mempty' to make it easy to space the output.

ghcid_script testDefinitions.hs testscript.hs -l

"hei"
"hei" :: [Char]

[] :: * -> *

146


testFunc :: [a] -> a


5
10

All modes also turns off +t with the `--setup=":unset +t" argument

Todo

Features :

make a syntax for ghci-commands where the result should not be shown, but instead the command itself. (xs   = 10)

Fixes :

Fix newline after definitions in test-mode. (xs = 10)

ghcid-script's People

Stargazers

Eirik Halvard Sæther avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.