Code Monkey home page Code Monkey logo

stackage-view's Introduction

stackage-view

View Haskell codebases

Introduction

This tool can be run in the root directory of a Cabal project which provides a way to look around the source modules.

Stackage-view screenshot

On the left are modules of the project and on the right is the source of the module.

Starting

In a Cabal project directory, run stackage-view and you should see:

$ stackage-view
Point your browser to http://localhost:3000/

If you go to that URL in your browser, you will see:

Target choosing screen

Pick the targets you want to check out and then hit Done.

Current Features

  • Go to definition: You can double-click any identifier to jump straight to the definition.
  • Type information of any expression or pattern binding. Just click any identifier to see its type. Alternatively, you can select an expression to see the type of that. Hitting the <-> expansion button will expand the selection to a parent node.

stackage-view's People

Contributors

borsboom avatar chrisdone avatar gleber avatar mgsloan avatar mpickering avatar rvion avatar snoyberg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stackage-view's Issues

how to build?

the README assumes the exe is already built. When I git clone and cabal install i see this:

cabal install
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: stackage-view-0.0.1 (user goal)
next goal: fpview (dependency of stackage-view-0.0.1)
Dependency tree exhaustively searched.

Can't build using stack on OS X

[N.B.: this is quite possibly also relevant to commercialhaskell/stack than stackage-view, but I'm starting the discussion here.]

Repro steps

  1. On an OS X box, install stack and clone this repo.
  2. cd path/to/stackage-view
  3. stack build

Actual results

>> stack build
Cannot find 'docker' in PATH.  Is Docker installed?

Expected results

stackage-view builds natively, so it can be invoked in a Cabal project directory.

Notes

The stack.yml file includes the stanza:

docker:
  repo: fpco/ghcjs-dev

This means that what should be a straightforward local build of this tool now must be built inside of a docker instance. This makes for a positively bizarre workflow, since the primary usage of this tool appears to be on a development host.

I fully understand the benefits of fully reproducible builds using docker (and VMs in general). Yet those benefits don't appear to apply to stackage-view because it's a client tool, not a server tool.

License uncertainity

Currently LICENSE file suggests this is a software whose source code is available, but not licensed under any open source license. This makes it impossible to use by anyone who's conscious about licensing of their code. If possible, please select a widely used and court-battle-tested open source license.

A problem occurred <<server died>>

I managed to get this project to build, but when I try and run it I end up with a big, orange page that says "A Problem Occurred".

Steps are:

$ stackage-view
Point your browser to http://localhost:3000/

I chose to point it at its own source code. Visiting localhost:3000 with a browser results in the usual "Chose Targets" screen with the choices "Library, Executable, Test suit". Selecting any combination and hitting "done" results in the orange screen. All further interaction (F5, visiting in another tab) goes directly to the orange screen.

The logs printed to the command line look normal, but I'll include them just in case:

127.0.0.1 - - [29/May/2015:19:09:19 +0100] "GET / HTTP/1.1" 200 - "" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
127.0.0.1 - - [29/May/2015:19:09:19 +0100] "GET /ghcjs/home.js HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
127.0.0.1 - - [29/May/2015:19:09:19 +0100] "GET /static/js/es5-shim.min.js HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
127.0.0.1 - - [29/May/2015:19:09:19 +0100] "POST /command HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
127.0.0.1 - - [29/May/2015:19:09:19 +0100] "GET /static/img/starting.png HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
127.0.0.1 - - [29/May/2015:19:09:19 +0100] "GET /static/js/console-polyfill.js HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
127.0.0.1 - - [29/May/2015:19:09:19 +0100] "GET /ghcjs/home.js HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
127.0.0.1 - - [29/May/2015:19:09:19 +0100] "GET /static/js/react.js HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
127.0.0.1 - - [29/May/2015:19:09:19 +0100] "GET /static/css/bootstrap.css HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
127.0.0.1 - - [29/May/2015:19:09:19 +0100] "GET /static/js/es5-sham.min.js HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
127.0.0.1 - - [29/May/2015:19:10:58 +0100] "POST /command HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
127.0.0.1 - - [29/May/2015:19:10:58 +0100] "GET /static/img/loading.png HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
127.0.0.1 - - [29/May/2015:19:10:58 +0100] "POST /command HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
127.0.0.1 - - [29/May/2015:19:10:58 +0100] "POST /command HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
127.0.0.1 - - [29/May/2015:19:11:11 +0100] "GET / HTTP/1.1" 200 - "" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
127.0.0.1 - - [29/May/2015:19:11:11 +0100] "GET /static/js/es5-shim.min.js HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
127.0.0.1 - - [29/May/2015:19:11:11 +0100] "GET /static/js/es5-sham.min.js HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
127.0.0.1 - - [29/May/2015:19:11:11 +0100] "POST /command HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
127.0.0.1 - - [29/May/2015:19:11:11 +0100] "GET /static/css/bootstrap.css HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
127.0.0.1 - - [29/May/2015:19:11:11 +0100] "GET /static/img/starting.png HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
127.0.0.1 - - [29/May/2015:19:11:11 +0100] "GET /static/js/console-polyfill.js HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
127.0.0.1 - - [29/May/2015:19:11:11 +0100] "GET /ghcjs/home.js HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
127.0.0.1 - - [29/May/2015:19:11:11 +0100] "GET /static/js/react.js HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
127.0.0.1 - - [29/May/2015:19:12:07 +0100] "GET / HTTP/1.1" 200 - "" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
127.0.0.1 - - [29/May/2015:19:12:07 +0100] "GET /static/js/es5-shim.min.js HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
127.0.0.1 - - [29/May/2015:19:12:07 +0100] "GET /static/js/es5-sham.min.js HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
127.0.0.1 - - [29/May/2015:19:12:07 +0100] "GET /static/js/console-polyfill.js HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
127.0.0.1 - - [29/May/2015:19:12:07 +0100] "POST /command HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
127.0.0.1 - - [29/May/2015:19:12:07 +0100] "GET /static/css/bootstrap.css HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
127.0.0.1 - - [29/May/2015:19:12:07 +0100] "GET /ghcjs/home.js HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
127.0.0.1 - - [29/May/2015:19:12:07 +0100] "GET /static/js/react.js HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
127.0.0.1 - - [29/May/2015:19:12:07 +0100] "GET /static/img/starting.png HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"

I should also mention that ide-backend-server seems to have problems. I don't know if that's related or otherwise causing this problem.

$ ide-backend-server
ide-backend-server: IdeSession/RPC/Server.hs:49:7-27: Irrefutable pattern failed for pattern errorLog : fds

Build error (GHCJS)

When buillding (sandbox), I get the following error:

[14 of 17] Compiling Handler.Home     ( server/Handler/Home.hs, dist/dist-sandbox-7bd9fa4d/build/Handler/Home.o )
ghcjs app/Client.hs -o /tmp/run-ghcjs.32276 -iclient -ishared -XCPP -XTemplateHaskell -package ghcjs-react

server/Handler/Home.hs:17:5:
    Exception when trying to run compile-time code:
      The GHCJS process failed with exit code 127.
    Code: ghcjsFileDev
            development
            ["-iclient", "-ishared", "-XCPP", "-XTemplateHaskell", ....]
            "app/Client.hs"
    In the splice:
      $(ghcjsFileDev
          development
          ["-iclient", "-ishared", "-XCPP", ....]
          "app/Client.hs")
cabal: Error: some packages failed to install:
stackage-view-0.0.1 failed during the building phase. The exception was:
ExitFailure 1

Ready for download distribution for Windows

Feature request

Currently under Windows it is hard to build it - it needs additional Docker installation and setup.
This tool is very handy and it will be really nice if we could download it directly as a binary.

Compilation error [client/React/Ace.hs:93:31]: Overlapping instances for Eq JSString arising from a use of ‘/=’

Compilation failed with the following output:

[ 7 of 13] Compiling React.Ace        ( client/React/Ace.hs, client/React/Ace.js_o )

client/React/Ace.hs:93:31:
    Overlapping instances for Eq JSString arising from a use of ‘/=’
    Matching instances:
      instance Eq (JSRef a) -- Defined in ‘GHCJS.Prim’
      instance Eq JSString -- Defined at client/React/Ace.hs:248:10
    In the first argument of ‘when’, namely ‘(code /= code')’
    In a stmt of a 'do' block:
      when (code /= code') (setValue editor code)
    In the expression:
      do { code' <- getValue editor;
           when (code /= code') (setValue editor code);
           stateStartLine <- getStartLine props;
           stateStartCol <- getStartCol props;
           .... }

server/Handler/Home.hs:17:5:
    Exception when trying to run compile-time code:
      The GHCJS process failed with exit code 1.
    Code: ghcjsFileDev
            development
            ["-iclient", "-ishared", "-XCPP", "-XTemplateHaskell", ....]
            "app/Client.hs"
    In the splice:
      $(ghcjsFileDev
          development
          ["-iclient", "-ishared", "-XCPP", ....]
          "app/Client.hs")
cabal: Error: some packages failed to install:
stackage-view-0.0.1 failed during the building phase. The exception was:
ExitFailure 1

"Exception when trying to run compile-time code" while building.

Stackage View doesn't seem to build for me. I tried the usual:

git clone https://github.com/fpco/stackage-view.git
cd stackage-view/
cabal sandbox init
cabal install

The commit hash I was using was 55c30e0, which was the latest at the time of posting.

Cabal builds the dependencies without difficulty but when it reaches Stackage View itself it fails with the following output:

[8 of 17] Compiling Settings.StaticFiles ( server/Settings/StaticFiles.hs, dist/dist-sandbox-c8d8085a/build/Settings/StaticFiles.o )
[9 of 17] Compiling SharedTypes      ( shared/SharedTypes.hs, dist/dist-sandbox-c8d8085a/build/SharedTypes.o )
[10 of 17] Compiling Stackage.View.Types ( server/Stackage/View/Types.hs, dist/dist-sandbox-c8d8085a/build/Stackage/View/Types.o )
[11 of 17] Compiling Foundation       ( server/Foundation.hs, dist/dist-sandbox-c8d8085a/build/Foundation.o )
[12 of 17] Compiling Stackage.View.Cabal ( server/Stackage/View/Cabal.hs, dist/dist-sandbox-c8d8085a/build/Stackage/View/Cabal.o )

server/Stackage/View/Cabal.hs:84:37: Warning:
    This binding for ‘lib’ shadows the existing binding
      bound at server/Stackage/View/Cabal.hs:67:13
[13 of 17] Compiling Import           ( server/Import.hs, dist/dist-sandbox-c8d8085a/build/Import.o )
[14 of 17] Compiling Handler.Home     ( server/Handler/Home.hs, dist/dist-sandbox-c8d8085a/build/Handler/Home.o )
ghcjs app/Client.hs -o /tmp/run-ghcjs.10911 -iclient -ishared -XCPP -XTemplateHaskell -package ghcjs-react
<command line>: cannot satisfy -package ghcjs-react
    (use -v for more information)

server/Handler/Home.hs:17:5:
    Exception when trying to run compile-time code:
      The GHCJS process failed with exit code 1.
    Code: ghcjsFileDev
            development
            ["-iclient", "-ishared", "-XCPP", "-XTemplateHaskell", ....]
            "app/Client.hs"
    In the splice:
      $(ghcjsFileDev
          development
          ["-iclient", "-ishared", "-XCPP", ....]
          "app/Client.hs")
cabal: Error: some packages failed to install:
stackage-view-0.0.1 failed during the building phase. The exception was:
ExitFailure 1

Here are the version of things I'm using:

ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.8.4

ghcjs --version
The Glorious Glasgow Haskell Compilation System for JavaScript, version 0.1.0 (GHC 7.8.4)

cabal --version
cabal-install version 1.22.0.0

node --version
v0.12.1

alex --version
Alex version 3.1.4, (c) 2003 Chris Dornan and Simon Marlow

happy --version
Happy Version 1.19.4 Copyright (c) 1993-1996 Andy Gill, Simon Marlow (c) 1997-2005 Simon Marlow

Happy is a Yacc for Haskell, and comes with ABSOLUTELY NO WARRANTY.
This program is free software; you can redistribute it and/or modify
it under the terms given in the file 'LICENSE' distributed with
the Happy sources.

ghcjs-dev image not on docker

04:03 PM noon ∈ stackage-view@master>stack docker pull                                    ▲▲▲ 
Pulling image from registry: 'fpco/ghcjs-dev:lts-2.13'
Pulling repository docker.io/fpco/ghcjs-dev
Error: image fpco/ghcjs-dev:lts-2.13 not found
Could not pull Docker image:
    fpco/ghcjs-dev:lts-2.13
There may not be an image on the registry for your resolver's LTS version in
your configuration file.

Add support for cabal sandboxes

Would amount to detecting that a sandbox is present and passing in appropriate arguments to ide-backend. Could probably be added to some Cabal helper library actually.

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.