All Projects → kowainik → extensions

kowainik / extensions

Licence: MPL-2.0 license
👅 Parse Haskell Language Extensions

Programming Languages

haskell
3896 projects

Projects that are alternatives of or similar to extensions

standardnotes-extensions
Standard Notes Extensions
Stars: ✭ 16 (-64.44%)
Mutual labels:  extensions
RichNotifications
No description or website provided.
Stars: ✭ 44 (-2.22%)
Mutual labels:  extensions
KrazyKotlin
A collection of useful Kotlin Extension
Stars: ✭ 75 (+66.67%)
Mutual labels:  extensions
RevitExtensions
Extensions for Revit plugin development
Stars: ✭ 37 (-17.78%)
Mutual labels:  extensions
MADE.NET
MADE.NET is a home to all of those bits of code that you know you'll reuse in another project. Making app development easier with .NET.
Stars: ✭ 75 (+66.67%)
Mutual labels:  extensions
glTF-Blender-IO-materials-variants
Blender3D addon for glTF KHR_materials_variants extension
Stars: ✭ 56 (+24.44%)
Mutual labels:  extensions
EPPlus.Core.Extensions
An extensions library for EPPlus package to generate and manipulate Excel files easily.
Stars: ✭ 66 (+46.67%)
Mutual labels:  extensions
VCore
VCore is a Swift collection containing objects, functions, and extensions that I use for my projects
Stars: ✭ 32 (-28.89%)
Mutual labels:  extensions
JimmysUnityUtilities
A bunch of code I like to have on hand while working in Unity
Stars: ✭ 93 (+106.67%)
Mutual labels:  extensions
crystal on steroids
A group of methods to make Crystal more programmer friendly (extracted from Rails ActiveSupport, Powerpack and others)
Stars: ✭ 48 (+6.67%)
Mutual labels:  extensions
RFKit
Toolkit for daily Cocoa development. Since 2012.
Stars: ✭ 20 (-55.56%)
Mutual labels:  extensions
KJCategories
Collection of native ios extensions and classes to boost development process. Such as UIKit, Foundation, QuartzCore, Accelerate, OpenCV, CoreGraphics, os and more. 超实用开发加速工具收集
Stars: ✭ 423 (+840%)
Mutual labels:  extensions
redmadrobot-android-ktx
Missing Android KTX extensions.
Stars: ✭ 27 (-40%)
Mutual labels:  extensions
php-periphery-serial
A php extension for peripheral I/O Serial in Linux (wrapper of c-periphery)
Stars: ✭ 13 (-71.11%)
Mutual labels:  extensions
v2ex-collections-search
v2ex收藏搜索
Stars: ✭ 21 (-53.33%)
Mutual labels:  extensions
extensions
Code Generators and Extensions for vanilla-rtb stack
Stars: ✭ 16 (-64.44%)
Mutual labels:  extensions
library
Optimizely Library
Stars: ✭ 62 (+37.78%)
Mutual labels:  extensions
extensions-rig
A full development environment to build Twitch Extensions. Currently only supports panel extensions but video overlay coming soon.
Stars: ✭ 26 (-42.22%)
Mutual labels:  extensions
windbgtree
A command tree based on commands and extensions for Windows Kernel Debugging.
Stars: ✭ 94 (+108.89%)
Mutual labels:  extensions
bazaar
The extension marketplace for your Flarum forum.
Stars: ✭ 58 (+28.89%)
Mutual labels:  extensions

extensions

Logo

GitHub CI Hackage MPL-2.0 license

Library and CLI tool to parse Haskell {-# LANGUAGE #-} extensions in source files, extract default-extensions from .cabal files and combine together default-extensions and per-module extensions.

Goals

The extensions library provides a lightweight way to get Haskell LANGUAGE pragmas for Haskell modules. It has the following goals:

  1. Be lightweight. Dependency footprint is extremely small, and using extensions either as a library or as a tool is straightforward.
  2. Support both default-extensions in Cabal and {-# LANGUAGE #-} pragmas in Haskell modules.
  3. Should work on common and real cases. extensions strives to support as many valid syntactic constructions as possible, but it may not work on every possible combination of CPP, comments and pragmas, where GHC would work. We encouragle you to open issue if you encounter any failures when using extensions.

How to use

You can use extensions either as a library or as a CLI tool.

Library

Usage with Cabal

extensions is compatible with the latest GHC compiler versions starting from 8.8.3.

In order to start using extensions in your project, you will need to set it up with the three easy steps:

  1. Add the dependency on extensions in your project's .cabal file. For this, you should modify the build-depends section by adding the name of this library. After the adjustment, this section could look like this:

    build-depends: base ^>= 4.14
                 , extensions ^>= 0.0
  2. In the module where you wish to extract extensions, you should add the import:

    import Extensions (getPackageExtensions)
  3. Now you can use the types and functions from the library:

    main :: IO ()
    main = getPackageExtensions "extensions.cabal" >>= print

Usage with Stack

If extensions is not available on your current Stackage resolver yet, fear not! You can still use it from Hackage by adding the following to the extra-deps section of your stack.yaml file:

extra-deps:
  - extensions-0.0.0.0

CLI tool

To use extensions as a CLI tool, you need to install it either with Cabal

cabal install extensions

Stack

stack install extensions

or the nix package manager which allows you to use it ad-hoc via nix-shell -p haskellPackages.extensions --run extensions or to install via

nix-env -iA nixpkgs.haskellPackages.extensions

The tool can be used to inspect language extensions in your Haskell project. Some common usages of the tool:

  1. Get all extensions in all modules, combined with default-extensions from the .cabal file. All extensions
  2. Get all extensions for a specific module, combined with Cabal extensions. Module extensions
  3. Get extensions defined only in a module. Only module

Alternatives

Alternatively, you can extract Haskell Language extensions using the following ways:

  1. Using ghc as a library. This approach ties you to a specific GHC version and requires more effort to support multiple GHCs. Also, GHC API is more complicated than extensions API (especially if you want to handle CPP). And even with CPP handling from ghc you won't be able to get all extensions defined in a module. However, this approach allows you to fully reproduce GHC behaviour.
  2. Using ghc-lib-parser. Same as the previous approach, but does not tie you to a specific GHC version. However, ghc-lib-parser is rather big dependency.
  3. Using the haskell-src-exts library. This library parses Haskell source files, but it's not actively maintained anymore and doesn't support CPP.
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].