Code Monkey home page Code Monkey logo

Comments (4)

rubik avatar rubik commented on May 26, 2024

The latest version on Hackage (0.2.0.0) of Argon uses Haskell-Src-Exts to parse the code. The problem with this approach is that one has to tell Haskell-Src-Exts which extensions should be loaded at compile time! This is unfortunate, since one cannot simply enable all extensions, as some extend the syntax in different ways. Argon had a very comprehensive extension list, see:

customExts = EnableExtension `map`

But, as you have seen, it's not enough.

Fortunately, this has been solved. I managed to replace Haskell-Src-Exts with the GHC API, and now Argon should be able to parse every valid module (one that hasn't syntax errors).
The new version is not available yet on Hackage. The only issue blocking the release is #3. It's not really a problem but it would make installation with Stack much easier.

If you try the version from master, it should work. If instead it does not, can you provide the code that Argon cannot parse? I tried with the first snippet at
https://www.fpcomplete.com/user/k_bx/playing-with-datakinds
and it worked.

from argon.

athanclark avatar athanclark commented on May 26, 2024

That sounds wonderful :) I've had issues with Haskell-Src-Exts in the past as well - another issue they (actually get right and GHC gets wrong) is with -XMultiParamTypeClasses and contexts - the following is valid:

{-# LANGUAGE MultiParamTypeClasses #-}

foo :: Foo a b => a -> b

But GHC doesn't need the LANGUAGE pragma, while Haskell-Src-Exts does. Anyway, I'm glad you were able to switch over! Are you using hint for the api? Or just raw GHC?

I'll try compiling the master branch, thank you for all your work! This tool is amazing!

from argon.

rubik avatar rubik commented on May 26, 2024

I'm glad that you're finding Argon useful! It's actually in a very early stage and can be improved a lot.

As of now I'm using plain GHC API. One major problem is that I'm only sure it works for GHC >=7.10. I've seen in Hint code it's possible to support previous versions, although this requires adding a lot of ugly #if directives. I'm confident that soon Argon will run at least from GHC 7.8 onwards.

P.S. That issue you mention is a weird one! It's odd that GHC does not require the pragma.

from argon.

rubik avatar rubik commented on May 26, 2024

I'm closing this as it's working with GHC >= 7.8. If you experience any problems, feel free to reopen or open a new issue altogether.

from argon.

Related Issues (20)

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.