commercialhaskell/describe

Describe Haskell code in GHCi

PowerShell

72

11 commits

updated Jul 27, 2017

See the code

README

describe

Describe Haskell code in GHCi

Example

The main use-case is figuring out how infix operators are parsed:

> :describe x <$> y <|> h <* p <*> k
(x Data.Functor.<$> y) GHC.Base.<|> ((h GHC.Base.<* p) GHC.Base.<*> k)

Tada!

Setup (Linux, macOS)

Install the package by running:

git clone https://github.com/commercialhaskell/describe.git
cd describe
sh global-install.sh # requires stack

Setup (Windows)

From a PowerShell terminal, install the package by running:

git clone https://github.com/commercialhaskell/describe.git
cd describe
.\global-install.ps1 # requires stack

Pitfalls

If you use something out of scope, you'll see

<<Non-variable/constructor in infix context>>

Just import the right thing and try again:

> :describe x <$> y <*> z <* p <|> k
(((x Data.Functor.<$> y) GHC.Base.<*> z) GHC.Base.<* p) <<Non-variable/constructor in infix context>> k
> import Control.Applicative
> :describe x <$> y <*> z <* p <|> k
(((x Data.Functor.<$> y) GHC.Base.<*> z) GHC.Base.<* p) GHC.Base.<|> k

Contributors

chrisdone

10 commits

rcook

1 commits

commercialhaskell/describe

Describe Haskell code in GHCi

PowerShell

72

11 commits

updated Jul 27, 2017

See the code

README

describe

Describe Haskell code in GHCi

Example

The main use-case is figuring out how infix operators are parsed:

> :describe x <$> y <|> h <* p <*> k
(x Data.Functor.<$> y) GHC.Base.<|> ((h GHC.Base.<* p) GHC.Base.<*> k)

Tada!

Setup (Linux, macOS)

Install the package by running:

git clone https://github.com/commercialhaskell/describe.git
cd describe
sh global-install.sh # requires stack

Setup (Windows)

From a PowerShell terminal, install the package by running:

git clone https://github.com/commercialhaskell/describe.git
cd describe
.\global-install.ps1 # requires stack

Pitfalls

If you use something out of scope, you'll see

<<Non-variable/constructor in infix context>>

Just import the right thing and try again:

> :describe x <$> y <*> z <* p <|> k
(((x Data.Functor.<$> y) GHC.Base.<*> z) GHC.Base.<* p) <<Non-variable/constructor in infix context>> k
> import Control.Applicative
> :describe x <$> y <*> z <* p <|> k
(((x Data.Functor.<$> y) GHC.Base.<*> z) GHC.Base.<* p) GHC.Base.<|> k

Contributors

chrisdone

10 commits

rcook

1 commits

Languages

PowerShell

38.8%

Shell

38.8%

Haskell

22.4%