All Projects → alexwl → Haskell Code Explorer

alexwl / Haskell Code Explorer

Licence: mit
Web application for exploring and understanding Haskell codebases

Programming Languages

haskell
3896 projects

Labels

Projects that are alternatives of or similar to Haskell Code Explorer

Darkmatter
The notebook-style Common Lisp environment
Stars: ✭ 336 (-25.99%)
Mutual labels:  webapp
Nusmods
🏫 Official course planning platform for National University of Singapore.
Stars: ✭ 379 (-16.52%)
Mutual labels:  webapp
Bastillion Ec2
A web-based SSH console to execute commands and manage multiple EC2 instances simultaneously running on Amazon Web Services (AWS).
Stars: ✭ 410 (-9.69%)
Mutual labels:  webapp
Play Samples
Stars: ✭ 335 (-26.21%)
Mutual labels:  webapp
Picoweb
Really minimal web application framework for the Pycopy project (minimalist Python dialect) and its "uasyncio" async framework
Stars: ✭ 361 (-20.48%)
Mutual labels:  webapp
Stan
🕵️ Haskell STatic ANalyser
Stars: ✭ 386 (-14.98%)
Mutual labels:  ghc
Spa
A webapp framework for routing control and view transitions
Stars: ✭ 331 (-27.09%)
Mutual labels:  webapp
Nestjs Bff
A full-stack TypeScript solution, and starter project. Includes an API, CLI, and example client webapp. Features include production grade logging, authorization, authentication, MongoDB migrations, and end-to-end testing.
Stars: ✭ 450 (-0.88%)
Mutual labels:  webapp
Profile Summary For Github
Tool for visualizing GitHub profiles
Stars: ✭ 19,489 (+4192.73%)
Mutual labels:  webapp
Sandbox
Development sandbox for front end projects and tutorials.
Stars: ✭ 408 (-10.13%)
Mutual labels:  webapp
Cppwebframework
​The C++ Web Framework (CWF) is a MVC web framework, Open Source, under MIT License, using C++ with Qt to be used in the development of web applications.
Stars: ✭ 348 (-23.35%)
Mutual labels:  webapp
Coreui
Open Source UI Kit built on top of Bootstrap 4 and plain JavaScript without any additional libraries like jQuery
Stars: ✭ 361 (-20.48%)
Mutual labels:  webapp
Ytmdl Web V2
Web version of ytmdl. Allows downloading songs with metadata embedded from various sources like itunes, gaana, LastFM etc.
Stars: ✭ 398 (-12.33%)
Mutual labels:  webapp
Scalc
📲 A simple calculator application
Stars: ✭ 336 (-25.99%)
Mutual labels:  webapp
Fans
这是一个app(android/iOS)项目,但页面视图全部都用的是html5页,没有使用app的原生页面。 前端h5是基于mui + vue2 + vue-router2 + es6 + webpack2 + vuex + signalR 的前端webApp单页项目框架,项目可以直接在PC上运行html5页面。 app打包技术是用HBuilder IDE工具一键打包成APP。
Stars: ✭ 416 (-8.37%)
Mutual labels:  webapp
Portal Lite
Multi-platform Personalized Portal: Web, Browser Extension. All components are web apps--users can compose their own Portal freely, and developers can contribute to the Privoce Web App library to easily incorporate their web app to our Portal.
Stars: ✭ 335 (-26.21%)
Mutual labels:  webapp
Gwt Material
A Google Material Design wrapper for GWT
Stars: ✭ 386 (-14.98%)
Mutual labels:  webapp
Monitorr
"Monitorr” is a self-hosted PHP web app that monitors the status of local and remote network services, websites, and applications.
Stars: ✭ 449 (-1.1%)
Mutual labels:  webapp
Openvpn Web Ui
Web interface (with golang backend) for monitoring and administration of OpenVPN server
Stars: ✭ 444 (-2.2%)
Mutual labels:  webapp
Udash Core
Scala framework for building beautiful and maintainable web applications.
Stars: ✭ 405 (-10.79%)
Mutual labels:  webapp

Haskell Code Explorer

CircleCI

Haskell Code Explorer is a web application for exploring and understanding Haskell codebases. It provides IDE-like code intelligence features such as types and documentation on hover, "go to definition", "find references" and semantic highlighting.

Examples:

Haskell Code Explorer

The public instance of Haskell Code Explorer is available at https://haskell-code-explorer.mfix.io. It contains core libraries (ghc, base, etc.) and a subset of packages from a Stackage snapshot.

Haskell Code Explorer consists of an indexer, an HTTP server, and a JavaScript application. The indexer uses GHC API to create a data structure that contains detailed information about the source code of a Cabal package. The HTTP server reads that data structure into memory and responds to HTTP requests from the JavaScript application.

