Giter Club home page Giter Club logo

timeit's Introduction

Overview

This is a fork of the original TimeIt project. It was forked as part of an introductory work on how to use dependencies in haskell project without resorting to packaging.

Notes

For the sake of being able to work with the project in Vscode using the LHS extension for Vscode, a hie.yaml file was added following the guideline provided in hie-bios - Cabal.

Although cabal is referenced here, the goal was not to work with packaging per say but to allow VsCode to open the project and provide assistance. That is, LHS for VsCode requires either Cabal or Stack. As the original project had a cabal file, we just used it by configuring the Vscode to work with it trough an hie file, because the cabal syntax is from a cabal version that is too old (Otherwise VsCode would have handle the cabal file automatically). If we wanted to use stack, then we would have to use hpack-convert to convert the cabal file to stack package.

General Introduction to Haskell Language Server and VsCode.

  • The haskell-language-server (HLS) project is an implementation of a server (a “language server”) for the Language Server Protocol (LSP). A language server talks to a client (typically an editor), which can ask the server to perform various operations, such as reporting errors or providing code completions. The advantage of this system is that clients and servers can interoperate more easily so long as they all speak the LSP protocol. In the case of HLS, that means that it can be used with many different editors, since editor support for the LSP protocol is now widespread.

  • HLS is responsible for actually understanding your project and answering the questions that the client asks of it, such as: what completion items could go here? are there any errors in the project? and so on.

  • In order to actually use it a client is needed (editor). The client is responsible for managing your interaction with the server: launching it, dispatching commands to it, and displaying or implementing responses. Some clients will even install the server binaries for you, such is the case for VsCode.

  • HLS needs to know how to build your Haskell project: what flags to pass, what packages to provide, etc. It gets this information from the build system used by your project (typically cabal or stack). The tool used to do this is called hie-bios. hie-bios calls the strategy it uses to get compilation flags (e.g. “ask cabal”) a “cradle”.

  • For instance, if you delete timeit.cabal and start HLS for VsCode, everything will work. This is because the project has no dependency what so ever. So Likely LHS just rely on the global GHC current config and compile the project (see How does Haskell language Server manage to work with a project with only standalone haskell file?) [[TODO]]

HLS for VsCode

timeit's People

Contributors

okouyad avatar merijn 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.