Motivation

Reading and understanding code is an essential part of the software development process. Understanding code in any statically typed language is much easier when code intelligence features (types on hover, go-to-definition, etc.) are available. Code intelligence for Haskell is especially useful because types are informative and precise (thanks to Haskell's purity and global type inference).

Features

  • Types (actual type, instantiated type, instance resolution tree) and documentation on hover. Types are interactive: left-click on a type constructor -> go to definition, right click on a type constructor -> show kind signature.
    Hover

  • Go to definition (cross-package)

  • Find references (cross-package) References

  • Search for Haskell functions, data and type constructors by name (in the current package / in all indexed packages) Search

  • Type of each expression
    Expression
    Select a piece of text to get the type of each Haskell expression inside the selection.

  • Semantic highlighting

Installation

git clone https://github.com/alexwl/haskell-code-explorer
cd haskell-code-explorer

To build Haskell Code Explorer Stack (https://docs.haskellstack.org/en/stable/README/) is needed.

At the moment Haskell Code Explorer supports GHC 8.6.5, 8.6.4, GHC 8.6.3, GHC 8.4.4, GHC 8.4.3, GHC 8.2.2, and 8.0.2.

For GHC 8.6.5:

stack install

For GHC 8.6.4:

stack --stack-yaml=stack-8.6.4.yaml install

For GHC 8.6.3:

stack --stack-yaml=stack-8.6.3.yaml install

For GHC 8.4.4:

stack --stack-yaml=stack-8.4.4.yaml install

For GHC 8.4.3:

stack --stack-yaml=stack-8.4.3.yaml install

For GHC 8.2.2:

stack --stack-yaml=stack-8.2.2.yaml install

For GHC 8.0.2:

stack --stack-yaml=stack-8.0.2.yaml install

Indexing source code of a Cabal package

haskell-code-indexer executable is responsible for indexing packages (by default, the index is saved to .haskell-code-explorer directory).

A package should be built using either cabal-install or stack before indexing (cabal new-build,cabal build, or stack build command should be executed).

The version of GHC used to build haskell-code-indexer must match the version of GHC used to build a package you are indexing (to find out the version of GHC try ghc --version or stack exec ghc -- --version command).

haskell-code-indexer requires globally installed GHC and cabal-install (cabal). The reason for this is that haskell-code-indexer uses cabal-helper library https://hackage.haskell.org/package/cabal-helper to get package build information. cabal-helper builds (at runtime) an executable linked against a version of Cabal library that was used to configure the package. You may need to run cabal update to get the latest list of available packages to be able to build the cabal-helper executable. By default, the cabal-helper executable (e.g.,cabal-helper0.8.1.2-Cabal2.4.1.0) is saved to $HOME/.cache/cabal-helper.

If there is no globally installed GHC on the system, then it is possible to use stack exec command (https://docs.haskellstack.org/en/stable/GUIDE/#exec) that adds a path to GHC binaries installed by Stack to PATH environment variable.

Run cabal update using stack exec:

stack --resolver=lts-13.20 exec --no-ghc-package-path cabal -- update

Index a package using stack exec:

stack --resolver=lts-13.20 exec --no-ghc-package-path haskell-code-indexer -- INDEXER_OPTIONS

--no-ghc-package-path option unsets GHC_PACKAGE_PATH environment variable. cabal fails with the error Use of GHC's environment variable GHC_PACKAGE_PATH is incompatible with Cabal. if the GHC_PACKAGE_PATH is set.

Examples

Show all indexer options:

haskell-code-indexer -h

Index package:

haskell-code-indexer --package PATH

Index package with specific dist directory:

haskell-code-indexer --package PATH --dist dist-newstyle/build/x86_64-linux/ghc-8.2.2/hpath-0.9.2

Starting HTTP Server

haskell-code-server executable reads the package index created by haskell-code-indexer and starts the HTTP server. The HTTP server responds to API requests and serves static assets (JavaScript files that are in haskell-code-explorer/javascript/release directory).

Examples

Show all server options:

haskell-code-server -h

Load the indexed package and start the server:

haskell-code-server --package PATH --port 8080

Load multiple indexed packages and start the server:

haskell-code-server --package PATH1 --package PATH2 --package PATH3 --port 8080

Load the indexed package and start the server, use Hoogle API (https://github.com/ndmitchell/hoogle/blob/3dbf68bfd701f942d3af2e6debb74a0a78cd392e/docs/API.md#json-api) to get documentation for functions and types defined in other packages (haskell-code-server makes requests to https://hoogle.haskell.org/):

haskell-code-server --package PATH --port 8080 --use-hoogle-api

Open http://localhost:8080 in a browser to explore source code of the package.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].